Nous allons dans cet article montrer comment retrouver les mots de passe des utilisateurs sur une distribution Linux (Debian 6).
Nous allons utiliser pour cella John.
John the ripper est un outil open source utililser pour cracker les mots de passe des utilisateur Linux ( il est aussi utilisable sur Window$)
Pour commencer, il faut tout d'abord télécharger l'outil en question. Vous pouvez le faire sur le site : http://www.openwall.com/john/.
Dans notre cas nous allons travailler avec la version 1.7.9.
Ok
télécharger : john-1.7.9.tar.gz ainsi que son patch : john-1.7.9-jumbo-6.tar.gz
En suite commencer par décompresser john-1.7.9.tar.gz
#tar xzvf john-1.7.9.tar.gz
Rendez vous a dans l'archive
Copier john-1.7.9-jumbo-6.tar.gz dans john-1.7.9/ ( la commade est cp)
Après copie decompressez john-1.7.9-jumbo-6.tar.gz et appliquer les patches
#cd john-1.7.9/tar xzvf john-1.7.9-jumbo-6.tar.gz | patch p1
Voici le contenu de notre repertoir john-1.7.9/
john-1.7.9# ls
doc john-1.7.9-jumbo-6 john-1.7.9-jumbo-6.tar.gz README run src
Alors passons a l'étape supérieur
Rappel: Notre outil john a été ecrit en C ( langage c) et sur Debian le compilateur C et l'outil make ne sont pas installés pardefaut ; donc pensez a l intaller avant de continuer si vous travaillez sur Debian .
Juste une parenthèse:
Deplacez vous dans le repertoire src de john
le contenu est :
john-1.7.9/src# ls
AFS_fmt.c config.c ia64.h MD5_std.c recovery.c tty.h
alpha.h config.h idle.c MD5_std.h recovery.h unafs.c
alpha.S cracker.c idle.h memory.c rpp.c unique.c
batch.c cracker.h inc.c memory.h rpp.h unshadow.c
batch.h crc32.c inc.h mips32.h rules.c vax.h
bench.c crc32.h john.asm mips64.h rules.h wordlist.c
bench.h DES_bs_b.c john.c misc.c sboxes.c wordlist.h
best.c DES_bs.c john.com misc.h sboxes-s.c x86-64.h
best.sh DES_bs.h list.c nonstd.c signals.c x86-64.S
BF_fmt.c DES_fmt.c list.h options.c signals.h x86-any.h
BF_std.c DES_std.c LM_fmt.c options.h single.c x86-mmx.h
BF_std.h DES_std.h loader.c params.c single.h x86-mmx.S
BSDI_fmt.c detect.c loader.h params.h sparc32.h x86.S
c3_fmt.c dummy.c logger.c pa-risc.h sparc64.h x86-sse.h
charset.c external.c logger.h path.c status.c x86-sse.S
charset.h external.h Makefile path.h status.h
common.c formats.c Makefile.dep ppc32alt.h symlink.c
common.h formats.h math.c ppc32.h times.h
compiler.c getopt.c math.h ppc64alt.h trip_fmt.c
compiler.h getopt.h MD5_fmt.c ppc64.h tty.c
Maintenant nous allons compiler notre programme
make clean SYSTEM
where SYSTEM can be one of the following:
linux-x86-64-avx Linux, x86-64 with AVX (2011+ Intel CPUs)
linux-x86-64-xop Linux, x86-64 with AVX and XOP (2011+ AMD CPUs)
linux-x86-64 Linux, x86-64 with SSE2 (most common)
linux-x86-avx Linux, x86 32-bit with AVX (2011+ Intel CPUs)
linux-x86-xop Linux, x86 32-bit with AVX and XOP (2011+ AMD CPUs)
linux-x86-sse2 Linux, x86 32-bit with SSE2 (most common, if 32-bit)
linux-x86-mmx Linux, x86 32-bit with MMX (for old computers)
linux-x86-any Linux, x86 32-bit (for truly ancient computers)
linux-alpha Linux, Alpha
linux-sparc Linux, SPARC 32-bit
linux-ppc32-altivec Linux, PowerPC w/AltiVec (best)
linux-ppc32 Linux, PowerPC 32-bit
linux-ppc64 Linux, PowerPC 64-bit
linux-ia64 Linux, IA-64
freebsd-x86-64 FreeBSD, x86-64 with SSE2 (best)
freebsd-x86-sse2 FreeBSD, x86 with SSE2 (best if 32-bit)
freebsd-x86-mmx FreeBSD, x86 with MMX
...
beos-x86-any BeOS, x86
generic Any other Unix-like system with gcc
Note : nous pouvons voir la les systèmes compatibles avec la version de john installée. Nous allons alors le compiler pour notre système
rm -f ../run/john.exe john-macosx-* *.o *.bak core
rm -f detect bench generic.h arch.h tmp.s
cp /dev/null Makefile.dep
ln -sf x86-any.h arch.h
make ../run/john ../run/unshadow ../run/unafs ../run/unique \
JOHN_OBJS="DES_fmt.o DES_std.o DES_bs.o DES_bs_b.o BSDI_fmt.o MD5_fmt.o MD5_std.o BF_fmt.o BF_std.o AFS_fmt.o LM_fmt.o trip_fmt.o dummy.o batch.o bench.o charset.o common.o compiler.o config.o cracker.o ...
Rentrons dans le repertoire run
le contenu est :
john-1.7.9/run# ls
all.chr alpha.chr john.conf mailer relbench
alnum.chr digits.chr lanman.chr password.lst
root@dns:/home/celinfo/Téléchargements/john-1.7.9/run# ./john --test
bash: ./john: Aucun fichier ou dossier de ce type
root@dns:/home/celinfo/Téléchargements/john-1.7.9/run# ls
all.chr alpha.chr john.conf mailer relbench
alnum.chr digits.chr lanman.chr password.lst
Nous pouvons deja faire un test de notre outil
john-1.7.9/run# ./john --test
Benchmarking: Traditional DES [24/32 4K]... DONE
Many salts: 179251 c/s real, 179251 c/s virtual
Only one salt: 175360 c/s real, 175711 c/s virtual
Benchmarking: BSDI DES (x725) [24/32 4K]... DONE
Many salts: 6436 c/s real, 6436 c/s virtual
...
Ok c'est l'heure de la vérité
nous savons que c'est le fichier /etc/shadown qui contient les mots de passe des utilisateur pour cella nous allons l'appliquer a notre outil
john-1.7.9/run# ./john /etc/shadow
Loaded 2 password hashes with 2 different salts (generic crypt(3) [?/32])
celinfo1234 (celinfo)
...
et le resultat est la
l'unitilisateur celinfo a pour mot de passe celinfo1234
C'est la fin
Merci
Nous allons utiliser pour cella John.
John the ripper est un outil open source utililser pour cracker les mots de passe des utilisateur Linux ( il est aussi utilisable sur Window$)
Pour commencer, il faut tout d'abord télécharger l'outil en question. Vous pouvez le faire sur le site : http://www.openwall.com/john/.
Dans notre cas nous allons travailler avec la version 1.7.9.
Ok
télécharger : john-1.7.9.tar.gz ainsi que son patch : john-1.7.9-jumbo-6.tar.gz
En suite commencer par décompresser john-1.7.9.tar.gz
#tar xzvf john-1.7.9.tar.gz
Rendez vous a dans l'archive
#cd john-1.7.9/
Copier john-1.7.9-jumbo-6.tar.gz dans john-1.7.9/ ( la commade est cp)
Après copie decompressez john-1.7.9-jumbo-6.tar.gz et appliquer les patches
#cd john-1.7.9/tar xzvf john-1.7.9-jumbo-6.tar.gz | patch p1
Voici le contenu de notre repertoir john-1.7.9/
john-1.7.9# ls
doc john-1.7.9-jumbo-6 john-1.7.9-jumbo-6.tar.gz README run src
Alors passons a l'étape supérieur
Rappel: Notre outil john a été ecrit en C ( langage c) et sur Debian le compilateur C et l'outil make ne sont pas installés pardefaut ; donc pensez a l intaller avant de continuer si vous travaillez sur Debian .
#apt-get install gcc
#apt-get install make
Juste une parenthèse:
Deplacez vous dans le repertoire src de john
john-1.7.9# cd src/
le contenu est :
john-1.7.9/src# ls
AFS_fmt.c config.c ia64.h MD5_std.c recovery.c tty.h
alpha.h config.h idle.c MD5_std.h recovery.h unafs.c
alpha.S cracker.c idle.h memory.c rpp.c unique.c
batch.c cracker.h inc.c memory.h rpp.h unshadow.c
batch.h crc32.c inc.h mips32.h rules.c vax.h
bench.c crc32.h john.asm mips64.h rules.h wordlist.c
bench.h DES_bs_b.c john.c misc.c sboxes.c wordlist.h
best.c DES_bs.c john.com misc.h sboxes-s.c x86-64.h
best.sh DES_bs.h list.c nonstd.c signals.c x86-64.S
BF_fmt.c DES_fmt.c list.h options.c signals.h x86-any.h
BF_std.c DES_std.c LM_fmt.c options.h single.c x86-mmx.h
BF_std.h DES_std.h loader.c params.c single.h x86-mmx.S
BSDI_fmt.c detect.c loader.h params.h sparc32.h x86.S
c3_fmt.c dummy.c logger.c pa-risc.h sparc64.h x86-sse.h
charset.c external.c logger.h path.c status.c x86-sse.S
charset.h external.h Makefile path.h status.h
common.c formats.c Makefile.dep ppc32alt.h symlink.c
common.h formats.h math.c ppc32.h times.h
compiler.c getopt.c math.h ppc64alt.h trip_fmt.c
compiler.h getopt.h MD5_fmt.c ppc64.h tty.c
Maintenant nous allons compiler notre programme
john-1.7.9/src#make
To build John the Ripper, type:make clean SYSTEM
where SYSTEM can be one of the following:
linux-x86-64-avx Linux, x86-64 with AVX (2011+ Intel CPUs)
linux-x86-64-xop Linux, x86-64 with AVX and XOP (2011+ AMD CPUs)
linux-x86-64 Linux, x86-64 with SSE2 (most common)
linux-x86-avx Linux, x86 32-bit with AVX (2011+ Intel CPUs)
linux-x86-xop Linux, x86 32-bit with AVX and XOP (2011+ AMD CPUs)
linux-x86-sse2 Linux, x86 32-bit with SSE2 (most common, if 32-bit)
linux-x86-mmx Linux, x86 32-bit with MMX (for old computers)
linux-x86-any Linux, x86 32-bit (for truly ancient computers)
linux-alpha Linux, Alpha
linux-sparc Linux, SPARC 32-bit
linux-ppc32-altivec Linux, PowerPC w/AltiVec (best)
linux-ppc32 Linux, PowerPC 32-bit
linux-ppc64 Linux, PowerPC 64-bit
linux-ia64 Linux, IA-64
freebsd-x86-64 FreeBSD, x86-64 with SSE2 (best)
freebsd-x86-sse2 FreeBSD, x86 with SSE2 (best if 32-bit)
freebsd-x86-mmx FreeBSD, x86 with MMX
...
beos-x86-any BeOS, x86
generic Any other Unix-like system with gcc
Note : nous pouvons voir la les systèmes compatibles avec la version de john installée. Nous allons alors le compiler pour notre système
john-1.7.9/src# make clean linux-x86-any
rm -f ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/john.bin ../run/john.com ../run/unshadow.com ../run/unafs.com ../run/unique.com ../run/john.exe ../run/unshadow.exe ../run/unafs.exe ../run/unique.exerm -f ../run/john.exe john-macosx-* *.o *.bak core
rm -f detect bench generic.h arch.h tmp.s
cp /dev/null Makefile.dep
ln -sf x86-any.h arch.h
make ../run/john ../run/unshadow ../run/unafs ../run/unique \
JOHN_OBJS="DES_fmt.o DES_std.o DES_bs.o DES_bs_b.o BSDI_fmt.o MD5_fmt.o MD5_std.o BF_fmt.o BF_std.o AFS_fmt.o LM_fmt.o trip_fmt.o dummy.o batch.o bench.o charset.o common.o compiler.o config.o cracker.o ...
Rentrons dans le repertoire run
john-1.7.9/src# cd ../run/
le contenu est :
john-1.7.9/run# ls
all.chr alpha.chr john.conf mailer relbench
alnum.chr digits.chr lanman.chr password.lst
root@dns:/home/celinfo/Téléchargements/john-1.7.9/run# ./john --test
bash: ./john: Aucun fichier ou dossier de ce type
root@dns:/home/celinfo/Téléchargements/john-1.7.9/run# ls
all.chr alpha.chr john.conf mailer relbench
alnum.chr digits.chr lanman.chr password.lst
Nous pouvons deja faire un test de notre outil
john-1.7.9/run# ./john --test
Benchmarking: Traditional DES [24/32 4K]... DONE
Many salts: 179251 c/s real, 179251 c/s virtual
Only one salt: 175360 c/s real, 175711 c/s virtual
Benchmarking: BSDI DES (x725) [24/32 4K]... DONE
Many salts: 6436 c/s real, 6436 c/s virtual
...
Ok c'est l'heure de la vérité
nous savons que c'est le fichier /etc/shadown qui contient les mots de passe des utilisateur pour cella nous allons l'appliquer a notre outil
john-1.7.9/run# ./john /etc/shadow
Loaded 2 password hashes with 2 different salts (generic crypt(3) [?/32])
celinfo1234 (celinfo)
...
et le resultat est la
l'unitilisateur celinfo a pour mot de passe celinfo1234
C'est la fin
Merci
Aucun commentaire:
Enregistrer un commentaire