Persisting in the boot chain
Hidden Disk Storage: Bootkit Data Outside the Partitions
Where legacy bootkits keep encrypted code outside any partition: the gap after the MBR, the end of the disk, a partition of their own. Traces and checks.
- Goal
- Persisting in the boot chain
- Layer
- Boot
- Where it acts
- Outside the partitionsOn the boot chain map
- Platforms
- Windows
- ATT&CK
- T1564.005
- Also known as
- Hidden file system, Unpartitioned space storage
- Checked by
- Disk boot sectors
Overview
A bootkit that starts from an infected MBR or volume boot record needs more room than one sector: a loader, a kernel driver or code block, payloads and a configuration. Files on the Windows volume are what scanners and forensic triage read first, so the legacy bootkits in this catalogue keep most of it in disk sectors that no file system covers: between the MBR and the first partition, after the last partition, or in a partition of their own. They read those sectors with raw disk access, usually encrypt them, and often build a small file system of their own inside. MITRE ATT&CK files this under Hidden File System (T1564.005).
The space is there by design. MBR disks leave a gap before the first partition, 62 sectors on disks partitioned before Windows Vista and 2,047 sectors once Vista moved the first partition to sector 2048 (Microsoft). Disks often have unallocated space after the last partition. And Windows lets software with administrator rights write sectors outside every volume, because partitioning tools need to.
All five legacy-boot families in this catalogue use it: TDL4, Gapz, Rovnix, ESPecter's legacy version and the FinSpy MBR bootkit. For a responder, the consequence is simple: a file-level collection, however complete, holds none of these sectors.
How it works
| Location | Size | Legitimate tenants | Bootkit use |
|---|---|---|---|
| Sectors 1 to 62 (first partition at 63, pre-Vista) | About 31 KiB | Boot managers; GRUB's core.img | ESPecter's copy of the original MBR, code, configuration and driver, which ESET places on track 0 |
| Sectors 1 to 2047 (first partition at 2048) | About 1 MiB | GRUB's core.img, which the GRUB manual says "can be embedded in the area between the MBR and the first partition"; some disk encryption and OEM tools | Rovnix's hidden partition, Gapz's bootkit image, and anything that fits in the smaller gap |
| After the last partition | Whatever was left unallocated | Backup GPT (last sectors), the dynamic disk database (1 MiB at the end of the disk), RAID metadata, VHD footers | TDL4's file system, FinSpy's first loader stage, Gapz's image, Rovnix when the front gap is too small |
| A partition of its own | Up to 50 GB | TDL4's Olmasco variant, in a free entry of the partition table |
On GPT disks Microsoft is explicit that "GPT disks do not allow hidden sectors" and that data critical to the platform lives "in partitions and not in unpartitioned or 'hidden' sectors" (Windows and GPT FAQ). The families here target BIOS boots from MBR disks, but the same unallocated ranges exist on GPT disks, and data in them has no Windows owner either.
The stores are built to resist analysis:
- Encryption. Kaspersky reports TDL4's files encrypted with RC4, and ESET reports that ESPecter's configuration in sector 5 is encrypted. Gapz encrypts its payload store sector by sector with AES-256, though that store is a file, not raw sectors.
- A file system of their own. TDL4 keeps named files (
mbr,ldr16,drv64,cfg.iniand others); ESET named Rovnix's "Virtual FAT"; TDL4's Olmasco variant checks each file's CRC32. - Protection while running. The bootkit's kernel driver hides or guards these sectors from reads and writes on the live system (see disk stack hooking).
How families use it
| Family | Where | What | Source |
|---|---|---|---|
| TDL4 | "The last sectors of the physical drive" | RC4-encrypted file system: the original MBR, ldr16, ldr32, ldr64, drv32, drv64, payload DLLs, cfg.ini | Kaspersky, 2011 |
| TDL4 (Olmasco variant) | A new partition of up to 50 GB at the end of the disk | TDL4's file system, capacity limited by the partition | ESET, October 2011 |
| Gapz | "Either before the very first partition or after the last partition" | Bootkit image: next-stage boot code and kernel-mode code. Its payload store is a file instead, in System Volume Information | ESET, 2013 |
| Rovnix | Right after the MBR when "over 0x7D0 sectors" (about 1 MB) are free before the first partition; otherwise the end of the disk | Encrypted hidden partition, "Virtual FAT", with the driver's modules and data | ESET, February 2012 |
| ESPecter (legacy) | Sectors 1 to 5 and from 6 | Original MBR (1), bootkit code (2 to 4), encrypted configuration (5), driver (from 6) | ESET, 2021 |
| FinSpy (MBR) | The last megabyte of the disk | The first loader stage, copied to memory by the infected MBR | Kaspersky, 2021 |
Rovnix's 0x7D0 sectors do not fit before a first partition at sector 63, so on an older disk it falls back to the end. Outside this catalogue, ATT&CK lists the BOOTRASH bootkit using "unallocated disk space between partitions", a range that tools looking only at the front and end of the disk miss.
Traces it leaves
| Where | Trace |
|---|---|
| Sectors before the first partition | Non-zero data, usually high-entropy, that no known boot loader explains; a second sector ending in 55 AA with a partition table (a saved MBR) |
| After the last partition | High-entropy data that is not a backup GPT, a dynamic disk database or RAID metadata |
| Partition table | A small extra partition at the end of the disk with no Windows file system, possibly flagged active |
| Between partitions | Unexplained data in unallocated gaps |
| Windows volume | Nothing: no file, no registry key for the store |
| Live system | Reads of these sectors may return zeros or clean content while the bootkit runs |
How to check a host
Image from outside, and image enough. The stores are filtered on the running system, and a disk head misses anything at the end. Boot trusted Linux media and take a full image, or at least the first 4 MiB and the last MiB (commands on the MBR infection page). A full image is the only way to see gaps between partitions.
Map the unallocated space, then measure what is in it:
mmls disk.img
dd if=disk.img bs=512 skip=1 count=2047 2>/dev/null | gzip -c | wc -c
dd if=disk.img of=gap.bin bs=512 skip=1 count=2047
xxd gap.bin | grep -v '0000 0000 0000 0000 0000 0000 0000 0000' | head
mmls (The Sleuth Kit) lists every allocated and unallocated range with its start and length; adjust skip and count to each unallocated range it shows. Compression gives a quick entropy hint: a range of zeros compresses to a few kilobytes, encrypted data hardly at all. The xxd line shows the non-zero rows. Then identify what you found: GRUB's core.img starts with a recognisable sector, the backup GPT has an EFI PART header, and a dynamic disk database has PRIVHEAD and VMDB signatures. What is left, high-entropy and unexplained, deserves analysis.
Live. Get-Disk | Select-Object Number, PartitionStyle, Size, AllocatedSize and Get-Partition show how much of each disk is partitioned. Unallocated space alone is common and proves nothing, and reading its content through the running system can be filtered.
What the checker looks for
The bootsector module reads the front and end of a disk image:
- "Data before the first partition does not match a known loader": non-zero data between the MBR (or, on GPT disks, the end of the partition entry array) and the first partition. It is medium when the data is high-entropy (7 bits per byte or more, with at least 1 KiB of non-zero bytes), low otherwise. GRUB's
core.imgis recognised where the GRUB MBR points and left out, and a VeraCrypt boot loader suppresses the finding. - "Copy of a boot sector before the first partition" for a saved MBR in that gap.
- "Data after the last partition" when the image includes the end of the disk, unless a backup GPT, a dynamic disk database, Intel RST or Linux md RAID metadata, a DDF RAID header or a VHD footer explains it.
- "Small last partition with no recognised file system" for a partition like TDL4's Olmasco variant.
The detail sheet shows the range, the first non-zero sector, the entropy and the first 4 KiB in hex. The module reads only the first 4 MiB and the last 1 MiB of large images, so it does not scan gaps between partitions or the inside of a large hidden partition, and it does not decrypt or parse any store. A disk head without its tail cannot show the end of the disk, and a head copied through the infected system may show the zeros the rootkit returns. The sample walk-through shows the front-gap finding on a Gapz-like disk.
Mitigation and recovery
Prevention. UEFI boot from a GPT disk with Secure Boot on removes the boot path these stores serve: no MBR or VBR code runs to read them. Restrict administrator rights, which raw disk writes need.
Recovery. Repairing the MBR or boot sector does not touch these stores: bootrec /fixmbr rewrites only the boot code, and even diskpart's plain clean overwrites only the partitioning and hidden-sector information on an MBR disk. Reinstalling Windows over the existing partitions leaves the end of the disk alone.
- Preserve a full image first; the stores hold the payloads and configuration an investigation needs, even if they cannot be decrypted at once.
- Wipe every sector:
clean all"specifies that each and every sector on the disk is set to zero". - Reinstall from trusted media, preferably to UEFI and GPT, and rotate the credentials used on the host.
Sources
Primary public reports, newest first.
- 2026-05-12Hide Artifacts: Hidden File System (T1564.005)MITRE ATT&CK
- 2021-10-05UEFI threats moving to the ESP: Introducing ESPecter bootkitESET
- 2021-09-28FinSpy: unseen findingsKaspersky
- 2017-06-07Windows and GPT FAQMicrosoft
- 2017-06-01Restricted Direct Disk Access and Volume Access in WindowsMicrosoft
- 2013-04-08Mind the Gapz: The most complex bootkit ever analyzed?ESET
- 2012-02-22Rovnix Reloaded: new step of evolutionESET
- 2011-10-18TDL4 rebootedESET
- 2011-09-26Alignment changes in Windows 2008 and 2008 R2Microsoft
- 2011-01-25TDSS. TDL-4Kaspersky
See also
Related techniques
- Replacing the MBR boot codePersisting in the boot chain
- Infecting the VBR, its BPB or the IPLPersisting in the boot chain
- Hooking the disk stack to return clean sectorsHiding and protecting itself
- Hooking the BIOS disk service (int 13h)Taking over the boot
Families that use it
- ESPecterUEFI bootkit
- FinSpy UEFI bootkitUEFI bootkit
- GapzVBR bootkit
- RovnixVBR bootkit
- TDL4 (TDSS / Alureon)MBR bootkit