Thireus' Bl0g

Crack Passwords using John the Ripper with Multiple CPU Cores (OpenMP)

by on Dec.05, 2011, under Crack1ng, Guides and tutorials, Hack1ng. 0 views

John the Ripper is a fast and famous password cracker.

John can break many password hashes, but one of the primary missing feature was the CPU multiple core support. But today, John the Ripper 1.7.9 supports OpenMP which brings Multi-Processing. Of course this feature was present on some patched versions of John, but since the 1.7.9 version it is officially integrated.

One of the best platform where you should use John the Ripper is UNIX, I personally prefer using john on Debian x86_64.

Let’s try some simple steps to enable and illustrate the new feature ;-)

$ wget
$ tar -xvzf john-1.7.9.tar.gz
  • Now let’s make some changes into the Makefile to enable the use of OpenMP
$ cd john-1.7.9/src/
john-1.7.9/src$ nano Makefile
  • Locate the following lines
# gcc with OpenMP
#OMPFLAGS = -fopenmp
#OMPFLAGS = -fopenmp -msse2
  • Uncomment OMPFLAGS
# gcc with OpenMP
OMPFLAGS = -fopenmp
OMPFLAGS = -fopenmp -msse2
  • Before compiling john, make sure you have gcc installed! Now, let’s compile john.
john-1.7.9/src$ make

This command will list all the systems where john can be compiled on. As I’m running Debian x86_64, I will choose linux-x86-64.

john-1.7.9/src$ make linux-x86-64

John should be located in the ../run folder.

  • Let’s try John
john-1.7.9/src$ cd ../run/
john-1.7.9/run$ ./john --test

Some benches should appear… ^^

Benchmarking: Traditional DES [128/128 BS SSE2-16]... DONE
Many salts:	7651K c/s real, 3872K c/s virtual
Only one salt:	6876K c/s real, 3487K c/s virtual

And John might use all your CPU cores.

  • Now let’s do something fun, if you want John to use a certain amount of cores you can adjust it with the environment variable OMP_NUM_THREADS:
john-1.7.9/run$ OMP_NUM_THREADS=1 ./john --test
Benchmarking: Traditional DES [128/128 BS SSE2-16]... DONE
Many salts:	3982K c/s real, 3990K c/s virtual
Only one salt:	3770K c/s real, 3770K c/s virtual

As you can see, this bench is twice slower than the previous one. Because I asked OpenMP to use only one core on my dual-core CPU.
Feel free to adjust the number of cores you want to use with OMP_NUM_THREADS :-)

Three other quick tips regarding John the Ripper

  • Restore your previous job in background
./john --restore &> /dev/null &
  • Get status for the current task
./john --status
  • Show cracked passwords
./john --show hash_file

 Let’s see if you can crack some of my UNIX accounts :-D


Have fun with my friend John :-)

Incoming search terms:

:, , , , , , ,

12 Comments for this entry

1 Trackback or Pingback for this entry

Thireus on Twitter