百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

SmmBackdoorNg

> 编程语言
开源

基于 UEFI 的平台的系统管理模式后门的更新版本:老狐狸,新招数

377 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

基于 UEFI 的平台的系统管理模式后门的更新版本:老狐狸,新招数

SMM Backdoor Next Gen

General information
Contents
Backdoor usage
Deploying the backdoor using firmware flash image infection
Using together with Hyper-V Backdoor
Building from the source code

General information

This version of System Management Mode backdoor for UEFI based platforms was heavily inspired by my previous project (check its GitHub repository) but introducing few key changes in order to make it more up to date:

  • In addition to the usual firmware flash image infection method as described in the article, new SMM backdoor also can be deployed with pre-boot DMA attack using PCI Express DIY hacking toolkit (see uefi_backdoor_simple.py program usage for more details) and industry-wide EFI SMM Core vulnerability exploitation to perform DXE to SMM execution transition. The vulnerability INTEL-SA-00144 was discovered by myself and reported to Intel PSIRT years ago, but it still remains not patched on many products that using old EDK2 derived firmware code, including whole AMI Aptio family. Latest generations of Intel machines are likely not vulnerable to this attack.

  • Client program smm_backdoor.py supports Windows and Linux systems and can interact with SMM backdoor using SW SMI (requires high privileges and chipsec installed) or APIC periodic timer method that can work with any privileges level.

  • There's smm_backdoor_privesc_linux.py and smm_backdoor_privesc_win.py test client programs for SMM backdoor that demonstrating local privileges escalation under Windows and Linux by using its API provided by smm_backdoor.py library.

  • SMM backdoor is fully virtualization-aware now, its library and client programs can work as expected inside Windows or Linux virtual machines running on the infected host system.

  • SMM backdoor also can be used to load my Hyper-V backdoor (which is also part of PCI Express DIY hacking toolkit) into the currently running hypervisor during RT phase and perform guest to host VM escape attacks. Test client program smm_backdoor_hyper_v.py is used for integration with Hyper-V backdoor and its deployment.

Contents

The project consists from the following files and directories:

  • src/ − Source code directory of UEFI DXE driver that implements SMM backdoor functionality along with software part of the exploit.

  • config.h − C header file with backdoor UEFI driver project configuration.

  • interface.h − C header file with SMM backdoor program interface definitions.

  • SmmBackdoorNg.inf − EDK II project configuration file for backdoor UEFI driver.

  • SmmBackdoorNg_X64.efi − Compiled binary of backdoor UEFI driver.

  • SmmBackdoorNg_X64.pdb − Debug symbols for the binary.

  • smm_backdoor.py − Backdoor client program, also used to infect PE images of UEFI SMM drivers.

  • smm_backdoor_privesc_linux.py − Backdoor client program with Linux local privileges escalation demo.

  • smm_backdoor_privesc_windows.py − Backdoor client program with Windows local privileges escalation demo.

  • smm_backdoor_hyper_v.py − Backdoor client program used for Hyper-V backdoor deployment.

Backdoor usage

Project documentation is incomplete at this moment, but here's some command line examples.

Deploying SMM backdoor UEFI driver with PCI Express DIY hacking toolkit using pre-boot DMA attack, DXE to SMM execution transition exploit mentioned above will be started automatically once backdoor driver will be loaded:

…

In case if you're going to deploy SMM backdoor with PCI Express DIY hacking toolkit − I would recommend to get used Xilinx ZC706 from e-Bay rather than older SP605 evaluation kit, since this board has better design, can perform DMA attacks faster and its development tools are more suitable for modern day use.

To deploy SMM backdoor you also can use my Pico DMA project − fully autonomous pre-boot DMA attack hardware implant for M.2 slot based on PicoEVB development board that can run arbitrary UEFI DXE drivers as payload.

In addition, you also can deploy the backdoor using firmware flash image infection described below in the next section.

Basic use of SMM backdoor smm_backdoor.py client program to display backdoor debug messages buffer once it was loaded and system has been booted:

…

Check for responding backdoor and show basic information about System Management Mode execution environment:

# python2 smm_backdoor.py --use-timer --test
[+] Checking if SMM backdoor is present...
[+] Obtaining information...

  CR0 = 0x80000033
  CR3 = 0x7b7b1000
 SMST = 0x7b7f84c0

[+] SMRAM regions:

 * 0x7b000000:7b000fff
 * 0x7b001000:7b7fffff

Example of reading of arbitrary physical memory, beginning of SMRAM region in this case:

…

To read and dump entire SMRAM regions into the file you can use the following command:

# python2 smm_backdoor.py --dump-smram
****** Chipsec Linux Kernel module is licensed under GPL 2.0
[+] Dumping SMRAM regions, this may take a while...
[+] Creating SMRAM_dump_7b000000_7b7fffff.bin

Example of smm_backdoor_privesc_linux.py client program usage for local privileges escalation under the Linux operating system:

…

Example of smm_backdoor_privesc_win.py client program usage for local privileges escalation under the Windows operating system:

…

Deploying the backdoor using firmware flash image infection

To infect platform firmware stored in the flash chip on the motherboard with SMM backdoor you will need some SPI flash programmer, I prefer to use cheap and widely available FT2232H Mini Module from FTDI. Also, there's a board called Tigrad − multi-protocol, multi-voltage tool for hardware hacking that can work as SPI flash programmer. In addition to the programmer you also will need the following tools:

  • UEFITool utility to parse and edit UEFI flash images
  • Flashrom utility to work with SPI flash programmer
  • SOIC8 test clip or probe hook clips kit to connect programmer to the flash chip without its de-soldering

First of all, you have to disassemble the machine and locate SPI flash chip with platform firmware. Usually, it's W25Q64 or W25Q128 Windbond NOR flash in SOIC8 package. Then you have to connect the chip to the FT2232H Mini Module. It’s more convenient to use SOIC8 test clip than probe hook clips, but very often there’s not enough free space around the chip to place test clip.

In case if you happen to find WSON8 packaged chip on you board instead of usual SOIC8 − you can either de-solder it or use some sort of DIY spring-loaded pogo pin test probe like this one to tap its pads:

Flash chip must be connected to the channel A of FT2232 Mini Module by the following scheme:

Now you can read flash chip contents using Flashrom:

# flashrom -p ft2232_spi:type=2232H,port=A –r firmware.bin

After that you need to open dumped firmware in UEFITool, locate arbitrary UEFI SMM driver to infect and extract its PE32 image section from the firmware image:

For example, I picked NvramSmm UEFI SMM driver responsible for NVRAM access as pretty much suitable one. Then you can infect extracted driver with SMM backdoor using --infect command line option of smm_backkdoor.py program:

# python2 smm_backkdoor.py --infect NvramSmm.bin --output NvramSmm_infected.bin --payload SmmBackdoorNg_X64.efi

After that you have to replace original driver image with NvramSmm_infected.bin one in UEFITool, save resulting firmware image and flash it back into the chip:

# flashrom -p ft2232_spi:type=2232H,port=A –w firmware_infected.bin

Using together with Hyper-V Backdoor

Once you have SMM backdoor loaded, as it shown above, you can use its capabilities to load Hyper-V backdoor during runtime phase with appropriate client program running inside arbitrary guest or host Hyper-V partition.

To do that you need to save backdoor.bin file form Hyper-V backdoor repository as hyper_v_backdoor.bin in the same folder with smm_backdoor_hyper_v.py test client program and then just run it:

…

In case when smm_backdoor_hyper_v.py is unable to locate target VMCS region − you can override its default scanning options by specifying appropriate values in --scan-from, --scan-to and --scan-step command line arguments of the program. Since VMCS region location stage might take a while, you also can use --verbose option of the program to display operation progress information.

After successful Hyper-V backdoor load you can run its client program to ensure that backdoor is up and responding:

PS C:\> .\hyper_v_backdoor_client.exe 0
[+] Running on CPU #0
[+] Hyper-V backdoor is running

      Hypervisor CR0: 0x80010031
      Hypervisor CR3: 0x100103000
      Hypervisor CR4: 0x422e0
 Hypervisor IDT base: 0xfffff87b69a00180 (limit = 0xffff)
  Hypervisor GS base: 0xfffff87b69ba6000
        VMCS address: 0x109341000
     VM exit handler: 0xfffff87b6960e010
       VM exit count: 0x86ed
       VM call count: 0x2518

For more information about Hyper-V backdoor client program and performing guest to host VM escape attacks on Windows targets you can check usage examples in Hyper-V backdoor documentation.

Building from the source code

To compile SMM backdoor UEFI driver SmmBackdoorNg_X64.efi you need to have a Windows machine with Visual Studio and EDK II source code installed.

To build project from the source code you need to perform the following steps:

  1. Install Visual Studio and EDK II following its setup instructions.

  2. Copy SmmBackdoorNg project directory into the EDK source code directory.

  3. Edit Conf/target.txt file of EDK, set ACTIVE_PLATFORM val

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Cbackdoorbootexploitfirmware

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言