Detection rules › Splunk

WMIC Host Reconniassance (PowerShell)

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

WMIC (Windows Management Instrumentation Command-line) reconnaissance involves using the WMIC tool to query system information, configurations, and installed software on Windows systems. Threat actors abuse this feature to gather valuable data about a target environment, which can help them tailor their attacks, escalate privileges, or move laterally across the network. This use case detects WMIC executions with commands that may be used to perform host reconnaissance.

MITRE ATT&CK coverage

References

Event coverage

Rule body yaml

id: '29377.52945'
title: WMIC Host Reconniassance
description: WMIC (Windows Management Instrumentation Command-line) reconnaissance
  involves using the WMIC tool to query system information, configurations, and installed
  software on Windows systems. Threat actors abuse this feature to gather valuable
  data about a target environment, which can help them tailor their attacks, escalate
  privileges, or move laterally across the network. This use case detects WMIC executions
  with commands that may be used to perform host reconnaissance.
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR
  "<EventID>4104<") ("cmd" OR "cmd.exe") TERM(wmic) (TERM(os) OR TERM(logicaldisk)
  OR TERM(share) OR TERM(cpu) OR TERM(memorychip) OR TERM(useraccount) OR TERM(nic)
  OR TERM(startup) OR TERM(service) OR TERM(cpu) OR TERM(path) OR TERM(bios) OR TERM(computersystem)
  OR TERM(product) OR TERM(partition) OR TERM(group) OR TERM(environment) OR TERM(diskdrive)
  OR TERM(qfe) OR TERM(sysdriver) OR TERM(namespace) OR TERM(datafile) OR TERM(csproduct)
  OR TERM(volume)) | regex process="(?i)\s(os|logicaldisk|share|cpu|memorychip|useraccount|nic|startup|service|cpu|path|bios|computersystem|product|partition|group|environment|diskdrive|qfe|sysdriver|namespace|datafile|csproduct|volume)"
  | table _time, host, user, process, process_name, parent_process_name, user | bin
  span=1s | stats values(*) as * by _time, host '
techniques:
- discovery:system information discovery
- execution:windows management instrumentation
technique_id: 
- T1082
- T1047
data_category:
- PowerShell logs
references:
- https://cyble.com/blog/aurora-a-stealer-using-shapeshifting-tactics/
- 'https://trustedsec.com/blog/wmi-for-script-kiddies '
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1047/T1047.md
- https://attack.mitre.org/techniques/T1047/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR "<EventID>4104<") ("cmd" OR "cmd.exe") TERM(wmic) (TERM(os) OR TERM(logicaldisk) OR TERM(share) OR TERM(cpu) OR TERM(memorychip) OR TERM(useraccount) OR TERM(nic) OR TERM(startup) OR TERM(service) OR TERM(cpu) OR TERM(path) OR TERM(bios) OR TERM(computersystem) OR TERM(product) OR TERM(partition) OR TERM(group) OR TERM(environment) OR TERM(diskdrive) OR TERM(qfe) OR TERM(sysdriver) OR TERM(namespace) OR TERM(datafile) OR TERM(csproduct) OR TERM(volume))

Stage 2: regex

| regex process="(?i)\s(os|logicaldisk|share|cpu|memorychip|useraccount|nic|startup|service|cpu|path|bios|computersystem|product|partition|group|environment|diskdrive|qfe|sysdriver|namespace|datafile|csproduct|volume)"

Stage 3: table

| table _time, host, user, process, process_name, parent_process_name, user

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.

FieldKindValues
EventCodeeq
  • 4104 corpus 268 (splunk 268)
processregex_match
  • "(?i)\s(os|logicaldisk|share|cpu|memorychip|useraccount|nic|startup|service|cpu|path|bios|computersystem|product|partition|group|environment|diskdrive|qfe|sysdriver|namespace|datafile|csproduct|volume)" corpus 3 (splunk 3)

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>4104<"
1"cmd"
1"cmd.exe"
1TERM
1wmic
1TERM
1os
1TERM
1logicaldisk
1TERM
1share
1TERM
1cpu
1TERM
1memorychip
1TERM
1useraccount
1TERM
1nic
1TERM
1startup
1TERM
1service
1TERM
1cpu
1TERM
1path
1TERM
1bios
1TERM
1computersystem
1TERM
1product
1TERM
1partition
1TERM
1group
1TERM
1environment
1TERM
1diskdrive
1TERM
1qfe
1TERM
1sysdriver
1TERM
1namespace
1TERM
1datafile
1TERM
1csproduct
1TERM
1volume