Skip to content

Commit 51bbba3

Browse files
committed
[New Rules] SPN Spoofing / Coercion Rules
1 parent 9f2d4d9 commit 51bbba3

File tree

2 files changed

+236
-0
lines changed

2 files changed

+236
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
[metadata]
2+
creation_date = "2025/06/14"
3+
integration = ["system", "windows"]
4+
maturity = "production"
5+
updated_date = "2025/06/14"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Identifies the creation of a DNS record containing a base64-encoded blob matching the pattern "UWhRCA...BAAAA". This
11+
pattern corresponds to a marshaled CREDENTIAL_TARGET_INFORMATION structure, commonly used in Kerberos coercion attacks.
12+
It is associated with tools and techniques that exploit SPN spoofing via DNS. Adversaries may abuse this to coerce
13+
victim systems into authenticating to attacker-controlled hosts while requesting Kerberos tickets for legitimate
14+
services (often the victim's own identity). This enables reflective Kerberos relay attacks, potentially resulting in
15+
privileged access such as NT AUTHORITY\\SYSTEM, without relying on NTLM fallback.
16+
"""
17+
from = "now-9m"
18+
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
19+
language = "eql"
20+
license = "Elastic License v2"
21+
name = "Potential Kerberos Coercion via DNS-Based SPN Spoofing"
22+
note = """## Triage and analysis
23+
24+
> **Disclaimer**:
25+
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
26+
27+
### Investigating Potential Kerberos Coercion via DNS-Based SPN Spoofing
28+
29+
### Possible investigation steps
30+
31+
- Review the event logs on the affected Windows host to confirm the presence of event code 5137, which indicates a directory service object modification.
32+
- Inspect the ObjectDN field to identify the full distinguished name of the created DNS record. Look for entries containing Base64-encoded segments matching UWhRCA...BAAAA, which are indicative of an embedded CREDENTIAL_TARGET_INFORMATION payload used in SPN spoofing.
33+
- Validate the associated user or computer account responsible for the DNS record creation. Investigate whether the account has legitimate administrative access to modify DNS zones or whether it may have been compromised.
34+
- Correlate with DNS query logs and network telemetry to determine if the suspicious DNS hostname was later queried or resolved by other hosts on the network. A match suggests the attacker moved forward with the coercion attempt.
35+
- Assess the permissions and access controls on the DNS zones to ensure they are appropriately configured and restrict unnecessary modifications by authenticated users.
36+
37+
### False positive analysis
38+
39+
- This activity is unlikely to happen legitimately.
40+
41+
### Response and remediation
42+
43+
- Review and remove the malicious DNS record containing the embedded CREDENTIAL_TARGET_INFORMATION Base64 payload (UWhRCA...BAAAA). Ensure that no additional coercion records exist in the same DNS zone.
44+
- Identify the source of the DNS modification by correlating the event with user context and host activity. Investigate whether the account used was compromised or misused.
45+
- Audit Kerberos ticket activity following the DNS record creation. Look for suspicious service ticket requests (Event ID 4769) or authentication attempts that could indicate a relay or privilege escalation attempt.
46+
- Temporarily isolate involved systems if signs of compromise or lateral movement are detected, especially if the record was successfully resolved and used for coercion.
47+
- Monitor network traffic for signs of Man-in-the-Middle activity, focusing on unusual DNS queries or redirections.
48+
- Escalate the incident to the security operations center (SOC) for further investigation and to assess the potential impact on other systems.
49+
"""
50+
references = [
51+
"https://www.synacktiv.com/publications/ntlm-reflection-is-dead-long-live-ntlm-reflection-an-in-depth-analysis-of-cve-2025",
52+
"https://blog.redteam-pentesting.de/2025/reflective-kerberos-relay-attack/",
53+
"https://googleprojectzero.blogspot.com/2021/10/using-kerberos-for-authentication-relay.html",
54+
"https://github.com/CICADA8-Research/RemoteKrbRelay/blob/main/README.md",
55+
"https://github.com/Orange-Cyberdefense/ocd-mindmaps/blob/main/excalimap/mindmap/ad/authenticated.md",
56+
]
57+
risk_score = 73
58+
rule_id = "f701be14-0a36-4e9a-a851-b3e20ae55f09"
59+
setup = """## Setup
60+
61+
The 'Audit Directory Service Changes' logging policy must be configured for (Success, Failure).
62+
Steps to implement the logging policy with Advanced Audit Configuration:
63+
64+
```
65+
Computer Configuration >
66+
Policies >
67+
Windows Settings >
68+
Security Settings >
69+
Advanced Audit Policies Configuration >
70+
Audit Policies >
71+
DS Access >
72+
Audit Directory Service Changes (Success,Failure)
73+
```
74+
75+
The above policy does not cover the target object by default (we still need it to be configured to generate events), so we need to set up an AuditRule using https://github.com/OTRF/Set-AuditRule.
76+
77+
```
78+
Set-AuditRule -AdObjectPath 'AD:\\CN=MicrosoftDNS,DC=DomainDNSZones,DC=Domain,DC=com' -WellKnownSidType WorldSid -Rights CreateChild -InheritanceFlags Descendents -AttributeGUID e0fa1e8c-9b45-11d0-afdd-00c04fd930c9 -AuditFlags Success
79+
```
80+
"""
81+
severity = "high"
82+
tags = [
83+
"Domain: Endpoint",
84+
"OS: Windows",
85+
"Use Case: Threat Detection",
86+
"Tactic: Credential Access",
87+
"Data Source: Active Directory",
88+
"Use Case: Active Directory Monitoring",
89+
"Data Source: Windows Security Event Logs"
90+
]
91+
timestamp_override = "event.ingested"
92+
type = "eql"
93+
94+
query = '''
95+
any where host.os.type == "windows" and event.code == "5137" and
96+
winlog.event_data.ObjectDN : "*UWhRCA*BAAAA*"
97+
'''
98+
99+
100+
[[rule.threat]]
101+
framework = "MITRE ATT&CK"
102+
[[rule.threat.technique]]
103+
id = "T1557"
104+
name = "Adversary-in-the-Middle"
105+
reference = "https://attack.mitre.org/techniques/T1557/"
106+
[[rule.threat.technique.subtechnique]]
107+
id = "T1557.001"
108+
name = "LLMNR/NBT-NS Poisoning and SMB Relay"
109+
reference = "https://attack.mitre.org/techniques/T1557/001/"
110+
111+
112+
[[rule.threat.technique]]
113+
id = "T1187"
114+
name = "Forced Authentication"
115+
reference = "https://attack.mitre.org/techniques/T1187/"
116+
117+
118+
[rule.threat.tactic]
119+
id = "TA0006"
120+
name = "Credential Access"
121+
reference = "https://attack.mitre.org/tactics/TA0006/"
122+
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
[metadata]
2+
creation_date = "2025/06/14"
3+
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "crowdstrike"]
4+
maturity = "production"
5+
updated_date = "2025/06/14"
6+
7+
[transform]
8+
[[transform.investigate]]
9+
label = "Show the related DNS events"
10+
providers = [
11+
[
12+
{ excluded = false, field = "dns.question.name", queryType = "phrase", value = "{{dns.question.name}}", valueType = "string" }
13+
]
14+
]
15+
relativeFrom = "now-48h/h"
16+
relativeTo = "now"
17+
18+
[rule]
19+
author = ["Elastic"]
20+
description = """
21+
Identifies queries to a DNS record containing a base64-encoded blob matching the pattern "UWhRCA...BAAAA". This pattern
22+
corresponds to a marshaled CREDENTIAL_TARGET_INFORMATION structure, commonly used in Kerberos coercion attacks. It is
23+
associated with tools and techniques that exploit SPN spoofing via DNS. Adversaries may abuse this to coerce victim
24+
systems into authenticating to attacker-controlled hosts while requesting Kerberos tickets for legitimate services
25+
(often the victim's own identity), enabling attacks such as NTLM reflection.
26+
"""
27+
from = "now-9m"
28+
index = [
29+
"endgame-*",
30+
"logs-crowdstrike.fdr*",
31+
"logs-endpoint.events.network-*",
32+
"logs-sentinel_one_cloud_funnel.*",
33+
"logs-windows.sysmon_operational-*",
34+
]
35+
language = "eql"
36+
license = "Elastic License v2"
37+
name = "Potential Kerberos SPN Spoofing via Suspicious DNS Query"
38+
note = """## Triage and analysis
39+
40+
### Investigating Potential Kerberos SPN Spoofing via Suspicious DNS Query
41+
42+
### Possible investigation steps
43+
44+
- Identify the system that issued the DNS query for the suspicious hostname. Determine whether it is a server or an end user device. This technique is typically only relevant against server systems, but queries originating from workstations may indicate compromise or misuse.
45+
- Identify attacker-controlled system by getting the IP addresses (`dns.resolved_ip`) that this DNS query resolved to by looking for the related `lookup_result` events.
46+
- $investigate_0
47+
- If this alert was triggered on a domain controller, escalate the investigation to involve the incident response team to determine the full scope of the breach as soon as possible.
48+
49+
### False positive analysis
50+
51+
- This activity is unlikely to happen legitimately.
52+
53+
### Response and remediation
54+
55+
- Review and remove malicious DNS records containing the embedded CREDENTIAL_TARGET_INFORMATION Base64 payload (UWhRCA...BAAAA). Ensure that no additional coercion records exist in the same DNS zone.
56+
- Isolate involved systems if signs of compromise or lateral movement are detected, especially if the record was successfully resolved and used for coercion.
57+
- Monitor network traffic for signs of Man-in-the-Middle activity, focusing on unusual DNS queries or redirections.
58+
- Escalate the incident to the security operations center (SOC) for further investigation and to assess the potential impact on other systems.
59+
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
60+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
61+
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
62+
"""
63+
references = [
64+
"https://www.synacktiv.com/publications/ntlm-reflection-is-dead-long-live-ntlm-reflection-an-in-depth-analysis-of-cve-2025",
65+
"https://blog.redteam-pentesting.de/2025/reflective-kerberos-relay-attack/",
66+
"https://googleprojectzero.blogspot.com/2021/10/using-kerberos-for-authentication-relay.html",
67+
"https://github.com/CICADA8-Research/RemoteKrbRelay/blob/main/README.md",
68+
"https://github.com/Orange-Cyberdefense/ocd-mindmaps/blob/main/excalimap/mindmap/ad/authenticated.md",
69+
]
70+
risk_score = 73
71+
rule_id = "99ac5005-8a9e-4625-a0af-5f7bb447204b"
72+
severity = "high"
73+
tags = [
74+
"Domain: Endpoint",
75+
"OS: Windows",
76+
"Use Case: Threat Detection",
77+
"Tactic: Credential Access",
78+
"Data Source: Elastic Defend",
79+
"Data Source: Elastic Endgame",
80+
"Data Source: Crowdstrike",
81+
"Data Source: SentinelOne",
82+
"Data Source: Sysmon",
83+
]
84+
timestamp_override = "event.ingested"
85+
type = "eql"
86+
87+
query = '''
88+
network where host.os.name : "windows" and dns.question.name : "*UWhRCA*BAAAA*"
89+
'''
90+
91+
92+
[[rule.threat]]
93+
framework = "MITRE ATT&CK"
94+
[[rule.threat.technique]]
95+
id = "T1557"
96+
name = "Adversary-in-the-Middle"
97+
reference = "https://attack.mitre.org/techniques/T1557/"
98+
[[rule.threat.technique.subtechnique]]
99+
id = "T1557.001"
100+
name = "LLMNR/NBT-NS Poisoning and SMB Relay"
101+
reference = "https://attack.mitre.org/techniques/T1557/001/"
102+
103+
104+
[[rule.threat.technique]]
105+
id = "T1187"
106+
name = "Forced Authentication"
107+
reference = "https://attack.mitre.org/techniques/T1187/"
108+
109+
110+
[rule.threat.tactic]
111+
id = "TA0006"
112+
name = "Credential Access"
113+
reference = "https://attack.mitre.org/tactics/TA0006/"
114+

0 commit comments

Comments
 (0)