Detection rules › Elastic

Remote MSI Package Installation via MSIEXEC

Time window
1m
Source
github.com/elastic/protections-artifacts

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

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of the built-in Windows Installer, MSIEXEC, to install a remote package. Adversaries may abuse
msiexec.exe to launch local or network accessible MSI files.
"""
id = "706bf4ca-45b7-4eb1-acae-b1228124594a"
license = "Elastic License v2"
name = "Remote MSI Package Installation via MSIEXEC"
os_list = ["windows"]
reference = [
    "https://lolbas-project.github.io/lolbas/Binaries/Msiexec/",
    "https://www.guardicore.com/labs/purple-fox-rootkit-now-propagates-as-a-worm/",
]
version = "1.0.32"

query = '''
sequence with maxspan=1m
  [registry where process.name : "msiexec.exe" and
    registry.value : "InstallSource" and registry.data.strings : "http*" and
    not registry.data.strings : "https://statics.teams.cdn.office.net/*"]
  [process where event.action == "start" and user.id : ("S-1-5-21*", "S-1-12-*") and
    descendant of [process where process.name : "msiexec.exe"]  and
    not (process.executable : ("?:\\Program Files (x86)\\*.exe", "?:\\Program Files\\*.exe") and process.code_signature.trusted == true) and
    not process.executable : ("?:\\Windows\\System32\\MsiExec.exe", "?:\\Windows\\syswow64\\MsiExec.exe", "?:\\WINDOWS\\Installer\\MSI*.tmp",
                              "C:\\Program Files (x86)\\AMS Services\\TransactNOW\\OALaunch.exe") and
    not (process.code_signature.subject_name : ("Ellie Mae, Inc.", "Chatgenie LLC") and process.code_signature.trusted == true)]
'''

min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.007"
name = "Msiexec"
reference = "https://attack.mitre.org/techniques/T1218/007/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: registry

[registry where process.name : "msiexec.exe" and
    registry.value : "InstallSource" and registry.data.strings : "http*" and
    not registry.data.strings : "https://statics.teams.cdn.office.net/*"]

Stage 2: process

[process where event.action == "start" and user.id : ("S-1-5-21*", "S-1-12-*") and
    descendant of [process where process.name : "msiexec.exe"]  and
    not (process.executable : ("?:\\Program Files (x86)\\*.exe", "?:\\Program Files\\*.exe") and process.code_signature.trusted == true) and
    not process.executable : ("?:\\Windows\\System32\\MsiExec.exe", "?:\\Windows\\syswow64\\MsiExec.exe", "?:\\WINDOWS\\Installer\\MSI*.tmp",
                              "C:\\Program Files (x86)\\AMS Services\\TransactNOW\\OALaunch.exe") and
    not (process.code_signature.subject_name : ("Ellie Mae, Inc.", "Chatgenie LLC") and process.code_signature.trusted == true)]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
registry.data.stringsstarts_withhttps://statics.teams.cdn.office.net/excludes:registry.data.strings field:"registry.data.strings" value:"https://statics.teams.cdn.office.net/"
process.code_signature.subject_nameeqEllie Mae, Inc., Chatgenie LLCexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Ellie Mae, Inc." field:"process.code_signature.subject_name" value:"Chatgenie LLC"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Program Files (x86)\*.exe, ?:\Program Files\*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\*.exe" field:"process.executable" value:"?:\Program Files\*.exe"
process.executablewildcard?:\Windows\System32\MsiExec.exe, ?:\Windows\syswow64\MsiExec.exe, ?:\WINDOWS\Installer\MSI*.tmp, C:\Program Files (x86)\AMS Services\TransactNOW\OALaunch.exeexcludes:process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.namewildcard
  • msiexec.exe corpus 46 (elastic 41, splunk 5)
field:"process_name" kind:wildcard value:"msiexec.exe"
registry.data.stringswildcard
  • http*
field:"Details" kind:wildcard value:"http*"
registry.valuewildcard
  • InstallSource corpus 2 (elastic 2)
field:"registry_value_name" kind:wildcard value:"InstallSource"
user.idwildcard
  • S-1-12-* corpus 46 (elastic 46)
  • S-1-5-21* corpus 47 (elastic 47)
field:"user.id" kind:wildcard