WMI Permanent Event Subscription - Sysmon

 Original Source: [splunk source]
Name:WMI Permanent Event Subscription - Sysmon
id:ad05aae6-3b2a-4f73-af97-57bd26cee3b9
version:13
date:None
author:Rico Valdez, Michael Haag, Splunk
status:production
type:Anomaly
Description:Detects the creation, modification or deletion of a WMI permanent event subscription using Sysmon EventID 21.
Data_source:
  • -Sysmon EventID 21
search:`sysmon`
EventCode=21
Operation IN (
Created,
Deleted,
Modified
)

| stats count min(_time) as firstTime
max(_time) as lastTime
BY dest user Consumer Filter

| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `wmi_permanent_event_subscription___sysmon_filter`


how_to_implement: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.
References:
  -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/
  -https://github.com/redcanaryco/atomic-red-team/blob/388942adbd9641f4dfdcf079d7efe9a75ec0ac43/atomics/T1546.003/T1546.003.yaml#L5
  -https://github.com/redcanaryco/atomic-red-team/blob/388942adbd9641f4dfdcf079d7efe9a75ec0ac43/atomics/T1546.003/T1546.003.yaml#L44
  -https://github.com/redcanaryco/atomic-red-team/blob/388942adbd9641f4dfdcf079d7efe9a75ec0ac43/atomics/T1546.003/T1546.003.yaml#L86
drilldown_searches:
 name:'View the detection results for - "$dest$" and "$user$"'
 search:'%original_detection_search% | search dest = "$dest$" user = "$user$"'
 earliest_offset:'$info_min_time$'
 latest_offset:'$info_max_time$'
 name:'View risk events for the last 7 days for - "$dest$" and "$user$"'
 search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$", "$user$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
 earliest_offset:'7d'
 latest_offset:'0'
analytic_story:['Suspicious WMI Use']

asset_type:Endpoint

mitre_attack_id:['T1546.003']

product:['Splunk Enterprise', 'Splunk Enterprise Security', 'Splunk Cloud']

category:endpoint

security_domain:endpoint

tags:

tests:
 name:'True Positive Test'
 attack_data:
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1546.003/atomic_red_team/windows-sysmon.log
  source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
  sourcetype: XmlWinEventLog
 test_type:'unit'
manual_test:None

Related Analytic Stories


Suspicious WMI Use