Detection: WMI Permanent Event Subscription - Sysmon

Description

Detects the creation, modification or deletion of a WMI permanent event subscription using Sysmon EventID 21.

 1`sysmon`
 2EventCode=21
 3Operation IN (
 4    Created,
 5    Deleted,
 6    Modified
 7)
 8
 9
10| stats count min(_time) as firstTime
11              max(_time) as lastTime
12    BY dest user Consumer Filter
13
14
15| `security_content_ctime(firstTime)`
16
17| `security_content_ctime(lastTime)`
18
19| `wmi_permanent_event_subscription___sysmon_filter`

Data Source

Name Platform Sourcetype Source
Sysmon EventID 21 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'

Macros Used

Name Value
sysmon (source=WinEventLog:Microsoft-Windows-Sysmon/Operational OR source=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational OR source=Syslog:Linux-Sysmon/Operational)
wmi_permanent_event_subscription___sysmon_filter search *
wmi_permanent_event_subscription___sysmon_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1546.003 Windows Management Instrumentation Event Subscription Persistence
Exploitation
Installation
DE.AE
CIS 10

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Finding (Notable) No
Creates Intermediate Finding (Risk Event) Yes
Anomaly detections generate Intermediate Findings (Risk Events). They do not generate a Finding (Notable) directly.

Implementation

To successfully implement this search, you must be collecting Sysmon data using Sysmon version 6.1 or greater and have Sysmon configured to generate alerts for WMI activity (eventID= 19, 20, 21). In addition, you must have at least version 6.0.4 of the Sysmon TA installed to properly parse the fields.

Known False Positives

Administrators and software may create authorized WMI subscriptions. Review the consumer and filter paths, then tune known authorized subscriptions with the detection filter macro.

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
A WMI consumer-to-filter binding was on [$dest$] by [$user$] consumer - [$Consumer$] was bound to filter [$Filter$]. dest system 50

References

Atomic Tests

Learn more about Atomic Red Team tests here.

Atomic Test ID Atomic Test Name Supported Platform
3c64f177-28e2-49eb-a799-d767b24dd1e0 Persistence via WMI Event Subscription - CommandLineEventConsumer Windows
fecd0dfd-fb55-45fa-a10b-6250272d0832 Persistence via WMI Event Subscription - ActiveScriptEventConsumer Windows
29786d7e-8916-4de6-9c55-be7b093b2706 Windows MOFComp.exe Load MOF File Windows

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation ✅ Passing N/A N/A N/A
Unit ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog
Integration ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub |

Version: 13