John the Ripper offers a wide range of command-line options to customize its behavior for different password cracking scenarios. This guide covers the most important options organized by category.
General Options
Basic Options
Option | Description |
---|
--help | Display help information |
--version | Display version information |
--list=WHAT | List capabilities, where WHAT can be: formats , subformats , inc-modes , rules , externals , sections , or parameters |
Session Management
Option | Description |
---|
--session=NAME | Name a new cracking session |
--restore[=NAME] | Restore a previously interrupted session |
--status[=NAME] | Display status of a session |
Example:
john --session=webserver hash.txt
john --restore=webserver
Wordlist Mode Options
Basic Wordlist Options
Option | Description |
---|
--wordlist=FILE | Use FILE as a wordlist |
--stdin | Read words from standard input |
--pipe | Like --stdin, but bulk reads |
Option | Description |
---|
--rules[=SECTION] | Enable word mangling rules |
--rules-stack=SECTION[,..] | Stack rules sections |
--loopback[=FILE] | Use already cracked passwords as a wordlist |
Example:
john --wordlist=rockyou.txt --rules hash.txt
john --loopback hash.txt
Incremental Mode Options
Option | Description |
---|
--incremental[=MODE] | Use incremental mode |
--mask=MASK | Specify a mask for hybrid attacks |
--markov[=LEVEL[:START[:END[:VALUE]]]] | Use Markov chains |
Example:
john --incremental=All hash.txt
john --markov=1 hash.txt
Option | Description |
---|
--format=NAME | Force hash type NAME |
--subformat=FORMAT | Select a benchmark format for --format=crypt |
--list=formats | List all available formats |
Example:
john --format=raw-md5 hash.txt
john --list=formats
Threading and Parallelization
Option | Description |
---|
--fork=N | Fork N processes |
--node=MIN[-MAX]/TOTAL | This node's number range out of TOTAL count |
Hardware Acceleration
Option | Description |
---|
--devices=N[-M] | Set OpenCL device(s) |
--platform=N | Set OpenCL platform |
--tune=N | Tuning options for OpenCL |
Example:
john --fork=4 hash.txt
john --devices=0 --format=opencl hash.txt
Output and Display Options
Option | Description |
---|
--show[=LEFT] | Show cracked passwords |
--show=formats | Show formats in which hashes were cracked |
--show=invalid | Show lines that are not valid for selected format |
--pot=NAME | Specify pot file to use |
--encoding=NAME | Input encoding (eg. UTF-8, ISO-8859-1) |
Example:
john --show hash.txt
john --pot=custom.pot hash.txt
Advanced Options
External Mode
Option | Description |
---|
--external=MODE | External mode or word filter |
--regen-lost-salts=N | Regenerate lost salts (see doc/OPTIONS) |
Benchmark and Testing
Option | Description |
---|
--test[=TIME] | Run tests and benchmarks for TIME seconds each |
--stress-test[=TIME] | Run stress tests for TIME seconds each |
Example:
john --test=5
john --external=filter_digits hash.txt
Practical Examples
Cracking Linux Shadow Passwords
sudo unshadow /etc/passwd /etc/shadow > passwords.txt
john --wordlist=/usr/share/wordlists/rockyou.txt passwords.txt
Cracking Windows NTLM Hashes
john --format=nt --wordlist=/usr/share/wordlists/rockyou.txt ntlm_hashes.txt
Using Multiple Cores
john --fork=4 --format=md5crypt hashes.txt
Using GPU Acceleration
john --format=md5crypt-opencl --devices=0 hashes.txt
Next Steps
After mastering the command-line options, explore:
- Hash Formats - Learn about the different hash formats supported by John
- Basic Usage - Review the fundamental operations of John the Ripper