Detection rules › Elastic

Suspicious Memory Mapping from a Windows Installer

Source
github.com/elastic/protections-artifacts

Identifies suspicious API calls from a Windows Installer module. This behavior is consistent with code injection attacks.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies suspicious API calls from a Windows Installer module. This behavior is consistent with code injection
attacks.
"""
id = "1604d90a-3fa2-494e-987b-f5196186c4b0"
license = "Elastic License v2"
name = "Suspicious Memory Mapping from a Windows Installer"
os_list = ["windows"]
version = "1.0.3"

query = '''
api where
   process.parent.executable : "C:\\Windows\\Sys?????\\msiexec.exe" and
   process.Ext.api.name in ("MapViewOfFile", "MapViewOfFile2") and
   process.Ext.api.parameters.size >= 100000 and process.Ext.api.parameters.protection in ("RWX", "R-X") and
   _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
   _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\Sys?????\\ntdll.dll!NtMapViewOfSection*")
'''

min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"

[[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 = "8.10.0"

Stages and Predicates

Stage 1: api

api where
   process.parent.executable : "C:\\Windows\\Sys?????\\msiexec.exe" and
   process.Ext.api.name in ("MapViewOfFile", "MapViewOfFile2") and
   process.Ext.api.parameters.size >= 100000 and process.Ext.api.parameters.protection in ("RWX", "R-X") and
   _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
   _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\Sys?????\\ntdll.dll!NtMapViewOfSection*")

Indicators

These rows show field, operator, and value matches.