Windows Script Interpreter Executing Process via WMI

Identifies use of the built-in Windows script interpreters (cscript.exe or wscript.exe) being used to execute a process via Windows Management Instrumentation (WMI). This may be indicative of malicious activity.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/11/27"
 3integration = ["endpoint", "windows"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2024/04/08"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies use of the built-in Windows script interpreters (cscript.exe or wscript.exe) being used to execute a process
13via Windows Management Instrumentation (WMI). This may be indicative of malicious activity.
14"""
15from = "now-9m"
16index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-endpoint.events.library-*", "logs-windows.sysmon_operational-*", "endgame-*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Windows Script Interpreter Executing Process via WMI"
20risk_score = 47
21rule_id = "b64b183e-1a76-422d-9179-7b389513e74d"
22severity = "medium"
23tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Initial Access", "Tactic: Execution", "Data Source: Elastic Endgame", "Data Source: Elastic Defend", "Data Source: Sysmon"]
24type = "eql"
25
26query = '''
27sequence by host.id with maxspan = 5s
28    [any where host.os.type == "windows" and 
29     (event.category : ("library", "driver") or (event.category == "process" and event.action : "Image loaded*")) and
30     (?dll.name : "wmiutils.dll" or file.name : "wmiutils.dll") and process.name : ("wscript.exe", "cscript.exe")]
31    [process where host.os.type == "windows" and event.type == "start" and
32     process.parent.name : "wmiprvse.exe" and
33     user.domain != "NT AUTHORITY" and
34     (process.pe.original_file_name :
35        (
36          "cscript.exe",
37          "wscript.exe",
38          "PowerShell.EXE",
39          "Cmd.Exe",
40          "MSHTA.EXE",
41          "RUNDLL32.EXE",
42          "REGSVR32.EXE",
43          "MSBuild.exe",
44          "InstallUtil.exe",
45          "RegAsm.exe",
46          "RegSvcs.exe",
47          "msxsl.exe",
48          "CONTROL.EXE",
49          "EXPLORER.EXE",
50          "Microsoft.Workflow.Compiler.exe",
51          "msiexec.exe"
52        ) or
53      process.executable : ("C:\\Users\\*.exe", "C:\\ProgramData\\*.exe")
54     )
55    ]
56'''
57
58
59[[rule.threat]]
60framework = "MITRE ATT&CK"
61[[rule.threat.technique]]
62id = "T1566"
63name = "Phishing"
64reference = "https://attack.mitre.org/techniques/T1566/"
65[[rule.threat.technique.subtechnique]]
66id = "T1566.001"
67name = "Spearphishing Attachment"
68reference = "https://attack.mitre.org/techniques/T1566/001/"
69
70
71
72[rule.threat.tactic]
73id = "TA0001"
74name = "Initial Access"
75reference = "https://attack.mitre.org/tactics/TA0001/"
76
77
78[[rule.threat]]
79framework = "MITRE ATT&CK"
80[[rule.threat.technique]]
81id = "T1059"
82name = "Command and Scripting Interpreter"
83reference = "https://attack.mitre.org/techniques/T1059/"
84[[rule.threat.technique.subtechnique]]
85id = "T1059.005"
86name = "Visual Basic"
87reference = "https://attack.mitre.org/techniques/T1059/005/"
88
89[[rule.threat.technique]]
90id = "T1047"
91name = "Windows Management Instrumentation"
92reference = "https://attack.mitre.org/techniques/T1047/"
93
94
95[rule.threat.tactic]
96id = "TA0002"
97name = "Execution"
98reference = "https://attack.mitre.org/tactics/TA0002/"

Related rules

to-top