Detection rules › Splunk

ntds.dit Access from Unexpected Location (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Adversaries may attempt to access or create a copy of the Active Directory domain database in order to steal credential information, as well as obtain other information about domain members such as devices, users, and access rights. This use case detects processes and parent processes interacting with ntds.dit from unexpected locations which may indicate malicious activity. Due to limitations in EDR logging, EDR rules will only detect on process path (not parent process path)

MITRE ATT&CK coverage

TacticTechniques
Credential Access

References

Telemetry coverage

Rule body

id: '20634.36765'
title: ntds.dit Access from Unexpected Location
description: 'Adversaries may attempt to access or create a copy of the Active Directory
  domain database in order to steal credential information, as well as obtain other
  information about domain members such as devices, users, and access rights. This
  use case detects processes and parent processes interacting with ntds.dit from unexpected
  locations which may indicate malicious activity. Due to limitations in EDR logging,
  EDR rules will only detect on process path (not parent process path). -- Threat
  Actor Association: Mustang Panda (aka. Stately Taurus//Earth Preta/BRONZE PRESIDENT/TA416/RedDelta),
  UNC5221, UTA0178'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) "ntds.dit" ("apache" OR "tomcat" OR "AppData"
  OR "Temp" OR "Public" OR "PerfLogs" OR "Public" OR "Downloads" OR ("Recycle" "Bin")
  OR "SysWOW64" OR "User" OR ("Program" "Files") OR "Debug" OR "fonts" OR "Help" or
  "repair" OR "ProgramData") | regex process="(?i)ntds\.dit"| where match(process_path,
  "(?i)\x5c(apache|tomcat|AppData|Temp|PerfLogs|Public|Downloads|User|ProgramData|Recycle(\s+|\.)Bin|(\x5cWindows\x5c(Debug|fonts|Help|repair|SysWOW64)))\x5c")
  or match(parent_process_path, "(?i)\x5c(apache|tomcat|AppData|Temp|PerfLogs|Public|Downloads|User|ProgramData|Recycle(\s+|\.)Bin|(\x5cWindows\x5c(Debug|fonts|Help|repair|SysWOW64)))\x5c")
  | table _time, host, user, process*, parent_process_path | bin span=1s | stats values(*)
  as * by _time, host '
techniques:
- credential-access:os credential dumping:ntds
technique_id:
- T1003.003
data_category:
- Process command-line parameters
- Windows event logs
references:
- https://blog.talosintelligence.com/2022/08/recent-cyber-attack.html?m=1

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) "ntds.dit" ("apache" OR "tomcat" OR "AppData" OR "Temp" OR "Public" OR "PerfLogs" OR "Public" OR "Downloads" OR ("Recycle" "Bin") OR "SysWOW64" OR "User" OR ("Program" "Files") OR "Debug" OR "fonts" OR "Help" or "repair" OR "ProgramData")

Stage 2: regex

| regex process="(?i)ntds\.dit"

Stage 3: where

| where match(process_path, "(?i)\x5c(apache|tomcat|AppData|Temp|PerfLogs|Public|Downloads|User|ProgramData|Recycle(\s+|\.)Bin|(\x5cWindows\x5c(Debug|fonts|Help|repair|SysWOW64)))\x5c") or match(parent_process_path, "(?i)\x5c(apache|tomcat|AppData|Temp|PerfLogs|Public|Downloads|User|ProgramData|Recycle(\s+|\.)Bin|(\x5cWindows\x5c(Debug|fonts|Help|repair|SysWOW64)))\x5c")

Stage 4: table

| table _time, host, user, process*, parent_process_path

Stage 5: bucket

| bin span=1s

Stage 6: stats

| stats values(*) as * by _time, host

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
parent_process_pathregex_match
  • "(?i)\x5c(apache|tomcat|AppData|Temp|PerfLogs|Public|Downloads|User|ProgramData|Recycle(\s+|.)Bin|(\x5cWindows\x5c(Debug|fonts|Help|repair|SysWOW64)))\x5c" corpus 2 (splunk 2)
field:"parent_process_name" kind:regex_match
processregex_match
  • "(?i)ntds.dit" corpus 4 (splunk 4)
field:"CommandLine" kind:regex_match
process_pathregex_match
  • "(?i)\x5c(apache|tomcat|AppData|Temp|PerfLogs|Public|Downloads|User|ProgramData|Recycle(\s+|.)Bin|(\x5cWindows\x5c(Debug|fonts|Help|repair|SysWOW64)))\x5c" corpus 2 (splunk 2)
field:"process_name" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1"ntds.dit"
1"apache"
1"tomcat"
1"AppData"
1"Temp"
1"Public"
1"PerfLogs"
1"Public"
1"Downloads"
1"Recycle"
1"Bin"
1"SysWOW64"
1"User"
1"Program"
1"Files"
1"Debug"
1"fonts"
1"Help"
1"repair"
1"ProgramData"