boot sector virus
termKept in this browser · My desk
A virus that hides in the code a computer runs from a disk's first sector at start-up, before any operating system loads.
The firmware of a PC loads the boot sector and passes control to whatever it holds, as long as the sector ends with the signature bytes 0x55 0xAA, so code placed there runs automatically, before the operating system. The US National Institute of Standards and Technology (NIST) lists boot sector viruses, which infect the master boot records of hard drives or the boot sectors of removable media, beside file infectors and multipartite viruses that do both. Brain (1986), Ping-Pong (1988) and Stoned spread this way on floppy disks. The same position was later used to destroy, as Nyetya did in 2017, and to persist below the operating system, as bootkits for the Unified Extensible Firmware Interface (UEFI) do.
Where it lives. A personal computer (PC) whose firmware is the Basic Input/Output System (BIOS) reads the first sector of the boot disk and runs it. On a hard disk that sector is the master boot record (MBR): Microsoft's technical reference describes master boot code, a disk signature at offset 0x01B8 and a 64-byte partition table of four 16-byte entries starting at offsets 0x01BE, 0x01CE, 0x01DE and 0x01EE, closed by the signature word 0x55AA. The master boot code finds the active partition, loads that partition's own boot sector, the volume boot record (VBR), and transfers control to it. Floppy and removable disks have no MBR: their first sector is the boot sector. A boot sector virus therefore has two homes on a hard disk and one on a floppy. Virus Bulletin's tutorial of April 1990 put the Italian (Ping-Pong) virus on floppy boot sectors and hard disk partition boot sectors, and F-Secure records Stoned on floppy boot sectors and hard disk MBRs.
How it works. The same tutorial gives the recipe in three steps: replace the genuine boot sector with an infected one, store the genuine sector in a previously unused sector, and store the bulk of the virus in other unused sectors. At start-up the virus's sector runs first, loads the rest of the virus into memory and then runs the genuine boot sector, so the machine seems to start normally; resident from that moment until switch-off, the virus can watch and interfere with the operating system and infect every disk that is used. The tutorial distinguished an infected PC, cleared by switching off, from infected media, which keep the virus without power: a PC infected from a floppy infects its hard disk and is clean only after booting from a clean system disk.
The first ones. Elk Cloner, written by Rich Skrenta as a 15-year-old student in Pennsylvania and passed around in early 1982, spread on Apple II floppies in the same way and showed a poem on every 50th start; a disk could be inoculated by writing the virus's own marker onto it. The early PC viruses moved the real boot sector out of the way and hid themselves in space the system would not touch. Brain, first detected in January 1986, kept most of its code in sectors marked as bad in the file allocation table and carried its authors' names and a Lahore address; it was also a stealth virus, which, when active in memory, redirected any attempt to read the boot sector and returned the original, and in March 1990 Fridrik Skulason warned that such viruses made checksum programs useless unless the computer was first rebooted from a clean system disk. Ping-Pong kept the original boot sector in a 1 KB cluster marked as bad. Stoned, which seems to have been meant to be harmless, stored the original at track 0, head 1, sector 3: on a 360K diskette that is the last sector of the root directory and rarely used, but on a 1.2M diskette overwriting it is much more likely to cause damage, and the virus spawned a large number of variants. Michelangelo, discovered in April 1991, overwrote disks on 6 March; Virus Bulletin's post-mortem of April 1992 traced the panic to a reported claim of five million infected computers worldwide, against 117 PCs that the United Kingdom's Computer Crime Unit reported hit, while two United States manufacturers had admitted shipping infected disks.
The defences of the time. They were manual. In August 1989 Virus Bulletin described an infection recognized by the virus's own code, 1357H at offset 1FCH of the hard disk boot record, and cleaned by backing up the files, booting from a known clean system disk and reformatting. Many personal computers' firmware setup offered an option that blocks writes to a hard disk's first sector, but it protects the partition table and not the boot records inside the partitions, and it is disabled by default because it can break operating system installers and disk tools. The National Institute of Standards and Technology (NIST) malware guide of July 2013 lists boot sector viruses beside file infectors and multipartite viruses and asks antivirus software to scan critical host components, boot records among them.
From spreading to destroying. The boot sector later became a target for destruction rather than spreading. Cisco Talos reported on 27 June 2017 that Nyetya, with administrative privileges, overwrote the boot sector of the first physical drive without saving a copy, or wiped the first ten sectors of the disk if that failed, and judged it intended to destroy rather than to earn. MITRE ATT&CK records WhisperGate, which overwrites the MBR with a boot loader that wipes the drives and shows a fake ransom note at the next start, and malware that modifies sector 0 so that it persists through a shutdown.
Bootkits. MITRE now files the technique as Pre-OS Boot: Bootkit (T1542.003), malware that modifies the boot sectors so that its code runs before the operating system loads: the MBR or the VBR on BIOS systems, and files in the Extensible Firmware Interface (EFI) system partition (ESP) on systems with the Unified Extensible Firmware Interface (UEFI). Its procedure examples include ROCKBOOT in the MBR, BOOTRASH in the VBR, Carberp and FinFisher variants carrying an MBR rootkit. Its mitigations are boot integrity, through a Trusted Platform Module (TPM) and a secure or trusted boot process, and control of the privileged accounts needed to write a raw disk; its detection strategy watches for raw access to physical drives, writes to the MBR, VBR or ESP and, on Linux, privileged runs of dd, grub-install or efibootmgr.
UEFI and signed boot. UEFI firmware does not rely on boot sectors and loads the boot loader directly, and its Secure Boot feature checks the signature of each piece of boot software, the operating system included, before handing over control. NIST Special Publication (SP) 800-147 (April 2011) applied the same idea to the firmware itself: BIOS updates accepted only when digitally signed and verified against a key in a Root of Trust for Update, with at least 112 bits of security strength, and protection against rollback to an older image that is authentic but vulnerable. That moved the attack rather than ending it. On 1 March 2023 ESET described BlackLotus, the first publicly known UEFI bootkit able to bypass Secure Boot on fully up-to-date Windows 11: it exploited the flaw catalogued in the Common Vulnerabilities and Exposures (CVE) list as CVE-2022-21894, fixed in January 2022, by bringing its own copies of validly signed but vulnerable binaries that had not yet been added to the revocation list, the rollback problem at the boot loader's level. Microsoft notes that the Secure Boot certificates it issued in 2011 begin expiring in June 2026, so the keys that decide what may boot are themselves being replaced.
Also known as: boot virus, boot-sector virus, mbr virus, vírus de setor de boot, vírus de boot
Sources
- NIST SP 800-83 Revision 1, Guide to Malware Incident Prevention and Handling for Desktops and Laptops, Souppaya and Scarfone, July 2013 (read 2026-11-23): compiled viruses include file infectors, boot sector viruses, which infect the master boot records of hard drives or the boot sectors of removable media, and multipartite viruses, which combine both; antivirus software should scan critical host components such as boot records
- Wikipedia, Boot sector (read 2026-11-23): the firmware passes control to whatever the boot sector holds when it ends with the signature 0x55 0xAA, so its code runs automatically, which made boot sectors a common attack vector for viruses; a BIOS option can block writes to a hard disk's first sector, protecting the partition table but not the volume boot records, and is disabled by default; UEFI does not rely on boot sectors and its Secure Boot expects signed code
- F-Secure, virus description: Brain (read 2026-11-23): possibly the oldest DOS virus, first detected in January 1986; most of it in sectors marked bad in the file allocation table; the authors' names and a Lahore address inside it
- F-Secure, virus description: Stoned (read 2026-11-23): a simple virus that seems designed to be harmless but, through a mistake, is not; infects floppy boot sectors; the original boot sector stored at track 0, head 1, sector 3, the last root directory sector of a 360K diskette, so overwriting it on a 1.2M diskette is much more likely to cause damage; a large number of variants
- Virus Bulletin, August 1989, Jim Bates, 'Italian Virus in Action' (read 2026-11-23): a boot sector virus recognized by its own code 1357H at offset 1FCH of the hard disk boot record; removed by backing up, booting from a known clean system disk and reformatting
- Cisco Talos, New Ransomware Variant Nyetya Compromises Systems Worldwide, 27 June 2017 (read 2026-11-23): with administrative privileges Nyetya overwrites the boot sector of PhysicalDrive0 without saving a copy, or wipes the first ten sectors of the disk; Talos judged it destructive rather than a tool for financial gain
- ESET WeLiveSecurity, BlackLotus UEFI bootkit: Myth confirmed, 1 March 2023 (read 2026-11-23): the first publicly known UEFI bootkit able to bypass UEFI Secure Boot on fully up-to-date Windows 11; it exploits CVE-2022-21894, fixed in January 2022, by bringing its own copies of validly signed but vulnerable binaries that had not been added to the revocation list
- Microsoft Learn, Secure Boot (read 2026-11-23): at start-up the firmware checks the signature of each piece of boot software, including UEFI drivers, EFI applications and the operating system, and boots only if the signatures are valid; the Secure Boot certificates issued in 2011 begin expiring in June 2026
- Microsoft, Windows Server 2003 Technical Reference, How Basic Disks and Volumes Work (read 2026-11-23): the MBR holds the master boot code, the disk signature at offset 0x01B8 and the 64-byte partition table, four 16-byte entries at 0x01BE, 0x01CE, 0x01DE and 0x01EE, and ends with the signature word 0x55AA; the master boot code finds the active partition, loads its boot sector and transfers control; floppy and removable disks have no MBR, their first sector is the boot sector
- MITRE ATT&CK, Pre-OS Boot: Bootkit, T1542.003, version 2.0, last modified 12 May 2026 (read 2026-11-23): bootkits modify the MBR or VBR on BIOS systems, or files in the EFI system partition on UEFI systems; procedure examples ROCKBOOT, BOOTRASH, Carberp, FinFisher, WhisperGate and others; mitigations boot integrity (TPM, secure or trusted boot) and privileged account management; detection of raw disk access and of changes to boot records and the ESP
- David Cooper, William Polk, Andrew Regenscheid and Murugiah Souppaya, NIST SP 800-147, BIOS Protection Guidelines, April 2011 (read 2026-11-23): authenticated BIOS updates with digital signatures verified against a Root of Trust for Update, at least 112 bits of security strength; a secure local update requiring physical presence; integrity protection, non-bypassability and protection against rollback to an authentic but vulnerable BIOS
- Virus Bulletin, April 1990, tutorial 'How Does An IBM PC Virus Infect a Computer?' (read 2026-11-23): bootstrap sector viruses replace the genuine sector, store it in a previously unused sector and keep the bulk of the virus in other unused sectors; they run first and stay memory-resident; infected PC versus infected media; Brain on the floppy bootstrap sector, Italian on floppies and on the hard disk partition bootstrap sector
- Virus Bulletin, March 1990, Fridrik Skulason, 'IBM PC Viruses: The New Generation' (read 2026-11-23): when active in memory Brain redirects any attempt to read the boot sector and returns the original; viruses invisible while active make checksum programs useless unless the computer is rebooted from a clean system disk
- Virus Bulletin, April 1992, the Michelangelo post-mortem (read 2026-11-23): the reported claim of five million infected computers; 117 PCs reported hit by the UK Computer Crime Unit; two US manufacturers shipped infected disks
- Wikipedia, Elk Cloner (read 2026-11-23): written by Rich Skrenta, a 15-year-old student, and circulated in early 1982; infected Apple DOS 3.3 floppies by a boot sector technique; a poem on every 50th start; disks inoculated with the virus's own marker