Detection rules › Elastic
Evasion via Multiple Memory Section Mapping
Identifies multiple calls to MapViewOfFile to manipulate the same section adddress and with RWX permissions. This may indicate an attempt to map a malicious private section at the same address of a legit one.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies multiple calls to MapViewOfFile to manipulate the same section adddress and with RWX permissions. This may
indicate an attempt to map a malicious private section at the same address of a legit one.
"""
id = "eab94afc-d8c0-41e6-964f-d396cb0cfbe4"
license = "Elastic License v2"
name = "Evasion via Multiple Memory Section Mapping"
os_list = ["windows"]
reference = ["https://github.com/oldboy21/SWAPPALA"]
version = "1.0.5"
query = '''
sequence by process.entity_id, process.Ext.api.parameters.address with maxspan=1m
[api where process.Ext.api.name in ("MapViewOfFile", "MapViewOfFile2") and process.Ext.api.parameters.protection == "RWX" and
process.Ext.api.parameters.size >= 10000 and process.executable != null and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != "85a6d48587500f6808c119838293e02b700e99035f8fd8dd0b49cc184ce66b6a"]
[api where process.Ext.api.name in ("MapViewOfFile", "MapViewOfFile2") and process.Ext.api.parameters.protection == "RWX"]
'''
min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
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
Ordered sequence: each step below must occur in order within 1m, correlated by process.Ext.api.parameters.address, process.entity_id.
Stage 1: api
[api where process.Ext.api.name in ("MapViewOfFile", "MapViewOfFile2") and process.Ext.api.parameters.protection == "RWX" and
process.Ext.api.parameters.size >= 10000 and process.executable != null and
_arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == false or $entry.exists == false) and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != "85a6d48587500f6808c119838293e02b700e99035f8fd8dd0b49cc184ce66b6a"]
Stage 2: api
[api where process.Ext.api.name in ("MapViewOfFile", "MapViewOfFile2") and process.Ext.api.parameters.protection == "RWX"]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.name | in |
| field:"process.Ext.api.name" kind:in |
process.Ext.api.parameters.protection | eq |
| field:"process.Ext.api.parameters.protection" kind:eq value:"RWX" |
process.Ext.api.parameters.size | ge |
| field:"process.Ext.api.parameters.size" kind:ge value:"10000" |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | ne |
| field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" kind:ne value:"85a6d48587500f6808c119838293e02b700e99035f8fd8dd0b49cc184ce66b6a" |