Detection rules › Splunk
WMIC Host Reconniassance (Windows Event Log)
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 | |
| Discovery |
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule body
id: '29377.52944'
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_winevent` (TERM(EventCode=4688) OR
"<EventID>4688<" OR Type=Process) ("powershell.exe" OR "cmd.exe" OR "pwsh.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)) SubjectUserName!="*$"
| 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:
- Process command-line parameters
- Windows event 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_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) ("powershell.exe" OR "cmd.exe" OR "pwsh.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)) SubjectUserName!="*$"
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
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"4688" |
SubjectUserName | ne |
| field:"SubjectUserName" kind:ne |
process | regex_match |
| field:"CommandLine" kind:regex_match |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>4688<" |
| 1 | "powershell.exe" |
| 1 | "cmd.exe" |
| 1 | "pwsh.exe" |
| 1 | wmic |
| 1 | os |
| 1 | logicaldisk |
| 1 | share |
| 1 | cpu |
| 1 | memorychip |
| 1 | useraccount |
| 1 | nic |
| 1 | startup |
| 1 | service |
| 1 | cpu |
| 1 | path |
| 1 | bios |
| 1 | computersystem |
| 1 | product |
| 1 | partition |
| 1 | group |
| 1 | environment |
| 1 | diskdrive |
| 1 | qfe |
| 1 | sysdriver |
| 1 | namespace |
| 1 | datafile |
| 1 | csproduct |
| 1 | volume |