Skip to content

WMI Command Line

Evidence: WMI Command Line
Description: Dump WMI Command Line Event Consumers
Category: System
Platform: windows
Short Name: wmicec
Is Parsed: Yes
Sent to Investigation Hub: Yes
Collect File(s): No

WMI CommandLineEventConsumers execute command-line programs when specific WMI events occur. This persistence mechanism allows attackers to launch executables or scripts with SYSTEM privileges in response to system events.

CommandLine consumers can execute any command-line program, including PowerShell, cmd.exe, or malicious executables.

This collector gathers structured data about wmi command line.

FieldDescriptionExample
NameConsumer nameBadConsumer
PayloadCommandCommand template to executecmd.exe /c powershell.exe -enc …
PayloadExecutableExecutable pathC:\Windows\System32\cmd.exe

This collector queries WMI for CommandLineEventConsumer instances in multiple namespaces:

  • ROOT\Subscription
  • ROOT\DEFAULT
  • ROOT\CIMV2

CommandLine consumers enable command execution persistence. Investigators use this data to detect WMI command-based persistence, identify malicious command payloads, track PowerShell execution via WMI, and detect living-off-the-land persistence.