Detection rules › Splunk
Remote Admin Tools (PowerShell)
PsExec, RemCom, PaExec, and CsExec are administrative command-line utilities that allow remote command execution
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | T1059.003 Command and Scripting Interpreter: Windows Command Shell, T1569.002 System Services: Service Execution |
| Lateral Movement | T1021 Remote Services, T1570 Lateral Tool Transfer |
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4103 | Payload Context: ContextInfo User Data: UserData. |
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
Rule body yaml
id: '5343.5759'
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_powershell` "\\\\" ("EventCode=4104"
OR "<EventID>4104<")| regex process="(?i)((\.exe(\")?(\s+|\s+\/c)\s+)|(psexec.{1,}))|(\"{1,})?\x5c\x5c.{2,}"|
table _time, host, user process, parent_process, parent_process_id, parent_process_name,
process_id, process_name, signature_id | bin span=1s | stats values(*) as * by _time,
host '
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:
- PowerShell logs
references:
- https://redcanary.com/blog/threat-hunting-psexec-lateral-movement/
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_powershell` "\\\\" ("EventCode=4104" OR "<EventID>4104<")
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, parent_process, parent_process_id, parent_process_name, process_id, process_name, signature_id
Stage 4: bucket
| bin span=1s
Stage 5: stats
| stats values(*) as * by _time, host
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.
| Field | Kind | Values |
|---|---|---|
process | regex_match |
|
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.
| Stage | Term |
|---|---|
| 1 | "\\\\" |
| 1 | "EventCode=4104" |
| 1 | "<EventID>4104<" |