Skip to content
Learni
View all tutorials
Cybersécurité

How to Use John the Ripper to Audit Passwords in 2026

Lire en français

Introduction

John the Ripper, often shortened to John, is an open-source password cracking tool developed since 1996 by the Openwall community. In 2026, it remains a cornerstone for legitimate security audits, used by pentesters to evaluate password strength in organizations. Far from common misconceptions, its ethical use aims to identify weaknesses before malicious attackers can exploit them.

Why is this crucial? Data breaches like those in 2024 (LinkedIn, RockYou2024) show that 80% of passwords are weak (dictionary words, simple patterns). John simulates realistic attacks: brute force (exhaustive trials), dictionary (common word lists), and rules (mutations like 'password' → 'P@ssw0rd!').

This beginner tutorial, purely conceptual with no code, guides you step-by-step through its theory. You'll understand how it processes hashes (MD5, SHA, bcrypt), optimizes performance (GPU via OpenCL), and integrates massive wordlists like RockYou. By the end, you'll know how to audit ethically and advocate for strong password policies. Perfect for cybersecurity beginners wanting to bookmark this as a reference guide. (248 words)

Prerequisites

  • Basic knowledge of cryptography: hashes (MD5, SHA-256, bcrypt) and salting.
  • Familiarity with Linux (John is native to Unix-like systems).
  • Ethical understanding: authorized audits only (legal pentesting, CTFs).
  • Access to public wordlists (RockYou, CrackStation) – legally downloadable.
  • No code: pure theory, applicable on Kali Linux or Jumbo version.

Step 1: Understand the Core Cracking Principles

John the Ripper relies on hash inversion: a hash is a one-way function (e.g., 'password' → '5f4dcc3b5aa765d61d8327deb882cf99' for MD5). The tool tries plaintext candidates, hashes them, and compares.

Simple analogies: Picture a safe with a 4-digit code (brute force: try 0000 to 9999). For long passwords, it's infeasible (2^128 trials for AES-128).

Supported Hash Types (2026):

TypeExampleJohn Speed
---------------------------
MD5Fast, obsoleteVery high
SHA-1VulnerableHigh
bcryptSlow by designMedium
Argon2Modern, memory-intensiveLow
John auto-detects formats with --format=auto. Case study: On RockYou2024 (10B passwords), '123456' cracks in seconds on MD5.

Performance: Jumbo (modern fork) leverages multi-core CPU + GPU (CUDA/OpenCL), up to 100k H/s on RTX 4090 for MD5.

Step 2: Main Attack Modes

Mode 1: Single crack – Uses login/username as candidates ('user:password' → hash). Ideal for Unix /etc/shadow. Theory: Exploits human laziness (password = username).

Mode 2: Wordlist/Dictionary – Loads a list (rockyou.txt) and hashes each entry. E.g., 14M words in RockYou, time = list_size * hash_time.

Mode 3: Incremental (brute force) – Systematically generates (aaa, aab...). Default charset: ?l?d?s (lowercase, digits, symbols). For 8 chars: 95^8 = 6.6e15 trials – years even on GPU.

Mode 4: Rules – Automated mutations: toggle case ('pass' → 'Pass'), append '123', leet ('a'→'@'). Rules file: 1000+ defaults.

Real example: MD5 hash 'e10adc3949ba59abbe56e057f20f883e' ('123456'). Wordlist finds it in 1s; without, brute force ~1min on CPU.

Combinations: --stdout + pipes for hybrids (wordlist + rules).

Step 3: Preparing Data and Sessions

Hash Extraction: From shadow, SAM (Windows), PDFs. Tools like unshadow or pdf2john (theoretical).

Input Files: hashes.txt in user:hash or standalone hash format.

Persistent Sessions: --session=audit1 saves progress (cracked results in .pot). Resume with --restore.

Advanced Wordlists:

  • RockYou: 14M, covers 30% of usage.
  • Hashcat rules: Compatible.
  • Custom: Cebase (names), DarkWeb leaks.

Case Study: Linux shadow audit. 100 users, 20% cracked in 1h (weak MD5s). Results: john.pot stores hash:plaintext to avoid re-cracking.

Scaling: Distribute via MPI (clusters) or cloud GPUs (AWS EC2 g5.xlarge).

Step 4: Analyzing Results and Reporting

Outputs:

  • --show: Lists cracked passwords.
  • .pot: Global cache.
  • Stats: --progress-every=10s.

Key Metrics:
MetricInterpretation
------------------------
c/sCandidates/sec
p/sPlaintexts/sec
TimeETA remaining

Ethical Reporting: Z-Score (password strength: entropy bits). E.g., 'password123' = 20 bits (weak). Recommend: 12+ chars, passphrases (diceware).

Visualization: Hashcat-utils or scripts for graphs (time vs. strength).

Best Practices

  • Ethics first: Get written authorization (RoE). Document everything.
  • Start simple: Wordlist + rules before brute force (90% success).
  • Optimize hardware: GPU Jumbo > CPU. Test formats with john --list=formats.
  • Stay updated: Weekly Jumbo GitHub pulls (new formats like PBKDF2-HMAC-SHA512).
  • Secure outputs: Encrypt .pot, delete after audit.

Common Mistakes to Avoid

  • Ignoring salting: Salted hashes (unique/user) break simple dictionaries – use --fork to parallelize.
  • Wrong wordlist: RockYou for US; use multilingual (SecLists) for FR.
  • No format detection: Specify --format=sha512crypt for modern shadow.
  • Forgetting restore: Lose progress on crash – always use --session.

Next Steps

Master Hashcat (GPU-first, faster). Read Openwall John docs. Practice on HackTheBox or CTFs.

Check out our Learni pentesting courses for hands-on ethical training. Books: 'Hacking Exposed', 'The Basics of Hacking and Penetration Testing'.