Detection rules › Splunk
WMI Permanent Event Subscription
The following analytic detects the creation of permanent event subscriptions using Windows Management Instrumentation (WMI). It leverages Sysmon EventID 5 data to identify instances where the event consumers are not the expected "NTEventLogEventConsumer." This activity is significant because it suggests an attacker is attempting to achieve persistence by running malicious scripts or binaries in response to specific system events. If confirmed malicious, this could lead to severe impacts such as data theft, ransomware deployment, or other damaging outcomes. Investigate the associated scripts or binaries to identify the source of the attack.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | T1047 Windows Management Instrumentation |
Rule body splunk
name: WMI Permanent Event Subscription
id: 71bfdb13-f200-4c6c-b2c9-a2e07adf437d
version: 10
creation_date: '2020-04-29'
modification_date: '2026-05-13'
author: Rico Valdez, Splunk
status: experimental
type: TTP
description: The following analytic detects the creation of permanent event subscriptions using Windows Management Instrumentation (WMI). It leverages Sysmon EventID 5 data to identify instances where the event consumers are not the expected "NTEventLogEventConsumer." This activity is significant because it suggests an attacker is attempting to achieve persistence by running malicious scripts or binaries in response to specific system events. If confirmed malicious, this could lead to severe impacts such as data theft, ransomware deployment, or other damaging outcomes. Investigate the associated scripts or binaries to identify the source of the attack.
data_source: []
search: |-
`wmi`
EventCode=5861
Binding
| rex field=Message "Consumer =\s+(?<consumer>[^;|^$]+)"
| search consumer!="NTEventLogEventConsumer=\"SCM Event Log Consumer\""
| stats count min(_time) as firstTime
max(_time) as lastTime
by ComputerName, consumer, Message
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| rename ComputerName as dest
| `wmi_permanent_event_subscription_filter`
how_to_implement: To successfully implement this search, you must be ingesting the Windows WMI activity logs. This can be done by adding a stanza to inputs.conf on the system generating logs with a title of [WinEventLog://Microsoft-Windows-WMI-Activity/Operational].
known_false_positives: Although unlikely, administrators may use event subscriptions for legitimate purposes.
references: []
finding:
title: WMI Permanent Event Subscription detected on $dest$
entity:
field: dest
type: system
score: 50
analytic_story:
- Suspicious WMI Use
asset_type: Endpoint
mitre_attack_id:
- T1047
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: endpoint
security_domain: endpoint
Stages and Predicates
Stage 1: search
`wmi`
EventCode=5861
Binding
Stage 2: rex
| rex field=Message "Consumer =\s+(?<consumer>[^;|^$]+)"
Stage 3: search
| search consumer!="NTEventLogEventConsumer=\"SCM Event Log Consumer\""
Stage 4: stats
| stats count min(_time) as firstTime
max(_time) as lastTime
by ComputerName, consumer, Message
Stage 5: search
| `security_content_ctime(firstTime)`
Stage 6: search
| `security_content_ctime(lastTime)`
Stage 7: rename
| rename ComputerName as dest
Stage 8: search
| `wmi_permanent_event_subscription_filter`
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 | Binding |
| 3 | SCM |
| 3 | Event |
| 3 | Log |
| 3 | Consumer\"" |