There are at least five types of rootkit, ranging from those at the lowest level in firmware (with the highest privileges), through to the least privileged user-based variants that operate in
Ring 3. Hybrid combinations of these may occur spanning, for example, user mode and kernel mode.
Kernel mode Kernel-mode rootkits run with the highest operating system privileges (
Ring 0) by adding code or replacing portions of the core operating system, including both the
kernel and associated
device drivers. Most operating systems support kernel-mode device drivers, which execute with the same privileges as the operating system itself. As such, many kernel-mode rootkits are developed as device drivers or loadable modules, such as
loadable kernel modules in
Linux or
device drivers in
Microsoft Windows. This class of rootkit has unrestricted security access, but is more difficult to write. Kernel rootkits can be especially difficult to detect and remove because they operate at the same
security level as the operating system itself, and are thus able to intercept or subvert the most trusted operating system operations. Any software, such as
antivirus software, running on the compromised system is equally vulnerable. In this situation, no part of the system can be trusted. A rootkit can modify data structures in the Windows kernel using a method known as
direct kernel object manipulation (DKOM). This method can be used to hide processes. A kernel mode rootkit can also hook the
System Service Descriptor Table (SSDT), or modify the gates between user mode and kernel mode, in order to cloak itself. It is common that a rootkit creates a hidden, encrypted filesystem in which it can hide other malware or original copies of files it has infected. Operating systems are evolving to counter the threat of kernel-mode rootkits. For example, 64-bit editions of Microsoft Windows now implement mandatory signing of all kernel-level drivers in order to make it more difficult for untrusted code to execute with the highest privileges in a system.
Bootkits A kernel-mode rootkit variant called a
bootkit can infect startup code like the
Master Boot Record (MBR),
Volume Boot Record (VBR), or
boot sector, and in this way can be used to attack
full disk encryption systems. An example of such an attack on disk encryption is the "
evil maid attack", in which an attacker installs a bootkit on an unattended computer. The envisioned scenario is a maid sneaking into the hotel room where the victims left their hardware. The bootkit replaces the legitimate
boot loader with one under their control. Typically the malware loader persists through the transition to
protected mode when the kernel has loaded, and is thus able to subvert the kernel. For example, the "Stoned Bootkit" subverts the system by using a compromised
boot loader to intercept encryption keys and passwords. In 2010, the Alureon rootkit has successfully subverted the requirement for 64-bit kernel-mode driver signing in
Windows 7, by modifying the
master boot record. Although not malware in the sense of doing something the user doesn't want, certain "Vista Loader" or "Windows Loader" software work in a similar way by injecting an
ACPI SLIC (System Licensed Internal Code) table in the RAM-cached version of the BIOS during boot, in order to defeat the
Windows Vista and Windows 7 activation process. This vector of attack was rendered useless in the (non-server) versions of
Windows 8, which use a unique, machine-specific key for each system, that can only be used by that one machine. Many antivirus companies provide free utilities and programs to remove bootkits.
Hypervisor level Rootkits have been created as Type II
Hypervisors in academia as proofs of concept. By exploiting hardware virtualization features such as
Intel VT or
AMD-V, this type of rootkit runs in Ring -1 and hosts the target operating system as a
virtual machine, thereby enabling the rootkit to intercept hardware calls made by the original operating system. Unlike normal hypervisors, they do not have to load before the operating system, but can load into an operating system before promoting it into a virtual machine. while
Blue Pill software is another. In 2009, researchers from Microsoft and
North Carolina State University demonstrated a hypervisor-layer anti-rootkit called
Hooksafe, which provides generic protection against kernel-mode rootkits.
Windows 10 introduced a new feature called "Device Guard", that takes advantage of virtualization to provide independent external protection of an operating system against rootkit-type malware.
Firmware and hardware A
firmware rootkit uses device or platform firmware to create a persistent malware image in hardware, such as a
router,
network card,
hard drive, or the system
BIOS. The rootkit hides in firmware, because firmware is not usually inspected for
code integrity. John Heasman demonstrated the viability of firmware rootkits in both
ACPI firmware routines and in a
PCI expansion card
ROM. In October 2008, criminals tampered with European
credit-card-reading machines before they were installed. The devices intercepted and transmitted credit card details via a mobile phone network. In March 2009, researchers Alfredo Ortega and
Anibal Sacco published details of a
BIOS-level Windows rootkit that was able to survive disk replacement and operating system re-installation. A few months later they learned that some laptops are sold with a legitimate rootkit, known as Absolute
CompuTrace or Absolute
LoJack for Laptops, preinstalled in many BIOS images. This is an anti-
theft technology system that researchers showed can be turned to malicious purposes.
Intel Active Management Technology, part of
Intel vPro, implements
out-of-band management, giving administrators
remote administration,
remote management, and
remote control of PCs with no involvement of the host processor or BIOS, even when the system is powered off. Remote administration includes remote power-up and power-down, remote reset, redirected boot, console redirection, pre-boot access to BIOS settings, programmable filtering for inbound and outbound network traffic, agent presence checking, out-of-band policy-based alerting, access to system information, such as hardware asset information, persistent event logs, and other information that is stored in dedicated memory (not on the hard drive) where it is accessible even if the OS is down or the PC is powered off. Some of these functions require the deepest level of rootkit, a second non-removable spy computer built around the main computer. Sandy Bridge and future chipsets have "the ability to remotely kill and restore a lost or stolen PC via 3G". Hardware rootkits built into the
chipset can help recover stolen computers, remove data, or render them useless, but they also present privacy and security concerns of undetectable spying and redirection by management or hackers who might gain control. ==Installation and cloaking==