Skip to content

VBR bootkit

Rovnix VBR Bootkit: Traces and Offline Checks

Rovnix, the bootkit ESET tracked from 2011: the replaced NTFS bootstrap code, the hidden encrypted partition, Carberp and the 2020 reuse, checks and recovery.

Kind
VBR bootkit · Boot layer
Platforms
Windows
First seen
2011
Status
Historical
Also known as
Cidox, Win64/Rovnix
Checked by
Disk boot sectors

Overview

Rovnix is a bootkit for Windows computers that start through the legacy BIOS. In August 2011 ESET described Win64/Rovnix, whose dropper it detected as Win32/Papras, as a bootkit that leaves the master boot record (MBR) alone and infects the NTFS bootstrap code of the active partition instead. ESET later called it the first bootkit family to use volume boot record (VBR) infection to load unsigned kernel-mode drivers on 64-bit Windows. ESET had noted the first Win32/Rovnix.A modifications at the beginning of summer 2011.

Rovnix was a framework more than a single piece of malware. ESET reported in July 2012 that a full-featured builder cost $60,000 with six months of support, that the framework had been sold to the Carberp developers behind the Hodprot (Origami) botnet, and that Carberp droppers carried it until the end of 2011. ESET's February 2012 post describes Rovnix components inside Win32/Carberp, then the most widespread banking trojan in Russia. Its July 2012 post covers Rovnix.D, with polymorphic bootstrap code and support for several payloads.

The Rovnix source code leaked with Carberp's in 2013. In June 2020 Kaspersky described a bootkit whose code is "remarkably similar to the known Rovnix bootkit", sent with a lure about a World Bank initiative on the coronavirus pandemic and detected as Trojan.Win32.Cidox, among other verdicts. Kaspersky's post does not name a group behind it. That is the latest public reporting found for this page. Rovnix needs BIOS boot, so it is catalogued as historical, but the leaked code means a "new" sample can still turn up on an old BIOS machine.

How it loads and hides

Boot chain. An NTFS volume starts with the VBR, followed by 15 sectors of bootstrap code, the initial program loader (IPL), that loads bootmgr or ntldr. ESET's 2011 analysis says Rovnix reads those 15 sectors, compresses them, appends them to its own bootstrap code and writes the result over the same 15 sectors. At boot the malicious code hooks the BIOS disk service (int 13h), patches the Windows loader as it is read from disk, regains control during kernel initialisation and loads its driver without the kernel's signature checks. It then hands control back to the original, decompressed IPL, so Windows starts normally.

Hidden storage. ESET's February 2012 post describes an encrypted hidden partition, which ESET called "Virtual FAT", holding the driver's modules and data. When at least 2,000 sectors (0x7D0, almost 1 MB) are free before the first partition, Rovnix places it right after the MBR; otherwise it uses the end of the disk. On a Windows 7 or later disk, where the first partition usually starts at sector 2048, the space after the MBR is large enough.

Protection. The driver hooks the IRP_MJ_INTERNAL_CONTROL handler of the disk miniport driver to protect its bootstrap code, the stored driver and the hidden partition, and registers image-load and process-creation notification routines. Payloads are injected into processes through an APC. On an infected running system, reads of the protected sectors cannot be trusted.

Later versions. Rovnix.D (ESET, July 2012) permutes its bootstrap code from sample to sample and stores the encrypted malicious VBR in a different place, so byte signatures do not carry from one infection to the next. The 2020 bootkit described by Kaspersky overwrites the VBR with its bootloader and places the packed original VBR next to it. It writes a driver Kaspersky calls KLoader to inject a backdoor into running processes, and its dropper gets administrator rights by hijacking a DLL of wusa.exe from a fake C:\Windows \System32 folder (with a space after Windows), which it deletes afterwards.

Traces on disk

LocationWhatSource
Active NTFS partition, the 15 sectors after the VBR (IPL)Replaced by Rovnix bootstrap code, with the original IPL compressed inside itESET, August 2011
Active NTFS partition, sector 0 (VBR)Overwritten by the 2020 variant's bootloader; packed original VBR stored next to itKaspersky, June 2020
2,000 sectors right after the MBR, or the end of the diskEncrypted hidden partition ("Virtual FAT")ESET, February 2012
C:\Windows \System32\ (trailing space after Windows)Short-lived folder used for the 2020 dropper's UAC bypass, then deleted; may remain in $MFT or the USN journalKaspersky, June 2020
easymule.exe, 1211.doc, uninstall.pdg, wtsapi.dllFile names in the 2020 delivery chainKaspersky, June 2020

There is no driver service and no driver file to find. The kernel code is read from raw sectors at every boot, which is the point of the design.

How to check a host

Can it apply? Rovnix needs BIOS boot from an MBR disk. System Information (msinfo32) shows "BIOS Mode"; bcdedit /enum "{current}" shows winload.exe for BIOS boot and winload.efi for UEFI; Get-Disk | Select-Object Number, PartitionStyle shows MBR or GPT.

Read the disk from outside. Rovnix protects its sectors on the running system, so image the disk from a WinPE or Linux boot medium, or attach it to another machine. Keep at least the first MiB, the first 16 sectors of each NTFS partition and the last MiB of the disk. From Linux, with /dev/sda the system disk and the active partition at sector 2048 (check with mmls):

sudo dd if=/dev/sda of=disk.img bs=4M status=progress
mmls disk.img
dd if=disk.img bs=512 skip=2048 count=16 2>/dev/null | xxd | less
dd if=disk.img bs=512 skip=2049 count=15 2>/dev/null | sha256sum
dd if=disk.img bs=512 skip=1 count=2047 2>/dev/null | gzip -c | wc -c

What to look for:

  • The IPL. The 15 sectors after the VBR normally hold the same code on every NTFS system volume prepared by the same Windows version. Compare their hash with a clean machine or image of that version. A difference, or data that does not look like boot code, needs explaining.
  • The VBR. Its code should match the standard NTFS boot code of that Windows version, and its text strings (A disk read error occurred, BOOTMGR is missing) should be in place.
  • The gap after the MBR. On a Windows disk it is usually zeros. The last command shows how well it compresses: a few kilobytes for zeros, close to 1 MiB for encrypted data. Some boot managers, encryption products and OEM tools store code there too, so identify what you find. Repeat for the space after the last partition.

On the file system, look in the $MFT and USN journal for the 2020 dropper's names and for a Windows folder with a trailing space at the root of C:. See the MFT and the USN journal on Windows Forensics.

What the checker looks for

bootsector is the module that can see Rovnix. On a disk image or disk head it:

  • raises "Volume boot code does not match a known loader" and "NTFS loader sectors do not match a known loader" when the boot sector's code or the NTFS initial program loader (sectors 1 to 15 of the partition) is not one it recognises, which is where Rovnix writes its code;
  • raises "Data before the first partition does not match a known loader" for non-zero, high-entropy data between the MBR and the first partition, where Rovnix places its hidden partition when there is room;
  • raises "Data after the last partition" for data at the end of the disk, when it gets a full image (it reads the first 4 MiB and the last 1 MiB).

Because Rovnix.D and later builds change their code from sample to sample, these findings rest on "this is not a loader the checker knows", not on a Rovnix signature, and none of them links to this page by itself. A hidden partition at the end of the disk is out of reach when only the disk head was collected. The module does not decrypt or parse the hidden partition, and it is misled by an image taken from the infected running system. The other modules have nothing to read: Rovnix registers no driver service (windrivers), does not use an EFI system partition (esp) and runs only on BIOS systems, outside the Windows Measured Boot logs (measuredboot).

Removal and recovery

  1. Preserve a full image, or at least the disk head, the partitions' first sectors and the disk tail, taken from a clean environment.
  2. The boot path can be rewritten from the Windows Recovery Environment (bootrec /fixmbr, bootrec /fixboot). Check afterwards that the VBR and the IPL match a clean reference: a repair that leaves the IPL in place leaves the bootkit in place.
  3. Prefer a rebuild. Rovnix delivered banking trojans (Carberp) and, in 2020, a backdoor that could run programs and record the microphone. The kernel driver had full control of the host while it ran. Wipe the disk, including the space outside the partitions (diskpart, clean all), and reinstall from known-good media.
  4. Rotate the credentials used on the host, including online banking and other web sessions.
  5. Move the machine to UEFI boot from a GPT disk with Secure Boot on, where VBR and IPL code are never run. Gapz and TDL4 are removed from the boot path the same way. For UEFI-era bootkits such as ESPecter, see How to check the ESP for a bootkit offline.

Sources

Primary public reports, newest first.

  1. 2020-06-23Oh, what a boot-iful mornin'Kaspersky
  2. 2012-07-13Rovnix bootkit framework updatedESET
  3. 2012-02-22Rovnix Reloaded: new step of evolutionESET
  4. 2011-08-23Hasta La Vista, Bootkit: Exploiting the VBRESET

See also

Related families