TExcelTAD
Home › Windows & Active Directory Security › Kerberoasting and AS-REP Roasting

Kerberoasting and AS-REP Roasting

Two of the most common findings in AD assessments need no exploit and no admin rights: any domain user can collect material encrypted with another account's password-derived key and try to guess that password offline, at whatever speed their hardware allows, with no failed logons on any DC. Kerberoasting does it with service tickets for accounts that have an SPN; AS-REP roasting with the AS-REP of accounts that don't require pre-authentication. Both are entirely about weak passwords on special accounts, which makes both entirely preventable. This lesson explains why the material is obtainable, how the requests look in DC logs, a detection in pandas, and the fix.

The flows are in Kerberos: AS, TGS and AP Exchanges; the encryption types in The PAC, Encryption Types and the End of RC4.

The mechanism

Kerberoasting. In the TGS exchange, the KDC encrypts the service ticket with the key of the account that owns the requested SPN, and it issues tickets for any SPN to any authenticated user (the service decides access later). When that account is a computer (a 120-character random password) or a gMSA (an even longer random one), guessing is hopeless. When it is a user account with a human-chosen password (svc-sql with Sql2019!), anyone in the domain can request a ticket and test password guesses against it offline. Attackers prefer RC4 tickets, whose key is the unsalted NT hash, because guessing is much faster than against AES.

AS-REP roasting. If an account has DONT_REQ_PREAUTH set, the KDC answers an AS-REQ for it without any proof of identity, and the AS-REP contains a part encrypted with the account's key. Anyone who can reach a DC on port 88, even without a domain account, can request it.

The Kerberos lab marks where each attack sits in the flow. It starts with pre-authentication off and RC4 service tickets: the AS-REP marker shows the part under alice's key that anyone can request (logged as 4768 with pre-authentication type 0), and the readouts rate Kerberoasting "easy (RC4)" at the TGS-REP (4769 with 0x17). Set pre-authentication to required and AS-REP roasting becomes "blocked (pre-auth on)"; switch tickets to AES and Kerberoasting is still "possible (AES: slower)", because only a long random password ends it.

clientalice @ WS01KDC (on DC01)AS + TGSservicesql011 AS-REQaliceno pre-auth2 AS-REPTGT{alice,S1,PAC}krbtgt{S1}Kc⚠ AS-REP roasting · 47683 TGS-REQTGT{auth}S1MSSQLSvc/sql014 TGS-REPticket{alice,S2,PAC}Ks{S2}S15 AP-REQticket{auth}S26 AP-REP{timestamp}S2⚠ AS-REP roasting: anyone gets this AS-REP; {S1}Kc lets them test password guessesofflinedetect: 4768 with pre-authentication type 0 (often ticket encryption 0x17)fix: require pre-auth on every account (clear DONT_REQ_PREAUTH); long passwordskeys:Kcalice (password)krbtgtKDCKsserviceS1TGS sessionS2service session

Tools that automate both are well known: Impacket's GetUserSPNs and GetNPUsers examples, Rubeus (C#), and the PowerShell and BloodHound collectors that list candidate accounts first. To a DC, all of them look the same: ordinary Kerberos requests, just from an unusual client in an unusual pattern.

How long guessing takes depends only on the password. The lab treats the fast hash setting (hash 0) as a stand-in for RC4 tickets, which are also cheap to compute; the rates are illustrative orders of magnitude.

8 random characters from 62 a–z A–Z 0–9entropy H = L · log2 C = 8 · 5.954 = 47.6 bitssearch space C^L = 62^8 = 2.18 × 10¹⁴ guessesguess rate R ≈ 10¹² /s (offline, 100 GPUs, SHA-256 (fast))expected time C^L / (2R) ≈ 1.8 minrates: illustrativeorders of magnitude,not benchmarkssecondhourdayyearcenturyuniverse age10⁻³ s10³ s10⁹ s10¹⁵ s10²¹ s14812162024expected time (log scale)SHA-256PBKDF2 600kbcrypt 12L = 8: 1.8 minlength L →

An 8-character random password from 62 symbols falls to a rig of 100 GPUs in about two minutes; human-chosen ones go faster, because they are tried first from wordlists. Raise len to 20 and the expected time is about a million times the age of the universe. A gMSA's password is a machine-generated random value far longer than that.

What the requests look like

Technique DC event Telltale fields
Kerberoasting 4769 per ticket Service Name = a user account (not a $ computer account); Ticket Encryption Type = 0x17 (RC4) in an AES domain; one client requesting many different services within minutes; services the client never actually connects to afterwards
AS-REP roasting 4768 Pre-Authentication Type: 0 (none) for the account; often from a host that doesn't normally authenticate that account; Ticket Encryption Type 0x17

A real client also requests service tickets, so the signal is in the shape: a laptop asking for tickets to SQL, backup, reporting and twenty other service accounts in 40 seconds, all in RC4, is not a user opening a file share.

A detection on synthetic DC events

python · try it yourself
import pandas as pd

t = lambda s: pd.Timestamp("2026-01-15 " + s)
ev = pd.DataFrame([
    # time, id, client account, client ip, service (4769) / target (4768), etype, preauth
    (t("09:00:02"), 4769, "alice", "10.10.0.21", "FS01
quot;, "0x12", None), (t("09:00:40"), 4769, "alice", "10.10.0.21", "svc-sql", "0x12", None), (t("09:05:10"), 4769, "bob", "10.10.0.22", "WEB01
quot;, "0x12", None), *[(t(f"09:31:{s:02d}"), 4769, "bob", "10.10.0.22", svc, "0x17", None) for s, svc in zip(range(0, 40, 5), ["svc-sql", "svc-backup", "svc-report", "svc-web", "svc-crm", "svc-legacy", "svc-print", "svc-scan"])], (t("09:40:00"), 4768, "svc-legacy", "10.10.0.66", "svc-legacy", "0x17", 0), (t("09:40:01"), 4768, "alice", "10.10.0.21", "alice", "0x12", 2), ], columns=["time", "id", "client", "ip", "target", "etype", "preauth"]) user_services = {"svc-sql", "svc-backup", "svc-report", "svc-web", "svc-crm", "svc-legacy", "svc-print", "svc-scan"} tgs = ev[(ev.id == 4769) & ev.target.isin(user_services)] win = (tgs.groupby(["client", "ip"]) .agg(services=("target", "nunique"), rc4=("etype", lambda e: (e == "0x17").sum()), first=("time", "min"), last=("time", "max"))) win["seconds"] = (win["last"] - win["first"]).dt.total_seconds().astype(int) print(win[["services", "rc4", "seconds"]].to_string()) for (client, ip), r in win.iterrows(): if r.services >= 5 and r.seconds <= 300: print(f"ALERT kerberoasting pattern: {client} from {ip}: {r.services} user-account SPNs " f"in {r.seconds} s, {r.rc4} as RC4") for _, r in ev[(ev.id == 4768) & (ev.preauth == 0)].iterrows(): print(f"ALERT AS-REP without pre-authentication for {r.target} requested from {r.ip} ({r.etype})")
                   services  rc4  seconds
client ip
alice  10.10.0.21         1    0        0
bob    10.10.0.22         8    8       35
ALERT kerberoasting pattern: bob from 10.10.0.22: 8 user-account SPNs in 35 s, 8 as RC4
ALERT AS-REP without pre-authentication for svc-legacy requested from 10.10.0.66 (0x17)

alice asks for one ticket to svc-sql in AES, which is what using a database looks like. bob asks for eight service-account tickets, all RC4, in 35 seconds. The AS-REP for svc-legacy came from 10.10.0.66, a machine with no business authenticating as a service account. Tune the thresholds on your own baseline; vulnerability scanners and inventory tools can produce similar bursts, and they belong on an allow-list by account and host.

Lab session: the defender's inventory

The fix starts with the list of exposed accounts. A lab session on DC01.corp.lab.test (sample output, abbreviated) with the AD module, run by an administrator of the lab:

console
PS C:\> Get-ADUser -Filter 'ServicePrincipalName -like "*"' -Properties ServicePrincipalName, PasswordLastSet, msDS-SupportedEncryptionTypes |
>>   Select-Object SamAccountName, PasswordLastSet, msDS-SupportedEncryptionTypes

SamAccountName PasswordLastSet      msDS-SupportedEncryptionTypes
-------------- ---------------      -----------------------------
krbtgt         1/2/2026 9:14:03 AM
svc-sql        3/11/2019 4:02:51 PM
svc-backup     6/30/2021 11:20:15 AM                           24

PS C:\> Get-ADUser -Filter 'DoesNotRequirePreAuth -eq $true' | Select-Object SamAccountName
SamAccountName
--------------
svc-legacy

krbtgt always appears (its SPN is kadmin/changepw), but its key is random and the KDC doesn't hand out ordinary service tickets for it, so it isn't a roasting risk. svc-sql has a password nearly seven years old and no AES setting: the top priority. svc-backup is AES-only (24 = 0x18) but still a user account. svc-legacy needs pre-authentication back.

How it is fixed

  1. Replace service user accounts with gMSAs (Windows LAPS and gMSA). Nothing to guess.
  2. Where a user account must remain: a random password of 25+ characters, rotated, stored in a vault, with msDS-SupportedEncryptionTypes = 0x18 (AES only) and a password reset so AES keys exist.
  3. Remove SPNs nobody uses (old SQL instances, test web apps), and never put an SPN on an admin account.
  4. Turn pre-authentication back on for every account; the few devices that needed it off (old Unix clients) must be replaced.
  5. Disable RC4 in the domain (encryption types) so that even a successful request yields only slow AES material.
  6. Decoy: a fake service account with an SPN that nothing uses; any 4769 for it is an alert (Honeytokens).

Pitfalls

  • Fixing the password but not the privilege. A roasted account is a problem in proportion to its rights; service accounts in Domain Admins are common and catastrophic.
  • Allowing "Password never expires" with no rotation process for service accounts.
  • Detecting on RC4 only. Careful attackers request AES tickets to blend in; the many-services-in-seconds shape still shows.
  • Overlooking AS-REP roasting because it needs no account: it works from any host that can reach port 88.

Practice

1. Why are computer accounts with SPNs (like FS01$) not a Kerberoasting risk?

Their passwords are 120 random characters set and rotated (every 30 days by default) by the machine itself; guessing them is impossible in practice.

2. Change bob's burst in the program to AES ("0x12") and spread it over four minutes. Which alert remains?

The Kerberoasting alert still fires (8 services within 300 s) with 0 as RC4. Spread over more than five minutes it would not; that is why per-hour baselines of distinct SPNs per client complement the short window.

3. An auditor says "AS-REP roasting needs a domain account, so it is an insider risk only." Correct them.

The AS-REQ for an account without pre-authentication needs no credentials at all; anyone who can reach a DC on port 88 and knows or guesses the account name can request it.

Test yourself

Why can any domain user Kerberoast a service account?

  1. Because of a bug in Windows
  2. The KDC issues service tickets for any SPN to any authenticated user, encrypted with the service account's key
  3. Because service accounts have no password
  4. Because SPNs are secret

Which 4768 field shows that an AS-REP was issued without pre-authentication?

  1. Ticket Options 0x40810010
  2. Pre-Authentication Type 0
  3. Result Code 0x18
  4. Service Name krbtgt

What is the most effective fix for Kerberoasting?

  1. Rename the service accounts
  2. Use gMSAs (or 25+ character random passwords) for accounts with SPNs, AES only
  3. Block port 88
  4. Disable all SPNs

Which pattern in 4769 events suggests Kerberoasting?

  1. One AES ticket for a file server
  2. One client requesting tickets for many user-account SPNs within seconds, often RC4
  3. Computer accounts renewing tickets
  4. Tickets for krbtgt