Detection: Windows Short Lived DNS Record

Description

The following analytic identifies the creation and quick deletion of a DNS object within 300 seconds in an Active Directory environment, indicative of a potential attack abusing DNS. This detection leverages Windows Security Event Codes 5136 and 5137, analyzing the duration between these events. This activity is significant as temporary DNS entries allows attackers to cause unexpecting network trafficking, leading to potential compromise.

 1`wineventlog_security` ((EventCode=5137  ObjectClass="dnsNode") OR (EventCode=5136 ObjectClass="dnsNode" AttributeLDAPDisplayName="dNSTombstoned" AttributeValue="TRUE"))
 2  
 3| stats min(_time) as firstTime max(_time) as lastTime values(EventCode) as event_codes values(ObjectDN) as dns_record values(SubjectUserName) as user values(Computer) as dest
 4    BY ObjectGUID
 5  
 6| where mvcount(event_codes)=2
 7  
 8| eval time_diff=lastTime - firstTime
 9  
10| where time_diff <= 300
11  
12| table firstTime, lastTime, dns_record, user, dest, time_diff, ObjectGUID
13  
14| `security_content_ctime(firstTime)`
15  
16| `security_content_ctime(lastTime)`
17  
18| `windows_short_lived_dns_record_filter`

Data Source

Name Platform Sourcetype Source
Windows Event Log Security 5136 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Security'
Windows Event Log Security 5137 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Security'

Macros Used

Name Value
wineventlog_security eventtype="wineventlog_security" OR Channel="security" OR source="XmlWinEventLog:Security" OR source="WinEventLog:Security"
windows_short_lived_dns_record_filter search *
windows_short_lived_dns_record_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1071.004 DNS Command and Control
T1187 Forced Authentication Credential Access
T1557.001 Name Resolution Poisoning and SMB Relay Collection
Exploitation
Command and Control
DE.CM
CIS 10

CVE

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 Finding (Notable) Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Intermediate Finding (Risk Event) Yes
TTP detections generate a Finding (Notable) and may generate Intermediate Findings (Risk Events) for associated entities.

Implementation

To successfully implement this search, you ned to be ingesting Event codes 5136 and 5137. 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 DNS server object within 30 seconds or less is unusual but not impossible in a production environment. Filter as needed.

Associated Analytic Story

Finding

Title Entity Field Entity Type Risk Score
A short-lived DNS object was created and deleted on $dest$ user user 50

Intermediate Findings

Message Entity Field Entity Type Risk Score
A short-lived DNS object was created and deleted on $dest$ dest system 50

References

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: 5