Detection rules › Splunk
Rare Process Execution (Windows Event Log)
Rare process executions are anomalies within an organization and are normally worth looking at. Although these kinds of detections can be false positive prone, they can be utilized as supporting evidence or as a last resort to detect malicious activity your other detection content may be missing
MITRE ATT&CK coverage
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule body
id: '5026.5077'
title: Rare Process Execution
description: 'Rare process executions are anomalies within an organization and are
normally worth looking at. Although these kinds of detections can be false positive
prone, they can be utilized as supporting evidence or as a last resort to detect
malicious activity your other detection content may be missing. -- Threat Actor
Association: Traveling Spider, Volt Typhoon, Wizard Spider - Software Association:
Conti, Nefilim, Ryuk'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
"<EventID>4688<") NOT (New_Process_Name IN ("C:\\Program Files*","C:\\Windows\\SoftwareDistribution\\Download\\Install\\*","C:\\ProgramData\\Microsoft\\Windows
Defender\\platform*") OR Creator_Process_Name IN ("C:\\Program Files*","C:\\Windows\\SoftwareDistribution\\Download\\Install\\*"))|
rex field=process_path "^(?<process_path_ext>.+)\x5c[^\x5c]+$"| fields _time, host,
user, process, process_*, parent_*`group_events("host, process_name", 10)` | eventstats
dc(host) as dc_host by process_name| eventstats c(process_path_ext) as c_process_path_ext
by process_path_ext| eventstats c(process) as c_process by process| where process_path!=parent_process_path
and (dc_host=1 and c_process_path_ext<3 and c_process<3)`hec_collect`'
techniques:
- execution:command and scripting interpreter:windows command shell
- execution:user execution:malicious file
technique_id:
- T1204.002
- T1059.003
data_category:
- Windows event logs
references:
- https://www.splunk.com/en_us/blog/security/detecting-early-signs-of-compromise-using-windows-sysinternal.html
- https://d1zq5d3dtjfcoj.cloudfront.net/F-Secure-APT29-9985.png
Stages and Predicates
Stage 1: search
search NOT (Creator_Process_Name IN ("C:\\Program Files*", "C:\\Windows\\SoftwareDistribution\\Download\\Install\\*") OR New_Process_Name IN ("C:\\Program Files*", "C:\\ProgramData\\Microsoft\\Windows Defender\\platform*", "C:\\Windows\\SoftwareDistribution\\Download\\Install\\*")) EventCode=4688 source="*" source IN ("WinEventLog:Security", "XmlWinEventLog:Security")
Stage 2: rex
Stage 3: fields
fields _time, host, parent_*, process, process_*, user
Stage 4: bucket
bucket _time
Stage 5: stats
stats BY host, process_name, _time
Stage 6: eventstats
eventstats … AS dc_host BY process_name
Stage 7: eventstats
eventstats … AS c_process_path_ext BY process_path_ext
Stage 8: eventstats
eventstats … AS c_process BY process
Stage 9: where
where c_process<3 c_process_path_ext<3 dc_host=1 process_path != parent_process_path
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
Creator_Process_Name | in | "C:\\Program Files*", "C:\\Windows\\SoftwareDistribution\\Download\\Install\\*" | excludes:Creator_Process_Name |
New_Process_Name | in | "C:\\Program Files*", "C:\\ProgramData\\Microsoft\\Windows Defender\\platform*", "C:\\Windows\\SoftwareDistribution\\Download\\Install\\*" | excludes:New_Process_Name |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"4688" |
c_process | lt |
| field:"c_process" kind:lt value:"3" |
c_process_path_ext | lt |
| field:"c_process_path_ext" kind:lt value:"3" |
dc_host | eq |
| field:"dc_host" kind:eq value:"1" |
process_path | cross_field_compare |
| field:"process_name" kind:cross_field_compare value:"parent_process_path" |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>4688<" |