ID | Technique | Tactic |
---|---|---|
T1207 | Rogue Domain Controller | Defense Evasion |
Detection: Windows AD Short Lived Server Object
Description
The following analytic identifies the creation and quick deletion of a Domain Controller (DC) object within 30 seconds in an Active Directory environment, indicative of a potential DCShadow attack. This detection leverages Windows Security Event Codes 5137 and 5141, analyzing the duration between these events. This activity is significant as DCShadow allows attackers with privileged access to register a rogue DC, enabling unauthorized changes to AD objects, including credentials. If confirmed malicious, this could lead to unauthorized AD modifications, compromising the integrity and security of the entire domain.
Search
1`wineventlog_security` EventCode=5137 OR EventCode=5141 ObjectDN="*CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration*"
2| transaction ObjectDN startswith=(EventCode=5137) endswith=(EventCode=5141)
3| eval short_lived=case((duration<30),"TRUE")
4| search short_lived = TRUE
5| stats values(ObjectDN) values(signature) values(EventCode) by _time, Computer, SubjectUserName
6| `windows_ad_short_lived_server_object_filter`
Data Source
Name | Platform | Sourcetype | Source |
---|---|---|---|
Windows Event Log Security 5137 | Windows | 'xmlwineventlog' |
'XmlWinEventLog:Security' |
Windows Event Log Security 5141 | Windows | 'xmlwineventlog' |
'XmlWinEventLog:Security' |
Macros Used
Name | Value |
---|---|
wineventlog_security | eventtype=wineventlog_security OR Channel=security OR source=XmlWinEventLog:Security |
windows_ad_short_lived_server_object_filter | search * |
windows_ad_short_lived_server_object_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
Setting | Value |
---|---|
Disabled | true |
Cron Schedule | 0 * * * * |
Earliest Time | -70m@m |
Latest Time | -10m@m |
Schedule Window | auto |
Creates Notable | Yes |
Rule Title | %name% |
Rule Description | %description% |
Notable Event Fields | user, dest |
Creates Risk Event | True |
Implementation
To successfully implement this search, you ned to be ingesting Event codes 5137
and 5141
. The Advanced Security Audit policy setting Audit Directory Services Changes
within DS Access
needs to be enabled. For these event codes to be generated, specific SACLs are required.
Known False Positives
Creating and deleting a server object within 30 seconds or less is unusual but not impossible in a production environment. Filter as needed.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
Potential DCShadow Attack Detected on $Computer$ | 64 | 80 | 80 |
References
-
https://stealthbits.com/blog/detecting-dcshadow-with-event-logs/
-
https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-5137
-
https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-5141
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | ✅ Passing | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | XmlWinEventLog:Security |
XmlWinEventLog |
Integration | ✅ Passing | Dataset | XmlWinEventLog:Security |
XmlWinEventLog |
Replay any dataset to Splunk Enterprise by using our replay.py
tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
Source: GitHub | Version: 4