Event ID 21 — WmiEvent (WmiEventConsumerToFilter activity detected)
Description
When a consumer binds to a filter, this event logs the consumer name and filter path.
Message #
Fields #
| Name | Description |
|---|---|
RuleName UnicodeString → string | Custom tag mapped to event, i.e. ATT&CK technique ID |
EventType UnicodeString → string | WMI event type |
UtcTime UnicodeString → string | Time in UTC when event was created |
Operation UnicodeString → string | WMI consumer-to-filter binding operation Known values
|
User UnicodeString → string | User that created the WMI consumer-to-filter binding |
Consumer UnicodeString → string | Consumer created to bind |
Filter UnicodeString → string | Filter created to bind |
Example Event #
{
"system": {
"provider": "Microsoft-Windows-Sysmon",
"guid": "5770385F-C22A-43E0-BF4C-06F5698FFBD9",
"event_source_name": "",
"event_id": 21,
"version": 3,
"level": 4,
"task": 21,
"opcode": 0,
"keywords": 9223372036854775808,
"time_created": "2019-07-19T14:57:02.378480Z",
"event_record_id": 4057,
"correlation": {},
"execution": {
"process_id": 2796,
"thread_id": 4356
},
"channel": "Microsoft-Windows-Sysmon/Operational",
"computer": "MSEDGEWIN10",
"security": {
"user_id": "S-1-5-18"
}
},
"event_data": {
"RuleName": "",
"EventType": "WmiBindingEvent",
"UtcTime": "2019-07-19 14:57:02.369",
"Operation": "Created",
"User": "MSEDGEWIN10\\IEUser",
"Consumer": " \"\\\\\\\\.\\\\ROOT\\\\subscription:CommandLineEventConsumer.Name=\\\"AtomicRedTeam-WMIPersistence-Example\\\"\"",
"Filter": " \"\\\\\\\\.\\\\ROOT\\\\subscription:__EventFilter.Name=\\\"AtomicRedTeam-WMIPersistence-Example\\\"\""
}
}
Detection Patterns #
WMI Consumer
Lateral Movement: Exploitation of Remote Services
Security-Auditing Event ID 4624: An account was successfully logged on.OREvent ID 4688: A new process has been created.ORSysmon Event ID 1: Process creationOREvent ID 19: WmiEventOREvent ID 20: WmiEventOREvent ID 21: WmiEvent
1 rule
Kusto Query Language
Community Notes #
May surface registration of WMI event-based auto-runs that survive reboots.
Detection Rules #
View all rules referencing this event →
Splunk # view in reference
- WMI Permanent Event Subscription - Sysmon source: The following analytic identifies the creation of WMI permanent event subscriptions, which can be used to establish persistence or perform privilege escalation. It leverages Sysmon data, specifically EventCodes 19, 20, and 21, to detect the creation of WMI EventFilters, EventConsumers, and FilterToConsumerBindings. This activity is significant as it may indicate an attacker setting up mechanisms to execute code with elevated SYSTEM privileges when specific events occur. If confirmed malicious, this could allow the attacker to maintain persistence, escalate privileges, and execute arbitrary code, posing a severe threat to the environment.
References #
- Microsoft Learn https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon#event-id-21-wmievent-wmieventconsumertofilter-activity-detected
- Example event sourced from https://github.com/NextronSystems/evtx-baseline
- OSSEM-DD https://github.com/OTRF/OSSEM-DD/blob/main/windows/sysmon/events/event-21.yml