Persistence via WMI Event Subscription
An adversary can use Windows Management Instrumentation (WMI) to install event filters, providers, consumers, and bindings that execute code when a defined event occurs. Adversaries may use the capabilities of WMI to subscribe to an event and execute arbitrary code when that event occurs, providing persistence on a system.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/12/04"
3integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
4maturity = "production"
5updated_date = "2024/11/02"
6min_stack_version = "8.14.0"
7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
8
9[rule]
10author = ["Elastic"]
11description = """
12An adversary can use Windows Management Instrumentation (WMI) to install event filters, providers, consumers, and
13bindings that execute code when a defined event occurs. Adversaries may use the capabilities of WMI to subscribe to an
14event and execute arbitrary code when that event occurs, providing persistence on a system.
15"""
16from = "now-9m"
17index = [
18 "logs-endpoint.events.process-*",
19 "winlogbeat-*",
20 "logs-windows.forwarded*",
21 "logs-windows.sysmon_operational-*",
22 "endgame-*",
23 "logs-system.security*",
24 "logs-m365_defender.event-*",
25 "logs-sentinel_one_cloud_funnel.*",
26 "logs-crowdstrike.fdr*",
27]
28language = "eql"
29license = "Elastic License v2"
30name = "Persistence via WMI Event Subscription"
31references = ["https://www.elastic.co/security-labs/hunting-for-persistence-using-elastic-security-part-1"]
32risk_score = 21
33rule_id = "9b6813a1-daf1-457e-b0e6-0bb4e55b8a4c"
34severity = "low"
35tags = [
36 "Domain: Endpoint",
37 "OS: Windows",
38 "Use Case: Threat Detection",
39 "Tactic: Persistence",
40 "Tactic: Execution",
41 "Data Source: Elastic Endgame",
42 "Data Source: Elastic Defend",
43 "Data Source: System",
44 "Data Source: Microsoft Defender for Endpoint",
45 "Data Source: Sysmon",
46 "Data Source: SentinelOne",
47 "Data Source: Crowdstrike",
48]
49timestamp_override = "event.ingested"
50type = "eql"
51
52query = '''
53process where host.os.type == "windows" and event.type == "start" and
54 (process.name : "wmic.exe" or ?process.pe.original_file_name == "wmic.exe") and
55 process.args : "create" and
56 process.args : ("ActiveScriptEventConsumer", "CommandLineEventConsumer")
57'''
58
59
60[[rule.threat]]
61framework = "MITRE ATT&CK"
62[[rule.threat.technique]]
63id = "T1546"
64name = "Event Triggered Execution"
65reference = "https://attack.mitre.org/techniques/T1546/"
66[[rule.threat.technique.subtechnique]]
67id = "T1546.003"
68name = "Windows Management Instrumentation Event Subscription"
69reference = "https://attack.mitre.org/techniques/T1546/003/"
70
71
72
73[rule.threat.tactic]
74id = "TA0003"
75name = "Persistence"
76reference = "https://attack.mitre.org/tactics/TA0003/"
77[[rule.threat]]
78framework = "MITRE ATT&CK"
79[[rule.threat.technique]]
80id = "T1047"
81name = "Windows Management Instrumentation"
82reference = "https://attack.mitre.org/techniques/T1047/"
83
84
85[rule.threat.tactic]
86id = "TA0002"
87name = "Execution"
88reference = "https://attack.mitre.org/tactics/TA0002/"
References
Related rules
- Web Shell Detection: Script Process Child of Common Web Processes
- New ActiveSyncAllowedDeviceID Added via PowerShell
- Execution of COM object via Xwizard
- Execution via MSSQL xp_cmdshell Stored Procedure
- ScreenConnect Server Spawning Suspicious Processes