This is pretty much a complete rip of this site: http://www.wsec.be/blog/2010/09/27/optimizing-john-the-ripper-for-multiple-cores/
and mainly just for my own quick reference.
So the first thing we need is to install some stuff. I did this on Ubuntu 10.04.
sudo apt-get install libmpich1.0-dev libmpich-mpd1.0-dev libmpich-shmem1.0-dev mpich2 mpich2-doc john libssl-dev
Download the source-code for the MPI-version of JtR here: http://www.bindshell.net/tools/johntheripper/john-1.7.3.1-all-2-mpi8.tar.gz
Extract the file by running this:
tar -zxvf john-1.7.3.1-all-2-mpi8.tar.gz
cd into the src-folder and compile JtR for the 64-bit platform by running this:
make linux-x86-64
mpd (of mpich2) is some sort of multi-processor thingy that lets us run JtR in multiple processes. To make it work, we need to create a conf-file for it’s daemon. Do this by running nano /etc/mpd.conf and enter this single line:
MPD_SECRETWORD=secret
Afterwards, do chmod 600 /etc/mpd.conf to make it accessible to the right people.
Now start the daemon by running mpd –daemon
cd into the run-directory and run JtR like this:
mpirun -np 8 ./john <regular jtr-switches>
This will make it run in 8 processes, and is awesome on an i7 system. Here’s a comparison:
Single-process | Multi-process |
Benchmarking: Traditional DES [64/64 BS]… DONE Many salts: 1511K c/s real, 1514K c/s virtual Only one salt: 1402K c/s real, 1405K c/s virtualBenchmarking: BSDI DES (x725) [64/64 BS]… DONE Many salts: 51087 c/s real, 51087 c/s virtual Only one salt: 50594 c/s real, 50692 c/s virtualBenchmarking: FreeBSD MD5 [32/64 X2]… DONE Raw: 12925 c/s real, 12951 c/s virtual Benchmarking: OpenBSD Blowfish (x32) [32/64 X2]… DONE Raw: 758 c/s real, 759 c/s virtual Benchmarking: Kerberos AFS DES [48/64 4K]… DONE Benchmarking: LM DES [64/64 BS]… DONE Benchmarking: NT MD4 [Generic 1x]… DONE Raw: 12201K c/s real, 12223K c/s virtual Benchmarking: Eggdrop [blowfish]… DONE Benchmarking: M$ Cache Hash [Generic 1x]… DONE Benchmarking: LM C/R DES [netlm]… DONE Many salts: 581734 c/s real, 583352 c/s virtual Benchmarking: NTLMv1 C/R MD4 DES [netntlm]… DONE Benchmarking: More Secure Internet Password [RSA MD defined by BSAFE 1.x – Lotus v6]… DONE Only one salt: 69811 c/s real, 69904 c/s virtual Benchmarking: Lotus5 [Lotus v5 Proprietary]… DONE Benchmarking: Raw MD5 [raw-md5]… DONE Benchmarking: Raw SHA-1 [raw-sha1]… DONE Raw: 3448K c/s real, 3452K c/s virtual Benchmarking: IPB2 MD5 [Invision Power Board 2.x salted MD5]… DONE Benchmarking: Netscape LDAP SHA [SHA-1]… DONE Benchmarking: OpenLDAP SSHA [salted SHA-1]… DONE Many salts: 4107K c/s real, 4112K c/s virtual Benchmarking: HTTP Digest access authentication [HDAA-MD5]… DONE |
Benchmarking: Traditional DES [128/128 BS SSE2-16]… DONE Many salts: 12232K c/s real, 12734K c/s virtualOnly one salt: 10656K c/s real, 10791K c/s virtualBenchmarking: BSDI DES (x725) [128/128 BS SSE2-16]… DONE Many salts: 402474 c/s real, 406518 c/s virtual Only one salt: 391702 c/s real, 397677 c/s virtual Benchmarking: FreeBSD MD5 [32/64 X2]… DONE Benchmarking: OpenBSD Blowfish (x32) [32/64 X2]… DONE Raw: 4028 c/s real, 4094 c/s virtual Benchmarking: Kerberos AFS DES [48/64 4K]… DONE Long: 6958K c/s real, 7037K c/s virtual Benchmarking: LM DES [128/128 BS SSE2-16]… DONE Benchmarking: NT MD4 [128/128 X2 SSE2-16]… DONE Raw: 123032K c/s real, 125704K c/s virtual Benchmarking: Mac OS X 10.4+ salted SHA-1 [32/64]… DONE Only one salt: 15201K c/s real, 15335K c/s virtual Benchmarking: M$ Cache Hash [Generic 1x]… DONE Only one salt: 37076K c/s real, 37927K c/s virtual Benchmarking: Apache MD5 [32/64 X2]… DONE Benchmarking: HMAC MD5 [hmac-md5]… DONE Benchmarking: Post.Office MD5 [STD]… DONE Only one salt: 20661K c/s real, 20842K c/s virtual Benchmarking: Raw MD5 [raw-md5]… DONE Benchmarking: IPB2 MD5 [Invision Power Board 2.x salted MD5]… DONE Only one salt: 12073K c/s real, 12210K c/s virtual Benchmarking: Raw SHA-1 [raw-sha1]… DONE Raw: 16043K c/s real, 16308K c/s virtual Benchmarking: Kerberos v5 TGT [krb5 3DES (des3-cbc-sha1)]… DONE Benchmarking: Netscape LDAP SHA [SHA-1]… DONE Benchmarking: Netscape LDAP SSHA [salted SHA-1]… DONE Many salts: 16721K c/s real, 16848K c/s virtual Only one salt: 15896K c/s real, 16056K c/s virtual Benchmarking: Eggdrop [blowfish]… DONE Benchmarking: Oracle [oracle]… DONE Benchmarking: MYSQL [mysql]… DONE Raw: 16237K c/s real, 16401K c/s virtual Benchmarking: MySQL 4.1 double-SHA-1 [mysql-sha1]… DONE Benchmarking: Lotus5 [Lotus v5 Proprietary]… DONE Benchmarking: More Secure Internet Password [RSA MD defined by BSAFE 1.x – Lotus v6]… DONE Many salts: 905769 c/s real, 917251 c/s virtual Only one salt: 536628 c/s real, 542741 c/s virtual Benchmarking: LM C/R DES [netlm]… DONE Only one salt: 2651K c/s real, 2685K c/s virtual Benchmarking: NTLMv1 C/R MD4 DES [netntlm]… DONE Only one salt: 3840K c/s real, 3898K c/s virtual Benchmarking: LMv2 C/R MD4 HMAC-MD5 [netlmv2]… DONE Only one salt: 3518K c/s real, 3567K c/s virtual Benchmarking: HalfLM C/R DES [nethalflm]… DONE Only one salt: 6427K c/s real, 6559K c/s virtual Benchmarking: MS-SQL [ms-sql]… DONE Only one salt: 15933K c/s real, 16135K c/s virtual Benchmarking: MS-SQL05 [ms-sql05]… DONE Only one salt: 16486K c/s real, 16527K c/s virtual Benchmarking: EPiServer SID Hashes [SHA-1]… DONE Many salts: 16634K c/s real, 16887K c/s virtual Only one salt: 16050K c/s real, 16192K c/s virtual Benchmarking: PHPS MD5 [MD5(MD5($pass).$salt)]… DONE Only one salt: 16079K c/s real, 16262K c/s virtual Benchmarking: MYSQL_fast [mysql-fast]… DONE Benchmarking: PIX MD5 [pix-md5]… DONE Benchmarking: SAP CODVN G (PASSCODE) [sapg]… DONE Only one salt: 4915K c/s real, 4959K c/s virtual Benchmarking: SAP BCODE [sapb]… DONE Many salts: 9781K c/s real, 9868K c/s virtual Only one salt: 7710K c/s real, 7788K c/s virtual Benchmarking: Netscreen MD5 [NS MD5]… DONE |