Detection rules › Splunk
Impacket SMBexec (Windows Event Log)
Impackets smbexec.py enables users to execute commands or gain an interactive shell on a remote host
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | T1059 Command and Scripting Interpreter, T1569.002 System Services: Service Execution |
| Lateral Movement | T1021.006 Remote Services: Windows Remote Management |
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| Security-Auditing | Event ID 4688 | A new process has been created. |
| Service-Control-Manager | Event ID 7045 | Event ID 7045 |
Rule body yaml
id: '5397.5497'
title: Impacket SMBexec
description: 'Impackets smbexec.py enables users to execute commands or gain an interactive
shell on a remote host. -- Threat Actor Association: APT28 (aka.Fancy Bear, Fighting
Ursa, Forest Blizzard, Pawn Storm, TA422, STRONTIUM), Cadet Blizzard, Silent Chollima,
UNC1945, UNC5221, UTA0178 - Software Association: LockBit, Ryuk, Vice Society'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` ((TERM(EventCode=7045) OR
"<EventID>7045<") OR (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process))|
eval service_name=Service_File_Name | where match(process, "\/c.{1,}?\x5c\x5c")
or match(service_name, "\/c.{1,}?\x5c\x5c") | table _time, host, user signature_id,
user, dest_host, process_id, process_name, process_path, process, parent_process_id,
parent_process_name, parent_process_path, event_id, src, service_name | bin span=1s
| stats values(*) as * by _time, host | where match(signature_id, "4688") and match(signature_id,
"7045") '
techniques:
- execution:command and scripting interpreter
- execution:system services:service execution
- lateral-movement:remote services:windows remote management
technique_id:
- T1059
- T1569.002
- T1021.006
data_category:
- Windows event logs
references:
- https://github.com/SecureAuthCorp/impacket/blob/master/examples/smbexec.py
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_winevent` ((TERM(EventCode=7045) OR "<EventID>7045<") OR (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process))
Stage 2: eval
| eval service_name=Service_File_Name
Stage 3: where
| where match(process, "\/c.{1,}?\x5c\x5c") or match(service_name, "\/c.{1,}?\x5c\x5c")
Stage 4: table
| table _time, host, user signature_id, user, dest_host, process_id, process_name, process_path, process, parent_process_id, parent_process_name, parent_process_path, event_id, src, service_name
Stage 5: bucket
| bin span=1s
Stage 6: stats
| stats values(*) as * by _time, host
Stage 7: where
| where match(signature_id, "4688") and match(signature_id, "7045")
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 |
|---|---|---|
EventCode | eq |
|
process | match |
|
service_name | match |
|
signature_id | 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 | TERM |
| 1 | "<EventID>7045<" |
| 1 | TERM |
| 1 | "<EventID>4688<" |