Detection rules › Splunk

WMI Temporary Event Subscription

Status
experimental
Severity
medium
Group by
computer_name, query
Author
Rico Valdez, Splunk
Source
github.com/splunk/security_content

The following analytic detects the creation of WMI temporary event subscriptions. It leverages Windows Event Logs, specifically EventCode 5860, to identify these activities. This detection is significant because attackers often use WMI to execute commands, gather information, or maintain persistence within a compromised system. If confirmed malicious, this activity could allow an attacker to execute arbitrary code, escalate privileges, or persist in the environment. Analysts should review the specific WMI queries and assess their intent, considering potential false positives from legitimate administrative tasks.

MITRE ATT&CK coverage

Rule body splunk

name: WMI Temporary Event Subscription
id: 38cbd42c-1098-41bb-99cf-9d6d2b296d83
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 WMI temporary event subscriptions. It leverages Windows Event Logs, specifically EventCode 5860, to identify these activities. This detection is significant because attackers often use WMI to execute commands, gather information, or maintain persistence within a compromised system. If confirmed malicious, this activity could allow an attacker to execute arbitrary code, escalate privileges, or persist in the environment. Analysts should review the specific WMI queries and assess their intent, considering potential false positives from legitimate administrative tasks.
data_source: []
search: |-
    `wmi`
    EventCode=5860
    Temporary
    | rex field=Message "NotificationQuery =\s+(?<query>[^;|^$]+)"
    | search
        query!="FROM Win32_ProcessStartTrace WHERE ProcessName = 'wsmprovhost.exe'"
        AND
        query!="FROM __InstanceOperationEvent WHERE TargetInstance ISA 'AntiVirusProduct' OR TargetInstance ISA 'FirewallProduct' OR TargetInstance ISA 'AntiSpywareProduct'"
    | stats count min(_time) as firstTime
                  max(_time) as lastTime
      by ComputerName, query
    | `security_content_ctime(firstTime)`
    | `security_content_ctime(lastTime)`
    | `wmi_temporary_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: Some software may create WMI temporary event subscriptions for various purposes. The included search contains an exception for two of these that occur by default on Windows 10 systems. You may need to modify the search to create exceptions for other legitimate events.
references: []
finding:
    title: WMI Temporary 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=5860
Temporary

Stage 2: rex

| rex field=Message "NotificationQuery =\s+(?<query>[^;|^$]+)"

Stage 3: search

| search
    query!="FROM Win32_ProcessStartTrace WHERE ProcessName = 'wsmprovhost.exe'"
    AND
    query!="FROM __InstanceOperationEvent WHERE TargetInstance ISA 'AntiVirusProduct' OR TargetInstance ISA 'FirewallProduct' OR TargetInstance ISA 'AntiSpywareProduct'"

Stage 4: stats

| stats count min(_time) as firstTime
              max(_time) as lastTime
  by ComputerName, query

Stage 5: search

| `security_content_ctime(firstTime)`

Stage 6: search

| `security_content_ctime(lastTime)`

Stage 7: search

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

FieldKindValues
EventCodeeq
  • 5860
queryne
  • "FROM Win32_ProcessStartTrace WHERE ProcessName = 'wsmprovhost.exe'"
  • "FROM __InstanceOperationEvent WHERE TargetInstance ISA 'AntiVirusProduct' OR TargetInstance ISA 'FirewallProduct' OR TargetInstance ISA 'AntiSpywareProduct'"

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.

StageTerm
1Temporary