NtDeleteBootEntry
Removes a BOOT_ENTRY from the Boot Configuration Database by ID, deleting the corresponding firmware variable on UEFI.
Prototype
NTSTATUS NtDeleteBootEntry( ULONG Id );
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| Id | ULONG | in | BCD-assigned identifier of the boot entry to remove (the value previously returned by NtAddBootEntry or seen via NtEnumerateBootEntries). |
Syscall IDs by Windows version
| Windows version | Syscall ID | Build |
|---|---|---|
| Win10 1507 | 0xC2 | win10-1507 |
| Win10 1607 | 0xC5 | win10-1607 |
| Win10 1703 | 0xC8 | win10-1703 |
| Win10 1709 | 0xC9 | win10-1709 |
| Win10 1803 | 0xCA | win10-1803 |
| Win10 1809 | 0xCB | win10-1809 |
| Win10 1903 | 0xCC | win10-1903 |
| Win10 1909 | 0xCC | win10-1909 |
| Win10 2004 | 0xD0 | win10-2004 |
| Win10 20H2 | 0xD0 | win10-20h2 |
| Win10 21H1 | 0xD0 | win10-21h1 |
| Win10 21H2 | 0xD1 | win10-21h2 |
| Win10 22H2 | 0xD1 | win10-22h2 |
| Win11 21H2 | 0xD6 | win11-21h2 |
| Win11 22H2 | 0xD7 | win11-22h2 |
| Win11 23H2 | 0xD7 | win11-23h2 |
| Win11 24H2 | 0xD9 | win11-24h2 |
| Server 2016 | 0xC5 | winserver-2016 |
| Server 2019 | 0xCB | winserver-2019 |
| Server 2022 | 0xD5 | winserver-2022 |
| Server 2025 | 0xD9 | winserver-2025 |
Kernel module
Related APIs
Syscall stub
4C 8B D1 mov r10, rcx B8 D9 00 00 00 mov eax, 0xD9 F6 04 25 08 03 FE 7F 01 test byte ptr [0x7FFE0308], 1 75 03 jne short +3 0F 05 syscall C3 ret CD 2E int 2Eh C3 ret
Undocumented notes
Single-argument syscall — just the BCD ID. Maps to `BcdDeleteObject` in user mode and to `bcdedit /delete {GUID}` on the command line. Requires SeSystemEnvironmentPrivilege. On UEFI the kernel issues an `EFI_SET_VARIABLE` with `DataSize = 0` against the matching `Boot####` NVRAM variable, which is the firmware-defined deletion semantic.
Common malware usage
Bootkits use NtDeleteBootEntry for **forensic cleanup** and **anti-recovery**. Forensic cleanup: after using a temporary boot entry to flash a UEFI implant (the LoJax / MosaicRegressor pattern), delete the helper entry so a post-incident `bcdedit /enum FIRMWARE` shows nothing. Anti-recovery: ransomware (notoriously a TrickBoot-derived stage) deletes the `{recovery}` and Windows RE entries so victims cannot boot WinRE to restore from VSS or repair MBR/GPT. Wipers go further and delete `{bootmgr}` itself to brick the host post-encryption.
Detection opportunities
ETW Microsoft-Windows-Kernel-Boot is the primary source; the deletion event identifies the removed GUID. Combine with a periodic enumeration snapshot — if an entry present in last night's `bcdedit /enum FIRMWARE` is absent today **without** a corresponding admin action ticket, that is a high-confidence alert. The deletion of `{default}`, `{bootmgr}` or any `{recovery*}` GUID should be treated as a destructive-attack indicator (BCDEdit ransomware playbook) and trigger an immediate VSS/backup integrity check.
Direct syscall examples
asmx64 direct stub (Win11 24H2, SSN 0xD9)
NtDeleteBootEntry PROC
mov r10, rcx ; ULONG Id
mov eax, 0D9h ; Win11 24H2
syscall
ret
NtDeleteBootEntry ENDPcAnti-recovery sweep (DO NOT RUN)
// Mirrors what ransomware does after encryption to prevent WinRE-based recovery.
// Public defensive analysis only.
NTSTATUS sweep_recovery(void) {
// IDs harvested from NtEnumerateBootEntries; filter on FriendlyName == "Windows Recovery Environment".
ULONG recovery_ids[] = { 0x10, 0x11 };
for (size_t i = 0; i < ARRAYSIZE(recovery_ids); ++i) {
NTSTATUS s = NtDeleteBootEntry(recovery_ids[i]);
if (!NT_SUCCESS(s)) return s;
}
return STATUS_SUCCESS;
}rustNaked stub
use std::arch::asm;
#[unsafe(naked)]
unsafe extern "system" fn nt_delete_boot_entry(_id: u32) -> i32 {
asm!(
"mov r10, rcx",
"mov eax, 0xD9", // Win11 24H2
"syscall",
"ret",
options(noreturn),
);
}MITRE ATT&CK mappings
Last verified: 2026-05-20