Skip to content
 
 

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Disable Kernel DMA Protection from pre-boot

This program is used to control an FPGA board running the PCILeech firmware. DMAReaper will automatically seek and destroy the DMAR ACPI table on the target computer via pre-boot DMA attack against UEFI. When successful, this operation will prevent usage of the IOMMU and subsequent initialization of Kernel DMA Protection when Windows Boots. This program is suitable for disabling Kernel DMA Protection on windows 10 or windows 11 even when target firmware has Secure Boot, VT-d, VT-x, Sure Start, Virtualization based BIOS Security, and Enhanced firmware runtime intrusion detection and prevention Enabled. This method will not trigger BitLocker recovery on auto-booting Windows with TPM BitLocker key protector. If you require disabling pre-boot DMA protection in order to use this tool but do not have access to UEFI GUI, consider patching settings in firmware directly with the help of NVRAMap.

Usage

usage: DMAReaper.py [-h] [-v] [-i INTENSITY] [-min MIN_ADDR] [-max MAX_ADDR]

DMAReaper — Disable Kernel DMA Protection via DMAR overwrite

options:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose debug output
  -i INTENSITY, --intensity INTENSITY
                        Number of times each memory segment is read during scan. Lower is faster but less reliable. (default: 3)
  -min MIN_ADDR, --min-addr MIN_ADDR
                        Minimum scan address (default: 0x10000000)
  -max MAX_ADDR, --max-addr MAX_ADDR
                        Maximum scan address (default: 0xFFFFFFFF)

The only value you might need to change out of the box is MIN_ADDR.

Demo

Preparation

  1. Connect the FPGA board to the target computer via appropriate PCI Express port (M.2 / ExpressCard / Mini PCIe)
  2. Connect the FPGA board to the attack computer via the data port (USB-C)
  3. Power on the target computer
  4. Quickly power on the board to ensure proper initialization
  5. Enter UEFI on the target computer
  6. You may need to repeat steps 3-5 several times before you get a valid PCIe Link. Timing is key.
  7. Once valid PCIe Link is established, run the DMAReaper.py program from attack computer and wait for success message.
  8. Upon completion, select "Continue Boot" or equivalent on target computer to boot into Windows with Kernel DMA Protection disabled.

Explanation

For more info, read my detailed blog post.

This program uses the LeechCore python API to control the FPGA and scan memory of target computer during UEFI. DMAReaper will identify the EFI System Table, use it to find the Configuration table and isolate the ACPI 2.0 VendorTable pointer. The program will then identify the ACPI 2.0 Root System Description Table to find all installed ACPI tables and parse them to identify the DMAR ACPI entry. Once the DMAR ACPI table is located, it will be overwritten with null bytes, effectively destroying it. Windows uses the DMAR table to report the IOMMU remapping, and when the table is absent, cannot utilize kernel DMA protection features. As a result, the protection is disabled and windows will boot without it. Note that this does not impact Virtualization Based Security (VBS) features such as HVCI and Secure System.

Shout-Out

A special thank you goes out to Ulf Frisk, the creator of the amazing PCILeech framework and LeechCore Library.

About

Disable Kernel DMA Protection on Windows 11 via pre-boot DMA attack

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages