Breaking the Boot Chain: Bootkitting Ubuntu for Fun and Profit
Ido Veltzman (Senior Security Researcher)
SEC-T 2026 · Day 3 · Main hall
Overview
In a compelling presentation at SEC-T, Ido Veltzman, a Senior Security Researcher specializing in kernel, UEFI, and boot security, unveiled a sophisticated approach to post-exploitation on Linux systems. His talk, "Breaking the Boot Chain: Bootkitting Ubuntu for Fun and Profit," delved into the intricate process of designing and implementing a UEFI GRUB bootkit. Veltzman, with a background primarily in Windows low-level security, extended his expertise to the Linux ecosystem, highlighting the critical yet often overlooked attack surface presented by the Linux boot sequence.

Key moments
- 0:00 Talk Introduction and Linux Bootkit Goals
- 1:00 GRUB: More Than Just a Bootloader
- 12:00 Comprehensive Linux Boot Chain Summary
- 14:00 Designing the Linux Bootkit: Key Challenges
- 25:45 Leveraging Linux Init Calls for Execution
- 30:50 Bootkit Proof of Concept Demonstration
- 34:00 Full Infection Chain Recap and Conclusions
- 36:40 Q&A: Bootkit Applicability to Other Distros
Breaking the Boot Chain: Bootkitting Ubuntu for Fun and Profit
Speakers: Ido Veltzman, Senior Security Researcher, Cybereason
Conference: SEC-T
YouTube: https://www.youtube.com/watch?v=s22wW8I_Jxk
Overview
In a compelling presentation at SEC-T, Ido Veltzman, a Senior Security Researcher specializing in kernel, UEFI, and boot security, unveiled a sophisticated approach to post-exploitation on Linux systems. His talk, "Breaking the Boot Chain: Bootkitting Ubuntu for Fun and Profit," delved into the intricate process of designing and implementing a UEFI GRUB bootkit. Veltzman, with a background primarily in Windows low-level security, extended his expertise to the Linux ecosystem, highlighting the critical yet often overlooked attack surface presented by the Linux boot sequence.
The core of Veltzman's research addresses the scarcity of publicly known Linux UEFI bootkits and the unique challenges involved in their creation. Unlike more standardized Windows boot processes, the Linux boot chain is characterized by its modularity, diverse components, and lack of direct callback mechanisms for UEFI applications, making traditional bootkit techniques difficult to apply. This article dissects Veltzman's methodology, from identifying crucial hooking points within GRUB and the kernel to leveraging obscure Linux internals for persistent, evasive code execution, ultimately demonstrating a functional bootkit capable of loading malicious kernel modules without detection or system disruption.
Background
▶ Watch: Talk Introduction and Linux Bootkit Goals (0:00)
To understand the attack, it's essential to first grasp the complexities of the Linux boot chain, particularly in a UEFI environment. The process begins with GRUB (Grand Unified Bootloader), which, as Veltzman explains, is far more than a simple bootloader. It functions as a full execution environment, supporting numerous file system types (FAT32, EXT4, XFS, BTRFS), and is highly configurable through shell scripts that translate into GRUB's own POSIX-like scripting language. For UEFI systems, GRUB's configuration is managed by grub-mkconfig, which compiles data from /etc/default/grub and scripts under /etc/grub.d into the final grub.cfg file.
GRUB's primary responsibility is to prepare and load the next stage: vmlinuz and initramfs. vmlinuz is an EFI application that serves as a compressed wrapper for the actual Linux kernel. Its role is to decompress the kernel (using various algorithms like gzip, lzma, xz, lz4, or zstd – with zstd being the focus for Ubuntu systems), resolve relocations, and initiate the kernel's execution. This involves normalizing the early CPU state, setting up a temporary boot stack, loading the Global Descriptor Table (GDT), and performing a series of jumps to transfer control to the decompressed kernel. A critical observation made by Veltzman is the limited number of UEFI callbacks registered by GRUB, which presents a significant hurdle for bootkit developers seeking to tap into specific boot events.
Following vmlinuz's decompression and initial setup, the actual kernel (vmlinux) takes over. It initializes page tables, memory management, interrupt handling, and crucial security mechanisms like KASLR (Kernel Address Space Layout Randomization) and NX (No-Execute). It also discovers and initializes built-in drivers, establishes the scheduler, and exposes syscalls for user-mode communication. Concurrently, the initramfs (initial RAM filesystem) plays a vital role. This is a temporary, RAM-based root filesystem that provides essential user-space tools and kernel modules needed before the real root filesystem can be mounted. It handles complex tasks like assembling RAID arrays, activating LVM, and requesting LUKS decryption keys (analogous to BitLocker in Windows). Once the real root filesystem is ready, the initramfs's init process uses the switch_root command to transition to the persistent filesystem and launch the final init system, typically systemd. This multi-stage, often parallel, and asynchronous boot process creates a challenging environment for attackers aiming to maintain control from the very beginning.
Key Findings
▶ Watch: Comprehensive Linux Boot Chain Summary (12:00)
Ido Veltzman's research yielded several crucial findings that collectively enable the creation of a persistent and evasive Linux UEFI bootkit:
- Identification of Critical Hooking Points: Veltzman successfully identified two key functions in the early boot chain that allow an attacker to gain control and gather necessary information:
grub_efi_linux_boot_imagewithin GRUB itself and the kernel's decompression function (zstd_decompressfor Ubuntu'svmlinuz). These hooks provide access to thevmlinuzand subsequently the decompressed kernel's memory addresses. - Leveraging Execution Caves: Despite the initial challenge of finding executable memory, Veltzman demonstrated that even small code caves (execution caves), such as a 41-byte region found in the decompressed kernel, can be effectively utilized. This required a strategy of binary golfing—minimizing shellcode size and separating data from code—along with making the code Position Independent (PIC).
- Novel Use of Linux Init Calls for Deferred Execution: A significant breakthrough was the realization that Linux init calls (a table-driven mechanism for kernel component initialization) could serve as a reliable, late-stage execution primitive. By patching the last
late_initcall, the bootkit ensures its shellcode runs when the system is largely stable, mitigating issues related to early boot volatility. - Integration of Linux Workqueue Subsystem: To overcome the inherent size limitations of code caves and the need for asynchronous execution, Veltzman integrated the Linux workqueue subsystem. This mechanism allows the initial, small shellcode (the "stager") to schedule a larger, more complex payload (the "worker") to run later in a process context, providing flexibility in timing and payload size.
- Successful Evasive LKM Loading: The research culminated in a proof-of-concept demonstrating the seamless loading of an unsigned malicious LKM (Loadable Kernel Module), dubbed "Silver Seal rootkit," without triggering system crashes or visible errors. This highlights the bootkit's evasiveness and deep persistence capabilities, operating below the standard OS security mechanisms.
- Underexposed Attack Surface: The entire endeavor underscored the fact that the Linux boot process, particularly UEFI GRUB, remains a significantly underexposed area in security research, presenting a potent avenue for attackers seeking stealthy, low-level persistence.
Technical Deep Dive
▶ Watch: Leveraging Linux Init Calls for Execution (25:45)
The design of Veltzman's Linux bootkit is a masterclass in exploiting low-level system internals, carefully navigating the complexities of the boot process to achieve deep persistence. The primary goals for the bootkit were: to run a malicious LKM directly, avoid patching the kernel to allow unsigned modules (which would be a detectable change), maintain full lifecycle control from GRUB to OS load, and operate without causing any system crashes or visible disruptions.
The initial hurdle was the limited number of UEFI callbacks offered by GRUB, which contrasts sharply with Windows EFI. This means direct event-driven hooking, common in Windows UEFI bootkits, is not feasible. Furthermore, the transition from physical to virtual addressing within the kernel is not precisely signaled, and the kernel's decompression phase, coupled with the largely independent execution of initramfs, creates a highly dynamic and unsynchronized environment.
Hooking the Boot Chain
Veltzman identified two critical hooking points to establish control:
- GRUB Hook:
grub_efi_linux_boot_image
- This function is responsible for loading
vmlinuzand its arguments. By hooking it beforevmlinuzexecution, the bootkit gains its first foothold. - Purpose: Obtain the memory address of
vmlinuz, its size, and any kernel arguments. This information is crucial for subsequent stages.
vmlinuzDecompression Hook:zstd_decompress
- Ubuntu utilizes ZSTD for kernel compression. Veltzman targeted the
zstd_decompressfunction (or its equivalent in other compression schemes). - Purpose: This hook provides access to the decompressed kernel image in memory. This is the crucial moment for the bootkit to patch the kernel directly, as
vmlinuzhas finished its job and the actual kernel is now ready for execution. The function receives parameters such as the decompression context, the buffer containing the compressed kernel, and critically, the output buffer that will hold the decompressed kernel.
Overcoming Execution Constraints
Once the decompressed kernel is in memory, the challenge shifts to executing arbitrary code. Direct execution at this stage is difficult due to the lack of clear, predictable execution paths and the volatile nature of early kernel initialization.
- Code Caves and Binary Golfing:
- Initial attempts to find large, executable regions of memory within the kernel image revealed a scarcity of space. The largest contiguous code cave found was only 41 bytes.
- To fit meaningful code into such a small space, Veltzman employed binary golfing techniques. This involves writing highly optimized, minimalistic shellcode. Key strategies included:
- Separating data from code: Storing data (e.g., paths to rootkits) in writable data caves, preserving precious executable memory for instructions.
- Multi-stage shellcode: Executing the shellcode in parts, where a small "stager" leads to a larger "worker."
- Position Independent Code (PIC): Essential because the exact memory location of the kernel and its components can vary, requiring code that does not rely on fixed addresses.
- Linux Init Calls as an Execution Primitive:
- Veltzman identified Linux init calls as a robust mechanism for deferred execution. These are a series of function pointers organized into tables (e.g.,
early_initcall,core_initcall,late_initcall) that the kernel executes at specific stages of its initialization. - Strategy: The bootkit patches the last
late_initcallentry to point to its small, golfed shellcode. This ensures that the bootkit's code runs after most of the kernel and its subsystems (scheduler, memory management, file systems) are initialized, providing a stable environment.
- Linux Workqueue Subsystem for Asynchronous Payload Execution:
- The
late_initcallhook provides an execution primitive, but the 41-byte code cave is still too small for a full rootkit loader. This is where the Linux workqueue subsystem comes into play. - Mechanism: The small
late_initcallshellcode (the "stager") is designed to: - Locate a pre-crafted
work_struct(a kernel data structure representing a work item) placed in a writable data cave. - Initialize this
work_structwith parameters, including a pointer to the "worker" shellcode. - Call
schedule_work(a kernel API) to queue thework_structfor execution by a kernel worker thread. - Crucially, after scheduling the work, the stager jumps back to the original
late_initcallfunction, ensuring the legitimate boot process continues uninterrupted. - Stager Shellcode (Assembly): The stager's assembly code is primarily responsible for locating the
work_struct, populating its fields (e.g., setting thefuncpointer to the worker shellcode's address), and invokingschedule_work. It uses placeholders for dynamic addresses (e.g.,work_structlocation,schedule_workAPI address).
- Worker Shellcode for Rootkit Loading:
- The "worker" shellcode, executed asynchronously via the workqueue, has more time and potentially more memory available.
- Functionality:
- It can include a short sleep (e.g., 10 seconds) to ensure the system is fully stable and user-mode is up.
- It then leverages
call_usermodehelper(a kernel API for executing user-mode programs from the kernel) to invokeinsmod. insmodis a standard Linux utility for loading kernel modules. By usingcall_usermodehelperto runinsmodwith the path to the malicious LKM, the bootkit can load an unsigned module without directly patching the kernel's module signing enforcement, making it more evasive.- After loading the LKM, the worker restores the stack frame and returns, allowing the kernel thread to continue its normal operations.
The Full Infection Chain
- GRUB Hook:
grub_efi_linux_boot_imageis intercepted to getvmlinuz's address and size. vmlinuzHook:zstd_decompressis intercepted to get the address of the decompressed kernel.- Kernel Patch: The last
late_initcallentry in the decompressed kernel is patched to point to the bootkit's stager shellcode (residing in a code cave). - Stager Execution: When the
late_initcallfires, the stager executes, initializes awork_struct, and callsschedule_work. It then jumps to the originallate_initcall. - Worker Execution: A kernel worker thread picks up the scheduled
work_struct, executes the worker shellcode. - LKM Loading: The worker shellcode uses
call_usermodehelperto invokeinsmod, loading the malicious LKM (e.g., "Silver Seal rootkit"). - System Continues: The system boots normally, with the malicious LKM loaded and running in the kernel, achieving deep, evasive persistence.
This multi-stage, multi-component attack chain demonstrates a profound understanding of the Linux boot process and kernel internals, combining several advanced techniques to achieve its objective.
Demo / Proof of Concept
▶ Watch: Bootkit Proof of Concept Demonstration (30:50)
Ido Veltzman provided a clear demonstration of the bootkit in action, running on an Ubuntu virtual machine hosted in Hyper-V. The proof-of-concept (POC) involved a simple shell script that replaced the original GRUB configuration with the bootkit-modified version.
Upon rebooting the VM, the system appeared to boot normally, which is a critical aspect of the bootkit's evasiveness. No visible errors, crashes, or unusual loading screens were presented to the user. The real insight into the bootkit's operation came from monitoring the serial port output, which provided a detailed log of the bootkit's execution:
- GRUB Initialization: The output confirmed the GRUB base address.
grub_efi_linux_boot_imageHook: The first hook was triggered, successfully acquiring the location ofvmlinuz.zstd_decompressHook: The second hook activated, indicating that the decompressed kernel's address had been obtained.- Init Call Table Patch: The serial log showed the entry in the
late_initcalltable being patched with the address of the bootkit's stager shellcode. - Code Cave Utilization: The specific memory addresses of the execution caves used for both the stager and the worker shellcode were logged, along with the initialization of the
work_struct.
After the system fully booted and the specified sleep duration (e.g., 10 seconds) passed, the ultimate proof of success was revealed in the kernel message buffer. By inspecting the dmesg output, Veltzman showed that his "Silver Seal rootkit" (a personal rootkit framework) had successfully loaded and printed a "hello world" message, confirming its presence and functionality within the kernel. This demonstration effectively validated the entire infection chain, from the initial GRUB hook to the final loading of an unsigned LKM, all while maintaining system stability and evading overt detection.
Defensive Implications
▶ Watch: Q&A: Bootkit Applicability to Other Distros (36:40)
The research presented by Ido Veltzman carries significant implications for defenders responsible for Linux systems. The demonstrated bootkit highlights a potent and often underexposed threat vector that demands serious attention.
- Deep Persistence: Bootkits provide an attacker with the deepest form of persistence, operating below the operating system level. This makes them exceptionally difficult to detect and remove using traditional endpoint security solutions, which typically operate within the OS context. An attacker with a bootkit maintains control even across reboots and OS reinstalls, making forensic analysis and remediation extremely challenging.
- Linux's Ubiquity: Linux powers a vast array of systems, from critical servers and cloud infrastructure to IoT devices, embedded systems, and desktops. A successful bootkit technique for Linux could therefore have widespread impact across diverse environments, many of which may lack robust boot integrity protections.
- Secure Boot is Crucial but Often Lacking: Veltzman explicitly noted that "many Linux systems don't really have Secure Boot." Secure Boot, a UEFI firmware feature, is designed to prevent unauthorized code (like bootkits) from executing during the boot process by verifying digital signatures of boot components. When properly configured and enforced, Secure Boot would significantly mitigate the type of attack demonstrated. However, its absence or misconfiguration on many Linux deployments creates an easy entry point. Attackers often only need root privileges (which can be obtained through various exploits) to install such a bootkit, bypassing any subsequent OS-level security.
- Complexity of the Linux Boot Chain: The intricate, multi-stage, and often parallel nature of the Linux boot process (GRUB,
vmlinuz,initramfs, kernel initialization) makes comprehensive monitoring and integrity checking a formidable task. The numerous "moving parts" and lack of direct, standardized callback mechanisms create blind spots that attackers can exploit. Defenders need to understand these complexities to identify potential points of compromise.
- Underexposed Attack Surface: The relative scarcity of public research and tools focusing on Linux UEFI bootkits means that defensive capabilities in this area are often underdeveloped. This "underexposed" nature gives attackers a significant advantage, as detection mechanisms and incident response playbooks for such low-level threats are less mature than for OS-level malware.
Recommendations for Defenders:
- Enforce Secure Boot: Mandate and properly configure UEFI Secure Boot across all Linux deployments. Ensure that only trusted, signed boot components are allowed to execute. Regularly audit Secure Boot configurations to prevent tampering.
- Monitor Boot Integrity: Implement solutions that monitor the integrity of boot components, including GRUB,
vmlinuz, andinitramfs. This could involve cryptographic hashing of boot files and comparing them against known good baselines. - Firmware Security: Pay attention to UEFI/BIOS firmware security. Firmware vulnerabilities can allow attackers to disable Secure Boot or install firmware-level rootkits.
- Root Cause Analysis for Root Compromises: If root access is achieved on a Linux system, always consider the possibility of bootkit installation. Deep forensic analysis, potentially involving offline inspection of boot partitions and firmware, may be necessary.
- Invest in Low-Level Threat Detection: Encourage research and development into tools and techniques specifically designed to detect boot-level compromises on Linux, including memory forensics during early boot stages or hardware-assisted integrity checks.
- Educate and Train: Raise awareness among security teams about the threat of Linux bootkits and the complexities of the Linux boot process.
Veltzman's work serves as a crucial reminder that security must extend beyond the operating system, deep into the boot chain, to truly protect modern computing environments.
Key Takeaways
- The Linux boot process, particularly with UEFI GRUB, is a complex, multi-stage chain that presents unique and powerful opportunities for deep, evasive persistence.
- Attaining initial control within GRUB (
grub_efi_linux_boot_imagehook) and subsequently intercepting the kernel's decompression phase (zstd_decompresshook) are critical steps for bootkit injection. - By leveraging obscure Linux kernel internals like init calls (specifically patching
late_initcall) and the workqueue subsystem, attackers can achieve reliable, deferred execution of arbitrary code, overcoming early boot volatility and space constraints. - Even extremely small executable regions (code caves) can be effectively utilized through binary golfing and multi-stage, Position Independent Code (PIC) shellcode.
- The demonstrated technique allows for the loading of unsigned kernel modules (LKMs) via
call_usermodehelperandinsmodwithout directly patching kernel signing enforcement, enhancing evasiveness. - Linux UEFI bootkits represent a potent and currently "underexposed" threat, offering attackers a highly persistent and difficult-to-detect foothold below the operating system level. Defenders must prioritize Secure Boot enforcement and boot integrity monitoring.
About the Speaker(s)
Ido Veltzman is a Senior Security Researcher at Cybereason. His expertise lies in low-level system security, with a particular focus on kernel, UEFI, and boot processes. While having a strong background in Windows security, his work on "Breaking the Boot Chain: Bootkitting Ubuntu for Fun and Profit" demonstrates his deep dive into the Linux ecosystem, applying similar rigorous research methodologies to uncover novel attack vectors and defensive strategies. His research contributes significantly to understanding and mitigating sophisticated threats at the earliest stages of system operation.
Reviews
Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT
Veltzman didn't just write another theoretical paper; he built a fully functional, highly evasive UEFI bootkit for Ubuntu that threads the needle from GRUB to an unsigned LKM without panicking the kernel. Stringing together initcalls, workqueues, and a 41-byte code cave into a reliable execution chain is elegant as hell. This is the exact kind of low-level offensive research we need more of.
Heather Calloway (CISO) — SOLID
Veltzman executes a deep, credible dive into Linux UEFI bootkits, an attack surface the industry historically ignores in favor of Windows. For leadership, the takeaway is simple: if your server fleet isn't enforcing Secure Boot, a root compromise means the box is permanently owned. It's an engineering talk, but it directly validates the need for strict firmware integrity controls.