UEFI bootkit
Bootkitty Linux UEFI Bootkit: Traces and Offline Checks
Bootkitty, a proof-of-concept UEFI bootkit for Ubuntu, replaces GRUB in the EFI system partition and loads unsigned kernel modules. Traces, checks, recovery.
- Kind
- UEFI bootkit · Boot layer
- Platforms
- Linux
- First seen
- 2024-11
- Status
- Proof of concept
- Checked by
- EFI system partitionMeasured Boot logsLinux kernel
Overview
Bootkitty is a UEFI bootkit for Linux. ESET published it on 27 November 2024, after a sample named bootkit.efi was uploaded to VirusTotal that month, and described it as the first UEFI bootkit aimed at Linux. ESET judged it a proof of concept: it found no deployment in its telemetry, the code only works on a few Ubuntu versions, and it relies on hard-coded byte patterns and offsets that can crash a system instead of compromising it. ESET, in an update on 2 December 2024, and Binarly later reported that it had been written as a project in Korea's Best of the Best (BoB) security training programme. The "BlackCat" strings in its kernel module have, according to ESET, no link to the ALPHV/BlackCat ransomware group.
On 29 November 2024, Binarly reported that a file found alongside the samples, logofail.bmp, exploits LogoFAIL, CVE-2023-40238, an image-parsing flaw in the BMP decoder of Insyde-based firmware. The exploit writes the bootkit's certificate into the shim MokList variable, so that shim trusts the bootkit with Secure Boot on. Binarly names affected models from Acer, HP, Fujitsu and Lenovo, and notes that Insyde's fix only helps once the vendor's firmware update is installed.
Bootkitty is on this list because it shows what a Linux bootkit looks like on disk and in the kernel, and because LogoFAIL remains unpatched on many machines.
How it loads and hides
Bootkitty is meant to sit on the EFI system partition (ESP) in place of Ubuntu's GRUB. ESET's removal advice implies the layout: the bootkit as /EFI/ubuntu/grubx64.efi, the legitimate GRUB moved to /EFI/ubuntu/grubx64-real.efi. Ubuntu's shim loads grubx64.efi as usual.
The bootkit is signed with a self-signed certificate, so it runs only when Secure Boot is off or when its certificate has been added to the shim's Machine Owner Key list, which is what the LogoFAIL file does. ESET describes what it does next, in memory:
- with Secure Boot on, it hooks the firmware's image authentication protocols so that every check reports success;
- it loads the real GRUB and patches its signature checks, so GRUB loads the kernel without verifying it;
- it patches the decompressed kernel: the module signature check always passes, the version and banner strings become
BoB13, andinitis started withLD_PRELOAD=/opt/injector.so /init.
After boot, ESET found related components: BCDropper, an unsigned kernel module (dropper.ko) whose modinfo output and debug paths contain "BlackCat"; it removes itself from the kernel's module list, hides files whose names start with injector, and drops an ELF that ESET named BCObserver to /opt/observer. BCObserver waits for gdm3 to start, then loads /opt/rootkit_loader.ko. ESET did not recover /opt/injector.so or rootkit_loader.ko.
Traces on disk
| Location | What | Source |
|---|---|---|
/boot/efi/EFI/ubuntu/grubx64.efi | The bootkit, self-signed, where GRUB should be | ESET |
/boot/efi/EFI/ubuntu/grubx64-real.efi | The legitimate GRUB, renamed | ESET |
UEFI variable MokList | A rogue certificate written by the LogoFAIL exploit (firmware NVRAM, not a file) | Binarly |
logofail.bmp | The LogoFAIL image found with the samples; the reports do not say where it would sit on a target | Binarly |
/opt/injector.so | Preloaded into init through LD_PRELOAD | ESET |
/opt/observer | BCObserver | ESET |
/opt/rootkit_loader.ko | Kernel module loaded by BCObserver | ESET |
dropper.ko | BCDropper, unsigned, "BlackCat" in modinfo | ESET |
Kernel log, /proc/sys/kernel/tainted | A tainted kernel after boot; BoB13 in the kernel banner | ESET |
ESET's report gives these SHA-1 hashes:
| File | SHA-1 |
|---|---|
bootkit.efi | 35ADF3AED60440DA7B80F3C452047079E54364C1 |
dropper.ko | BDDF2A7B3152942D3A829E63C03C7427F038B86D |
observer | E8AF4ED17F293665136E17612D856FA62F96702D |
Copies built from the same project would have different hashes; the layout above is the more durable trace.
How to check a host
Offline, from an image or a collection with boot/efi/:
- List
EFI/ubuntu/on the ESP. Agrubx64-real.efiis not part of Ubuntu's layout. Comparegrubx64.efiwith the signed copy shipped by thegrub-efi-amd64-signedpackage,/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed, and check its signer: Ubuntu's GRUB is signed by Canonical, the bootkit is self-signed. - Look in
/optforinjector.so,observerandrootkit_loader.ko, and for.kofiles outside/lib/modules. - Read
kern.logor the saved journal for taint messages and a kernel banner containingBoB13. - If a TPM event log was saved, read it: shim extends
MokListinto PCR 14 and measures each binary it loads into PCR 4 (shim README.tpm), so an added certificate or a different second-stage loader changes the log between boots.
Live:
mokutil --sb-state
mokutil --list-enrolled
sudo ls -la /boot/efi/EFI/ubuntu/
sudo sha256sum /boot/efi/EFI/ubuntu/grubx64.efi /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed
sudo sbverify --list /boot/efi/EFI/ubuntu/grubx64.efi
uname -v
cat /proc/sys/kernel/tainted
sudo cat /proc/1/environ | tr '\0' '\n' | grep LD_PRELOAD
ls -la /opt
ESET lists BoB13 in uname -v or dmesg, LD_PRELOAD in the environment of PID 1, and an unexpected taint value as signs. It also notes that on a Secure Boot system, an unsigned test module that loads successfully means module signature checking has been switched off. A rootkit that hides files and modules can make ls and lsmod lie; read the ESP and root file system from another system to be sure. The Linux side is covered in Checking Linux kernel modules offline and on Linux Forensics' kernel modules page.
What the checker looks for
espreadsboot/efi/EFI/...on a Linux host. Bootkitty'sgrubx64.efiraises "A self-signed signature on\EFI\ubuntu\grubx64.efi" when its signing certificate is itself self-signed; outside the Windows and fallback folders this is a medium finding. The renamedgrubx64-real.efikeeps GRUB's valid distribution signature, so the checker lists it without a finding: compare the folder with the package copies, as shown above. "is much newer than the other files in its folder" applies when the folder holds at least three files and the bootkit is a week or more newer than the rest.measuredbootreads a savedbinary_bios_measurements, which covers only the boot it was saved in; the checker compares boots only for Windows logs. It raises "Secure Boot was off during this boot" when the firmware measured Secure Boot as off, which Bootkitty needs unless the attacker's certificate is enrolled. If the firmware measured the renamed GRUB when the bootkit started it,\EFI\ubuntu\grubx64-real.efiappears as "A boot application outside the usual boot paths". The detail sheet lists thedbentries that authorized each image; the checker does not read the MOK list measurements.linuxkernelreads module files only underlib/modules/, sodropper.koand/opt/rootkit_loader.koare not read as modules, and nothing searchesmodinfofor "BlackCat". It can show their load in the kernel log ("Kernel log: unsigned module loaded", "Kernel log: out-of-tree module loaded") when the kernel printed those lines andkern.logormessageswas collected, and, with the collect script's_live/outputs, "Kernel tainted by an out-of-tree or unsigned module".
It cannot read UEFI variables, so a rogue MokList entry is only visible with mokutil on the live host or by decoding its measurement in the TPM log yourself. It cannot test whether the firmware is vulnerable to LogoFAIL; that is the firmware vendor's advisory and update.
Removal and recovery
ESET's fix for the bootkit itself is to move /EFI/ubuntu/grubx64-real.efi back to /EFI/ubuntu/grubx64.efi, which works only if the bootkit was deployed under that name. On a real incident, prefer:
- Preserve the ESP, the root file system and the kernel logs.
- Reinstall GRUB and shim from the distribution's signed packages, or rebuild the host. The kernel ran with signature checks off and with unknown modules; files and modules may be hidden.
- Remove unknown MOK certificates (
mokutil --deletewith the certificate file, ormokutil --reset), then confirm at the MokManager prompt on the next boot. - Install the firmware vendor's update for LogoFAIL, turn Secure Boot on, and set a firmware password.
- Rotate credentials used on the host, as for any root-level compromise.
Sources
Primary public reports, newest first.
- 2024-11-29LogoFAIL Exploited to Deploy Bootkitty, the first UEFI bootkit for LinuxBinarly
- 2024-11-27Bootkitty: Analyzing the first UEFI bootkit for LinuxESET
- 2024-11-27Bootkitty indicators of compromiseESET
- 2023-12-07CVE-2023-40238 (LogoFAIL in Insyde BmpDecoderDxe)NVD
See also
Related families
- BlackLotusUEFI bootkit
- ESPecterUEFI bootkit
- CosmicStrandFirmware implant