In this section

Kernel Rootkits in Memory Forensics: modules, modscan, callbacks, Hidden Processes and the SSDT

Module 0

Introduction

Everything in the previous lessons happened in user space: processes, their memory, their handles. Below them is the kernel, which manages all of it and which the analyst's plugins read to see anything at all.

Code that runs in the kernel, usually as a driver, can change what the kernel reports about itself: remove a process from the list, remove itself from the list of drivers, and register to be told whenever something happens on the machine.

That is what a rootkit does, and memory forensics is one of the few ways to see past it, because a memory image holds the kernel's structures whether or not the kernel would admit to them.

moduleswalks the kernel'sloaded-module listthenmodscanscans memory fordriver structuresthencallbacksreads the arraysdrivers register inthenBy addresswhich module, if any,holds each pointer

The kernel has its own list-versus-scan problem, and a second one: code that the kernel calls without any list naming it.

This lesson reads two captures of the same workstation with the same driver, callback_demo.sys, loaded on a machine set to accept test-signed drivers. In the first, the driver loaded openly and registered a callback.

In the second, it hid itself, copied a callback into pool memory and hid a process, and the host kept beaconing after the response team had removed the attacker's user-space foothold. Module 6 teaches the kernel's structures and each technique in depth.

The reason to learn this at the foundation stage is that the kernel decides what every other lesson can see. Every plugin in lessons 0.2 to 0.6 read a structure the kernel keeps, and a rootkit's whole purpose is to edit those structures so that the machine misreports itself.

An analyst who has only ever read the lists will, on a rootkit host, read a clean machine. The defense is the one lesson 0.2 started: for every list, a second view that does not depend on it, and a habit of reading the two against each other.

01

A Driver, Seen Openly

The module list and a callback

The kernel keeps a list of loaded drivers, which windows.modules walks. In the first capture the driver is there, with its base address and size:

$ vol -f NE-ENG-031-driver.raw windows.modules | grep -e Base -e callback_demo \
    | cut -f2-4
Progress:  100.00		PDB scanning finished
Base	Size	Name
0xf80179a40000	0x7000	callback_demo.sys

A driver of 0x7000 bytes, 28 KB, at 0xf80179a40000. When it started, it registered a callback, which windows.callbacks reads from the arrays the kernel keeps of routines to call when certain events happen:

$ vol -f NE-ENG-031-driver.raw windows.callbacks | grep -e Type -e callback_demo \
    | cut -f1-4
Progress:  100.00		PDB scanning finished
Type	Callback	Module	Symbol
PspCreateProcessNotifyRoutine	0xf80179a41140	callback_demo	-

PspCreateProcessNotifyRoutine is the array of routines the kernel calls every time a process is created. callback_demo.sys put one there, at 0xf80179a41140, inside its own image. From then on, the driver is told about every new process on the machine, and it can act on each one before the process runs its first instruction.

Callbacks like this are not malicious in themselves. Security products depend on them: the same arrays in the rootkit capture hold entries for Defender's filter driver and for Sysmon, which use them to see processes, threads and image loads as they happen.

That is exactly why attackers want them too. A driver with a process-creation callback can watch for a security tool starting and interfere with it, or hide each new process it cares about as it appears.

Seen openly, the driver is easy to find: it is in the list, its callback names it, and its file is in the drivers folder. The rest of the lesson is about the same driver when it does not want to be found.

Notice what makes this capture a lab rather than an ordinary workstation: it is set to accept test-signed drivers. 64-bit Windows refuses by default to load a driver without a signature it trusts, so on a production machine an attacker needs another way into the kernel, most often a legitimately signed driver with a known flaw that lets them run their own code.

The memory evidence of what happens afterwards is the same either way, and that is what this course reads: what a driver did once it ran, not how it obtained permission to load. Module 6 loads this same test-signed driver in the course lab, so the student builds the footprint before hunting it.

02

The Same Driver, Unlinked

The list and the scan disagree

In the rootkit capture, the module list has no entry for callback_demo.sys. The pool scan, windows.modscan, finds it anyway:

$ vol -f NE-ENG-031-rootkit.raw windows.modules | grep -ci callback_demo
Progress:  100.00		PDB scanning finished
0
$ vol -f NE-ENG-031-rootkit.raw windows.modscan | grep -e Base -e callback_demo \
    | cut -f2-4
Progress:  100.00		PDB scanning finished
Base	Size	Name
0xf80179a40000	0x7000	callback_demo.sys

Zero matches in the list; one in the scan, at the same base address and size as in the first capture. The driver unlinked itself from the loaded-module list after it loaded, and the scan, which looks for the structures the kernel allocates for each loaded driver rather than following the list, found it.

This is lesson 0.2's lesson moved down a level. pslist walks a list and psscan scans memory; modules walks a list and modscan scans memory. A difference between the two views has the same two common explanations: something was removed from the list deliberately, or it was unloaded and its structure is a remnant.

For processes the exit time chose between them. For drivers, the evidence that chooses is whether anything still points into the driver's memory, and the next section finds that something does.

Hiding from the list does not remove every trace. The driver was started as a service, and the service record is still there in the service control manager's memory:

$ vol -f NE-ENG-031-rootkit.raw windows.svcscan | grep -i callback_demo \
    | cut -f4-6,8
Progress:  100.00		PDB scanning finished
SERVICE_DEMAND_START	SERVICE_RUNNING	SERVICE_KERNEL_DRIVER	callback_demo

A kernel driver service named callback_demo, running, started on demand, with its binary in the drivers folder. That path is the bridge to the disk: the file is usually still there, and it gives the investigation a binary to collect, hash and check for a signature. Memory finds the driver; the disk tells you where it came from.

Tools on a live machine that list drivers ask the kernel, which answers from its list, so a driver that leaves the list is invisible to them while it keeps running. The image asks nothing; it reads the memory where the list and the structures both live.

The comparison is also the reason Module 6 reads modscan's output as an inventory rather than as a list of suspects. On a clean machine, the scan and the list agree almost exactly; every difference is a question, and a driver that is in the scan, absent from the list, with code that the kernel still calls, has only one ordinary answer, which is not ordinary at all.

03

Callbacks No Module Claims

Attributing by address

windows.callbacks names the module that contains each callback's address. In the rootkit capture, 18 callbacks are registered, and two have no module named:

$ vol -f NE-ENG-031-rootkit.raw windows.callbacks | cut -f1-4 \
    | grep -e Type -e "\t-$"
Progress:  100.00		PDB scanning finished
Type	Callback	Module	Symbol

A blank module means the plugin found no loaded module whose range contains the address, and in this capture there are two different reasons for that. Checking each address against the ranges the scan found settles it:

Two callbacks with no module named

Attributed by address

0xf80179a41140

process creation: inside callback_demo.sys (modscan, base 0xf80179a40000, size 0x7000)

0xffffd18c4a2e1b40

image load: in pool memory, inside no driver at all

Meaning

the first is a hidden driver; the second is code with no driver

The process-creation callback at 0xf80179a41140 is the same address as in the first capture, and it lies inside the range modscan reported for callback_demo.sys. The plugin could not name the module because the module is no longer in the list it consults. Attributing by address, against the scan's ranges, names it.

The image-load callback at 0xffffd18c4a2e1b40 is different. It is not inside callback_demo.sys or any other driver: it is in pool memory, the kernel's general-purpose heap, where the driver copied it. Code in pool memory has no file and no module entry at all, so even a scan for driver structures will not find it. Its only trace is the pointer in the callback array, and the address that pointer holds.

Recognizing an evasive callback of this kind is one of the calls Module 6's closing hunt asks the student to make. This is the kernel's equivalent of lesson 0.3's injected code: executable code with nothing behind it.

The attribution is a procedure, worth doing the same way every time, because the blank column invites two opposite mistakes: reading a dash as a plugin quirk, or reading every dash as malicious. Take each unnamed callback, compare its address with the base and size of every driver the scan found, and record either the driver whose range holds it or the fact that none does.

Here, 0xf80179a41140 minus the base 0xf80179a40000 is 0x1140, well inside the image's 0x7000 bytes. The second address begins 0xffffd18c, while every one of the 61 modules modscan found in this image is loaded at an address beginning 0xf80. No driver range can hold it.

04

A Process the Kernel Hides

No exit time, and a live session

The rootkit capture's cross-view shows one process found by the scan and not the list:

$ vol -f NE-ENG-031-rootkit.raw windows.malware.psxview | grep -e pslist -e rundll32
Progress:  100.00		PDB scanning finished
Offset(Virtual)	Name	PID	pslist	psscan	thrdscan	csrss	Exit Time
0xd187c28a5dc0	rundll32.exe	5320	False	True	False	False	N/A

rundll32.exe, PID 5320, absent from pslist, found by psscan, and with no exit time. Lesson 0.2 met the same combination with an exit time, update.exe, and read it as a process that had finished.

Without one, the reading reverses: the process is still running, and something removed it from the active list. thrdscan, which finds processes through their threads, misses it too in this capture, so the deciding evidence is what the process is doing:

$ vol --hide-columns Offset Proto State -f NE-ENG-031-rootkit.raw windows.netscan \
    | grep -e Owner -e 5320
Progress:  100.00		PDB scanning finished
LocalAddr	LocalPort	ForeignAddr	ForeignPort	PID	Owner	Created
10.5.0.31	50120	10.5.0.20	443	5320	rundll32.exe	2026-03-21 09:43:06.000000 UTC

It holds an HTTPS session to 10.5.0.20, opened at 09:43:06, the beacon the response team was chasing. A process that has exited cannot hold a socket.

Notice that netscan found the owner without any help from the process list: the connection structure records the PID and the process name itself, so the network view is a third, independent witness alongside the list and the scan. When the list and the scan disagree, it is often the view that settles which one is telling the truth.

The process name is also worth a moment. rundll32.exe is a standard Windows binary whose job is to load a DLL and call a function in it, which makes it a common host for an attacker's code: the process name is ordinary, and the work is done by whatever DLL it was told to load.

Lesson 0.2's habit would read the command line next, but windows.cmdline walks the same list the driver edited, and it returns nothing for PID 5320.

The hiding reaches every plugin that starts from the list. filescan, which scans, does find a DLL in the Public user folder, \Users\Public\x.dll, and Module 6 follows it up. This one is running, hidden from the kernel's own list by the driver that also hid itself.

That explains the case. The case notes record that the response team removed the attacker's foothold from explorer.exe at 14:02, and the host kept connecting out, because the channel was never in explorer.exe. It was in a process the process list did not show, protected by a driver the driver list did not show.

Module 6's lesson on direct kernel object manipulation, DKOM, reads exactly how the unlinking works and where its limits lie.

The timing matters as much as the hiding. windows.info gives the image's system time as 15:27:40, so the channel had been open for more than five and a half hours when memory was captured, and the response team's cleanup at 14:02 came in the middle of it.

A live response that listed processes on the running host saw explorer.exe, cleaned it and found nothing else, because the list it read was the one the driver had edited. Nothing about that response was careless; it trusted a view the attacker controlled. The memory image was the first view of this host that did not depend on the kernel's own account of itself.

05

A Clean Table Is a Result

The system call table, read and recorded

Older rootkits hooked the system call table, redirecting the kernel's own services to their code. windows.ssdt lists the table's entries and the module each points into. Counting the entries that point anywhere other than the kernel and its graphics component:

$ vol -f NE-ENG-031-rootkit.raw windows.ssdt | grep -v -e ntoskrnl -e win32k \
    | grep -c 0x
Progress:  100.00		PDB scanning finished
0

None. The table is clean. That is a result to record, not a reason to stop: this rootkit did everything it needed with callbacks and unlinking, which leave the system call table untouched. The system service descriptor table maps each system call to the kernel function that handles it.

Hooking it was a common rootkit technique on 32-bit Windows. On 64-bit Windows, Kernel Patch Protection checks critical kernel structures, the table among them, and stops the machine with a bug check if it finds them modified, which is one reason rootkits moved to callbacks: a supported interface the kernel expects drivers to use.

A clean table rules out one technique, not a rootkit, and a report that says only "no SSDT hooks found" has answered a narrower question than the one it was asked.

1. Compare modules with modscana driver only the scan finds was unlinked2. Read every callbackand the module each one names, or does not3. Attribute the unnamed onesby address against modscan's ranges4. Check the process viewsa hidden process has no exit time5. Read the system call tablea clean table is one result among several

A first pass over the kernel, in the order Module 6 takes it.

The order in that figure is the order this lesson took, and it is built so that no single clean result ends the search. The module list was clean; the scan was not.

The named callbacks were ordinary; the unnamed ones were not. The process list was clean; the scan and the connection table were not. The system call table was clean, and that was the last check, not the first.

Every one of those clean results would have been a reasonable place for a hurried analyst to stop, and each would have led to the same wrong conclusion the response team reached. The habit is to finish the whole pass and read the results together.

Read together, the results in this capture tell one story with no gaps. A driver loaded as a service, registered a process-creation callback from its own image, put an image-load callback in pool memory, removed itself from the module list, and removed a process from the active list.

That process holds the session the response team was chasing. Each finding explains another, which is what a complete reading looks like; a finding that explains nothing else is a reason to keep looking.

06

What Module 6 Builds On It

Kernel-level compromise in depth

Module 6 starts with the crossing from user space into kernel space and what a driver can do there, reads the driver list and what it hides, loads a driver in the course lab and captures the result, finds the driver when it hides, reads callbacks and the system call table, and ends with DKOM and the detection floor: the point below which memory analysis of this kind cannot see.

Its closing hunt hands the student the calls this lesson made for them: refusing a clean list, reading a list-versus-scan gap as a hidden driver, attributing a callback by address rather than name, reading a clean system call table narrowly, and deciding when the hunt is actually complete.

What Module 6 builds

Module 6

6.1 to 6.2

into kernel space; the driver list and what it hides

6.3 to 6.5

load a driver, capture, find it hidden

6.6 to 6.7

callbacks; system call table hooks

6.8 to 6.9

DKOM and the detection floor; the rootkit hunt

The habit to carry into it is the one this lesson built. Compare every list with a scan, attribute every unnamed pointer by address, read a process with no exit time as hidden rather than gone, and treat clean results as results. A rootkit's purpose is to make the obvious views look normal, and it usually succeeds at that; it rarely succeeds at making every view agree.

There is also a limit to keep in view. Code running in the kernel can, in principle, alter any structure an analyst reads, including the ones the scans rely on. Module 6's detection floor is about that limit: which manipulations leave a trace in memory and which leave none, so that a report can say what the analysis could and could not have seen.

That is a different kind of honesty from the earlier lessons. A missing process in user space is usually explained by evidence somewhere else in the image; a careful kernel rootkit may leave nothing to find, and the report has to say which checks were run rather than claim the kernel is clean.

None of this needs a new tool. Every plugin in this lesson has a user-space counterpart from the earlier ones: modscan is psscan for drivers, an unnamed callback is malfind's region with no file behind it, and the hidden process is the same cross-view read with the exit time deciding the answer. Module 6 adds depth to each, not a different way of thinking.

Do

Practice

Find what the kernel calls that no list admits to
prepared evidence

The prepared evidence below is the process, thread and image-load callbacks registered in the rootkit capture, with the module each one names. Find the callbacks no module claims, decide which of them points into no driver at all, and read the hidden process correctly. Each answer comes with its reasoning, so check it against the rows rather than only the choice.

The rows are the process, thread and image-load callbacks only; the registry, shutdown and bug-check callbacks in the full output all belong to named drivers and are left out to keep the question on the ones that matter.

In the range, run the callbacks plugin on the baseline capture of this workstation and compare the rows. The addresses differ between the two images, because drivers load at different addresses on each boot, so compare the Module column: every module the baseline names is named in the rootkit capture too, and the two entries with no module are the only ones the baseline lacks.

That comparison is the fastest way to triage callbacks on a host you know: a known-good image of the same build tells you which drivers belong, and anything left over is where the hunt starts. On a host with no baseline, the attribution by address has to carry the whole weight.

The kernel has its own list-versus-scan problem: a driver can unlink itself from the module list and still be found by a pool scan. Callbacks show what the kernel calls, and the ones no module claims are attributed by address, against the scan's ranges, or found to point into pool memory with no driver at all.

A process found only by the scan, with no exit time and a live session, is hidden, not gone. A clean system call table is one result among several, and the pass is finished before any of them is trusted.

The next lesson asks the same questions of a Linux host.