How etwti-fluctuationmonitor detects hidden shellcode
mainThe monitor detects hidden shellcode by identifying violations of the 'immutable code page' principle. In secure environments, memory protection for code pages should only progress from Read/Write (RW) to Read/Execute (RX).
While Windows enforces this for the kernel (via PatchGuard) and user-mode images (via Arbitrary Code Guard), it does not protect private user-mode executable code like JIT (Just-In-Time) compilers.
The monitor watches for two specific suspicious transitions using Microsoft-Windows-Threat-Intelligence ETW events:
- Executable memory being changed to non-executable.
- Executable memory changing from non-writable to writable.
To minimize false positives caused by legitimate JIT memory reuse or API hooking, the monitor uses a frequency-based heuristic: it only alerts if these transitions occur more than once for a given memory region.