Password Attacks
John the Ripper is a free and open-source password security auditing and password recovery tool. It can crack various password hash types offline and is highly customizable with different attack modes and mangling rules.
sudo apt install john
john [options] <password-file>
John the Ripper (JtR) is a free, open-source password security auditing and password recovery tool. First released in 1996, it has become one of the most versatile and widely-used password crackers in the world.
John excels at automatic hash type detection, making it accessible to beginners. It supports hundreds of hash formats including MD5, SHA, NTLM, bcrypt, DES, and can directly crack passwords from encrypted ZIP, RAR, PDF, and Office documents.
The tool operates entirely offline, making it safe for authorized password auditing without triggering account lockouts. It uses CPU-based cracking with multi-process support for parallelization across multiple cores.
| Command | Purpose |
|---|---|
john --list=formats | Inspect formats compiled into this build. |
john --test=3 --format=raw-md5 | Run a short local benchmark. |
(umask 077 && unshadow ./passwd.copy ./shadow.copy > ./audit.hashes) | Prepare protected authorized Linux hash copies. |
(umask 077 && zip2john ./owned-audit.zip > ./owned-audit.hash) | Extract an owned archive's audit hash. |
john hashes.txtAuto-detect crack - Launch a quick start cracking session letting John automatically detect the hash typejohn --wordlist=/usr/share/wordlists/rockyou.txt hashes.txtDictionary attack - Use a specific wordlist to test common passwords against the target hashesjohn --show hashes.txtShow cracked - Display the cracked passwords alongside their associated usernames from the sessionjohn --format=raw-md5 hashes.txtSpecify format - Manually set the hash type when the format is already knownjohn --incremental hashes.txtBrute force - Try all possible character combinations in an exhaustive searchjohn --incremental=digits hashes.txtDigits only brute force - Restrict character mutations to numeric patterns for PIN crackingunshadow /etc/passwd /etc/shadow > combined.txtCombine Linux authentication files - Merge system user and shadow files into a format John can readjohn --rules --wordlist=wordlist.txt hashes.txtRules mode - Apply wordlist mangling rules to mutate dictionary words into common variationsjohn --fork=4 --wordlist=wordlist.txt hashes.txtMulti-process execution - Distribute the workload across 4 CPU cores to speed up the cracking processjohn --session=mycrack hashes.txtNamed session - Save the current cracking progress under a specified name for long operationsjohn --restore=mycrackRestore session - Resume an interrupted or paused cracking session from its last saved statejohn --format=nt hashes.txtNTLM hashes - Target Windows SAM database or Active Directory password hashesjohn --format=raw-sha256 hashes.txtSHA256 hashes - Target standard standalone SHA-256 cryptographic check valuesjohn --format=bcrypt hashes.txtbcrypt hashes - Force parsing rules for modern, high-cost adaptive hashing algorithmsjohn --format=zip encrypted.zipZIP password - Attempt to crack password-protected ZIP archive extractions directlyjohn --format=rar encrypted.rarRAR password - Direct dictionary or brute-force attack against protected RAR archivesjohn --format=pdf document.pdfPDF password - Attack and attempt to unlock password-protected PDF structuresjohn --format=office document.docxOffice password - Target and audit encrypted Microsoft Office documentsjohn --list=formatsList formats - Display all supported hash types and cryptographic algorithms available in the buildjohn --list=rulesList rules - View the configuration profiles for wordlist mangling transformationsjohn --mask=?d?d?d?d hashes.txtMask attack - Perform pattern-based cracking targeting a known layout (e.g., exactly 4 digits)john --mask=?u?l?l?l?d?d?d?s hashes.txtComplex mask - Attack using structured layout rules like Upper+Lower+Lower+Lower+Digit+Digit+Digit+Specialjohn --pot=custom.pot hashes.txtCustom potfile - Isolate cracked password storage into a separate results database filejohn --external=filter hashes.txtExternal mode - Execute advanced custom word generation logic using external C-based filterszip2john encrypted.zip > ziphash.txtExtract ZIP hash - Parse an encrypted ZIP archive to extract its hash file for crackingrar2john encrypted.rar > rarhash.txtExtract RAR hash - Extract the embedded encryption hash out of a protected RAR file archivepdf2john.pl document.pdf > pdfhash.txtExtract PDF hash - Pull the cryptographic security key signature out of an encrypted PDF documentssh2john id_rsa > sshhash.txtExtract SSH key hash - Convert an encrypted SSH private key into a crackable hashoffice2john document.docx > officehash.txtExtract Office hash - Pull the hash from a password-protected Microsoft Office filejohn --wordlist=rockyou.txt --rules=Jumbo hashes.txtJumbo rules - Apply the extended Jumbo ruleset for deeper mutationsCrack /etc/shadow passwords using unshadow to combine passwd and shadow files.
Recover passwords from extracted Windows SAM database hashes.
Crack passwords from ZIP, RAR, and 7z archives using format-specific modes.
Recover passwords from encrypted PDF and Office documents.
Solve cryptography and password cracking challenges in competitions.
John is pre-installed on Kali Linux. Run 'john hashes.txt' to auto-detect the hash format, or specify with '--format=md5 hashes.txt'. Use '--wordlist=/usr/share/wordlists/rockyou.txt' for dictionary attacks. The community edition (jumbo) supports 200+ hash formats.
First combine passwd and shadow files: 'unshadow /etc/passwd /etc/shadow > hashes.txt'. Then crack with: 'john --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt'. This only works on systems you own or have authorization to audit. The unshadow tool is included with John.
John the Ripper is better for CPU-based cracking and obscure hash formats. Hashcat excels with GPU acceleration for common hashes (MD5, SHA-1, NTLM). John supports 200+ formats natively; Hashcat has better performance for supported formats. Many professionals use both.
Run 'john --show hashes.txt' to display all cracked passwords. Use '--format=raw-md5' to specify the hash type. The output shows each hash alongside its plaintext. Combine with '--incremental' to show only newly cracked hashes since last session.
Yes. Use 'pdf2john protected.pdf > hash.txt' then 'john hash.txt' for PDFs. For ZIP files: 'zip2john protected.zip > hash.txt' then crack. John also supports RAR, 7z, Office documents, and KeePass databases via specialized extraction tools.
The default wordlist directory is '/usr/share/wordlists/'. The most commonly used file is 'rockyou.txt' — if it doesn't exist, decompress it: 'sudo gunzip /usr/share/wordlists/rockyou.txt.gz'. You can also use custom wordlists with the --wordlist flag.
Password Attacks
Hydra is a parallelized login cracker that supports numerous protocols including FTP, HTTP, HTTPS, SMB, SSH, and many more. It performs rapid dictionary attacks against login pages and services to test password strength.
Password Attacks
Learn how to use Hashcat in Kali Linux as a beginner, from checking the install and selecting the right modes to running a wordlist crack and reading results.
Password Attacks
Crunch is a wordlist generator where you can specify a standard character set or a custom one. It can generate all possible combinations.
Password Attacks
CeWL is a custom word list generator that spiders a target URL and creates a wordlist from the content. Great for targeted password attacks.
Password Attacks
Medusa is a speedy, parallel, and modular login brute-forcer. It supports many protocols including HTTP, FTP, SSH, SMB, MySQL, and more.
Password Attacks
CUPP (Common User Passwords Profiler) creates custom wordlists based on target personal information like names, birthdays, nicknames, pets, and keywords.
Learn to use John the Ripper for CPU-based password cracking including wordlist attacks, incremental mode, rule-based cracking, and hash format handling.
Security · IntermediateLearn how password hashing works, the difference between hashing and encryption, common algorithms, and best practices for secure password storage.
Security · BeginnerMaster password hygiene, multi-factor authentication, password manager usage, and strategies to protect your accounts from credential theft.
Security · IntermediateComprehensive Hashcat tutorial for Kali Linux. Learn GPU-accelerated password recovery, attack modes (-a 0, -a 3 mask attacks), rules, and hash modes cheat sheet.
The software outputs the recovered cleartext next to the corresponding user identifier. Status prompts indicate the current speed and an estimated completion timeframe.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.