Skip to content

Lesson 3 of 13 · 13m

SPNs, Service Accounts, and the Keys Behind Tickets

How SPNs map to the key material that encrypts service tickets, why RC4 vs AES changes everything for attackers, and where gMSA fits.

A service ticket is only as strong as the password of the account the SPN resolves to. That sentence explains kerberoasting, most of the 4769 event analysis in detection work, and half of Microsoft's gMSA marketing. The SPN is just a lookup key — MSSQLSvc/sql01.corp.local:1433 registered on svc-sql — but the KDC uses it to find whose key encrypts the ticket. Crack the ticket, recover the service account's password.

What a SPN actually is

servicePrincipalName is a multi-valued attribute on the account object that hosts the service. setspn -L svc-sql lists them. When a client asks for MSSQLSvc/sql01.corp.local:1433, the KDC searches for an account carrying that SPN and encrypts the ticket with that account's key. Two consequences:

  • Duplicate SPNs break authentication silently — the KDC picks the first match. setspn -X finds duplicates.
  • Any user account with a SPN is roastable. DONT_REQ_PREAUTH is not required for kerberoasting; having a SPN is.

The wrong mental model: "service accounts are a different kind of account." They are user objects with a SPN and, usually, a password set in 2016 by someone who left. Password rotation for service accounts historically broke production, so orgs set "password never expires" and forgot. Attackers count on it.

RC4 vs AES: the key decides the crack cost

The encryption type on a TGS-REP is negotiated between client, KDC policy, and the msDS-SupportedEncryptionTypes attribute on the service account. RC4-HMAC tickets are encrypted with the NT hash directly — unsalted, fast. AES tickets derive the key via PBKDF2-style iterated hashing (aes256-cts-hmac-sha1-96 with the salt CORP.LOCALsvc-sql and 4096 iterations).

For offline cracking this is the whole game. An RC4 ticket is a single MD4 per guess — Hashcat mode 13100 burns through billions per second on a GPU rig. AES tickets (mode 19700) cost roughly three orders of magnitude more per guess. Microsoft knows: Server 2025 deprecates RC4 for Kerberos, and the April 2024 Windows updates started logging RC4 usage events to push estates toward AES.

The practice for defenders: enumerate SPN-bearing accounts (Get-ADUser -Filter {ServicePrincipalName -like "*"} -Properties ServicePrincipalName), check msDS-SupportedEncryptionTypes, and force AES with a password reset. The reset matters — AES keys are derived at password-set time; an account whose password predates AES deployment may not have AES keys in its key list at all.

The PAC inside the ticket

Every service ticket carries a Privilege Attribute Certificate — the user's SID, group SIDs, and logon metadata, signed by the KDC. The PAC is what the service actually trusts: it never calls the DC to verify group membership, it reads the signed list. That makes the PAC the forgery target — MS14-068 (CVE-2014-6324, patched November 18 2014) let any domain user rewrite the PAC checksum with their own key and mint tickets claiming Domain Admins membership. The post-patch signature — event 4769 with Failure Code 0xF, a denied service ticket — is still worth alerting on; on unpatched DCs the tell was 4624/4672 logons where Account Name and Security ID disagree. Silver tickets and diamond tickets, covered later, are PAC-manipulation attacks: forge the ticket or modify the PAC inside a real one.

gMSA and why it exists

Group Managed Service Accounts (New-ADServiceAccount) hand the password problem to the DC: a 240+ character random password rotated every 30 days by the KDS root key, retrievable only by authorized computers via Get-ADServiceAccount / the password retrieval extension. Nobody can phish it because nobody knows it. Kerberoasting a gMSA is not theoretically impossible — the ticket is still crackable in principle — but the keyspace makes it a rounding error. The tradeoffs: gMSA needs 2012+ domain functional level, the KDS root key must exist (Get-KdsRootKey — created with a 10-day effective delay for lab safety unless you use Add-KdsRootKey -EffectiveImmediately), and some legacy services cannot consume them. Where gMSA cannot run, a 25+ character managed password rotated quarterly is the fallback position — long enough that RC4 speed stops mattering.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.