WMI Permanent Event Subscription


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.

Query · spl

`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`

Implementation guide

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.

Analyst notes

Known false positives: Although unlikely, administrators may use event subscriptions for legitimate purposes.

Raw source WMI Permanent Event Subscription · SPL
Esc
Published by splunk/security_content ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
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

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.