Kerberoasting was described publicly more than ten years ago. In our internal tests it is still one of the most reliable ways to move from a normal user account to a privileged one. The reason is not a software bug. It is how service accounts are usually managed.
How the attack works
Any authenticated user in Active Directory can request a Kerberos service ticket for any account that has a service principal name (SPN). Part of that ticket is encrypted with a key derived from the service account's password.
An attacker requests the ticket, takes it offline and tries to crack the password. Nothing is sent to the domain controller during cracking, so there is nothing to detect at that stage. If the password is weak, or was set years ago by a human, it often falls quickly.
Service accounts tend to be over-privileged, so one cracked password can be the shortest path to Domain Admin.
Find your exposure
List user accounts that have an SPN. In PowerShell with the Active Directory module:
Get-ADUser -Filter {ServicePrincipalName -like "*"} `
-Properties ServicePrincipalName, PasswordLastSet, AdminCount, `
"msDS-SupportedEncryptionTypes" |
Select-Object Name, PasswordLastSet, AdminCount, "msDS-SupportedEncryptionTypes"
Pay attention to three things: accounts with AdminCount set to 1, passwords last set years ago, and accounts that still allow RC4 encryption.
Fix it
- Use group managed service accounts (gMSA) wherever the application supports them. Their passwords are long, random and rotated automatically, which makes cracking impractical.
- Use long random passwords for service accounts that cannot use gMSA. Aim for 30 or more characters, stored in a password vault.
- Remove SPNs that are not needed. Old SPNs on user accounts are common and pure risk.
- Disable RC4 for Kerberos and require AES. RC4 tickets are much faster to crack.
- Reduce privileges. Service accounts rarely need to be Domain Admins. Grant only the rights the service uses.
Detect it
Domain controllers log ticket requests as event 4769. Useful detections include:
- Ticket requests using RC4 encryption (type 0x17) in an environment that should be AES-only.
- A single account requesting tickets for many different services in a short time.
- Requests for a decoy service account that no real application uses. Any request for it is suspicious.
We test for this in every internal network penetration test. If you would like a second opinion on your Active Directory, get in touch.