Detection rules › Elastic
Potential Image Hollowing via Mapping
Identifies attempts to map the whole content of a file in a memory region with RWX permissions. This may indicate an attempt to perform module hollowing.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies attempts to map the whole content of a file in a memory region with RWX permissions. This may indicate an
attempt to perform module hollowing.
"""
id = "5cb45f1b-9061-4bdd-8e45-3cbef2dbf465"
license = "Elastic License v2"
name = "Potential Image Hollowing via Mapping"
os_list = ["windows"]
reference = [
"https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-mapviewoffile2",
"https://www.elastic.co/security-labs/dissecting-remcos-rat-part-four",
"https://www.elastic.co/security-labs/doubling-down-etw-callstacks",
]
version = "1.0.3"
query = '''
api where process.Ext.api.name in ("MapViewOfFile", "MapViewOfFile2") and
/* map the whole file to an executable memory region */
process.Ext.api.parameters.size == 0 and process.Ext.api.parameters.protection == "RWX" and
process.Ext.api.metadata.target_address_path like ("c:\\*.dll", "c:\\*.exe") and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown")
'''
min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[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.Ext.api.name in ("MapViewOfFile", "MapViewOfFile2") and
process.Ext.api.parameters.size == 0 and process.Ext.api.parameters.protection == "RWX" and
process.Ext.api.metadata.target_address_path like ("c:\\*.dll", "c:\\*.exe") and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack_final_user_module.name | in | Kernel, Unknown | excludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Kernel" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown" |
Indicators
These rows show field, operator, and value matches.