Suspicious File Memory Mapping via Managed .NET


Description

Identifies attempts to map the content of a file in a memory region with RWX permissions from a Managed .NET application.

Query · eql

api where process.Ext.api.name == "MapViewOfFile" and process.Ext.api.parameters.protection == "RWX" and
 process.Ext.api.parameters.size >= 100000 and process.Ext.api.metadata.target_address_name == "Unbacked" and
 process.thread.Ext.call_stack_final_user_module.name == "system.core.ni.dll" and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info :"c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*")
Raw source Suspicious File Memory Mapping via Managed .NET · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Identifies attempts to map the content of a file in a memory region with RWX permissions from a Managed .NET
application.
"""
id = "6bd0cf1f-e3b9-4c09-884e-1a722f10326b"
license = "Elastic License v2"
name = "Suspicious File Memory Mapping via Managed .NET"
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 == "MapViewOfFile" and process.Ext.api.parameters.protection == "RWX" and
 process.Ext.api.parameters.size >= 100000 and process.Ext.api.metadata.target_address_name == "Unbacked" and
 process.thread.Ext.call_stack_final_user_module.name == "system.core.ni.dll" and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info :"c:\\windows\\sys?????\\kernelbase.dll!LoadLibrary*")
'''

min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.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.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.10.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.