4. Kernel Mode Rootkits
A malicious program such as rootkit can load a kernel driver to run the code in kernel mode. Once it's running in the kernel space, it has access to the internal operating system code and it can monitor system events, evade detection by modifying the internal data structures, hook functions, and modify the call tables. A kernel mode driver typically has an extension of .sys
and it resides in %windir%\system32\drivers
. A kernel driver is normally loaded by creating a service of type Kernel Driver Service (as described in Chapter 7, Malware Functionalities and Persistence, in the Service section).
Windows has implemented various security mechanisms that are designed to prevent the execution of unauthorized code in the kernel space. This makes it difficult for a rootkit to install the kernel drivers. On 64-bit Windows, Microsoft implemented Kernel-Mode Code Signing (KMCS), which requires the kernel mode drivers to be digitally signed in order to be loaded into memory...