John the Ripper Cheat Sheet: Cracking Modes, Rules & Converters

Copy-ready John the Ripper commands: wordlist, rule-based mangling and incremental modes; the *2john converters for SSH keys, ZIP, PDF and Office files; format detection, session restore and --show.

Take This Page With You

Every command on this page is ready to run as written.

Command Reference

1. Crack With a Wordlist

The default first pass. John auto-detects the hash format from the file.

john --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt

2. Add Rule-Based Mangling

--rules applies transformations - capitalisation, leetspeak, appending digits - so one word covers many candidates.

john --wordlist=rockyou.txt --rules hashes.txt

3. Brute Force Without a Wordlist

Incremental mode walks the keyspace. Powerful and slow; use it last and with a time limit.

john --incremental hashes.txt --max-run-time=3600

4. Show What Was Cracked

Without --show, John resumes the session rather than reporting. This is the command people forget.

john --show hashes.txt

5. Force a Specific Format

Needed when auto-detection guesses wrong, or when you know exactly what you are looking at.

john --format=sha512crypt hashes.txt --wordlist=rockyou.txt

6. Crack an SSH Private Key

Convert the key to a John-friendly hash first - ssh2john ships with the Jumbo build.

ssh2john id_rsa > id_rsa.hash && john --wordlist=rockyou.txt id_rsa.hash

7. Crack a Password-Protected ZIP

zip2john extracts the hash from the archive, which is the only part John needs.

zip2john archive.zip > zip.hash && john --wordlist=rockyou.txt zip.hash

8. Crack a Protected PDF

pdf2john is slow on large documents; extract the hash once and reuse it.

pdf2john protected.pdf > pdf.hash && john --wordlist=rockyou.txt pdf.hash

9. Crack Office Documents

office2john handles the modern OOXML containers; older binary formats need a different converter.

office2john report.docx > office.hash && john --wordlist=rockyou.txt office.hash

10. Use Every CPU Core

Fork a worker per core; John does not saturate the machine on its own.

john --format=raw-sha256 --fork=4 --wordlist=rockyou.txt hashes.txt

11. Resume an Interrupted Session

Sessions are recoverable by name; restore continues instead of restarting the search.

john --session=lab1 hashes.txt && john --restore=lab1

12. Build a Custom Rule File

Write mangling rules once, reuse them across engagements instead of retyping the variants.

john --wordlist=base.txt --rules=MyRules hashes.txt   # rules live in john.conf

Frequently Asked Questions

Why is John not finding a hash that hashcat cracks instantly?

Almost always the build. The "core" version packaged by some distributions supports a small set of formats and no GPU; the Jumbo build supports hundreds of formats and includes the *2john converters. Check with john --list=formats before assuming the hash is unusual.

What is the difference between John and hashcat?

John excels at breadth - hundreds of formats and a converter for almost every file type you will meet - and runs on the CPU. hashcat is built for GPU throughput and wins decisively on raw speed for common fast hashes. In practice: use John when you have an odd format, hashcat when you have a lot of hashes of a known type.

Why does --show return nothing when something was cracked?

You are pointing at a different file than the run that cracked it, or the hash file was edited in between so the line no longer matches. John stores results in ~/.john/john.pot keyed on the ciphertext; deleting that file loses the history, not the hashes.

How long will a password take to crack?

That depends on the hash type, the candidate space and the hardware - and on nothing else. A fast hash such as unsalted MD5 is effectively transparent for short passwords; bcrypt, scrypt and Argon2id are designed so that each guess costs real time. Use the site calculator to reason about entropy rather than trusting a table of "seconds to crack".

Is cracking a hash lawful?

Only for hashes you are entitled to test: your own, your lab's, or a client's under written authorisation. Hashes from a breach dump are someone else's data, and attacking live accounts with recovered passwords is a criminal act regardless of how the hash was obtained.


Related Guides, Tools & Cheat Sheets