Detect WMI Event Subscription Persistence
Description
The following analytic identifies the creation of WMI Event Subscriptions, which can be used to establish persistence or perform privilege escalation. It detects EventID 19 (EventFilter creation), EventID 20 (EventConsumer creation), and EventID 21 (FilterToConsumerBinding creation) from Sysmon logs. This activity is significant because WMI Event Subscriptions can execute code with elevated SYSTEM privileges, making it a powerful persistence mechanism. If confirmed malicious, an attacker could maintain long-term access, escalate privileges, and execute arbitrary code, posing a severe threat to the environment.
- Type: TTP
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2024-05-15
- Author: Michael Haag, Splunk
- ID: 01d9a0c2-cece-11eb-ab46-acde48001122
Annotations
ATT&CK
Kill Chain Phase
- Exploitation
- Installation
NIST
- DE.CM
CIS20
- CIS 10
CVE
Search
1
2
3
4
5
6
`sysmon` EventID=20
| stats count min(_time) as firstTime max(_time) as lastTime by Computer User Destination
| rename Computer as dest
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `detect_wmi_event_subscription_persistence_filter`
Macros
The SPL above uses the following Macros:
detect_wmi_event_subscription_persistence_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Required fields
List of fields required to use this analytic.
- _time
- Destination
- dest
- User
How To Implement
To successfully implement this search, you need to be ingesting logs with that provide WMI Event Subscription from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA and have enabled EventID 19, 20 and 21. Tune and filter known good to limit the volume.
Known False Positives
It is possible some applications will create a consumer and may be required to be filtered. For tuning, add any additional LOLBin's for further depth of coverage.
Associated Analytic Story
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
63.0 | 70 | 90 | Possible malicious WMI Subscription created on $dest$ |
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.
Reference
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1546.003/T1546.003.md
- https://www.eideon.com/2018-03-02-THL03-WMIBackdoors/
- https://github.com/trustedsec/SysmonCommunityGuide/blob/master/chapters/WMI-events.md
- https://in.security/2019/04/03/an-intro-into-abusing-and-identifying-wmi-event-subscriptions-for-persistence/
Test Dataset
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 | version: 2