Course contentsShow
← Security
Lesson 1553 of 3,05231. Operating System Security - MalwareFree lesson

Bootkits and MBR Persistence

Infecting boot sectors and bootloaders to achieve execution before the operating system loads and security tools initialize.

Bootkits and MBR Persistence

What you'll learn: How attackers compromise the boot process itself to gain control before any operating system defenses can start.

The Ultimate Stealth: Pre-OS Malware

A bootkit is malware that infects the boot sector or bootloader—the very first code executed when a computer starts. By compromising the Master Boot Record (MBR) on legacy BIOS systems or the bootloader on UEFI systems, attackers achieve execution before the operating system and all its security tools even load.

Think of your computer's boot process like a security checkpoint at an airport. Normal malware tries to sneak through the checkpoint (the OS and antivirus). A bootkit, however, replaces the security guard at the entrance—it controls who gets checked and can let itself and its accomplices pass undetected before anyone else arrives.

How Bootkits Work

  1. Infection: The bootkit overwrites or modifies the MBR (first 512 bytes of a disk) or bootloader code
  2. Execution: When the system powers on, the BIOS/UEFI loads the infected boot code first
  3. Persistence: The bootkit loads its malicious payload into memory before the OS starts
  4. Stealth: It can then hook operating system functions, hide processes, files, and even disable security tools from the ground up

Because bootkits execute at such a low level, they're extremely difficult to detect. Traditional antivirus scans happen after the OS loads—by which time the bootkit has already compromised the system and can hide its presence or lie to security software.

Modern defenses like UEFI Secure Boot (which we covered earlier) verify bootloader signatures, making bootkits significantly harder to deploy on properly configured systems.

Key Takeaway: Bootkits achieve persistence by infecting boot sectors and executing before the OS loads, making them nearly invisible to traditional security tools and extremely persistent across reboots and reinstalls.