John the Ripper (JtR) is a fast password cracker, primarily for cracking passwords using dictionary attacks, brute force, and hybrid attack modes. Here are some common commands and techniques to effectively use John the Ripper.
1. Basic Usage
1.1 Checking John Version
john --version
# Displays the version of John the Ripper.
1.2 Password Cracking
john [options] < password-file >
# Start cracking password hashes.
1.3 Show Cracked Passwords
john --show < password-fil e >
# Show all cracked passwords from a given password file.
2. Attack Modes
2.1 Dictionary Attack
john --wordlist= < dictionary > < password-fil e >
# Use a wordlist to perform a dictionary attack.
2.2 Single Crack Mode
john --single < password-fil e >
# Use single crack mode, ideal for simple passwords.
2.3 Incremental Mode
john --incremental < password-fil e >
# Use incremental mode for brute-forcing passwords.
2.4 External Mode
john --external= < mode > < password-fil e >
# Use an external mode, like a custom script or filter.
3. Advanced Options
john --format= < format > < password-fil e >
# Specify the format of the hash (e.g., md5, sha256).
3.2 Session Management
john --session= < name > < password-fil e >
# Save progress to a session for later resumption.
3.3 Resuming a Session
john --restore= < name >
# Resume a previously started and saved session.
john --list=formats
# List all supported hash formats.
3.5 Parallel Processing
john --fork= < n > < password-fil e >
# Split the job into 'n' processes for parallel processing.
4. Configuration and Customization
4.1 Custom Rules
john --rules= < custom-rule > < password-fil e >
# Apply custom rules for more complex cracking strategies.
4.2 Wordlist Rules
john --wordlist= < dictionary > --rules < password-fil e >
# Apply wordlist with rules for modified dictionary attacks.
4.3 Configuration File
john --config= < path-to-config > < password-fil e >
# Use a custom configuration file.
5. Utilities
unshadow < passwd-fil e > < shadow-fil e > > combined.txt
# Combine passwd and shadow files for UNIX-like systems.
john --pot= < output-file > --show < password-fil e >
# Extract cracked passwords and save them in a file.
6.1 Benchmarking
john --test
# Benchmarking John's performance on your system.
6.2 Tuning Options
john --max-run-time= < seconds > < password-fil e >
# Limit the runtime to prevent excessive processing.
7. References