Name:WMI Permanent Event Subscription id:71bfdb13-f200-4c6c-b2c9-a2e07adf437d version:4 date:2024-10-17 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: drilldown_searches:
: tags: analytic_story: - 'Suspicious WMI Use' asset_type:Endpoint confidence:50 impact:50 message:tbd mitre_attack_id: - 'T1047' observable: name:'dest' type:'Hostname' - role: - 'Victim' product: - 'Splunk Enterprise' - 'Splunk Enterprise Security' - 'Splunk Cloud' required_fields: - '_time' - 'EventCode' - 'Message' - 'consumer' - 'ComputerName' risk_score:25 security_domain:endpoint