Windows API reference
NtProtectVirtualMemory
Changes the protection of committed pages in a specified process virtual address space; the native equivalent of VirtualProtectEx.
- Library
- Ntdll.dll
- Category
- Injection, Memory Management
- Suspicion
- high
- MITRE ATT&CK
- T1055 Process Injection
Detection summary
Commonly used to flip shellcode pages from RW to RX or RWX after NtWriteVirtualMemory; detect ETW-TI protection-change events, private executable memory, PAGE_EXECUTE_READWRITE allocations, and allocation-write-protect-thread/APC sequences. EDR memory scans should flag executable regions not backed by a mapped image. Direct syscalls bypass user-mode hooks.
- Sysmon: No Sysmon event mapped
- ETW: Microsoft-Windows-Threat-Intelligence
- Notes: No Sysmon event is emitted for protection changes; Sysmon 10 only covers process-handle acquisition. ETW-TI or EDR kernel callbacks are required.
Sources and documentation
- Microsoft Learn documentation (equivalent API documentation)
Not yet human-reviewed. Page metadata generated .
Legitimate use
Runtimes, debuggers and security tools that change memory protection natively.
Related APIs
- VirtualProtect — Kernel32.dll