Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 1.62 KB

README.md

File metadata and controls

19 lines (11 loc) · 1.62 KB

screenshot

Detection of hidden shellcode via CFG bitmap anomalies

  1. Memory scanners can only reasonably scan executable memory regions.
  2. The kernel memory manager only stores the original protection and the current protection in the Virtual Address Descriptor (VAD) tree.

Gargoyle and similiar techniques use these facts and periodically toggle their memory protection to non-executable to hide from memory scanners.

However, Gabriel Landau observed that the Control Flow Guard (CFG) bitmap is only updated whenever a region is marked executable, and specifically that it is not updated when a region is marked non-executable. This means that the CFG bitmap (inadvertently) records the location of all private memory addresses that are, or have previously been, executable during the lifetime of the process.

This can be used to flag memory regions in CFG-enabled processes that have been changed from executable to non-executable. This makes protection fluctuation stand out beautifully in most host processes.

See [Black Hat Asia 2023] You Can Run, but You Can't Hide - Finding the Footprints of Hidden Shellcode for more details.

Related Work