Detection rules › Splunk

Rare Process Execution (Sysmon)

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

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

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

id: '5026.5675'
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_sysmon` EventCode=1 NOT (process_path
  IN ("C:\\Program Files*","C:\\Windows\\SoftwareDistribution\\Download\\Install\\*","C:\\ProgramData\\Microsoft\\Windows
  Defender\\platform*") OR parent_process_path 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 Sysmon
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 (parent_process_path IN ("C:\\Program Files*", "C:\\Windows\\SoftwareDistribution\\Download\\Install\\*") OR process_path IN ("C:\\Program Files*", "C:\\ProgramData\\Microsoft\\Windows Defender\\platform*", "C:\\Windows\\SoftwareDistribution\\Download\\Install\\*")) EventCode=1 source="*" source IN ("WinEventLog:Microsoft-Windows-Sysmon/Operational", "XmlWinEventLog:Microsoft-Windows-Sysmon/Operational")

Stage 2: rex

The parser skipped this rex command; the rule body above shows it verbatim.

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

eventstatsAS dc_host BY process_name

Stage 7: eventstats

eventstatsAS c_process_path_ext BY process_path_ext

Stage 8: eventstats

eventstatsAS 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.

FieldKindExcluded valuesSearch
parent_process_pathin"C:\\Program Files*", "C:\\Windows\\SoftwareDistribution\\Download\\Install\\*"excludes:parent_process_path
process_pathin"C:\\Program Files*", "C:\\ProgramData\\Microsoft\\Windows Defender\\platform*", "C:\\Windows\\SoftwareDistribution\\Download\\Install\\*"excludes:process_path

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 1 corpus 241 (splunk 225, kusto 15, elastic 1)
field:"EventID" kind:eq value:"1"
c_processlt
  • 3 corpus 6 (splunk 6)
field:"c_process" kind:lt value:"3"
c_process_path_extlt
  • 3 corpus 2 (splunk 2)
field:"c_process_path_ext" kind:lt value:"3"
dc_hosteq
  • 1 corpus 8 (splunk 8)
field:"dc_host" kind:eq value:"1"
process_pathcross_field_compare
  • parent_process_path transforms: op:ne corpus 2 (splunk 2)
field:"process_name" kind:cross_field_compare value:"parent_process_path"