martes, 20 de diciembre de 2011

Cracking passwd con John the Ripper

Descargamos el John:

root@prueba:~# wget http://www.openwall.com/john/g/john-1.7.9.tar.gz


Destareamos/Descomprimimos:

root@prueba:~# tar xzvf john-1.7.9.tar.gz


Accedemos a la ruta de los fuentes:

root@prueba:~# cd john-1.7.9/src/


Compilamos para linux x86:

root@prueba:~/john-1.7.9/src# make linux-x86-any


Instalamos:

root@prueba:~/john-1.7.9/src# make install


Accedemos a los ejecutables compilados:

root@prueba:~/john-1.7.9# cd run/


Copiamos el passwd y el shadow en otra ruta:

root@prueba:~/john-1.7.9/run# cp /etc/passwd /etc/shadow /root/


Corremos el unshadow y redireccionamos la salida a un archivo llamado unsha.txt:

root@prueba:~/john-1.7.9/run# ./unshadow /root/passwd /root/shadow > /root/unsha.txt


Corremos el john con un modo simple y le pasamos como parametro el archivo que creamos:

root@prueba:~/john-1.7.9/run# ./john -single /root/unsha.txt
Loaded 1 password hash (generic crypt(3) [?/32])
guesses: 0 time: 0:00:00:03 23% c/s: 25.13 trying: Morsa8 - mor$a
guesses: 0 time: 0:00:00:07 38% c/s: 25.09 trying: Mors4 - \morsa
Mors4 (morsa)
guesses: 1 time: 0:00:00:11 100% c/s: 25.10 trying: Mors4 - \morsa
Use the "--show" option to display all of the cracked passwords reliably


Usamos la opción show para ver los passwords crackeados:

root@prueba:~/john-1.7.9/run# ./john -show /root/unsha.txt
morsa:Mors4:1002:1003::/home/morsa:/bin/sh
1 password hashes cracked, 0 left


Nos da como resultado del usuario morsa su correspondiente password: Mors4

No hay comentarios: