Skip to content

Walks the CFG bitmap to find previously executable but currently hidden shellcode regions

Notifications You must be signed in to change notification settings

jdu2600/CFG-FindHiddenShellcode

Repository files navigation

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

About

Walks the CFG bitmap to find previously executable but currently hidden shellcode regions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages