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"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2024/03/28"
 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 = ["logs-endpoint.events.process-*", "winlogbeat-*", "logs-windows.*", "endgame-*", "logs-system.security*"]
18language = "eql"
19license = "Elastic License v2"
20name = "Persistence via WMI Event Subscription"
21references = ["https://www.elastic.co/security-labs/hunting-for-persistence-using-elastic-security-part-1"]
22risk_score = 21
23rule_id = "9b6813a1-daf1-457e-b0e6-0bb4e55b8a4c"
24setup = """## Setup
25
26If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
27events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
28Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
29`event.ingested` to @timestamp.
30For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
31"""
32severity = "low"
33tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Persistence", "Tactic: Execution", "Data Source: Elastic Endgame", "Data Source: Elastic Defend"]
34timestamp_override = "event.ingested"
35type = "eql"
36
37query = '''
38process where host.os.type == "windows" and event.type == "start" and
39  (process.name : "wmic.exe" or ?process.pe.original_file_name == "wmic.exe") and
40  process.args : "create" and
41  process.args : ("ActiveScriptEventConsumer", "CommandLineEventConsumer")
42'''
43
44
45[[rule.threat]]
46framework = "MITRE ATT&CK"
47[[rule.threat.technique]]
48id = "T1546"
49name = "Event Triggered Execution"
50reference = "https://attack.mitre.org/techniques/T1546/"
51[[rule.threat.technique.subtechnique]]
52id = "T1546.003"
53name = "Windows Management Instrumentation Event Subscription"
54reference = "https://attack.mitre.org/techniques/T1546/003/"
55
56
57
58[rule.threat.tactic]
59id = "TA0003"
60name = "Persistence"
61reference = "https://attack.mitre.org/tactics/TA0003/"
62
63[[rule.threat]]
64framework = "MITRE ATT&CK"
65
66[[rule.threat.technique]]
67id = "T1047"
68name = "Windows Management Instrumentation"
69reference = "https://attack.mitre.org/techniques/T1047/"
70
71[rule.threat.tactic]
72id = "TA0002"
73name = "Execution"
74reference = "https://attack.mitre.org/tactics/TA0002/"

References

Related rules

to-top