| name | john-the-ripper |
| description | Build, extend, and operate John the Ripper — a fast password cracking tool supporting hundreds of hash types. Use when cracking password hashes, extracting hashes from archives or documents, performing wordlist or rule-based attacks, or recovering credentials during a penetration test. Covers community vs jumbo builds, supported formats, auto-detect, wordlist mode, rule sets (Jumbo, KoreLogic, All), incremental mode, mask mode, *2john extraction utilities, session management, potfile, and comparison with Hashcat.
|
| license | GPLv2 |
| metadata | {"author":"redhoundinfosec","version":"1.0","repo":"https://github.com/openwall/john","language":"C"} |
john-the-ripper Agent Skill
When to Use This Skill
Use this skill when:
- Cracking password hashes obtained during a penetration test
- Extracting crackable hashes from ZIP, RAR, PDF, SSH keys, KeePass, or BitLocker
- The user asks about john, JtR, or john the ripper
- Choosing between wordlist, rules, incremental, or mask attack modes
- Managing crack sessions, restoring interrupted jobs, or reading the potfile
- Deciding whether to use John or Hashcat for a specific hash type
What John the Ripper Does
John the Ripper is an open-source password cracking tool that supports hundreds of hash types
and five primary attack modes. The Jumbo community release significantly extends the core
version with additional formats, rule sets, and *2john extraction utilities. It is used when
Hashcat is unavailable (CPU-only environments) or when its rule syntax or format auto-detection
is more convenient.
Installation
sudo apt install john
sudo apt install john
sudo apt install build-essential libssl-dev yasm libgmp-dev libpcap-dev pkg-config libbz2-dev
git clone https://github.com/openwall/john -b bleeding-jumbo
cd john/src && ./configure && make -s clean && make -sj$(nproc)
sudo ln -s $(pwd)/john/run/john /usr/local/bin/john
docker pull ghcr.io/openwall/john
docker run --rm -v $(pwd):/data ghcr.io/openwall/john /data/hashes.txt
john --list=build-options
john --version
Supported Hash Formats
john --list=formats
john --list=formats | grep -i ntlm
john --list=formats | grep -i bcrypt
john --list=formats | grep -i sha256
Hash Extraction (*2john Utilities)
zip2john secret.zip > zip.hash
zip2john -S secret.zip > zip.hash
rar2john secret.rar > rar.hash
7z2john secret.7z > 7z.hash
pdf2john.pl secret.pdf > pdf.hash
pdf2john secret.pdf > pdf.hash
ssh2john id_rsa > ssh.hash
keepass2john keepass.kdbx > keepass.hash
keepass2john -k keyfile.key keepass.kdbx > keepass.hash
bitlocker2john -i disk.img > bitlocker.hash
office2john secret.docx > office.hash
hccapx2john capture.hccapx > wpa.hash
wpapcap2john capture.pcap > wpa.hash
gpg2john private.gpg > gpg.hash
sudo cat /etc/shadow > shadow.txt
john shadow.txt
cut -d: -f4 dump.ntds > ntlm.hash
unshadow /etc/passwd /etc/shadow > combined.txt
john combined.txt
Attack Modes
Auto-Detect (Single-Crack) Mode
john hashes.txt
john --format=NT hashes.txt
john --format=sha512crypt shadow.txt
john --show=left hashes.txt
Wordlist Mode
john --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt
john --wordlist=/usr/share/wordlists/rockyou.txt --format=NT hashes.txt
cat wordlist.txt | john --stdin hashes.txt
Rules-Based Attack
Rules mutate wordlist candidates. John Jumbo ships many built-in rulesets.
john --wordlist=rockyou.txt --rules=Jumbo hashes.txt
john --wordlist=rockyou.txt --rules=KoreLogic hashes.txt
john --wordlist=rockyou.txt --rules=All hashes.txt
john --wordlist=rockyou.txt --rules=Best64 hashes.txt
john --wordlist=rockyou.txt --rules=T0XlC hashes.txt
john --wordlist=rockyou.txt --rules=Single hashes.txt
john --list=rules
Incremental Mode (Brute Force)
john --incremental hashes.txt
john --incremental=Alpha hashes.txt
john --incremental=Digits hashes.txt
john --incremental=Alnum hashes.txt
john --incremental=ASCII hashes.txt
john --incremental=Alpha --min-length=6 --max-length=8 hashes.txt
Mask Mode (Hybrid Brute Force)
john --mask='?u?l?l?l?d?d?d?d' hashes.txt
john --mask='Password?d?d' hashes.txt
john --mask='?w?d?d' --wordlist=rockyou.txt hashes.txt
john --mask='?1?1?1?d?d' --1='[aeiou]' hashes.txt
john --mask='?w?d?d?s' --wordlist=rockyou.txt --rules hashes.txt
Prince Mode (PRINCE algorithm)
john --prince=wordlist.txt hashes.txt
john --prince=wordlist.txt --rules=Jumbo hashes.txt
Session Management
john --session=myengagement --wordlist=rockyou.txt hashes.txt
john --restore=myengagement
john --restore
ls ~/.john/
kill -USR1 $(pidof john)
Potfile and Showing Cracked Passwords
cat ~/.john/john.pot
john --show hashes.txt
john --show --format=NT ntlm.hash
john --show=left hashes.txt
john --pot=./engagement.pot --wordlist=rockyou.txt hashes.txt
john --pot=./engagement.pot --show hashes.txt
> ~/.john/john.pot
Cracking Specific Hash Types
Linux /etc/shadow
unshadow /etc/passwd /etc/shadow > combined.txt
john --wordlist=rockyou.txt --rules=Jumbo combined.txt
john --show combined.txt
Windows NTLM (from secretsdump / mimikatz)
cut -d: -f4 dump.ntds | sort -u > ntlm_hashes.txt
john --format=NT --wordlist=rockyou.txt --rules=Jumbo ntlm_hashes.txt
Kerberoasting (TGS Hashes)
john --format=krb5tgs --wordlist=rockyou.txt --rules=Jumbo kerb_hashes.txt
AS-REP Roasting
john --format=krb5asrep --wordlist=rockyou.txt asrep_hashes.txt
SSH Key Passphrase
ssh2john id_rsa > id_rsa.hash
john --wordlist=rockyou.txt --rules id_rsa.hash
john --show id_rsa.hash
KeePass Database
keepass2john database.kdbx > keepass.hash
john --wordlist=rockyou.txt --rules=Jumbo keepass.hash
Common Workflows
Post-Compromise Credential Harvesting
impacket-secretsdump domain/admin:pass@dc.local -outputfile dump
cut -d: -f4 dump.ntds | sort -u > ntlm.hash
john --format=NT --wordlist=/usr/share/wordlists/rockyou.txt ntlm.hash
john --format=NT --wordlist=/usr/share/wordlists/rockyou.txt --rules=Jumbo ntlm.hash
john --format=NT --show ntlm.hash | tee cracked.txt
CTF Hash Cracking Pipeline
echo '$6$rounds=5000$salt$hash...' | john --stdin --format=auto --show
john --wordlist=/usr/share/wordlists/rockyou.txt --format=sha512crypt target.hash
john --wordlist=/usr/share/wordlists/rockyou.txt --rules=All target.hash
john --incremental=Alnum --min-length=1 --max-length=6 target.hash
John vs Hashcat
| Feature | John the Ripper | Hashcat |
|---|
| GPU acceleration | Limited (OpenCL) | Excellent (CUDA/OpenCL) |
| CPU performance | Strong | Strong |
| Rule syntax | John rules (verbose) | Hashcat rules (compact) |
| Format support | Wider (many *2john utils) | Fewer, but major types covered |
| Auto-detect format | Yes | No (must specify -m mode) |
| Incremental (brute) | Built-in | Built-in |
| Mask attack | --mask | -a 3 |
| Prince mode | Built-in | Separate binary |
| Best for | CPU-only, broad format support, CTF convenience | GPU rig, maximum speed on common types |
john --wordlist=rockyou.txt --rules=Jumbo hashes.txt
hashcat -m 1000 hashes.txt rockyou.txt -r /usr/share/hashcat/rules/best64.rule
Advanced Techniques
Loopback Mode (feed cracked passwords back)
john --wordlist=rockyou.txt --rules hashes.txt
john --loopback hashes.txt
Custom Wordlist Generation
crunch 8 10 abcdefghijklmnopqrstuvwxyz0123456789 -o custom.txt
john --wordlist=custom.txt hashes.txt
cewl https://target.example.com -d 3 -m 6 -w site_words.txt
john --wordlist=site_words.txt --rules=Jumbo hashes.txt
Distributed Cracking
split -n l/4 hashes.txt chunk_
john --wordlist=rockyou.txt --rules chunk_aa &
john --wordlist=rockyou.txt --rules chunk_ab &
john --wordlist=rockyou.txt --rules chunk_ac &
john --wordlist=rockyou.txt --rules chunk_ad &
cat node1.pot node2.pot node3.pot node4.pot | sort -u > combined.pot
Troubleshooting
| Issue | Fix |
|---|
No password hashes loaded | Wrong --format=; use --list=formats to find correct name |
| Very slow bcrypt/scrypt | Switch to Hashcat with GPU; these are inherently slow |
| Potfile already contains all hashes | Delete or move ~/.john/john.pot |
Segmentation fault on large file | Split hash file into chunks |
| Format auto-detect wrong | Force with --format=; run john --test --format=X to validate |
| Rules not found | Ensure using Jumbo build; check john --list=rules |
| Session restore fails | Check ~/.john/ for .rec file; use --restore=sessionname |
Built by Red Hound InfoSec — On-demand offensive security expertise for SMBs.
20+ years of Fortune 500 experience. Penetration testing, attack surface analysis, and security consulting.
Related reading: 5 Active Directory Misconfigurations We See in Every Engagement
redhound.us | GitHub | Book a consultation