1. INTRODUCTION
John the Ripper (JtR) is a fast and powerful password cracking tool.
It supports:
Linux /etc/shadow hashes
Windows NTLM hashes
ZIP/RAR archives
SSH private keys
Kerberos tickets
Used in pentesting, CTFs, OSCP labs, and digital forensics.
2. BASIC SYNTAX
Run John on a hash file:
john hashes.txt
Show cracked passwords:
john --show hashes.txt
Resume interrupted cracking:
john --restore
3. COMMON HASH FORMATS
Linux shadow hashes:
Formats: sha512crypt, md5crypt, bcrypt, yescrypt
Windows NTLM hashes:
Format: NT
ZIP / RAR archive hashes:
Formats: zip, rar
SSH private key hashes:
Format: SSH
4. IDENTIFY HASH TYPE
List all supported formats:
john --list=formats
Auto-detect hash format:
john hashes.txt
Force a format manually:
john --format=NT hashes.txt
5. WORDLIST ATTACK
Crack using a wordlist:
john --wordlist=rockyou.txt hashes.txt
Use mutation rules:
john --wordlist=rockyou.txt --rules hashes.txt
Rules generate variations like:
password123 → Password123!
admin → admin2024
6. INCREMENTAL / BRUTE FORCE MODE
Pure brute force:
john --incremental hashes.txt
Digits only:
john --incremental=digits hashes.txt
Alphanumeric mode:
john --incremental=alnum hashes.txt
7. MASK ATTACKS (PATTERN-BASED)
Crack based on known structure.
Password starts with "P" + 6 digits:
john --mask=P?d?d?d?d?d?d hashes.txt
8 lowercase characters:
john --mask=?l?l?l?l?l?l?l?l hashes.txt
8. CRACKING ZIP / RAR ARCHIVES
Extract hash:
zip2john file.zip > zip.hash
rar2john file.rar > rar.hash
Crack it:
john zip.hash --wordlist=rockyou.txt
9. CRACKING SSH PRIVATE KEYS
Extract hash:
ssh2john id_rsa > rsa.hash
Crack it:
john rsa.hash --wordlist=rockyou.txt
10. CRACKING WINDOWS NTLM HASHES
john --format=NT hashes.txt --wordlist=rockyou.txt
NTLM example:
aad3b435b51404eeaad3b435b51404ee:8846f7eaee8fb117ad06bdd830b7586c
11. POT FILE (CRACKED PASSWORD STORAGE)
John stores cracked passwords in:
~/.john/john.pot
Show cracked entries:
john --show hashes.txt
12. SESSION MANAGEMENT
Start named session:
john --session=myjob hashes.txt
Restore session:
john --restore=myjob
13. PERFORMANCE TIPS
Crack in this order for best efficiency:
1. Wordlist mode (fastest)
2. Wordlist + rules
3. Mask attacks (targeted brute force)
4. Incremental mode (slowest)
14. REAL PENTEST & CTF EXAMPLES
Crack Linux shadow:
unshadow passwd shadow > combo.txt
john combo.txt --wordlist=rockyou.txt
Crack Windows SAM:
samdump2 SYSTEM SAM > ntlm.txt
john ntlm.txt --format=NT --wordlist=rockyou.txt
Crack SSH key:
ssh2john id_rsa > hash.txt
john hash.txt --wordlist=rockyou.txt
Crack ZIP archive:
zip2john secrets.zip > zip.hash
john zip.hash --wordlist=rockyou.txt
← Back to tutorial