Detection rules › Elastic

Suspicious Executable Heap Allocation via CLR

Source
github.com/elastic/protections-artifacts

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.

MITRE ATT&CK coverage

TacticTechniques
Stealth

Rule body

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

Stages and Predicates

Stage 1: api

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)

Exclusions

The rule actively suppresses these predicates.

Indicators

These rows show field, operator, and value matches.