Detection rules › Splunk

Remote Admin Tools (Windows Event Log)

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

PsExec, RemCom, PaExec, and CsExec are administrative command-line utilities that allow remote command execution

MITRE ATT&CK coverage

References

Event coverage

Rule body yaml

id: '5343.5439'
title: 'Remote Admin Tools  '
description: 'PsExec, RemCom, PaExec, and CsExec are administrative command-line utilities
  that allow remote command execution Threat Actor Association: Antlion, DarkSide,
  BlackMatter, APT29/Nobelium, APT31, Carbanak, FIN6, FIN7, FIN8, FIN12, Fox Kitten,
  GoldenJackal, Hello Kitty / Five Hands, MalKamak, Muddled Libra, OilRig, Traveling
  Spider, UNC2596, Vice Society, Wizard Spider - Software Association: ALPHV/BlackCat,
  AvosLocker, BianLian, Blackbyte, Blacksuit, Black Basta, Conti, Cuba, GhostShell,
  Lockbit, Play, Prometheus/Spook, Prestige, PYSA/Mespinoza, Quantum, Rhysida, Royal,
  Vice Society - Atomics T1021.002 Test#3'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) ".exe" "\\\\"| regex process="(?i)((\.exe(\")?(\s+|\s+\/c)\s+)|(psexec.{1,}))|(\"{1,})?\x5c\x5c.{2,}"
  | table _time, host, user process, process_*, parent_process, parent_process_*,
  src_user | bin span=1s | stats values(*) as * by _time, host, process `hec_collect`'
techniques:
- execution:system services:service execution
- lateral-movement:remote services
- execution:command and scripting interpreter:windows command shell
- lateral-movement:lateral tool transfer
technique_id:
- T1569.002
- T1021
- T1059.003
- T1570
data_category:
- Process command-line parameters
- Windows event logs
references:
- https://redcanary.com/blog/threat-hunting-psexec-lateral-movement/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) ".exe" "\\\\"

Stage 2: regex

| regex process="(?i)((\.exe(\")?(\s+|\s+\/c)\s+)|(psexec.{1,}))|(\"{1,})?\x5c\x5c.{2,}"

Stage 3: table

| table _time, host, user process, process_*, parent_process, parent_process_*, src_user

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host, process `hec_collect`

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)
processregex_match
    • "(?i)((.exe(\")?(\s+|\s+\/c)\s+)|(psexec.{1,}))
    • (\"{1,})?\x5c\x5c.{2,}"
    corpus 2 (splunk 2)

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".exe"
1"\\\\"