Detection rules › Splunk

Impacket SMBexec (Windows Event Log)

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

Impackets smbexec.py enables users to execute commands or gain an interactive shell on a remote host

MITRE ATT&CK coverage

References

Event coverage

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.

FieldKindValues
EventCodeeq
  • 4688 corpus 313 (splunk 283, kusto 30)
  • 7045 corpus 20 (splunk 18, chronicle 1, kusto 1)
processmatch
  • "\/c.{1,}?\x5c\x5c"
service_namematch
  • "\/c.{1,}?\x5c\x5c"
signature_idmatch
  • "4688" corpus 8 (splunk 8)
  • "7045"

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>7045<"
1TERM
1"<EventID>4688<"