Bootkit that infects the kernel via SSDT hooking
- Uses UEFI TSL phase for infecting kernel
- Image is Boot Service Driver so will be automatically unloaded before boot
- Bypasses PatchGuard by hooking SSDT pre-initialization
- Tiny binary only 3 KB in size
- Makes SSDT hook by modifying
KiServiceTableto redirect syscalls before kernel initialization. - Injects payload into unused
PAGEsection padding to evade.textdisk-memory comparisons. - Retrieves usermode arguments via usermode stack
GS:[UserRSP]from_KPCR. - Executes kernel functions from usermode via hooked
NtShutdownSystemsyscall.
- Hooks
ExitBootServicesto intercept boot process exit.
- Calls
BlpArchSwitchContextto access virtual memory. - Scans
OslLoaderBlockto findntoskrnl.exebase address. - Injects payload into
PAGEsection padding. - SSDT Manipulation:
- Resolves
KiServiceTablevia manual kernel traversal. - Overwrites
NtShutdownSystementry to point to the payload.
- Resolves
- Restores original
ExitBootServiceshook and firmware context.
- Retrieves usermode arguments via usermode stack
GS:[UserRSP]from_KPCR. - Can execute any kernel function (e.g.
MmCopyVirtualMemory). - Preserves original
NtShutdownSystemfunctionality to avoid suspicion.
Full explanation on how it works u can find here.
Bootkit bootkit;
uint64_t current_process = bootkit.call("PsGetCurrentProcess");- Tested on Windows 10 22H2.
- Patterns can require updates for other OS versions.
- Inspired by ekknod SubGetVariable project.

