root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat john.md
// cracking

John the Ripper

21 Jul 2026 · 6 min read
John the Ripper is one of the most veteran and widely used password cracking tools. Given a file of hashes, it tries to recover the plaintext passwords through dictionary, mutation rules or brute force. Its main strength is that it detects the hash format automatically and works well without a GPU.

The nuance that truly matters is that John does not only crack hashes: its *2john utility ecosystem (ssh2john, zip2john, office2john) turns protected files into hashes that John can attack. On top of that, automatic detection is convenient but not always right: with ambiguous formats it is worth setting --format by hand so you don't waste time trying the wrong algorithm.

1. Beginner level — dictionary and detection

JOHN cheat sheet — Beginner
CommandWhat it does
john hash.txtCracks by detecting the hash type automatically
john --wordlist=<wl> hash.txtDictionary attack with a wordlist
john --format=raw-md5 hash.txtSpecifies the hash format
john --show hash.txtShows the already cracked passwords
john --statusShows the progress of the current attack
john --incremental hash.txtIncremental brute-force attack
john --rules --wordlist=<wl> hash.txtApplies mutation rules to the wordlist
unshadow passwd shadow > out.txtCombines passwd and shadow to crack
john out.txtCracks the combined file from unshadow
john --list=formatsLists the supported hash formats
john --wordlist=<wl> --rules=best64 hash.txtUses the best64 rule set
john --fork=4 hash.txtSplits the attack into 4 parallel processes
john --pot=custom.pot hash.txtUses a custom pot file
john --testRuns a performance benchmark

2. Advanced level — Kerberos and extraction

JOHN cheat sheet — Advanced
CommandWhat it does
john --format=nt hash.txtCracks Windows NTLM hashes
john --format=krb5tgs hash.txt <wl>Cracks Kerberoasting tickets
john --format=krb5asrep hash.txt <wl>Cracks AS-REP Roasting
john --mask='?d?d?d?d' hash.txtMask attack with fixed positions
john --session=ataque1 hash.txtNames the session to pause it later
john --restore=ataque1Resumes a paused session
john --wordlist=<wl> --rules=jumbo hash.txtUses the extended jumbo rule set
john --format=raw-sha256 --wordlist=<wl> hash.txtDictionary attack against SHA-256 hashes
ssh2john id_rsa > out.txtExtracts the hash from an SSH private key
zip2john archivo.zip > out.txtExtracts the hash from a protected ZIP
office2john doc.docx > out.txtExtracts the hash from an Office document
john --nolog hash.txtRuns without generating a log file
john --dev=0 hash.txtForces the use of a GPU device (OpenCL)
john --wordlist=<wl> --stdout | john --pipe hash.txtChains generation and cracking through a pipe

3. Details people miss

  • Automatic format detection is convenient but can fail on ambiguous hashes (for example raw-md5 versus other 32-character ones); if you doubt the result, set --format explicitly.
  • John stores already cracked passwords in the .pot file (~/.john/john.pot) and will not try them again; if you repeat an attack and nothing shows up, use --show or delete the pot to retry.
  • For unshadow and to read /etc/shadow you need root privileges; remember to combine passwd and shadow with unshadow before passing the result to John.
  • Kali usually ships the jumbo build, which is the one that provides the Kerberos formats (krb5tgs, krb5asrep) and the *2john utilities; the core build does not include them.
  • --fork uses several CPU processes, but to really speed up slow hashes you want OpenCL properly set up; John is not as strong on GPU as Hashcat, so split the work depending on the case.

zip2john — extracting the hash from an encrypted ZIP

zip2john turns a password-protected ZIP into a hash John can crack:

zip2john archive.zip > hash.txt

With a wordlist:

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

If John doesn't auto-detect the format:

john --format=zip hash.txt

View the already-cracked password:

john --show hash.txt

Responsible use

These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.