scanrootkit

Kernel Mode Rootkits: How They Work and How Windows Fights Back

A kernel mode rootkit runs inside the operating system kernel, the core of the system that manages memory, processes, drivers and hardware. Ordinary programs, including most of your security software, run above it in user mode and depend on the kernel to tell them the truth. A rootkit in the kernel decides what that truth is.

That is why kernel rootkits are the classic hard case. This guide explains how they get in, the techniques they have used to hide, and the protections Microsoft built in response. For the wider picture of rootkit layers, see types of rootkits.

How a kernel mode rootkit gets into the kernel

On Windows, the normal way to run code in the kernel is to load a device driver. Drivers exist for good reasons: graphics cards, storage controllers, VPNs, antivirus and anti-cheat software all need kernel access. A rootkit uses the same door. It needs administrator rights to install a driver, which is why it usually arrives after another piece of malware or an exploit has already taken control of the account.

Once the driver loads, it runs with the same privilege as Windows itself. There is no higher authority on the running machine to check its work, short of a hypervisor or the firmware.

On Linux, the equivalent is a loadable kernel module (LKM), covered briefly at the end of this page.

How kernel rootkits hide

Kernel rootkits have used a few broad techniques. The details matter less than the idea: each one edits the system’s own records or intercepts the system’s own answers.

SSDT hooking

The System Service Descriptor Table (SSDT) is the kernel’s lookup table for system calls. When a program asks to list files or open a registry key, Windows looks up the matching kernel function in this table. Early Windows rootkits overwrote entries in it so the calls went to the rootkit first, which filtered the results before passing them on.

Direct kernel object manipulation (DKOM)

Windows keeps track of running processes in a linked list of kernel structures. DKOM edits those structures directly, for example unlinking a process from the list so tools that walk the list never see it, while the scheduler keeps running it. There is no hook to find, only a structure that is quietly wrong.

Filter drivers and callbacks

Windows lets drivers register as filters on the file system or network stack, and to receive callbacks when processes start. Security software relies on these features. A rootkit can use the same supported mechanisms to hide files or block security tools, which is harder to flag because nothing is technically patched.

Why PatchGuard ended SSDT hooking on 64-bit Windows

Microsoft introduced Kernel Patch Protection, better known as PatchGuard, in 2005 with the x64 editions of Windows Server 2003 SP1 and Windows XP Professional x64 Edition. It periodically checks critical kernel code and structures, including the SSDT, and deliberately crashes the system with a bug check if it finds them modified.

That made SSDT hooking unusable on 64-bit Windows. It also broke some legitimate security products that had been patching the kernel the same way, which is why Microsoft added supported filter and callback interfaces instead. PatchGuard is not a complete barrier: code already running in the kernel can, in principle, interfere with it, and researchers have published bypasses over the years. But it raised the cost of the old techniques enough that most 64-bit Windows threats moved elsewhere, including into the boot process (see bootkits and firmware rootkits).

Driver signature enforcement

64-bit Windows refuses to load kernel drivers that are not digitally signed. From Windows 10 version 1607, new installations with Secure Boot on only load new kernel drivers that Microsoft has signed through its Hardware Dev Center portal, not just any code-signing certificate.

Attackers have worked around signing in three ways:

BYOVD: bring your own vulnerable driver

Many legitimate drivers from hardware and utility vendors contain bugs that let any program ask the driver to read or write kernel memory. These drivers are properly signed, so Windows loads them. In a BYOVD attack, the attacker installs one of these old signed drivers on purpose, then uses its flaw to do what an unsigned rootkit driver could not: switch off security software, remove kernel callbacks, or load further code.

Documented cases include:

BYOVD is the reason driver signing is no longer enough on its own, and the reason for the blocklist below.

Modern Windows defenses

Memory integrity (HVCI)

Memory integrity, also called hypervisor-protected code integrity (HVCI), uses the Windows hypervisor to run the code-integrity checks in an isolated environment the normal kernel cannot modify. Even code running in the kernel cannot mark its own memory as executable without passing those checks. Microsoft says it is on by default on most new Windows 11 devices.

To check it: Windows Security > Device security > Core isolation details > Memory integrity. It needs hardware virtualization enabled in the UEFI settings. If an old driver is incompatible, Windows will list it and leave memory integrity off until the driver is removed or updated.

Microsoft vulnerable driver blocklist

Microsoft maintains a list of known vulnerable and malicious drivers that Windows refuses to load. Starting with Windows 11 version 22H2, the blocklist is on by default on all devices, and it is also enforced whenever memory integrity, Smart App Control or S mode is active. The toggle sits on the same Core isolation page in Windows Security.

Microsoft is clear that the list does not catch every vulnerable driver, and it is updated only a few times a year with major Windows releases (it is also available as an optional update). It narrows the BYOVD window rather than closing it.

Secure Boot and Measured Boot

Secure Boot checks the signature of each piece of boot code so a bootkit cannot load ahead of Windows and switch off the protections above. Windows 11 requires UEFI firmware that is Secure Boot capable, along with TPM 2.0. Measured Boot records what loaded in the TPM, which lets security tools check later whether the boot chain was altered.

Defense What it stops Where to check
PatchGuard Patching core kernel code and tables Always on in 64-bit Windows
Driver signing Loading unsigned drivers Always on in 64-bit Windows
Memory integrity (HVCI) Unsigned code running in kernel memory Windows Security > Device security > Core isolation
Vulnerable driver blocklist Known vulnerable signed drivers (BYOVD) Same Core isolation page
Secure Boot Bootkits loading before Windows UEFI settings; msinfo32 shows Secure Boot State

Linux LKM rootkits

On Linux, kernel rootkits usually take the form of a loadable kernel module that hooks system calls or kernel functions to hide processes, files and network connections, much like their Windows cousins. Several open-source research projects exist; the famous rootkits guide covers Singularity, a public research LKM rootkit for 6.x kernels that hooks system calls through the kernel’s own ftrace feature.

The main defenses are:

You can see the current lockdown mode in /sys/kernel/security/lockdown. The checks for a suspected infection are in Linux rootkit detection.

If you suspect a kernel rootkit

The rootkit controls what the running system reports, so trust a view from outside it:

  1. Disconnect from the network and change important passwords from a different, clean device.
  2. Run an offline rootkit scan, such as Microsoft Defender Offline, which scans before Windows and its drivers load.
  3. If a kernel rootkit is confirmed, back up your documents and do a full wipe and reinstall. Cleaning a kernel infection in place leaves you guessing what else it changed.

The full process is in how to remove a rootkit, and the Windows-specific checks are in Windows rootkit detection.

Frequently asked questions

What is a kernel mode rootkit?
A kernel mode rootkit is malware that loads as a driver or kernel module and runs inside the operating system kernel, with the highest privilege on the machine. From there it can hide files, processes and network connections from every program and switch off security software.
Can antivirus remove a kernel mode rootkit?
Sometimes, but it is the hardest case for software running on the same system, because the rootkit can tamper with what the antivirus sees. An offline scan that boots from outside Windows is more reliable, and a full wipe and reinstall is the dependable fix once one is confirmed.
What is BYOVD?
Bring your own vulnerable driver. The attacker installs a legitimate, validly signed driver that has a known security flaw, then uses that flaw to run code or change memory in the kernel. Windows trusts the driver's signature, so signing rules alone do not stop it.
How do I turn on memory integrity in Windows?
Open Windows Security, go to Device security, select Core isolation details, and switch on Memory integrity, then restart. It needs hardware virtualization enabled in the UEFI settings, and an incompatible driver can stop it from turning on.
Do kernel rootkits exist on Linux?
Yes. On Linux they usually take the form of a loadable kernel module (LKM) that hooks system calls. Secure Boot with kernel lockdown and enforced module signing makes loading an unsigned module much harder.