SHADOW FILE FORMAT
Each line in /etc/shadow follows this format:
username:$id$salt$hash:lastchg:min:max:warn:inactive:expire
HASH TYPE IDENTIFIERS ($id$)
| PREFIX | ALGORITHM | STRENGTH | JOHN FORMAT |
| $1$ | MD5crypt | Weak | md5crypt |
| $2a$ / $2b$ | bcrypt | Strong | bcrypt |
| $5$ | SHA-256crypt | Medium | sha256crypt |
| $6$ | SHA-512crypt | Strong | sha512crypt |
| $y$ | yescrypt | Very Strong | yescrypt |
| (none) | DES crypt | Very Weak | descrypt |
| ! | Locked account | N/A | N/A |
| * | No password | N/A | N/A |
WORKFLOW
# Step 1: Combine passwd + shadow
unshadow /etc/passwd /etc/shadow > shadow.txt
# Step 2: Wordlist attack
john shadow.txt --wordlist=/usr/share/wordlists/rockyou.txt
# Step 3: Rules-based attack
john shadow.txt --wordlist=/usr/share/wordlists/rockyou.txt --rules
# Step 4: Show cracked passwords
john shadow.txt --show
# Specify format explicitly
john shadow.txt --format=md5crypt --wordlist=...
JOHN SYNTAX REFERENCE
| FLAG | DESCRIPTION |
| --wordlist=FILE | Use a wordlist for dictionary attack |
| --rules | Apply mangling rules to wordlist words |
| --show | Display all cracked passwords |
| --format=NAME | Force a specific hash format |
| --list=formats | List all supported hash formats |
| --incremental | Brute-force attack (slow) |
| --single | Single crack mode (uses username etc.) |
| --status | Show cracking progress |
RISK RATINGS
| RATING | CRITERIA |
| CRITICAL | DES/MD5 hashes with dictionary passwords |
| HIGH | SHA-512 with common/short passwords |
| MEDIUM | Strong hashes, complex passwords |
| LOW | bcrypt/yescrypt, long random passwords |