Kerberoasting: any domain user can ask for the crackable hash, and the request looks normal
Kerberoasting turns one ordinary domain account into offline password cracking against every service account with an SPN. What makes it work, why RC4 is the tell, and how to shrink the attack surface with AES, gMSAs and event 4769.
By Ahmed PingerPublished
9 min read19 views
Kerberoasting is not a vulnerability in the sense of a patch that closes it. It is a feature of Kerberos working exactly as designed, turned against the weakest passwords in the directory. The one distinction that matters: any authenticated domain user can request a service ticket for any account that has a Service Principal Name, and part of that ticket is encrypted with a key derived directly from the service account's password. Nothing stops the request, because requesting service tickets is the entire point of Kerberos. The attacker takes the ticket offline and grinds against it until the password falls out.
That is the whole shape of it. What separates a domain where this is a minor nuisance from one where it is game over is not the protocol. It is the passwords and the encryption types you allow.
Why the exposure varies so much between domains
The Ticket-Granting Service part of a Kerberos exchange returns a ticket whose body is encrypted with the target service's long-term key. When the service runs as a machine account, that key is derived from a long machine-managed password that no human will ever crack. When the service runs as a normal user account with a Service Principal Name, whose password was set by an administrator in 2019 and never rotated, the key is derived from whatever that person typed. The protocol treats both identically. The offline cracking economics do not.
So the risk is a function of three things you control:
- How many user accounts carry an SPN. Every one is a candidate. Accounts created for SQL Server, IIS application pools, scheduled tasks and line-of-business middleware are the usual population.
- How strong those passwords are. A 14-character random password is effectively safe from cracking today.
Summer2019!is not. - Which encryption type the ticket comes back in. An RC4 ticket is dramatically cheaper to crack than an AES256 one, and RC4 is still negotiable in most domains that have not turned it off.
A domain with three gMSA-backed services and AES enforced has almost no Kerberoasting surface. A domain with forty human-set service account passwords and RC4 still on the wire is one GetUserSPNs.py query away from a domain admin credential.
The advisory that anchors the RC4 half: CVE-2022-37966
There is no single CVE for "Kerberoasting" because the technique abuses intended behaviour. The closest real vendor anchor for the part that actually got hardened is CVE-2022-37966, the Windows Kerberos RC4-HMAC elevation of privilege vulnerability, published 2022-11-09 and rated CVSS 3.1 8.1 (High) by Microsoft. The November 2022 updates changed how session keys are negotiated and pushed domains toward AES by default, because weak RC4-HMAC negotiation allowed a security bypass and elevation of privilege. Microsoft's own remediation guidance for Kerberoasting, published 2024-10-11, is the primary source to build a programme around, and it recommends gMSAs or dMSAs wherever possible, otherwise long randomly generated passwords, and AES for service accounts with the password changed afterwards, and it advises manually disabling RC4 on service accounts where it is not yet off by default.
For the adjacent escalation path once a service account is cracked, see the earlier post on AD CS ESC1. A roasted service account with certificate enrolment rights is a common bridge from "cracked a password" to "issued myself a domain admin certificate."
A lab you can build without Docker
You need one domain controller and one member workstation. Neither needs to be production.
- Windows route: install Windows Server 2022 from the Microsoft Evaluation Center ISO or VHD, which runs 180 days, and promote it to a domain controller with
Install-ADDSForest. Add a Windows 10 or 11 evaluation VM to the domain. This gives you the real event log fields. - Linux route: provision a Samba AD domain controller with
samba-tool domain provisionon a single Linux VM. Samba uses the Heimdal KDC by default and issues real Kerberos tickets, which is enough to see the mechanics, though the Windows security event schema below is specific to a Windows DC.
Seed the lab deliberately. Create a handful of user accounts, give two or three of them an SPN with setspn -S, and set one of those passwords to something short and dictionary-based so you can watch the difference in cracking cost. Leave one service on a strong random password as the control.
The point of the lab is not to run an attack tool. It is to see, in your own logs, what a service ticket request looks like and how an RC4 request differs from an AES one. Public tooling for the offensive half (Rubeus on Windows, the Impacket GetUserSPNs.py script on Linux) exists and is well documented elsewhere. This post does not reproduce its invocation, in keeping with the house line: enough to make the bug legible to a defender, not a working weapon.
Finding it in your own directory
Kerberoasting starts with enumeration that any user can perform, so you should perform it first. Every account below is a line item you either harden or explain.
# Every user account that carries an SPN. This is the exact target list.
Get-ADUser -Filter {ServicePrincipalName -like "*"} -Properties ServicePrincipalName,
msDS-SupportedEncryptionTypes, PasswordLastSet |
Select-Object SamAccountName, PasswordLastSet, msDS-SupportedEncryptionTypes,
@{n="SPNs";e={$_.ServicePrincipalName -join ";"}}
Read that output as an attacker would. Sort by PasswordLastSet: an account whose password has not changed in years is a soft target, because it predates whatever password policy you have now and has had years of exposure. Look at msDS-SupportedEncryptionTypes: where it is null or set to a value that still includes RC4, the ticket can come back RC4-encrypted regardless of what the rest of the domain does.
# Accounts still exposing RC4 (bit 0x4) or with no explicit AES bits set.
Get-ADUser -Filter {ServicePrincipalName -like "*"} -Properties msDS-SupportedEncryptionTypes |
Where-Object {
-not $_.'msDS-SupportedEncryptionTypes' -or
($_.'msDS-SupportedEncryptionTypes' -band 0x4)
} | Select-Object SamAccountName, msDS-SupportedEncryptionTypes
The two questions that triage the whole list: does this account need an SPN at all, and does its password get managed by a machine or by a human? An SPN left on an account after the service was decommissioned is pure liability. Remove it. A human-managed password on a service account is the thing you are trying to eliminate.
Fixing it
The instinct is to reach for "turn off RC4" first because it is the satisfying switch. Microsoft's guidance starts with gMSAs, and this ordering follows it.
1. Move services to managed accounts. A group Managed Service Account (gMSA) has a long, randomly generated password that Windows rotates automatically, and no administrator ever knows it. A gMSA-backed service is not crackable in any practical sense, which removes it from the target population entirely. This is the single highest-leverage change, and it is why it comes first.
2. Where a gMSA genuinely does not fit, make the password long and random. Microsoft's floor is a 14-character minimum for service accounts, with longer and randomly generated strongly preferred. The threat is offline brute force, so length is the only property that helps; complexity rules do not save a short password.
3. Configure the account for AES. Set msDS-SupportedEncryptionTypes so tickets come back AES-encrypted, and make sure the service and its keys support it. Then change the account password so AES keys exist; Microsoft warns the account may otherwise still be vulnerable to Kerberoasting. An AES256 ticket raises the per-guess cost enough that a decent password becomes uncrackable in any useful timeframe.
4. Then disable RC4 domain-wide. Once you have confirmed nothing still needs it, tighten DefaultDomainSupportedEncTypes and the per-account settings so RC4 is no longer offered. Doing this before steps 1 to 3 breaks authentication for anything that only spoke RC4 and teaches everyone to distrust the change. Doing it after is anticlimactic, which is the goal.
Membership of the Protected Users group also forces AES and blocks RC4 in pre-authentication for the accounts in it, but it is meant for privileged human accounts, not service accounts, whose credentials live on the host regardless.
Detecting it
The offensive half is nearly silent because it is a normal Kerberos request. You are not looking for something malformed. You are looking for volume, encryption type, and who is asking.
Event 4769, "A Kerberos service ticket was requested," is generated on the domain controller for every TGS request. The fields that matter:
- Ticket Encryption Type
0x17is RC4-HMAC. In a domain you believe is AES-only, an RC4 service ticket request is an anomaly worth an alert on its own, because roasting tools often request RC4 deliberately for the cheaper crack.0x12is AES256, the value you want to see. - Ticket Options and the requesting account. One user account requesting service tickets for many distinct SPNs in a short window is the signature of enumeration-then-roast, as opposed to a user's workstation quietly requesting the one or two services it actually uses.
- Failure Code. Expired-ticket noise (
0x20) is informational and should be filtered out so it does not bury the signal.
Two practical detections built on 4769: alert on any 0x17 request in an environment that should be AES-only, and alert on a single account requesting service tickets for more than a threshold of distinct services in a short interval. Both are cheap, and both survive the fact that the request itself is legitimate.
What to take away
Kerberoasting is a password problem wearing a protocol costume. The protocol will hand out the crackable material to anyone who asks, forever, because that is its job. Everything that decides whether that matters is on your side of the line: whether service accounts have SPNs they no longer need, whether their passwords were typed by a person or managed by a machine, and whether RC4 is still on the wire making the crack cheap. Move services to gMSAs, make the rest long and random, enforce AES, then retire RC4. Watch 4769 for RC4 requests and for one account roasting the directory. The request will always look normal; your job is to make the answer worthless.
Further reading
- Microsoft: Microsoft's guidance to help mitigate Kerberoasting (2024-10-11): gMSA, 14-character minimum, AES, RC4 disablement
- NVD: CVE-2022-37966: Windows Kerberos RC4-HMAC elevation of privilege
- Microsoft KB5021131: managing the Kerberos protocol changes for CVE-2022-37966: DefaultDomainSupportedEncTypes, msDS-SupportedEncryptionTypes
- Microsoft Learn: 4769(S, F) A Kerberos service ticket was requested: ticket encryption type values and monitoring recommendations
- Microsoft Learn: Group Managed Service Accounts overview: why gMSAs remove the crackable password
- ASD ACSC and partners: Detecting and mitigating Active Directory compromises (September 2024): Kerberoasting among the common techniques
- Microsoft Evaluation Center: Windows Server 2022: 180-day evaluation ISO/VHD for the lab
Was this useful?
Get the next write-up by email
New technical write-ups by email when we publish. No sales sequence, and every email has an unsubscribe link.
Prefer a feed? RSS. How we handle your address: privacy notice.
Comments
Loading comments…