Kerberoasting: Detection and Hardening for Active Directory

Kerberoasting turns weak service account passwords into domain compromise, and it barely looks like an attack. How it works, the event IDs and queries that catch it, and the hardening that makes it pointless.

3 min readAdvanced

Kerberoasting is one of the most reliable paths to privilege in Active Directory, and one of the quietest. Any authenticated domain user can request a Kerberos service ticket for any account with a Service Principal Name (SPN). Part of that ticket is encrypted with the service account's password hash. The attacker takes it offline and guesses the password at leisure. No failed logons, no lockouts, nothing touching the target server.

If the service account has a weak password and broad rights, which is common for accounts created years ago, one user compromise becomes domain compromise.

Why it works

Three design facts combine:

  1. Ticket requests are normal. Requesting service tickets is how Kerberos works. Users do it constantly.
  2. Encryption is tied to the account password. For user-based service accounts, the ticket is encrypted with a key derived from a human-chosen password.
  3. Old encryption types make cracking cheap. If RC4 is allowed, the key is the account's NT hash, and offline guessing is very fast. AES-only accounts are far slower to attack.

The real vulnerability isn't Kerberos. It's user accounts acting as services with weak, rarely rotated passwords.

Detection

The signal: event 4769

Enable Audit Kerberos Service Ticket Operations on domain controllers. Every service ticket request logs event 4769. You're looking for requests that differ from normal ticket traffic:

  • Encryption type 0x17 (RC4) when your environment is otherwise AES. This is the highest-value filter.
  • One account requesting tickets for many different SPNs in a short window.
  • Requests for service accounts that are rarely used interactively.

Exclude machine accounts (names ending in $) and krbtgt to cut the noise.

kusto
// Microsoft Sentinel / Defender: possible Kerberoasting (RC4 service tickets)
SecurityEvent
| where EventID == 4769
| where TicketEncryptionType == "0x17"
| where ServiceName !endswith "$" and ServiceName != "krbtgt"
| summarize SPNs = dcount(ServiceName), Services = make_set(ServiceName, 20),
            FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
          by TargetUserName, IpAddress, bin(TimeGenerated, 15m)
| where SPNs >= 3
| order by SPNs desc

Start with a threshold of three distinct SPNs in 15 minutes, then tune against a week of baseline. Some legacy applications legitimately request RC4 tickets. Document them as exceptions instead of loosening the rule.

A honeypot account that only attackers touch

Create a service account with an attractive SPN, a long random password and no legitimate use. Any 4769 request for it is suspicious by definition. It's one of the highest-fidelity detections you can deploy in Active Directory.

kusto
SecurityEvent
| where EventID == 4769 and ServiceName =~ "svc-sqlbackup-legacy"   // your decoy account
| project TimeGenerated, TargetUserName, IpAddress, TicketEncryptionType

Hardening that makes it pointless

Detection buys time. Hardening removes the payoff.

  1. Use Group Managed Service Accounts (gMSA) wherever the application supports them. Windows sets and rotates 120-character random passwords automatically, which makes offline guessing hopeless.
  2. Long random passwords for the rest. Any remaining user-based service account should have a password of 25+ random characters, stored in a vault and rotated.
  3. Disable RC4. Set service accounts to AES only (the msDS-SupportedEncryptionTypes attribute) and plan the domain-wide removal of RC4.
  4. Least privilege. Service accounts shouldn't be Domain Admins. Most don't need to be members of any privileged group at all.
  5. Inventory SPNs regularly. Find user accounts with SPNs, remove stale ones, and review each remaining account's rights.
powershell
# Inventory: user accounts with SPNs, their password age and encryption types
Get-ADUser -LDAPFilter "(servicePrincipalName=*)" -Properties servicePrincipalName, PasswordLastSet, msDS-SupportedEncryptionTypes, MemberOf |
  Select-Object SamAccountName, PasswordLastSet, msDS-SupportedEncryptionTypes,
                @{n="SPNs";e={$_.servicePrincipalName -join "; "}},
                @{n="Groups";e={($_.MemberOf | ForEach-Object { ($_ -split ",")[0] -replace "CN=" }) -join ", "}} |
  Sort-Object PasswordLastSet

Anything with a password set years ago, RC4 allowed and privileged group membership goes to the top of the list.

Mapping

Checklist

  • 4769 auditing enabled on all domain controllers and forwarded to your SIEM.
  • RC4 ticket detection deployed and tuned, with documented exceptions.
  • A decoy SPN account in place with an alert on any ticket request.
  • gMSA used wherever possible, and remaining service accounts on 25+ character random passwords.
  • RC4 disabled for service accounts, and no service accounts in privileged groups.
HackersRoot Research · Research team

The HackersRoot research team investigates attack techniques across AI systems, cloud and identity, and enterprise networks, then publishes the detections and hardening guidance that stop them.

More from HackersRoot →

Related research

Detection Engineering

From CCTV to Cryptominer: Exposed GeoVision Software, a Disabled Defender and 13 Breached Organisations

Huntress traced intrusions at 13 organisations to one place: internet-exposed GeoVision camera management software running as SYSTEM on Windows. The attackers disabled Microsoft Defender with a vulnerable driver and debugger hijacks, then installed a cryptominer. Here is the attack chain, the detections that catch it, and why your physical-security systems belong in your patch programme.