BadPing
BadPing
Toggle sidebar

Clear your Secure Boot keys

The step people get stuck on. Secure Boot stays enabled, its key databases get emptied.

Why this is needed #

Secure Boot works from a set of key databases stored in your firmware: a Platform Key, a Key Exchange Key, and lists of allowed and blocked signatures. Anything that boots has to be signed by something in there.

On the very first launch, BadPing installs its own bootloader, and that bootloader has to be trusted by your firmware. It cannot be, while the databases are full of factory keys that were never issued to us.

So you empty them. Clearing the Platform Key puts your firmware into Setup Mode, a state where new keys can be enrolled without being signed by an existing one. Our bootloader enrolls its keys there, and your machine leaves Setup Mode with Secure Boot fully enforcing again, this time trusting us.

Enabled, not disabled

The Secure Boot option in your BIOS stays set to Enabled through all of this. You are emptying its keys, not switching it off. If you disable Secure Boot instead, the loader will refuse to start.

Read this first #

BitLocker will ask for your recovery key

Secure Boot state is part of what BitLocker measures, so changing it can trigger a recovery prompt on the next boot. Suspend BitLocker before you touch these settings, or make sure you can read your 48-digit recovery key from another device. Without it the drive stays locked, and nobody can unlock it for you.

To suspend it: open Manage BitLocker from the Start menu, then choose Suspend protection on your system drive. Turn it back on after setup is complete. Your recovery key is also saved to your Microsoft account at account.microsoft.com/devices/recoverykey if you signed in with one.

  • If you dual-boot Linux with a signed shim, clearing the keys changes how it boots. Ask on Discord first.
  • Some anti-cheats for other games check Secure Boot state and may complain until the bootloader is installed.
  • Work laptops managed by an employer usually block this outright, and you should not be trying it on one.

Find your board #

Pick your motherboard or laptop brand. Menu names move around between BIOS versions, so treat these as where to look rather than an exact path, and fall back to the generic instructions if yours does not match.

ASUS

ROG, TUF Gaming, PRIME, ProArt

  1. 1.
    Press Delete (or F2) repeatedly as the machine powers on to enter the UEFI BIOS Utility.
  2. 2.
    Press F7 to switch to Advanced Mode if you land on the EZ Mode screen.
  3. 3.
    Go to the Boot tab and open Secure Boot.
  4. 4.
    Set OS Type to Windows UEFI mode. Secure Boot must stay enabled.
  5. 5.
    Open Key Management.
  6. 6.
    Select Clear Secure Boot Keys and confirm.
  7. 7.
    Go back one screen. Secure Boot State should now read Setup Mode, and the PK/KEK/DB entries should show as not installed.
  8. 8.
    Press F10 to save and exit.

MSI

Click BIOS 5 and 6, MEG, MPG, MAG, PRO

  1. 1.
    Press Delete repeatedly as the machine powers on, then F7 for Advanced Mode.
  2. 2.
    Go to Settings, then Advanced, then Windows OS Configuration. On some boards it is Settings, then Security.
  3. 3.
    Open Secure Boot.
  4. 4.
    Set Secure Boot Support to Enabled and Secure Boot Mode to Custom.
  5. 5.
    Open Key Management.
  6. 6.
    Select Delete all Secure Boot variables (older BIOS versions call it Reset to Setup Mode) and confirm.
  7. 7.
    System Mode at the top of the page should now read Setup.
  8. 8.
    Press F10 to save and exit.

Gigabyte

AORUS, UD, Gaming X

  1. 1.
    Press Delete repeatedly as the machine powers on. Press F2 if you land on Easy Mode.
  2. 2.
    Go to the Boot tab. On newer BIOS versions it is Settings, then Boot.
  3. 3.
    Make sure CSM Support is Disabled, then open Secure Boot.
  4. 4.
    Set Secure Boot Enable to Enabled and Secure Boot Mode to Custom.
  5. 5.
    Open Key Management.
  6. 6.
    Select Reset To Setup Mode (older versions call it Clear Secure Boot Keys) and confirm.
  7. 7.
    Press F10 to save and exit.

ASRock

Taichi, Steel Legend, Phantom Gaming

  1. 1.
    Press F2 or Delete repeatedly as the machine powers on, then switch to Advanced Mode.
  2. 2.
    Go to the Security tab and open Secure Boot.
  3. 3.
    Set Secure Boot to Enabled and Secure Boot Mode to Custom.
  4. 4.
    Open Key Management.
  5. 5.
    Select Clear Secure Boot Keys and confirm. Some versions list it as Reset to Setup Mode.
  6. 6.
    Press F10 to save and exit.

Dell

XPS, Alienware, Inspiron, OptiPlex

  1. 1.
    Press F2 repeatedly as the machine powers on.
  2. 2.
    Open Boot Configuration and make sure the boot mode is UEFI with Legacy option ROMs disabled.
  3. 3.
    Open Secure Boot and set Enable Secure Boot to On.
  4. 4.
    Open Expert Key Management and tick Enable Custom Mode.
  5. 5.
    Under Custom Mode Key Management, select PK and choose Delete, then repeat for KEK, db and dbx.
  6. 6.
    Choose Apply Changes, then Exit.

HP

OMEN, Victus, Pavilion, EliteDesk

  1. 1.
    Press Escape repeatedly as the machine powers on, then F10 for BIOS Setup.
  2. 2.
    Go to Security, then Secure Boot Configuration. Accept the warning screen if one appears.
  3. 3.
    Set Secure Boot to Enable and Legacy Support to Disable.
  4. 4.
    Select Clear Secure Boot keys and confirm.
  5. 5.
    Press F10 to save. You may be asked to type a four-digit code shown on screen to confirm the change.

Lenovo

Legion, ThinkPad, IdeaPad, ThinkCentre

  1. 1.
    Press F1 or F2 repeatedly as the machine powers on. On Legion and IdeaPad models you can also use the Novo button.
  2. 2.
    Go to the Security tab and open Secure Boot.
  3. 3.
    Set Secure Boot to Enabled.
  4. 4.
    Select Reset to Setup Mode and confirm. Some models call it Clear All Secure Boot Keys.
  5. 5.
    Press F10 to save and exit.
Several Lenovo laptops hide key management until a supervisor password is set. Set one under Security, then Password, and remember it.

Another brand

AMI Aptio, Insyde H2O, Phoenix and anything else

  1. 1.
    Enter your BIOS. The key is usually Delete, F2, F10 or Escape, and it is shown for a second on the first boot screen.
  2. 2.
    Look for Secure Boot under a tab named Security, Boot or Authentication.
  3. 3.
    Set Secure Boot to Enabled, and set Secure Boot Mode to Custom if that option exists.
  4. 4.
    Open the sub-menu named Key Management, Expert Key Management or Secure Boot Keys.
  5. 5.
    Choose the entry that mentions Setup Mode, Clear or Delete all, for example Reset to Setup Mode or Delete all Secure Boot variables. Do not choose anything that mentions Restore, Install or Factory Keys, which does the opposite.
  6. 6.
    Save and exit, usually with F10.
If none of that is there, your firmware may not expose key management at all. See the last section of this page.

Confirm you are in Setup Mode #

Back in Windows, open PowerShell as administrator and run:

PowerShell
Get-SecureBootUEFI -Name SetupMode

Look at the Bytes column in the output. A value of 1 means you are in Setup Mode and ready to launch the loader. A value of 0 means the keys are still enrolled and the clearing step did not take.

Two other things you can expect to see, both normal at this point:

  • msinfo32 reports Secure Boot State as Off, because no Platform Key is enrolled yet.
  • Confirm-SecureBootUEFI returns False for the same reason.

Both flip back after the first launch enrolls our keys. If Get-SecureBootUEFI errors with an unsupported platform message instead, your machine is booting in Legacy mode and you need to revisit the BIOS page.

If the option is missing #

Not every firmware exposes key management. Work through these before giving up:

  1. 1.
    Make sure you are in Advanced or Expert mode, not the simplified first screen.
  2. 2.
    Set Secure Boot Mode to Custom if that option exists. Standard mode hides key management on most boards.
  3. 3.
    Set a BIOS supervisor or administrator password. Several laptop vendors only reveal these menus once one is set.
  4. 4.
    Update your BIOS to the latest version from the manufacturer, then look again.
  5. 5.
    Check for a Restore Factory Keys entry. If that exists, the clearing option is almost always next to it.

If none of that surfaces it, your firmware is locked down and the machine cannot run our stack. That is common on prebuilt office desktops and managed laptops. Ask on Discord with your exact model before you buy anything else.

Putting it back later

This is reversible. The same key management menu has a Restore Factory Keys or Install Default Secure Boot Keys entry that puts your board back to how it shipped.

The site needs a few cookies to work. With your OK we would also count visits with Google Analytics and run live chat through Crisp. We do not sell anything about you, mostly because nobody would buy it. Cookie policy