
Ring -4 to Ring 0: offense-defense firmware research platform. We build the bootkits, then we catch them. Closed-loop. Zero trust in silicon.
"Barzakh" (برزخ) — a barrier between two realms; the unseen boundary separating the living world from the world of spirits. Here it stands for the barrier between offense and defense, between vulnerability and detection.
The most comprehensive open-source UEFI firmware security research platform
Firmware threat emulation | Modular detection engine | Closed-loop adversary validation
138 registered built-in detectors — generated registry.
⚠️ ACADEMIC RESEARCH PROJECT — DEFENSIVE SECURITY ONLY
This platform exists to study firmware threats and build defenses against them. It contains offense emulations with lab safeguards. Use it only in authorized, isolated research environments. This safety guidance does not alter the BSD-2-Clause-Patent license.
Scan/deployment migration: see HARDENING.md for full JSON scan outcomes, exit codes (0/1/2), mandatory API authentication, approved input roots, validation provenance, and the limits of heuristic findings.
Barzakh is a full-stack firmware security research platform that models real-world bootkit TTPs across every privilege ring — from UEFI DXE drivers (Ring 0) down through SMM, Intel ME, AMD PSP, platform DMA controllers (Ring -3), and CPU microarchitectural threats (Ring -4). It pairs each offense technique with a corresponding detection engine, creating a closed-loop system where every attack is both reproducible and detectable.
Key capabilities:
barzakh-scanner range up boots a real QEMU q35 VM (SMM on, swtpm TPM 2.0, OVMF), deploys payloads through the removable USB boot path, captures guest RAM, and asserts detections end-to-end (see docs/RANGE.md)barzakh-server serves a web dashboard and JSON API (port 8420) with scheduled scans and risk-score trendsbarzakh-agent watches firmware targets, records history, and forwards findings to SIEMs (Elastic ECS, ArcSight CEF, QRadar LEEF) or webhookspxe_icmp_overflow payload (134 total), each with kill-switched dormant variants| Threat | Technique | Barzakh Coverage |
|---|---|---|
| BlackLotus (CVE-2023-24932) | Secure Boot bypass via vulnerable shim | blacklotus detector + blacklotus_mok payload |
| LogoFAIL (CVE-2023-40238) | Image parser overflow in UEFI firmware | logofail detector + logofail_image payload |
| PixieFail (CVE-2023-45229+) | Network stack buffer overflows in EDK2 | pixiefail detector + pixiefail_dhcp payload |
| CosmicStrand | SPI flash DXE persistence | FV integrity + SPI region + persistence detector |
| LoJax | First in-the-wild SPI implant | ME/SPI detector + flash descriptor analysis |
| MoonBounce | Modified core DXE in SPI flash | Boot Services hook + firmware volume diffing |
| MosaicRegressor | UEFI persistence framework | Multi-stage: FV tamper + PE inject + trampoline |
| Hacking Team (RCS) | UEFI rootkit with Option ROM | Option ROM detector + PCI expansion analysis |
| FinSpy | UEFI bootloader modification | ExitBootServices interception + memory scanning |
| Bootkitty (2024) | First Linux UEFI bootkit, GRUB signature bypass | linux_bootchain detector + bootkitty_grub_patch payload |
| CVE-2024-7344 | Signed reloader loads unsigned PE payloads | reloader detector + secureboot_reloader payload |
| CVE-2023-1017/1018 | TPM 2.0 reference implementation buffer overflow | tpm_command detector + tpm_ref_overflow payload |
| CVE-2026-97631 | EDK II UefiPxeBcDxe ICMP error overflow past the 504-byte Mode.IcmpError field during PXE boot | pxe_icmp_overflow detector + pxe_icmp_overflow payload (armed + dormant) |
21 EDK II modules across 3 architectures (x86_64, AArch64, RISC-V) emulating every known firmware persistence technique:
| Module | Ring | Technique |
|---|---|---|
DxeInject | 0 | DXE phase driver injection — LoadImage/StartImage + SetVariable hooks, FV persistence, SPI flash emulator with FVB2/Boot Guard backends, kill-switches |
ExitBootHook | 0 | ExitBootServices interception + MSR hooking |
SpiChipsetEmulator | -1 | Chipset-level SPI interface simulation |
SmmPersistence | -1 | SMM handler installation and SMRAM persistence |
CapsuleHijack | -1 | UEFI capsule update mechanism abuse |
AcpiTableInject | -2 | ACPI table injection for kernel memory access |
VirtualAddressMapHook | -2 | EFI Runtime Services hooking |
PciOptionRom | -2 | PCI Option ROM implantation |
MeSpiManipulation | -3 | Intel ME SPI flash region manipulation |
HeciIntercept | -3 | Host-ME communication channel interception |
MeDmaAttack | -3 | ME-initiated DMA to host memory |
AmtSolChannel | -3 | AMT Serial-over-LAN covert channel |
FtpmCommandForge | -3 | AMD fTPM command forgery via PSP mailbox |
| Module | Technique |
|---|---|
Aarch64DxeInject | ARM64 DXE injection with EL-aware payloads |
ExceptionVectorHook | VBAR_EL1 exception table relocation |
El3SecureMonitor | EL3 Secure Monitor call interception |
TzascManipulation | TrustZone Address Space Controller bypass |
DeviceTreeInject | Device Tree Blob modification for persistence |
IbootTrustChain | Apple iBoot chain-of-trust subversion |
SepMailboxIntercept | Apple SEP (Secure Enclave) mailbox interception |
| Module | Technique |
|---|---|
RiscVDxeInject | M-mode firmware injection on RISC-V platforms |