
John the Ripper is a powerful password-cracking tool designed for security professionals to test password strength. It supports various encryption formats, detects weak passwords, and helps enhance security by identifying vulnerabilities in authentication systems. John the Ripper is a go-to password-cracking tool for pentesters, enabling efficient testing of password strength and uncovering weak credentials across various formats.
Installation and Setup
From Package Managers
Kali Linux: Pre-installed. Run directly with john.
sudo apt update && sudo apt install johnbrew install john-jumboFrom Source
git clone https://github.com/openwall/john -b bleeding-jumbo john-jumbocd john-jumbo/src./configure && make -s clean && make -sj4cd ../run./john --helpUpdating John the Ripper
cd john-jumbo && git pull && cd src && make clean && make -sj4sudo apt update && sudo apt upgrade johnBasic Commands
john hashfile.txt #Crack hashes with default settingsjohn --wordlist=wordlist.txt hashfile.txt #Use a custom wordlistjohn --rules --wordlist=wordlist.txt hashfile.txt #Enable rules for advanced mutationsjohn --incremental hashfile.txt #Incremental brute force attackjohn --mask=?d?d?d?d hashfile.txt #Mask attack for 4-digit PINsjohn --show hashfile.txt #Display cracked passwordsjohn --restore=session_name #Resume a saved sessionjohn --session=my_session hashfile.txt #Save progress with a session nameFormat Detection and Specification
john --list=formats #List all supported hash formatsjohn --format=raw-md5 hashfile.txt #Specify hash formatExternal Wordlists
john --wordlist=/usr/share/wordlists/rockyou.txt hashfile.txtjohn --wordlist=custom_list.txt hashfile.txt --rulesPerformance Tuning
john --fork=4 hashfile.txt #Multi-threading with 4 processesjohn --format=nt --fork=8 hashfile.txt #Combine format and threadingjohn --max-run-time=3600 hashfile.txt #Stop after 1 hourCustom Masks and Incremental Modes
john --mask=?u?l?l?l?d hashfile.txt #Uppercase, lowercase, and digit maskjohn --mask=?d?d?d?d?d --incremental hashfile.txt #Incremental 5-digit PINjohn --incremental=digits hashfile.txt #Incremental mode for digitsjohn --incremental=alnum hashfile.txt #Incremental alphanumericjohn --mask=?a?a?a?a?a hashfile.txt #Any printable ASCII characterFile-Specific Cracking
ZIP Files
zip2john file.zip > zip_hash.txt #Convert ZIP to hashjohn zip_hash.txt --wordlist=wordlist.txt #Crack ZIP passwordSSH Private Keys
ssh2john id_rsa > ssh_hash.txt #Convert SSH key to hashjohn ssh_hash.txt --wordlist=wordlist.txt #Crack SSH passwordPDF Files
pdf2john.pl file.pdf > pdf_hash.txt #Convert PDF to hashjohn pdf_hash.txt --wordlist=wordlist.txt #Crack PDF passwordWindows Hashes
LM/NTLM Cracking
john --format=lm hashfile.txt #Crack LM hashesjohn --format=nt hashfile.txt #Crack NTLM hashesSAM Dump
samdump2 /mnt/windows/System32/config/SAM > sam_hashes.txtjohn sam_hashes.txt --format=ntSession and State Management
john --session=my_session hashfile.txt #Save session with a namejohn --restore=my_session #Restore sessionjohn --status=my_session #Check session statusjohn --nolog hashfile.txt #Run without loggingCracking Modes
Single Crack Mode
john --single hashfile.txt #Use usernames as guessesWordlist Mode
john --wordlist=wordlist.txt hashfile.txtjohn --wordlist=wordlist.txt --rules=Jumbo hashfile.txt #Apply advanced rulesIncremental Mode
john --incremental hashfile.txt #Brute force with rulesExternal Mode
john --external=Filter hashfile.txt #Apply external rulesCustom Rules
Define custom rules in john.conf under [List.Rules:CustomRules]. Example:
[List.Rules:CustomRules]cAz"123" #Append "123" to each wordAz"!!" #Append "!!"Run with:
john --rules=CustomRules --wordlist=wordlist.txt hashfile.txtSome good custom John the Ripper rules:
[List.Rules:Try]cAz"[0-9]"cAz"[£!$@#]"cAz"[0-9][0-9]"cAz"[0-9][£!$@#]"cAz"[£!$@#][0-9]"cAz"[£!$@#][£!$@#]"cAz"[0-9][0-9][0-9]"cAz"[£!$@#][0-9][0-9]"cAz"[0-9][0-9][£!$@#]"cAz"[0-9][£!$@#][0-9]"cAz"[£!$@#][£!$@#][£!$@#]"cAz"[0-9][0-9][0-9][0-9]"cAz"[0-9][£!$@#][£!$@#][£!$@#]"cAz"[£!$@#][0-9][£!$@#][£!$@#]"cAz"[£!$@#][£!$@#][0-9][£!$@#]"cAz"[£!$@#][£!$@#][£!$@#][0-9]"cAz"[0-9][0-9][£!$@#][£!$@#]"cAz"[0-9][£!$@#][0-9][£!$@#]"cAz"[0-9][£!$@#][£!$@#][0-9]"cAz"[£!$@#][0-9][£!$@#][0-9]"cAz"[£!$@#][0-9][0-9][£!$@#]"cAz"[£!$@#][£!$@#][0-9][0-9]"cAz"[0-9][0-9][0-9][£!$@#]"cAz"[0-9][0-9][£!$@#][0-9]"cAz"[0-9][£!$@#][0-9][0-9]"cAz"[£!$@#][0-9][0-9][0-9]"cAz"[£!$@#][£!$@#][£!$@#][£!$@#]"Az"[0-9]"Az"[£!$@#]"Az"[0-9][0-9]"Az"[0-9][£!$@#]"Az"[£!$@#][0-9]"Az"[£!$@#][£!$@#]"Az"[0-9][0-9][0-9]"Az"[£!$@#][0-9][0-9]"Az"[0-9][0-9][£!$@#]"Az"[0-9][£!$@#][0-9]"Az"[£!$@#][£!$@#][£!$@#]"Az"[0-9][0-9][0-9][0-9]"Az"[0-9][£!$@#][£!$@#][£!$@#]"Az"[£!$@#][0-9][£!$@#][£!$@#]"Az"[£!$@#][£!$@#][0-9][£!$@#]"Az"[£!$@#][£!$@#][£!$@#][0-9]"Az"[0-9][0-9][£!$@#][£!$@#]"Az"[0-9][£!$@#][0-9][£!$@#]"Az"[0-9][£!$@#][£!$@#][0-9]"Az"[£!$@#][0-9][£!$@#][0-9]"Az"[£!$@#][0-9][0-9][£!$@#]"Az"[£!$@#][£!$@#][0-9][0-9]"Az"[0-9][0-9][0-9][£!$@#]"Az"[0-9][0-9][£!$@#][0-9]"Az"[0-9][£!$@#][0-9][0-9]"Az"[£!$@#][0-9][0-9][0-9]"Az"[£!$@#][£!$@#][£!$@#][£!$@#]"
[List.Rules:TryHarder]cAz"[0-9]"cAz"[£!$@#%?.:^&]"cAz"[0-9][0-9]"cAz"[0-9][£!$@#%?.:^&]"cAz"[£!$@#%?.:^&][0-9]"cAz"[£!$@#%?.:^&][£!$@#%?.:^&]"cAz"[0-9][0-9][0-9]"cAz"[£!$@#%?.:^&][0-9][0-9]"cAz"[0-9][0-9][£!$@#%?.:^&]"cAz"[0-9][£!$@#%?.:^&][0-9]"cAz"[£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&]"cAz"[0-9][0-9][0-9][0-9]"cAz"[0-9][£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&]"cAz"[£!$@#%?.:^&][0-9][£!$@#%?.:^&][£!$@#%?.:^&]"cAz"[£!$@#%?.:^&][£!$@#%?.:^&][0-9][£!$@#%?.:^&]"cAz"[£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&][0-9]"cAz"[0-9][0-9][£!$@#%?.:^&][£!$@#%?.:^&]"cAz"[0-9][£!$@#%?.:^&][0-9][£!$@#%?.:^&]"cAz"[0-9][£!$@#%?.:^&][£!$@#%?.:^&][0-9]"cAz"[£!$@#%?.:^&][0-9][£!$@#%?.:^&][0-9]"cAz"[£!$@#%?.:^&][0-9][0-9][£!$@#%?.:^&]"cAz"[£!$@#%?.:^&][£!$@#%?.:^&][0-9][0-9]"cAz"[0-9][0-9][0-9][£!$@#%?.:^&]"cAz"[0-9][0-9][£!$@#%?.:^&][0-9]"cAz"[0-9][£!$@#%?.:^&][0-9][0-9]"cAz"[£!$@#%?.:^&][0-9][0-9][0-9]"cAz"[£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&]"Az"[0-9]"Az"[£!$@#%?.:^&]"Az"[0-9][0-9]"Az"[0-9][£!$@#%?.:^&]"Az"[£!$@#%?.:^&][0-9]"Az"[£!$@#%?.:^&][£!$@#%?.:^&]"Az"[0-9][0-9][0-9]"Az"[£!$@#%?.:^&][0-9][0-9]"Az"[0-9][0-9][£!$@#%?.:^&]"Az"[0-9][£!$@#%?.:^&][0-9]"Az"[£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&]"Az"[0-9][0-9][0-9][0-9]"Az"[0-9][£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&]"Az"[£!$@#%?.:^&][0-9][£!$@#%?.:^&][£!$@#%?.:^&]"Az"[£!$@#%?.:^&][£!$@#%?.:^&][0-9][£!$@#%?.:^&]"Az"[£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&][0-9]"Az"[0-9][0-9][£!$@#%?.:^&][£!$@#%?.:^&]"Az"[0-9][£!$@#%?.:^&][0-9][£!$@#%?.:^&]"Az"[0-9][£!$@#%?.:^&][£!$@#%?.:^&][0-9]"Az"[£!$@#%?.:^&][0-9][£!$@#%?.:^&][0-9]"Az"[£!$@#%?.:^&][0-9][0-9][£!$@#%?.:^&]"Az"[£!$@#%?.:^&][£!$@#%?.:^&][0-9][0-9]"Az"[0-9][0-9][0-9][£!$@#%?.:^&]"Az"[0-9][0-9][£!$@#%?.:^&][0-9]"Az"[0-9][£!$@#%?.:^&][0-9][0-9]"Az"[£!$@#%?.:^&][0-9][0-9][0-9]"Az"[£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&][£!$@#%?.:^&]"
[List.Rules:BeBrutal]cAz"[0-9]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[0-9][0-9]"cAz"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[0-9][0-9][0-9]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9]"cAz"[0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[0-9][0-9][0-9][0-9]"cAz"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"cAz"[0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9]"cAz"[0-9][0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"cAz"[0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"cAz"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9][0-9]"cAz"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[0-9]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[0-9][0-9]"Az"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[0-9]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[0-9][0-9][0-9]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9]"Az"[0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[0-9][0-9][0-9][0-9]"Az"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"Az"[0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9]"Az"[0-9][0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"Az"[0-9][0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9]"Az"[0-9][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][0-9][0-9][0-9]"Az"[£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*][£!$@#%?.:^&()+_-={}|\[\]\;',/<>`~*]"



