T1558.004 Microsoft Sentinel · KQL

Detect AS-REP Roasting in Microsoft Sentinel

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/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
// Detection 1: AS-REP Roasting via Event ID 4768 — No Preauthentication Required
SecurityEvent
| where TimeGenerated > ago(1h)
| where EventID == 4768
| extend EventXml = parse_xml(EventData)
| extend TargetUserName = tostring(EventXml.EventData.Data[0]["#text"])
| extend TargetDomainName = tostring(EventXml.EventData.Data[1]["#text"])
| extend TicketOptions = tostring(EventXml.EventData.Data[4]["#text"])
| extend Status = tostring(EventXml.EventData.Data[5]["#text"])
| extend TicketEncryptionType = tostring(EventXml.EventData.Data[6]["#text"])
| extend PreAuthType = tostring(EventXml.EventData.Data[7]["#text"])
| extend IpAddress = tostring(EventXml.EventData.Data[9]["#text"])
| extend IpPort = tostring(EventXml.EventData.Data[10]["#text"])
// PreAuthType 0x0 = no preauthentication required (DONT_REQ_PREAUTH set)
| where PreAuthType == "0" or PreAuthType == "0x0"
// Exclude machine accounts — they typically have preauthentication disabled legitimately
| where not (TargetUserName endswith "$")
// Flag RC4 encryption requests (0x17=23) which are preferred for offline cracking
| extend WeakEncryption = TicketEncryptionType in ("0x17", "23", "0x18", "24")
| extend EncryptionLabel = case(
    TicketEncryptionType == "0x17" or TicketEncryptionType == "23", "RC4-HMAC (crackable)",
    TicketEncryptionType == "0x18" or TicketEncryptionType == "24", "RC4-HMAC-EXP (crackable)",
    TicketEncryptionType == "0x12" or TicketEncryptionType == "18", "AES256-CTS (crackable offline)",
    TicketEncryptionType == "0x11" or TicketEncryptionType == "17", "AES128-CTS",
    "Unknown"
  )
| project TimeGenerated, Computer, TargetUserName, TargetDomainName, IpAddress, IpPort,
           PreAuthType, TicketEncryptionType, EncryptionLabel, WeakEncryption, Status, TicketOptions
| sort by TimeGenerated desc
// --
// Detection 2: Bulk AS-REP Roasting — Multiple Accounts Requested From Single Source
// Run separately for bulk enumeration alerting
// SecurityEvent
// | where TimeGenerated > ago(1h)
// | where EventID == 4768
// | extend EventXml = parse_xml(EventData)
// | extend TargetUserName = tostring(EventXml.EventData.Data[0]["#text"])
// | extend PreAuthType = tostring(EventXml.EventData.Data[7]["#text"])
// | extend IpAddress = tostring(EventXml.EventData.Data[9]["#text"])
// | where PreAuthType == "0" or PreAuthType == "0x0"
// | where not (TargetUserName endswith "$")
// | summarize AccountsRoasted=dcount(TargetUserName), Accounts=make_set(TargetUserName), FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated) by IpAddress
// | where AccountsRoasted >= 3
// | sort by AccountsRoasted desc
high severity high confidence

Detects AS-REP Roasting attacks by monitoring Kerberos Authentication Service ticket requests (Event ID 4768) where PreAuthType equals 0x0, indicating the target account has Kerberos preauthentication disabled. Flags RC4 encryption type requests (0x17) which adversaries specifically request for faster offline cracking. Excludes machine accounts ($ suffix) which may legitimately have preauthentication disabled. The commented-out Detection 2 block identifies bulk enumeration patterns where an attacker requests AS-REP hashes for multiple accounts from the same source IP within a short window — a hallmark of automated tooling like Rubeus or GetNPUsers.py.

Data Sources

DS0026: Active Directory — Active Directory Credential RequestWindows Security Event Log — Event ID 4768Domain Controller Security Auditing

Required Tables

SecurityEvent

False Positives & Tuning

  • Service accounts or application accounts that have preauthentication deliberately disabled for legacy application compatibility (older Kerberos implementations)
  • Vulnerability scanners (Tenable, Qualys, Rapid7) performing Kerberos configuration assessments against the domain
  • Privileged Access Workstations or jump servers legitimately authenticating to accounts where preauthentication is disabled for operational reasons
  • Kerberos monitoring tools or identity security products (CrowdStrike Identity, Semperis) that enumerate account configurations for reporting
Download portable Sigma rule (.yml)

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.

  1. 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).

  2. 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.

  3. 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.

  4. 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).

Unlock Pro Content

Get the full detection package for T1558.004 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections