Skip to content
Misconfiguration Write-up Advanced

BTR Reforged: Weaponizing Defender’s Remediation Driver as a Kernel Operation Primitive

The Windows Defender Boot-Time Removal driver (BTR.sys) accepts an encrypted configuration from an alternate data stream and performs file and registry operations from kernel mode. An attacker with administrator rights can craft a valid transaction to delete or move files and modify registry keys, including disabling security software, without exploiting a memory corruption vulnerability.

[email protected] Follow

Published on research.checkpoint.com

What if a trusted security component could be repurposed into an attacker-controlled kernel primitive? What if a signed Microsoft remediation driver could be instructed to execute arbitrary file and registryoperations from Ring 0 – without exploits, vulnerabilities, or memory corruption?

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The driver trusts a configuration file stored in an alternate data stream and uses a hard-coded encryption key, so anyone who knows the format can create valid instructions for privileged file and registry operations.

Impact

An attacker with administrator rights could use the signed driver to delete or move files and modify registry keys, potentially disabling security software such as Microsoft Defender, though the driver must run as a system-start service and cannot load at the earliest boot phase.

What the attacker needed

Administrator privileges; ability to create a service; ability to write an alternate data stream; reboot for boot-time execution

The fix

The driver should not use a hard-coded encryption key and should restrict who can supply its configuration, or Microsoft should change the design so the driver only accepts transactions created by the Defender engine.

How it was found

  1. Extract the legitimate BTR.sys driver from the local MpEngine.dll resource section.
  2. Generate a randomized driver filename and write the encrypted transaction payload into an alternate data stream attached to that file.
  3. Construct a custom RC4-encrypted payload with correct CRC32 checksums and padding.
  4. Chain multiple operations into a single transaction, optionally including an anti-forensics action to delete the driver's log file.
  5. Create a service with a randomized name and load the driver immediately via NtLoadDriver, or configure it to start at boot.
  6. Unload the driver and remove all artifacts after execution.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Windows has a built-in cleanup tool that runs very early during startup to remove stubborn files. This research shows that the tool can be tricked into doing other file and registry changes for anyone who can create the right encrypted instructions. Because the tool is signed by Microsoft and runs with the highest privileges, it can delete or change things that normal programs cannot.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by [email protected]

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.