Suspicious Executable Heap Allocation via CLR


Description

Identifies attempts to allocate large RWX heap memory from native code, this may indicate an attempt to execute assembly payload via Microsoft Common Language Runtime DLL.

Query · eql

api where process.Ext.api.name == "VirtualAlloc" and process.Ext.api.parameters.size >= 100000 and
 process.Ext.api.parameters.protection == "RWX" and process.thread.Ext.call_stack_final_user_module.name == "mscoreei.dll" and
 process.thread.Ext.call_stack_summary regex """ntdll.dll\|kernelbase.dll\|mscoreei.dll\|clr.dll\|[a-z0-9]+\.(dll|exe)""" and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "c:\\windows\\microsoft.net\\framework64\\*\\mscoreei.dll!GetProcessExecutableHeap*") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "c:\\windows\\microsoft.net\\framework64\\*\\clr.dll!GetClassActivatorForApplicationImpl*") and
 not (process.executable : "C:\\Program Files\\ASM Technologies\\ASMTower*\\ASMTower.exe" and
      process.code_signature.subject_name == "ASM Technologies" and process.code_signature.trusted == true)
Raw source Suspicious Executable Heap Allocation via CLR · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Identifies attempts to allocate large RWX heap memory from native code, this may indicate an attempt to execute assembly
payload via Microsoft Common Language Runtime DLL.
"""
id = "98e95014-ee8c-429a-9ff0-359c80d9ec8d"
license = "Elastic License v2"
name = "Suspicious Executable Heap Allocation via CLR"
os_list = ["windows"]
version = "1.0.3"

query = '''
api where process.Ext.api.name == "VirtualAlloc" and process.Ext.api.parameters.size >= 100000 and
 process.Ext.api.parameters.protection == "RWX" and process.thread.Ext.call_stack_final_user_module.name == "mscoreei.dll" and
 process.thread.Ext.call_stack_summary regex """ntdll.dll\|kernelbase.dll\|mscoreei.dll\|clr.dll\|[a-z0-9]+\.(dll|exe)""" and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "c:\\windows\\microsoft.net\\framework64\\*\\mscoreei.dll!GetProcessExecutableHeap*") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "c:\\windows\\microsoft.net\\framework64\\*\\clr.dll!GetClassActivatorForApplicationImpl*") and
 not (process.executable : "C:\\Program Files\\ASM Technologies\\ASMTower*\\ASMTower.exe" and
      process.code_signature.subject_name == "ASM Technologies" and process.code_signature.trusted == true)
'''

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.