wmic_ntds_dit_T1003_003_cisa_report
Description
Detects extraction of ntds.dit file using vssadmin.exe or ntdsutil.exe with wmic as identified in CISA Living off the Land pdf
Query · yara_l
events:
(
$process.metadata.event_type = "PROCESS_LAUNCH" and
(
// cisa report referenced cmd /c in their report throughout, can filter this in/out for tuning as needed
// other wmic switches like /user and /password, these have been excluded to focus on the commands being issued since local access does not require these
re.regex($process.target.process.command_line, `(|cmd.*/c).*wmic.*process.*call.*create.*ntdsutil.*create.*full`) nocase or
// for greater precision to align with the report, the following line can be used instead of the previous line to focus on specific folders referenced
//re.regex($process.target.process.command_line, `(|cmd.*/c).*wmic.*process.*call.*create.*ntdsutil.*create.*full.*windows\\temp\\(tmp|pro|msafee_logs)`) nocase or
re.regex($process.target.process.command_line, `(|cmd.*/c).*vssadmin.*create.*shadow`) nocase or
// To detect this without wmic being used but written to c:\windows\temp\ in general
re.regex($process.target.process.command_line, `(|cmd.*/c).*ntdsutil.*create.*full.*windows\\temp\\`) nocase
)
)
or
(
// This does not detect one of the utilities responsible for executing ntdsutil or vssadmin, but does detect .dit file being created in monitored folders
$process.metadata.event_type = "FILE_CREATION" and
re.regex($process.target.file.full_path, `\.dit$`) nocase
)
or
(
//Identify application event log actions associated with the creation of the ntds.dit file and with ntds database
$process.metadata.product_name = "ESENT" and
$process.metadata.vendor_name = "Microsoft" and
(
$process.metadata.product_event_type = "216" or
$process.metadata.product_event_type = "325" or
$process.metadata.product_event_type = "326" or
$process.metadata.product_event_type = "327"
)
)
$process.principal.hostname = $hostname
match:
$hostname over 5m
outcome:
$risk_score = 85
$event_count = count_distinct($process.metadata.id)
// added to populate alert graph with additional context
// Commented out principal.hostname because it is already represented in graph as match variable. If match changes, can uncomment to add to results
//$principal_hostname = array_distinct($process.principal.hostname)
$principal_process_pid = array_distinct($process.principal.process.pid)
$principal_process_command_line = array_distinct($process.principal.process.command_line)
$principal_process_file_sha256 = array_distinct($process.principal.process.file.sha256)
$principal_process_file_full_path = array_distinct($process.principal.process.file.full_path)
$principal_process_product_specific_process_id = array_distinct($process.principal.process.product_specific_process_id)
$principal_process_parent_process_product_specific_process_id = array_distinct($process.principal.process.parent_process.product_specific_process_id)
$target_process_pid = array_distinct($process.target.process.pid)
$target_process_command_line = array_distinct($process.target.process.command_line)
$target_process_file_sha256 = array_distinct($process.target.process.file.sha256)
$target_process_file_full_path = array_distinct($process.target.process.file.full_path)
$target_process_product_specific_process_id = array_distinct($process.target.process.product_specific_process_id)
$principal_user_userid = array_distinct($process.principal.user.userid)
condition:
$process