← retour aux outils back to tools

# John the Ripper

Cracker de mots de passe classique supportant des centaines de types de hash. Moteur de règles puissant et détection automatique de format. Fonctionne en CPU uniquement (complément au GPU de hashcat). Classic password cracker supporting hundreds of hash types. Strong rule engine and format auto-detection. Works CPU-only (complement to hashcat's GPU).

↗ https://www.openwall.com/john/

## Overview

John the Ripper (JtR) is a venerable CPU-based password cracker with excellent format auto-detection, a rich ruleset, and the `*2john` helper utilities that convert files (zip, pdf, ssh keys, etc.) into crackable hashes.

## Basic Cracking

Auto-detect format and crack

    john hash.txt

Wordlist attack

    john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt

With rules (mangling)

    john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt --rules

    # Specify format explicitly
    john hash.txt --format=NT --wordlist=/usr/share/wordlists/rockyou.txt
    john hash.txt --format=bcrypt --wordlist=/usr/share/wordlists/rockyou.txt

    # Show cracked passwords
    john hash.txt --show
    john hash.txt --show --format=NT

Resume a session

    john --restore

Incremental (brute-force) mode

    john hash.txt --incremental

## *2john — Converting Files to Hashes

SSH private key

    ssh2john id_rsa > id_rsa.hash

ZIP archive

    zip2john archive.zip > zip.hash

RAR archive

    rar2john archive.rar > rar.hash

PDF

    pdf2john document.pdf > pdf.hash

KeePass database

    keepass2john database.kdbx > keepass.hash

/etc/shadow

    unshadow /etc/passwd /etc/shadow > shadow.hash

Office documents (Word, Excel)

    office2john document.docx > office.hash

Bitcoin wallet

    bitcoin2john wallet.dat > wallet.hash

## Common Formats

    john --list=formats            # List all supported formats
    john --list=formats | grep -i ntlm
    john --list=formats | grep -i kerberos

    --format=NT             # NTLM

    --format=netntlmv2      # Net-NTLMv2 (Responder captures)

    --format=krb5tgs        # Kerberoasting

    --format=krb5asrep      # AS-REP Roasting

    --format=sha256crypt    # Linux SHA-256

    --format=sha512crypt    # Linux SHA-512 ($6$)

    --format=bcrypt         # bcrypt

    --format=md5crypt       # Linux MD5 ($1$)

## Rules

    # Built-in rule sets
    john hash.txt --wordlist=rockyou.txt --rules=Single
    john hash.txt --wordlist=rockyou.txt --rules=Wordlist
    john hash.txt --wordlist=rockyou.txt --rules=Extra
    john hash.txt --wordlist=rockyou.txt --rules=All

    # Custom rules in john.conf / john.local.conf
    [List.Rules:Custom]
    cAz"[0-9]"     # Capitalize + append digit

## Tips

- Use `john --show` after cracking to view results (potfile is stored at `~/.john/john.pot`)
- For GPU-accelerated cracking, prefer hashcat; JtR is best for its `*2john` converters
- `john --make-charset=custom.chr` generates custom character sets
- Specify sessions with `--session=name` to run multiple jobs in parallel

Help / Man page

    john [options] [password-files]

    Modes:
      --single[=SECTION]    "Single crack" mode
      --wordlist=FILE       Wordlist mode
      --stdin               Read passwords from stdin
      --incremental[=MODE]  Incremental (brute-force) mode
      --restore[=NAME]      Resume an interrupted session

    Options:
      --format=NAME         Force hash type
      --rules[=SECTION]     Enable word mangling rules
      --show[=LEFT]         Show cracked passwords
      --list=WHAT           List capabilities (formats, rules, etc.)
      --users=LIST          Crack only specified users
      --groups=LIST         Crack only users in groups
      --session=NAME        Named session (for parallel runs)
      --pot=FILE            Alternate pot file
      --no-log              Disable session logging
      --fork=N              Fork N processes

## Vue d’ensemble

John the Ripper (JtR) est un cracker de mots de passe CPU vénérable, doté d’une excellente détection automatique de format, d’un riche jeu de règles, et des utilitaires `*2john` qui convertissent des fichiers (zip, pdf, clés ssh, etc.) en hashes crackables.

## Cracking de base

    # Détection automatique du format et cracking
    john hash.txt

    # Attaque par dictionnaire
    john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt

    # Avec règles (mangling)
    john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt --rules

    # Spécifier le format explicitement
    john hash.txt --format=NT --wordlist=/usr/share/wordlists/rockyou.txt
    john hash.txt --format=bcrypt --wordlist=/usr/share/wordlists/rockyou.txt

    # Afficher les mots de passe crackés
    john hash.txt --show
    john hash.txt --show --format=NT

    # Reprendre une session
    john --restore

    # Mode incrémental (brute-force)
    john hash.txt --incremental

## *2john : conversion de fichiers en hashes

    # Clé privée SSH
    ssh2john id_rsa > id_rsa.hash

    # Archive ZIP
    zip2john archive.zip > zip.hash

    # Archive RAR
    rar2john archive.rar > rar.hash

    # PDF
    pdf2john document.pdf > pdf.hash

    # Base de données KeePass
    keepass2john database.kdbx > keepass.hash

    # /etc/shadow
    unshadow /etc/passwd /etc/shadow > shadow.hash

    # Documents Office (Word, Excel)
    office2john document.docx > office.hash

    # Portefeuille Bitcoin
    bitcoin2john wallet.dat > wallet.hash

## Formats courants

    john --list=formats            # Lister tous les formats supportés
    john --list=formats | grep -i ntlm
    john --list=formats | grep -i kerberos

    --format=NT             # NTLM

    --format=netntlmv2      # Net-NTLMv2 (captures Responder)

    --format=krb5tgs        # Kerberoasting

    --format=krb5asrep      # AS-REP Roasting

    --format=sha256crypt    # Linux SHA-256

    --format=sha512crypt    # Linux SHA-512 ($6$)

    --format=bcrypt         # bcrypt

    --format=md5crypt       # Linux MD5 ($1$)

## Règles

    # Jeux de règles intégrés
    john hash.txt --wordlist=rockyou.txt --rules=Single
    john hash.txt --wordlist=rockyou.txt --rules=Wordlist
    john hash.txt --wordlist=rockyou.txt --rules=Extra
    john hash.txt --wordlist=rockyou.txt --rules=All

    # Règles personnalisées dans john.conf / john.local.conf
    [List.Rules:Custom]
    cAz"[0-9]"     # Met en majuscule + ajoute un chiffre

## Conseils

- Utiliser `john --show` après le cracking pour voir les résultats (le potfile est stocké dans `~/.john/john.pot`)
- Pour le cracking accéléré par GPU, préférer hashcat ; JtR est surtout utile pour ses convertisseurs `*2john`
- `john --make-charset=custom.chr` génère des jeux de caractères personnalisés
- Spécifier des sessions avec `--session=name` pour lancer plusieurs jobs en parallèle

Aide / Page de manuel

    john [options] [password-files]

    Modes:
      --single[=SECTION]    "Single crack" mode
      --wordlist=FILE       Wordlist mode
      --stdin               Read passwords from stdin
      --incremental[=MODE]  Incremental (brute-force) mode
      --restore[=NAME]      Resume an interrupted session

    Options:
      --format=NAME         Force hash type
      --rules[=SECTION]     Enable word mangling rules
      --show[=LEFT]         Show cracked passwords
      --list=WHAT           List capabilities (formats, rules, etc.)
      --users=LIST          Crack only specified users
      --groups=LIST         Crack only users in groups
      --session=NAME        Named session (for parallel runs)
      --pot=FILE            Alternate pot file
      --no-log              Disable session logging
      --fork=N              Fork N processes