Detection rules › Splunk

Suspicious Executable by CMD.exe (Windows Event Log)

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

Detect when an executable has been launched by cmd.exe. Such as spawning powershell.exe, cscript rundll32 and similar processes being a child process of cmd

MITRE ATT&CK coverage

References

Event coverage

Rule body yaml

id: '8823.11630'
title: Suspicious Executable by CMD.exe
description: 'Detect when an executable has been launched by cmd.exe. Such as spawning
  powershell.exe, cscript rundll32 and similar processes being a child process of
  cmd. -- Threat Actor Association: APT28 (aka.Fancy Bear, Fighting Ursa, Forest Blizzard,
  Pawn Storm, TA422, STRONTIUM), APT34/OilRig, APT43, FIN8, Flax Typhoon, REvil, WinterVivern/UAC-0114
  - Software Association: Alchimist, AvosLocker, Black Basta, MagicRAT, Rhysida'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<") "cmd.exe" ("powershell.exe" OR "services.exe" OR "dllhost.exe"
  OR "rundll32.exe" OR "cscript.exe" OR "regsvr32.exe" OR "mshta.exe") | regex parent_process_name="(?i)(cmd\.exe)"
  | regex process_path="(?i)((powershell)|(services)|(dllhost)|(rundll32)|(cscript)|(regsvr32)|(mshta))\.exe"
  | table _time, host, user event_id, parent_*, process_*, process, signature_id,
  src_*, dest_* | bin span=1s | stats values(*) as * by _time, host | where isnotnull(user) '
techniques:
- execution:command and scripting interpreter
technique_id: 
- T1059
data_category:
- Windows event logs
references:
- https://secure.anvilogic.com/use_cases?id=AVL_UC1041#more_info

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<") "cmd.exe" ("powershell.exe" OR "services.exe" OR "dllhost.exe" OR "rundll32.exe" OR "cscript.exe" OR "regsvr32.exe" OR "mshta.exe")

Stage 2: regex

| regex parent_process_name="(?i)(cmd\.exe)"

Stage 3: regex

| regex process_path="(?i)((powershell)|(services)|(dllhost)|(rundll32)|(cscript)|(regsvr32)|(mshta))\.exe"

Stage 4: table

| table _time, host, user event_id, parent_*, process_*, process, signature_id, src_*, dest_*

Stage 5: bucket

| bin span=1s

Stage 6: stats

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

Stage 7: where

| where isnotnull(user)

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
EventCodeeq
  • 4688 corpus 313 (splunk 283, kusto 30)
parent_process_nameregex_match
  • "(?i)(cmd.exe)" corpus 2 (splunk 2)
process_pathregex_match
  • "(?i)((powershell)|(services)|(dllhost)|(rundll32)|(cscript)|(regsvr32)|(mshta)).exe"
useris_not_null
  • (no value, null check)

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

StageTerm
1TERM
1"<EventID>4688<"
1"cmd.exe"
1"powershell.exe"
1"services.exe"
1"dllhost.exe"
1"rundll32.exe"
1"cscript.exe"
1"regsvr32.exe"
1"mshta.exe"