Potential Remote File Execution via MSIEXEC

Identifies the execution of the built-in Windows Installer, msiexec.exe, to install a remote package. Adversaries may abuse msiexec.exe to launch local or network accessible MSI files.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2023/09/28"
 3integration = ["endpoint"]
 4maturity = "production"
 5updated_date = "2024/05/21"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10Identifies the execution of the built-in Windows Installer, msiexec.exe, to install a remote package. Adversaries may
11abuse msiexec.exe to launch local or network accessible MSI files.
12"""
13from = "now-9m"
14index = ["logs-endpoint.events.process-*", "logs-endpoint.events.network-*"]
15language = "eql"
16license = "Elastic License v2"
17name = "Potential Remote File Execution via MSIEXEC"
18risk_score = 21
19rule_id = "3e441bdb-596c-44fd-8628-2cfdf4516ada"
20severity = "low"
21tags = [
22    "Domain: Endpoint",
23    "OS: Windows",
24    "Use Case: Threat Detection",
25    "Tactic: Initial Access",
26    "Tactic: Defense Evasion",
27    "Data Source: Elastic Defend",
28]
29type = "eql"
30
31query = '''
32sequence with maxspan=1m
33 [process where host.os.type == "windows" and event.action == "start" and
34    process.name : "msiexec.exe" and process.args : "/V"] by process.entity_id
35 [network where host.os.type == "windows" and process.name : "msiexec.exe" and
36    event.action == "connection_attempted"] by process.entity_id
37 [process where host.os.type == "windows" and event.action == "start" and
38  process.parent.name : "msiexec.exe" and user.id : ("S-1-5-21-*", "S-1-5-12-1-*") and
39  not process.executable : ("?:\\Windows\\SysWOW64\\msiexec.exe",
40                            "?:\\Windows\\System32\\msiexec.exe",
41                            "?:\\Windows\\System32\\srtasks.exe",
42                            "?:\\Windows\\SysWOW64\\srtasks.exe",
43                            "?:\\Windows\\System32\\taskkill.exe",
44                            "?:\\Windows\\Installer\\MSI*.tmp",
45                            "?:\\Program Files\\*.exe",
46                            "?:\\Program Files (x86)\\*.exe",
47                            "?:\\Windows\\System32\\ie4uinit.exe",
48                            "?:\\Windows\\SysWOW64\\ie4uinit.exe",
49                            "?:\\Windows\\System32\\sc.exe",
50                            "?:\\Windows\\system32\\Wbem\\mofcomp.exe",
51                            "?:\\Windows\\twain_32\\fjscan32\\SOP\\crtdmprc.exe",
52                            "?:\\Windows\\SysWOW64\\taskkill.exe",
53                            "?:\\Windows\\SysWOW64\\schtasks.exe",
54                            "?:\\Windows\\system32\\schtasks.exe",
55                            "?:\\Windows\\System32\\sdbinst.exe") and
56  not (process.code_signature.subject_name == "Citrix Systems, Inc." and process.code_signature.trusted == true) and
57  not (process.name : ("regsvr32.exe", "powershell.exe", "rundll32.exe", "wscript.exe") and
58       process.Ext.token.integrity_level_name == "high" and
59       process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")) and
60  not (process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and process.code_signature.trusted == true) and
61  not (process.name : "rundll32.exe" and process.args : "printui.dll,PrintUIEntry")
62  ] by process.parent.entity_id
63'''
64
65
66[[rule.threat]]
67framework = "MITRE ATT&CK"
68[[rule.threat.technique]]
69id = "T1566"
70name = "Phishing"
71reference = "https://attack.mitre.org/techniques/T1566/"
72[[rule.threat.technique.subtechnique]]
73id = "T1566.002"
74name = "Spearphishing Link"
75reference = "https://attack.mitre.org/techniques/T1566/002/"
76
77
78
79[rule.threat.tactic]
80id = "TA0001"
81name = "Initial Access"
82reference = "https://attack.mitre.org/tactics/TA0001/"
83[[rule.threat]]
84framework = "MITRE ATT&CK"
85[[rule.threat.technique]]
86id = "T1218"
87name = "System Binary Proxy Execution"
88reference = "https://attack.mitre.org/techniques/T1218/"
89[[rule.threat.technique.subtechnique]]
90id = "T1218.007"
91name = "Msiexec"
92reference = "https://attack.mitre.org/techniques/T1218/007/"
93
94
95
96[rule.threat.tactic]
97id = "TA0005"
98name = "Defense Evasion"
99reference = "https://attack.mitre.org/tactics/TA0005/"

Related rules

to-top