Skip to main content
L Jyothendra
Writeups
Detection Engineering

Detection notes: catching Kerberoasting before it becomes a domain compromise

JYOTHENDRA · 09 Aug 2026 · 9 min read

Notes from building and tuning a detection for Kerberoasting, including why naive TGS-REQ counting alarms fail and what a signal that actually survives production looks like.

Why this technique

Kerberoasting is a staple of the OSCP-adjacent AD attack path and one of the highest ROI techniques for a real attacker: it requires no elevated privileges, generates traffic that looks like normal Kerberos activity, and can be done entirely offline once the ticket is captured. That combination makes it a good test case for whether a detection engineering process actually works, rather than just producing an alert that looks good in a demo.

The attack, briefly

Any authenticated domain user can request a service ticket (TGS) for any service principal name (SPN) registered in AD. The ticket is encrypted with the hash of the service account's password. If that account is a regular AD user account (common for legacy service accounts) rather than a machine account, the hash is crackable offline with no further contact with the domain controller.

# Enumerate SPNs and request tickets in one shot
impacket-GetUserSPNs -dc-ip 10.10.10.10 domain.local/user:password -request

# Or from Linux with a valid TGT
python3 GetUserSPNs.py -k -no-pass -dc-ip 10.10.10.10 domain.local/user

The output is a hash in krb5tgs format, crackable with:

hashcat -m 13100 tgs_hashes.txt rockyou.txt

First attempt: naive detection

My first pass was the obvious one: alert on a spike in event ID 4769 (Kerberos service ticket requested) with encryption type 0x17 (RC4), since RC4 is a red flag for a downgrade or a roastable ticket.

SELECT AccountName, COUNT(*) AS req_count
FROM security_events
WHERE EventID = 4769 AND TicketEncryptionType = '0x17'
GROUP BY AccountName, bin(TimeGenerated, 5m)
HAVING COUNT(*) > 5

This alarm fired constantly in the test environment. Two problems surfaced immediately when I checked it against baseline traffic:

  1. Legacy applications and some monitoring tools legitimately request RC4 tickets in bulk as part of normal operation, especially against older service accounts that haven't been migrated to AES.
  2. GetUserSPNs.py run carefully requests one ticket per SPN, not a burst. A patient attacker with a small SPN list generates a single request that never crosses a volume threshold at all.

Volume-based detection on this event alone was both noisy and evadable. That's the core lesson of doing detection engineering seriously: an alert that fires on lab traffic but hasn't been checked against realistic background noise and a patient adversary is not a detection, it's a hypothesis.

Better signal

I narrowed the logic to what's actually anomalous about Kerberoasting rather than what's easy to query:

  • Encryption type combined with account type. RC4 tickets requested for SPNs tied to user accounts (not machine accounts) are far rarer than RC4 tickets in general. Machine accounts have long random passwords and gain nothing from being roasted; the interesting case is a sAMAccountType of user paired with a registered SPN.
  • Requesting account vs. historical baseline. Does this specific account normally request tickets for this SPN? A one-time analyst account suddenly requesting tickets for every service account with an SPN in the domain, in a tight time window, is a stronger signal than raw RC4 volume from anywhere.
  • Ticket options field. Legitimate service ticket requests from applications tend to come from the same source host repeatedly. Requests originating from a workstation that has no prior relationship with that SPN, sourced from an interactive logon session rather than a service context, is worth weighting.

Refined logic (pseudocode, adapted to whatever SIEM is in use):

event_id == 4769
AND ticket_encryption_type == 0x17
AND target_account.sam_account_type == USER  -- not a computer account
AND requesting_account NOT IN historical_baseline(target_spn, lookback=30d)
GROUP BY requesting_account
HAVING distinct(target_spn) >= 3 WITHIN 10m

This drops the false-positive rate from "fires hourly" to "fires on an account that requested tickets for three or more previously-unrequested user-backed SPNs inside a ten-minute window" — which is close to what GetUserSPNs -request actually produces even when run one SPN at a time, because tools default to enumerating all SPNs in a domain in one pass.

Validation

I re-ran the attack path from a low-privilege domain user against a lab DC with the tuned rule active, then separately generated a day of normal service-ticket traffic from legitimate application accounts to confirm it stayed quiet. The rule fired on the Kerberoasting run and stayed silent against baseline traffic across three days of replay.

I also tested the evasion an attacker would try first: requesting AES-encrypted tickets instead of RC4, which some Kerberoasting tooling supports and which older RC4-only rules miss entirely. AES-encrypted service tickets for user-backed SPNs are crackable too (just slower), so the rule can't rely on encryption type alone. I added a parallel branch that ignores encryption type and just tracks the SPN-enumeration-velocity pattern per account, which caught the AES variant in testing.

Lessons learned

  • A detection that only works against the exact command your test used is a detection against a tool, not a technique. Test against variations (RC4 vs AES tickets, single vs bulk SPN requests, different tooling) before calling it done.
  • Volume thresholds are a starting point, not an ending point. The strongest signals here came from correlating account type, historical baseline, and request pattern — not from "count went up."
  • Every detection needs a documented false-positive check against real baseline traffic before it ships. "It didn't fire in the lab" and "it won't fire in production" are different claims.
  • Document the mitigations this detection doesn't cover: it does not catch the offline cracking step, and it does nothing if the target service account already has a strong random password. Detection is one layer; migrating legacy service accounts off RC4 and enforcing long random passwords on service accounts closes the underlying gap.

References

  • MITRE ATT&CK T1558.003 Kerberoasting
  • Microsoft: Audit Kerberos Service Ticket Operations (event 4769)
  • SigmaHQ detection rules repository