Detection rules › Splunk
WMIC Host Reconniassance (PowerShell)
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
| Tactic | Techniques |
|---|---|
| Execution | T1047 Windows Management Instrumentation |
| Discovery | T1082 System Information Discovery |
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
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.
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>4104<" |
| 1 | "cmd" |
| 1 | "cmd.exe" |
| 1 | TERM |
| 1 | wmic |
| 1 | TERM |
| 1 | os |
| 1 | TERM |
| 1 | logicaldisk |
| 1 | TERM |
| 1 | share |
| 1 | TERM |
| 1 | cpu |
| 1 | TERM |
| 1 | memorychip |
| 1 | TERM |
| 1 | useraccount |
| 1 | TERM |
| 1 | nic |
| 1 | TERM |
| 1 | startup |
| 1 | TERM |
| 1 | service |
| 1 | TERM |
| 1 | cpu |
| 1 | TERM |
| 1 | path |
| 1 | TERM |
| 1 | bios |
| 1 | TERM |
| 1 | computersystem |
| 1 | TERM |
| 1 | product |
| 1 | TERM |
| 1 | partition |
| 1 | TERM |
| 1 | group |
| 1 | TERM |
| 1 | environment |
| 1 | TERM |
| 1 | diskdrive |
| 1 | TERM |
| 1 | qfe |
| 1 | TERM |
| 1 | sysdriver |
| 1 | TERM |
| 1 | namespace |
| 1 | TERM |
| 1 | datafile |
| 1 | TERM |
| 1 | csproduct |
| 1 | TERM |
| 1 | volume |