↓ Skip to main content
  1. Blog/

How Microsoft Defender helps disable protection

·2 mins·

This year at DEF CON 34, Check Point researchers demonstrated how a component of the legitimate Microsoft Defender security solution can be used to disable various security software (including Defender itself), as well as to perform other malicious actions at the kernel level.

The attack is based on BTR.sys (Boot Time Removal Tool), a standard Microsoft-signed driver extracted from the BOOTTIMETOOL resource within the MpEngine.dll file. Microsoft Defender uses this driver to perform system recovery tasks (boot-time remediation) during the early stages of boot.

To interact with the driver, the attacker constructs a special command list (changelist). The BTR.sys driver expects to receive it as a binary structure encrypted with the RC4 algorithm using a static 256-byte key. This key is hardcoded into the driver itself. The driver’s logic consists of reading this list and performing file and registry operations. However, it does not verify whether the initiating process has proper access rights to the target objects.

To carry out the attack, the attacker needs administrator rights and the SeLoadDriverPrivilege privilege. For covert delivery, the exploit places the encrypted changelist in an NTFS Alternate Data Stream (ADS) named :changelist attached to the driver file. To launch the driver, the attacker creates a service directly in the registry, under the HKLM\SYSTEM\CurrentControlSet\Services branch, bypassing the Service Control Manager.

The driver is activated during an ideal time window when the file system is already accessible, but user services and security solution drivers have not yet initialized. At this moment, BTR.sys reads and decrypts the hidden changelist from the alternate data stream and begins executing commands as the System process in kernel mode.

Thus, for the attack, the attacker does not need to bring additional malware or third-party drivers. At the same time, blocking the launch of the BTR.sys driver using standard Windows tools is impossible, as it is a necessary component of Windows Defender. Researchers also reported that Microsoft has not classified this capability as a “vulnerability” and does not plan to patch it.

How to detect the attack

Creation of the :changelist stream for the driver:

logsource:
    product: windows
    service: sysmon
detection:
    selection_event:
        EventID: 15
    selection_stream:
              TargetFilename|re: '(?i)\.sys:changelist$'
    condition: selection_event and selection_stream

Setting the registry value:

logsource:
    product: windows
    service: sysmon
detection:
    selection_event:
        EventID: 13
    selection_service_path:
        TargetObject|startswith: 'HKLM\SYSTEM\CurrentControlSet\Services\'
    selection_sys_file:
        Details|re: '(?i).*\\[a-z]{8}\.sys$'
    condition: selection_event and selection_service_path and selection_sys_file

Related