Saturday, 1 August 2009

John the ripper on mpi steroids or how to crack YOUR passwords faster

Ok, so everybody knows john. John is the ripper. He rips passwords. But he's not always fast enough. However, thanks to this patch he can now take an advantage of your multicore system! Here's the quick & dirty howto.

All required goodies are there in Gentoo portage tree so in a true Gentooer fashion:

# emerge -av openmpi johntheripper

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild N ] sys-cluster/openmpi-1.3.2 USE="cxx ipv6 threads -debug -fortran -heterogeneous -mpi-threads -pbs -romio" 0 kB
[ebuild N ] app-crypt/johntheripper-1.7.3.1 USE="mmx mpi sse2 (-altivec) -custom-cflags -minimal" 0 kB

Total: 2 packages (2 new), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No]

Make sure that the mpi flag is enabled. After it's done, quick test to confirm it's working:

# mpirun -np 2 uname -rsv
Linux 2.6.29-hardened #13 SMP Fri Jul 24 15:26:08 BST 2009
Linux 2.6.29-hardened #13 SMP Fri Jul 24 15:26:08 BST 2009

Where 2 is number of processors (or cores) available. Ok, ready to go - first benchmarking without multicore:

# john --test
mca: base: component_find: unable to open /usr/lib/openmpi/mca_osc_pt2pt: file not found (ignored)
mca: base: component_find: unable to open /usr/lib/openmpi/mca_osc_rdma: file not found (ignored)
Benchmarking: Traditional DES [128/128 BS SSE2]... DONE
Many salts: 1529K c/s real, 1698K c/s virtual
Only one salt: 1253K c/s real, 1392K c/s virtual

Benchmarking: BSDI DES (x725) [128/128 BS SSE2]... DONE
Many salts: 49920 c/s real, 56089 c/s virtual
Only one salt: 48512 c/s real, 53902 c/s virtual

Benchmarking: FreeBSD MD5 [32/32]... DONE
Raw: 4933 c/s real, 5542 c/s virtual
Benchmarking: OpenBSD Blowfish (x32) [32/32]... DONE
Raw: 305 c/s real, 342 c/s virtual

There is not much info about the error reported but it does not seem to be critical. Now run with through the mpi:

# mpirun -np 2 john --test
mca: base: component_find: unable to open /usr/lib/openmpi/mca_osc_pt2pt: file not found (ignored)
mca: base: component_find: unable to open /usr/lib/openmpi/mca_osc_rdma: file not found (ignored)
mca: base: component_find: unable to open /usr/lib/openmpi/mca_osc_pt2pt: file not found (ignored)
mca: base: component_find: unable to open /usr/lib/openmpi/mca_osc_rdma: file not found (ignored)
Benchmarking: Traditional DES [128/128 BS SSE2]... DONE
Many salts: 3178K c/s real, 6754K c/s virtual
Only one salt: 2622K c/s real, 5651K c/s virtual

Benchmarking: BSDI DES (x725) [128/128 BS SSE2]... DONE
Many salts: 102846 c/s real, 222092 c/s virtual
Only one salt: 99703 c/s real, 215022 c/s virtual

Benchmarking: FreeBSD MD5 [32/32]... DONE
Raw: 9869 c/s real, 21833 c/s virtual
Benchmarking: OpenBSD Blowfish (x32) [32/32]... DONE
Raw: 616 c/s real, 1353 c/s virtual

Whooaa! That's a bit faster...And here's a more comprehensive guide too. Off course using rainbow tables will be always faster, but: good (big) rainbow tables are needed and if the password is salted than you're out of luck. Anyway - happy cracking! ;]

BTW: Oh and do use loong and complex passwords...also - if you compare full benchmark output, just look how fast is cracking md5 as compared to sha-1 or blowfish...and although john does not support cracking sha512 passwords as of yet, your system probably supports this algorithm for password hashing so...but that's a totally different story!

No comments:

Post a Comment

Have your say: