Detect AS-REP Roasting in Elastic Security
Adversaries may reveal credentials of accounts that have disabled Kerberos preauthentication by password cracking Kerberos AS-REP messages. When preauthentication is disabled on an account (userAccountControl flag DONT_REQ_PREAUTH), an attacker can send an AS-REQ message without an encrypted timestamp and receive an AS-REP response containing a TGT encrypted with the target account's password hash. This encrypted blob can be taken offline and cracked with tools like Hashcat or John the Ripper. The attack is commonly executed with Rubeus (asreproast module) or Impacket's GetNPUsers.py. Unlike Kerberoasting, AS-REP Roasting does not require a valid domain account to initiate — an unauthenticated attacker can send AS-REQ messages directly to the KDC. Successfully cracked credentials enable persistence, privilege escalation, and lateral movement via valid account access.
MITRE ATT&CK
- Tactic
- Credential Access
- Technique
- T1558 Steal or Forge Kerberos Tickets
- Sub-technique
- T1558.004 AS-REP Roasting
- Canonical reference
- https://attack.mitre.org/techniques/T1558/004/
Elastic Detection Query
// Detection 1: AS-REP Roasting — Single Account, No Preauthentication (Event 4768)
any where event.provider == "Microsoft-Windows-Security-Auditing"
and event.code == "4768"
and winlog.event_data.PreAuthType == "0"
and not winlog.event_data.TargetUserName : "*$"
// Optional enrichment fields available on matching events:
// winlog.event_data.TicketEncryptionType — 0x17/23 = RC4 (preferred for offline cracking)
// winlog.event_data.IpAddress — source of the AS-REQ
// winlog.event_data.TargetDomainName — target domain
// winlog.event_data.Status — result code
// Detection 2: Bulk AS-REP Roasting — 3+ Unique Accounts from Same IP in 10 Minutes
// Use as a threshold/correlation rule in Kibana, or as an ES|QL aggregation:
// FROM logs-system.security-*
// | WHERE event.code == "4768"
// AND winlog.event_data.PreAuthType == "0"
// AND NOT ENDS_WITH(winlog.event_data.TargetUserName, "$")
// | STATS accounts_roasted = COUNT_DISTINCT(winlog.event_data.TargetUserName),
// account_list = VALUES(winlog.event_data.TargetUserName)
// BY winlog.event_data.IpAddress, BUCKET(@timestamp, 10 minutes)
// | WHERE accounts_roasted >= 3
// | SORT accounts_roasted DESC Detects AS-REP Roasting attacks by monitoring Windows Security Event 4768 (Kerberos Authentication Service) for requests with PreAuthType=0, indicating the DONT_REQ_PREAUTH flag is set on the target account. Identifies both single-account attempts and bulk enumeration scenarios. RC4 encryption type (0x17/23) in TicketEncryptionType indicates a hash most suitable for offline cracking with Hashcat or John the Ripper.
Data Sources
Required Tables
False Positives & Tuning
- Legacy enterprise applications (SAP, Oracle E-Business Suite, older IBM middleware) that require DONT_REQ_PREAUTH on dedicated service accounts for compatibility with non-Windows Kerberos implementations — these generate consistent single-account events from known application server IPs
- Unix/Linux or macOS systems joined to Active Directory via SSSD, Winbind, or Apple's AD plugin that use accounts with preauthentication disabled for cross-platform Kerberos compatibility
- Authorised penetration testing or red team exercises explicitly targeting accounts configured with DONT_REQ_PREAUTH to validate detection coverage and incident response
Other platforms for T1558.004
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1AS-REP Roasting with Rubeus
Expected signal: Domain Controller Security Event ID 4768 for each roasted account with PreAuthType=0x0 and TicketEncryptionType=0x17 (RC4). Source IpAddress will be the attacking machine's IP. Sysmon Event ID 1 on attacking host: Process Create for Rubeus.exe with CommandLine containing 'asreproast'. Sysmon Event ID 3: network connections from Rubeus.exe to DC port 88 (Kerberos).
- Test 2AS-REP Roasting with Impacket GetNPUsers.py
Expected signal: Domain Controller Security Event ID 4768 for the target account with PreAuthType=0x0 and TicketEncryptionType=0x17. Source IpAddress will be the Linux/external attacking host's IP. No process creation event on the DC itself. If the attack originates from outside the domain, IpAddress will be a non-domain IP, which is a high-confidence indicator.
- Test 3PowerShell LDAP Enumeration of DONT_REQ_PREAUTH Accounts
Expected signal: Sysmon Event ID 1: PowerShell process creation with CommandLine containing 'DoesNotRequirePreAuth' or '4194304'. Domain Controller Event ID 4662 with ObjectType containing 'user' and AccessMask 0x10 (read property) — may generate many events. PowerShell ScriptBlock Log Event ID 4104 with the LDAP filter content.
- Test 4Manual AS-REQ without Preauthentication via PowerShell
Expected signal: Domain Controller Security Event ID 4768 for 'df00tech-asrep-test' with PreAuthType=0x0 and TicketEncryptionType=0x17. Security Event ID 4738 when preauthentication is disabled/re-enabled on the account. Rubeus.exe process creation (Sysmon Event ID 1) and network connection to DC port 88 (Sysmon Event ID 3).
References (10)
- https://attack.mitre.org/techniques/T1558/004/
- https://blog.harmj0y.net/activedirectory/roasting-as-reps/
- https://blog.stealthbits.com/cracking-active-directory-passwords-with-as-rep-roasting/
- https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4768
- https://social.technet.microsoft.com/wiki/contents/articles/23559.kerberos-pre-authentication-why-it-should-not-be-disabled.aspx
- https://blogs.technet.microsoft.com/motiba/2018/02/23/detecting-kerberoasting-activity-using-azure-security-center/
- https://github.com/GhostPack/Rubeus
- https://github.com/fortra/impacket/blob/master/examples/GetNPUsers.py
- https://adsecurity.org/?p=2293
- https://redsiege.com/kerberoast-slides
Unlock Pro Content
Get the full detection package for T1558.004 including response playbook, investigation guide, and atomic red team tests.