Safe mode boot armed from a command line
AN0323 pairs boot-configuration changes with registry edits under the SafeBoot keys, and this rule matches the command-line form of both. The first arm is bcdedit.exe or bootcfg.exe with `safeboot` anywhere on the line, which covers `/set {default} safeboot minimal`, the `safeboot network` variant that keeps networking available for a remote operator, and `/deletevalue safeboot` — the removal is kept in deliberately, because an adversary reverting the change after the payload has run is as much of the behaviour as arming it, and excluding it would only hide the second half of the chain. The second arm keys on a command line naming `CurrentControlSet\Control\SafeBoot`, which is where a service or driver has to be registered for it to start in a limited boot; that string matches reg.exe and the PowerShell `HKLM:\SYSTEM\...` path form in one selection, since both spell the key the same way. MITRE's `SafeBootRegistryPaths` and `AllowedAdminTools` knobs are what the key string and the image list implement, populated here from the analytic's prose rather than taken from MITRE. Its `TimeWindow` knob — correlate the registry write with the boot-configuration command a few minutes either side — is a cross-event join with a timeframe, and lib/sigma models neither, so the two arms are ORed and either fires alone. The limit that matters most here is not a field problem. This rule sees the host being *armed* for safe mode; it cannot see the safe-mode session itself, because that boot is exactly when Sysmon, the EDR agent and the log shipper this telemetry depends on are the services that do not start. Whatever the adversary does after the reboot is likely to produce no events at all, so a single match here should be treated as the last thing you will see rather than as one signal among many. Vocabulary and prerequisites. AN0323 gives Security EventID 4688 for this leg and the brief maps it onto the Sigma `process_creation` category, which is Sysmon-EventID-1-shaped; this rule is written in that vocabulary (`Image`, `CommandLine`), so an estate feeding raw 4688 needs `NewProcessName` mapped onto `Image` first, and 4688 needs both *Audit Process Creation* and the separate *Include command line in process creation events* policy before `CommandLine` exists at all — neither is on in a default install or in the Microsoft and CIS baselines. The analytic's other three log sources (Sysmon EventID 12, 13 and 14 on `registry_add`, `registry_set` and `registry_rename`) are separate logsources and are not authored here; the consequence is that a SafeBoot value written through RegSetValueEx by an implant, imported with `regedit /s safeboot.reg` where the key sits inside the file, or set by msconfig — whose Safe boot checkbox edits the BCD store through the API and spawns no bcdedit — produces no match at all. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0116, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
Sentinel · KQL
Run this as a search.
DeviceProcessEvents| where (((FolderPath endswith "\\bcdedit.exe" or FolderPath endswith "\\bootcfg.exe") and ProcessCommandLine contains "safeboot") or ProcessCommandLine contains "CurrentControlSet\\Control\\SafeBoot")
Splunk · SPL
Run this as a search.
index=* (((Image="*\\bcdedit.exe" OR Image="*\\bootcfg.exe") AND CommandLine="*safeboot*") OR CommandLine="*CurrentControlSet\\Control\\SafeBoot*")Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE (((TO_LOWER(process.executable) LIKE "*\\\\bcdedit.exe" OR TO_LOWER(process.executable) LIKE "*\\\\bootcfg.exe") AND TO_LOWER(process.command_line) LIKE "*safeboot*") OR TO_LOWER(process.command_line) LIKE "*currentcontrolset\\\\control\\\\safeboot*")
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,windows,process_creation,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <!-- 2 rules: the Sigma condition ORs across different fields, which one rule cannot express. Any one matching is a hit. --> <rule id="100000" level="7"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(\\bcdedit\.exe$|\\bootcfg\.exe$)</field> <field name="CommandLine" type="pcre2">(?i)safeboot</field> <description>Safe mode boot armed from a command line (1/2)</description> <mitre> <id>T1688</id> </mitre> </rule> <rule id="100001" level="7"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="CommandLine" type="pcre2">(?i)CurrentControlSet\\Control\\SafeBoot</field> <description>Safe mode boot armed from a command line (2/2)</description> <mitre> <id>T1688</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.