Rebooting a Windows host into safe mode is one of the cheapest ways to switch off endpoint protection, because safe mode starts only a minimal set of drivers and services and many security agents are not among them. MITRE ATT&CK v20 tracks this as T1688 Safe Mode Boot under the Defense Impairment tactic (TA0112), Windows only, formerly a sub-technique of Impair Defenses. Ransomware families including LockBit 3.0, Black Basta, REvil, Qilin, RansomHub, AvosLocker and Embargo are recorded using it, usually minutes before encryption. This page covers how the technique works, the boot configuration and registry changes that give it away, the two v20 mitigations, how to monitor for the agent going dark, and how to test safely. It is written for detection engineers, endpoint owners and incident responders. The REvil (Sodinokibi) profile shows the technique inside one ransomware family; this page is the technique view.
Key takeaways
- The tell is a boot configuration change. Forcing safe mode on the next boot means writing a safeboot value to the Boot Configuration Data store, most often with bcdedit /set {current} safeboot minimal or network, which needs administrator rights and is rare in normal operations.
- Persistence in safe mode is a registry write. Malware that must run after the reboot adds its service under HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal or \Network, which is a high-confidence alert.
- ATT&CK's mitigations are simple and effective. M1054 asks that endpoint defences run in safe mode; M1026 asks that the admin rights needed to do this are tightly held.
- Silence is a signal. A host that reboots and whose security agent stops reporting while the machine is still on the network should page someone, not wait for the next daily report.
- It is a late-stage ransomware step. By the time a host is forced into safe mode, the actor already has admin rights; respond as an active ransomware incident.
How the technique works
ATT&CK describes safe mode as starting Windows with a limited set of drivers and services, in two versions: Safe Mode and Safe Mode with Networking, and notes that additional services can be started after a safe mode boot. Third-party security software such as EDR may not start. Adversaries force a host into safe mode after the next reboot by modifying the Boot Configuration Data (BCD) store, and they make their own code run there by adding it to the list of minimal services through the registry (T1112 Modify Registry) or by registering a malicious COM object that is loaded in safe mode.
Research cited by ATT&CK shows the sequence. Sophos documented Snatch ransomware installing a service named SuperBackupMan, adding HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\SuperBackupMan so it would start in safe mode, running bcdedit.exe /set {current} safeboot minimal and forcing an immediate reboot, then deleting volume shadow copies and encrypting. CyberArk Labs showed in 2016 that an attacker with local administrator rights could do the same remotely, load code through a service or a COM object loaded by explorer.exe, and tamper with security tools that did not run in Minimal Safe Mode before returning the host to normal mode.
| Step | What the adversary changes | Where it is visible |
|---|---|---|
| 1. Gain admin rights | Local administrator or SYSTEM through valid accounts or exploitation | Logon events, PAM and EDR |
| 2. Ensure code runs in safe mode | Service key under SafeBoot\Minimal or \Network; or a COM object registration | Registry auditing, Sysmon 12 and 13 |
| 3. Set the boot option | safeboot value in the BCD store via bcdedit (or bootcfg on very old systems) | Process creation (4688, Sysmon 1); command line |
| 4. Force a reboot | shutdown /r or an API call, sometimes disguised as an update prompt | System log shutdown events; EDR |
| 5. Act in safe mode | Encrypt files, delete shadow copies, modify security tool settings | Only tools that run in safe mode see this |
| 6. Return to normal boot | Delete the safeboot value (bcdedit /deletevalue {current} safeboot) | Process creation on the next normal boot, if the payload does it there |
Real cases
| Software or source | What was recorded | Detection lesson |
|---|---|---|
| LockBit 3.0 (S1202), joint advisory AA23-075A (FBI, CISA, MS-ISAC, March 2023) | A -safe parameter reboots the host into Safe Mode with Networking using bcdedit /set {current} safeboot network, with bcdedit /deletevalue {current} safeboot to reverse it; bootcfg equivalents on pre-Vista systems | Both the set and the delete commands are worth alerting on |
| Black Basta (S1070) | Reboots victims into Safe Mode with Networking via bcdedit /set safeboot network | Networking variant keeps remote access while defences are down |
| REvil (S0496) | Can force a reboot into safe mode with networking (BleepingComputer, 2021) | Ransomware builders expose this as a simple switch |
| Qilin (S1242) and RansomHub (S1212) | Reboot targeted systems into safe mode before encryption | Recent ransomware-as-a-service families still rely on it |
| AvosLocker (S1053) | Can restart a compromised machine in safe mode | Same pattern across families |
| Embargo (S1247) | Used a DLL variant of MDeployer to disable security solutions through safe mode (ESET, October 2024) | Safe mode is also used purely to tamper with security tools, not only to encrypt |
See the LockBit Threat Actor Profile, Black Basta Threat Actor Profile, Qilin Threat Actor Profile and RansomHub Threat Actor Profile for the wider operations.
What to detect and where
ATT&CK v20 detection strategy DET0116 (analytic AN0323) looks for boot configuration utilities (bcdedit.exe, bootcfg.exe) changing BCD, correlated with registry changes under the SafeBoot keys. The tuning elements it names are the SafeBoot registry paths, the admin tools allowed to make such changes and the time window between them.
| Signal | Source | Rule idea | Noise |
|---|---|---|---|
| bcdedit with safeboot in the command line | Security 4688 with command line logging, or Sysmon 1 | Alert on any /set ... safeboot or /deletevalue ... safeboot outside an approved support tool | Very low; help desk use is rare and can be allow-listed by account |
| bootcfg with /safeboot | Same | Alert always on modern Windows | Near zero |
| New subkey under SafeBoot\Minimal or SafeBoot\Network | Sysmon 12 (key create), 13 (value set), 14 (rename) | Alert on any new service name; compare with the baseline list of default entries | Low; some security and backup products register here on install |
| Service created then safeboot set then reboot within minutes | System 7045 service install, 4688, System log shutdown events | Sequence rule per host within a short window | Very low |
| Security agent offline after a reboot while the host is on the network | EDR console health, NAC or DHCP, network flow | Host seen on the network with no agent heartbeat for more than a few minutes after a reboot | Moderate; needs a maintenance window calendar |
| Many hosts rebooting at once outside patch windows | System log, EDR | Fleet-level rule on unplanned reboot bursts | Low outside patch windows |
Two cautions. First, logs written while the host is in safe mode may be incomplete or later tampered with, which CyberArk Labs also notes, so the reliable evidence is what reached your SIEM before the reboot. Second, event 4826 (Boot Configuration Data loaded) records boot settings such as test signing, kernel debugging and integrity checks, but Microsoft's documentation lists no safe mode field, so do not rely on it for this technique.
The registry and service side overlaps with MITRE ATT&CK T1112 Modify Registry and T1543 Create or Modify System Process Defensive Guide; shadow copy deletion in safe mode is T1490 Inhibit System Recovery Defensive Guide.
Mitigations
| Mitigation | ATT&CK v20 guidance | How to apply it |
|---|---|---|
| M1054 Software Configuration | Ensure that endpoint defences run in safe mode | Ask your EDR and antivirus vendors whether their agent and its protections load in Safe Mode and Safe Mode with Networking, enable that option where it is configurable, and verify it in a lab |
| M1026 Privileged Account Management | Restrict administrator accounts to as few individuals as possible, following least privilege, because they can be abused to boot a machine into safe mode remotely | Remove standing local admin rights, use unique local admin passwords (Windows LAPS), and grant elevation just in time |
NHI Mgmt Group recommendations beyond the v20 list:
- Turn on tamper protection in your EDR: it limits changes to agent services and registry keys, which narrows what an attacker can change while in safe mode.
- Protect the SafeBoot keys: keep default permissions and monitor them; any non-vendor service added there should be investigated.
- Restrict remote service creation and remote reboot paths: limit who can use remote service control, WMI and remote shutdown to administrative tiers, which is how attackers reach many hosts at once.
- Keep offline and immutable backups: if a host does get encrypted in safe mode, recovery depends on backups the attacker could not reach.
Where identity fits
Every recorded use of T1688 needs administrator rights, and ransomware crews usually get them at scale through domain admin credentials or through service accounts used by software deployment and remote management tools, which are often local administrator everywhere. NHI Mgmt Group recommendation: inventory the non-human accounts with local admin rights across the estate, scope each to the hosts it actually manages, and alert when one of them runs bcdedit or creates a service outside its normal job. The EDR Evasion and Defence Guide covers the broader agent protection picture.
Responding to a forced safe mode boot
- Treat it as active ransomware: invoke the ransomware playbook and check for the same command on other hosts in the last hour.
- Isolate at the network: if the agent is offline, use switch port, NAC or firewall isolation, because EDR containment will not work.
- Preserve evidence: collect the pre-reboot SIEM events, the SafeBoot registry hive and the BCD store from an offline copy of the disk where possible.
- Remove the boot option and persistence: clear the safeboot value and the added SafeBoot service keys before returning the host to service, or rebuild it.
- Rotate the credentials used: the admin or service account that ran bcdedit is compromised.
How to test
- Use a lab VM with a snapshot: never test on production endpoints.
- Set and clear the option without rebooting: run bcdedit /set {current} safeboot minimal, confirm the alert, then bcdedit /deletevalue {current} safeboot. This exercises the detection without taking the host down.
- Add and remove a test SafeBoot key: create a harmless subkey under SafeBoot\Minimal, confirm Sysmon 12 and the alert, then delete it.
- Test agent behaviour in safe mode: on the lab VM, boot into Safe Mode with Networking and confirm whether your EDR loads, reports and blocks a test action. Record the result as evidence for M1054.
- Test the heartbeat rule: reboot the lab VM into safe mode and confirm the agent-offline alert fires within your target time.
- Roll back: restore the snapshot and confirm the BCD store no longer contains a safeboot value.
Measuring coverage
- Safe mode protection verified: percentage of endpoint builds where the security agent has been tested and confirmed to run in safe mode.
- Command line logging: percentage of Windows hosts sending process creation with command lines (target: all).
- Local admin exposure: number of accounts, human and non-human, with local admin on more than 100 hosts, trending down.
- Agent silence response: median time from agent heartbeat loss after reboot to analyst triage.
- Test pass rate: quarterly emulation of the bcdedit and SafeBoot key tests detected.
Common failure patterns
- Assuming the EDR runs in safe mode: many agents do not, and the only way to know is to test your build.
- No command line logging: without it, bcdedit.exe looks like a routine admin tool.
- Treating agent-offline as a hygiene metric: a missing heartbeat after an unplanned reboot is a live incident signal, not tomorrow's report.
- Shared local admin passwords: one stolen hash lets the actor force safe mode on every host.
- Cleaning the host but not the boot store: a leftover safeboot value or SafeBoot service key re-triggers the problem on the next reboot.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| MITRE ATT&CK v20 | T1688 Safe Mode Boot (TA0112 Defense Impairment); formerly a sub-technique of Impair Defenses; related T1112, T1543, T1490, T1486 | Technique, procedures and DET0116 |
| MITRE ATT&CK v20 mitigations | M1054 Software Configuration; M1026 Privileged Account Management | Official mitigations |
| NIST SP 800-53 Rev 5 | AC-6 Least Privilege; CM-6 Configuration Settings | Admin rights and secure boot configuration |
| NIST SP 800-53 Rev 5 | SI-3 Malicious Code Protection; SI-4 System Monitoring | Protection that persists in safe mode; agent health monitoring |
| NIST CSF 2.0 | PR.AA-05; DE.CM-09 | Access permissions and monitoring of computing environments |
For the tactic overview and the mitigations catalogue, see the ATT&CK Stealth and Defense Impairment Tactics Guide and the ATT&CK Mitigations hub.
Related Defense Impairment techniques, each with its own page: MITRE ATT&CK T1686 Disable or Modify System Firewall, MITRE ATT&CK T1689 Downgrade Attack.
Practitioner checklist
- Retag detection content from the former Impair Defenses sub-technique ID to T1688.
- Enable command line capture for process creation on all Windows hosts.
- Alert on bcdedit or bootcfg with safeboot in the command line.
- Monitor SafeBoot\Minimal and SafeBoot\Network for new subkeys.
- Build the service install, safeboot, reboot sequence rule.
- Alert on security agents going silent after an unplanned reboot.
- Test and document whether your EDR runs in both safe mode variants.
- Enable EDR tamper protection.
- Remove standing local admin and deploy unique local admin passwords.
- Scope service accounts with local admin rights and watch their use.
Standards and references
- MITRE ATT&CK: T1688 Safe Mode Boot
- MITRE ATT&CK: DET0116 Detection Strategy for Safe Mode Boot Abuse
- CISA: #StopRansomware LockBit 3.0 (AA23-075A)
- Microsoft Learn: bcdedit
- Microsoft Learn: Event 4826 Boot Configuration Data loaded
- Sophos: Snatch ransomware reboots PCs into Safe Mode to bypass protection
- CyberArk Labs: From Safe Mode to Domain Compromise
- NIST: SP 800-53 Rev 5 Security and Privacy Controls
Related NHI Mgmt Group resources: EDR Evasion and Defence Guide · REvil (Sodinokibi) · T1685 Disable or Modify Tools Defensive Guide · Defence Evasion Techniques Guide