Kerberoasting

Overview

  • Request service ticket for any service with registered SPN

  • Use ticket to crack service password

  • Use BloodHound to find Kerberoastable accounts

  • If service is a domain admin we can gather loot and dump the NTDS.dit

  • If not, you can use it to log into other systems and pivot or escalate

  • Use cracked password for password spraying

Exploitation

Find Accounts with SPN

# Windows built-in
setspn -T DOMAIN -Q ​*/*

# PowerView
Get-NetUser -SPN | Select -ExpandProperty serviceprincipalname

# AD Module
Get-ADUser -Filter { ServicePrincipalName -ne "$null" } -Properties ServicePrincipalName

Force Set SPN

If we have enough rights on user (GenericAll/GenericWrite) we can set an SPN for a user then request a TGS for it for Kerberoasting.

Extracting Tickets

Extracting Hashes

Detection

  • Security event ID 4769: A Kerberos ticket was requested

  • Filter results based on the following information from logs

    • Service name should not be krbtgt

    • Service name does not end with $ (to filter out machine accounts used for services)

    • Account name should not be machine@domain (to filter out requests from machines)

    • Failure code is '0x0' (to filter out failures, 0x0 is success)

    • Most importantly, ticket encryption type is 0x17

Mitigation

  • Strong service account passwords

  • Don't make service accounts domain admins

  • Use Managed Service Accounts (Automatic change of password periodically and delegated SPN Management)

  • https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/jj128431(v=ws.11)

Last updated