Early Remote Memory Allocation
Description
Identifies attempts to allocate remote memory into a target process early before the start of its initial thread, this behavior is often associated with remote process injection preparation.
Query · eql
sequence with maxspan=1m
[api where process.Ext.api.behaviors == "cross-process" and process.Ext.api.behaviors =="parent-child" and
process.Ext.api.name in ("VirtualAllocEx", "MapViewOfFile", "MapViewOfFile2") and
Target.process.Ext.token.integrity_level_name != "low" and process.thread.Ext.call_stack_summary != null and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
not process.thread.Ext.call_stack_final_user_module.name in ("Kernel", "Unknown", "Undetermined") and
not process.thread.Ext.call_stack_final_user_module.path like ("?:\\program files\\*", "?:\\program files (x86)\\*") and
process.thread.Ext.call_stack_final_user_module.protection_provenance != "Kernel" and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != "0ebf9d054ab20f8ce5ac2cd5f66244af4289faaac743bd616809d08cec78d6c2"] by process.entity_id, Target.process.entity_id
[process where event.action == "start"] by process.parent.entity_id, process.entity_id