Windows API reference
NtAllocateVirtualMemory
Reserves, commits, or changes the state of a region of pages in the user-mode virtual address space of a specified process.
- Library
- Ntdll.dll
- Category
- Injection, Memory Management
- Suspicion
- high
- MITRE ATT&CK
- T1055 Process Injection
Detection summary
Malware uses NtAllocateVirtualMemory to stage shellcode or a PE in a remote process, often requesting PAGE_EXECUTE_READWRITE or allocating RW and later flipping to RX; detect ETW-TI remote-allocation events, EDR kernel callbacks, private executable memory not backed by an image, and sequences with NtWriteVirtualMemory, NtProtectVirtualMemory and NtCreateThreadEx. Direct or indirect syscalls can bypass user-mode hooks, so kernel telemetry and memory scanning are primary.
- Sysmon: No Sysmon event mapped
- ETW: Microsoft-Windows-Threat-Intelligence
- Notes: Sysmon does not log VirtualAlloc or NtAllocateVirtualMemory directly. Microsoft-Windows-Threat-Intelligence exposes remote memory operations only when the provider is enabled and supported by the EDR.
Sources and documentation
- Microsoft Learn documentation (direct documentation)
Not yet human-reviewed. Page metadata generated .
Legitimate use
Memory managers, runtimes, debuggers and security tools that allocate virtual memory natively.
Related APIs
- VirtualAllocEx — Kernel32.dll