What Is a Boot Sector Virus? How It Works, Examples, Removal and Prevention

Learn what a boot sector virus is, how it infects systems, real-world examples like Michelangelo, how to detect, prevent, and remove it. Stay protected from legacy malware threats.

May 23, 2025 - 14:24
Updated: 1 month ago
106.2k
What Is a Boot Sector Virus? How It Works, Examples, Removal and Prevention

Quick answer: A boot sector virus is malware that infects the master boot record (MBR) or boot sector of a disk so it runs before the operating system starts. Classic examples spread by floppy disks and USB drives. Today the same idea appears as bootkits that target UEFI firmware. Defend with Secure Boot, firmware updates, boot-order lockdown and clean-media recovery.

Key takeaways

  • The boot sector is the first code a computer runs, so malware placed there starts before the OS and antivirus.
  • Classic examples include Brain (1986), Stoned (1987) and Michelangelo (found 1991, famous for a 1992 scare).
  • Modern descendants are bootkits and firmware malware, such as the BlackLotus UEFI bootkit reported in 2023.
  • Prevention: Secure Boot, updated firmware, a firmware password, no booting from unknown USB drives and BitLocker or disk encryption.
  • Removal needs clean boot media, since the infected disk cannot be trusted while it is running.

What is a boot sector virus?

A boot sector virus is malware that copies itself into the boot sector or master boot record (MBR) of a storage device. This is the small piece of code the computer's firmware runs first to start loading an operating system. Because the virus runs before Windows or Linux, it can load itself into memory and stay hidden from tools that start later.

How does it work?

  1. Infection. You boot, or accidentally boot, from an infected floppy or USB drive. The virus code runs.
  2. Takeover. It moves the original boot code elsewhere on the disk and puts its own code in the boot sector.
  3. Resident in memory. It loads first on every start, then hands control to the real boot code so the computer seems normal.
  4. Spread. It infects other disks inserted into the machine.

Historically, the main spreading method was sharing floppy disks. Today it would need physical or administrator access, a malicious USB boot, or a successful firmware attack.

Famous examples

NamePeriodNotes
Brain1986Often called the first PC virus; spread through floppy boot sectors
Stoned1987Common boot sector virus that showed a message
MichelangeloFound 1991Set to trigger on 6 March and caused a media scare in 1992
Petya2016Ransomware that overwrote the MBR to lock the disk
BlackLotusReported 2023UEFI bootkit reported to bypass Secure Boot on unpatched systems

Are boot sector viruses still a threat?

The classic floppy-era viruses are mostly history. The idea is not. Attackers still target the boot process because it gives deep control and survives reinstalling the operating system in some cases. Modern forms are called bootkits or UEFI/firmware malware. They are rarer and need more skill, but they are serious when they appear. Check the current status of any named threat in a source such as the National Vulnerability Database.

What are the symptoms?

  • "Missing operating system" or a boot error after plugging in a USB drive
  • Computer will not boot, or boots very slowly
  • Strange messages at start-up
  • Security tools disabled or unable to start
  • Disk partitions disappear or show as empty

These can also be disk or hardware failures, so rule that out too.

How to remove it

  1. Disconnect the machine from the network and remove unknown USB drives.
  2. Boot from clean media, such as a Windows installation USB or a trusted security rescue disk made on a clean computer.
  3. Scan from the rescue environment. Back up important files first, only the data, not programs.
  4. Repair the boot record. In the Windows recovery command prompt, bootrec /fixmbr and bootrec /fixboot repair the boot record on MBR disks. bootrec /rebuildbcd rebuilds the boot configuration. On UEFI/GPT systems the process is different, so follow Microsoft's guidance on Microsoft Learn.
  5. Update firmware and re-enable Secure Boot.
  6. If in doubt, wipe. Repartition and reinstall, then restore data after scanning it.

On Linux you can back up your own MBR for future recovery with sudo dd if=/dev/sda of=mbr-backup.img bs=512 count=1. Check the disk name with lsblk first, because the wrong device name can destroy data.

How to prevent it

  • Turn on Secure Boot and keep UEFI firmware up to date.
  • Set a firmware (BIOS/UEFI) password and set the boot order to internal disk first.
  • Do not boot from unknown USB drives, and disable USB boot on shared computers.
  • Use full-disk encryption such as BitLocker and keep a recovery key.
  • Keep operating system and security patches current.

Boot sector virus versus file virus

A file infector attaches to executable files and runs when you open them. A boot sector virus infects the boot area and runs at start-up, before the operating system. See our broader posts on types of viruses, what a virus is and the polymorphic virus.

Next steps

Next steps: to learn malware behaviour and defence, see our Cyber Security course, and compare with other virus types.

Related reading

Frequently Asked Questions

A boot sector virus is malware that infects the boot sector or master boot record of a storage device. It runs when the computer starts, before the operating system loads, which makes it hard for normal antivirus tools to see or stop.

Historically through infected floppy disks and later USB drives booted by accident. Today the spread needs physical access, a malicious bootable device or a firmware attack, so keep USB boot disabled and firmware updated.

Classic ones are mostly historic, but the same idea lives on in bootkits and UEFI malware such as BlackLotus, reported in 2023. They are rare but serious, so use Secure Boot and update firmware.

Boot from clean media, back up data, scan from a rescue environment and repair the boot record, for example with bootrec commands on Windows MBR disks. If unsure, wipe and reinstall, then update firmware and re-enable Secure Boot.

MBR is the older boot method that uses the first sector of a disk. UEFI is the modern firmware standard that can use GPT disks and supports Secure Boot, which verifies boot software is trusted before running it.

Sometimes, but an infection that runs before the operating system can hide from tools running inside it. Scanning from a clean rescue disk works better, and a full wipe is the safest option.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.