John the Ripper
John the Ripper is a free and open-source password security auditing and password recovery tool available for many operating systems. It is designed to detect weak passwords in Unix/Linux and Windows systems.
Basic Usage
# Basic usage with automatic format detection
john hash.txt
# Specify a format
john --format=raw-md5 hash.txt
# Use wordlist
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
# Show cracked passwords
john --show hash.txtExtracting Hashes
Shadow File (Linux)
# First, combine /etc/passwd and /etc/shadow
unshadow /etc/passwd /etc/shadow > hashes.txt
# Then crack with John
john hashes.txtWindows NTLM Hashes
Zip Files
RAR Files
PDF Files
SSH Keys
Attack Modes
Dictionary Attack
Incremental Mode (Brute Force)
Rules-Based Attack
Common Hash Formats
Advanced Options
Custom Rules
John's custom rules allow you to create complex password transformations. Add these to the john.conf file:
Integration in Pentesting Workflow
Extract hashes from the target system
Identify hash types (
hashidorhash-identifiercan help)Select appropriate attack method based on hash type and context
Begin with quick wordlist attacks using common passwords
Move to rule-based attacks if simple wordlists fail
Use incremental (brute force) mode as a last resort for short passwords
Tips for Effective Usage
Always start with the most likely password patterns for your target
Use the
--potoption to save cracked passwords for future referenceLeverage session management for long-running cracks
Use custom rules based on the target organization (company name, founding year, etc.)
For Linux shadow files, target lower-privileged users first as they often have weaker passwords
Use
--showto display already cracked passwords without rerunning the attack
Real-World Example: Cracking Linux Passwords
Additional Resources
Last updated