Detection rules › Sigma

Registry Persistence via Service in Safe Mode

Status
test
Severity
high
Log source
product windows, category registry_set
Author
frack113
Source
github.com/SigmaHQ/sigma

Detects the modification of the registry to allow a driver or service to persist in Safe Mode.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 13RegistryEvent (Value Set)

Rule body yaml

title: Registry Persistence via Service in Safe Mode
id: 1547e27c-3974-43e2-a7d7-7f484fb928ec
status: test
description: Detects the modification of the registry to allow a driver or service to persist in Safe Mode.
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1112/T1112.md#atomic-test-33---windows-add-registry-value-to-load-service-in-safe-mode-without-network
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1112/T1112.md#atomic-test-34---windows-add-registry-value-to-load-service-in-safe-mode-with-network
author: frack113
date: 2022-04-04
modified: 2025-10-22
tags:
    - attack.stealth
    - attack.t1564.001
logsource:
    category: registry_set
    product: windows
detection:
    selection:
        TargetObject|contains:
            - '\Control\SafeBoot\Minimal\'
            - '\Control\SafeBoot\Network\'
        TargetObject|endswith: '\(Default)'
        Details: 'Service'
    filter_optional_sophos:
        Image: 'C:\WINDOWS\system32\msiexec.exe'
        TargetObject|endswith:
            - '\Control\SafeBoot\Minimal\SAVService\(Default)'
            - '\Control\SafeBoot\Network\SAVService\(Default)'
    filter_optional_mbamservice:
        Image|endswith: '\MBAMInstallerService.exe'
        TargetObject|endswith: '\MBAMService\(Default)'
        Details: 'Service'
    filter_optional_hexnode:
        Image: 'C:\Hexnode\Hexnode Agent\Current\HexnodeAgent.exe'
        TargetObject|endswith:
            - '\Control\SafeBoot\Minimal\Hexnode Updater\(Default)'
            - '\Control\SafeBoot\Network\Hexnode Updater\(Default)'
            - '\Control\SafeBoot\Minimal\Hexnode Agent\(Default)'
            - '\Control\SafeBoot\Network\Hexnode Agent\(Default)'
        Details: 'Service'
    condition: selection and not 1 of filter_optional_*
falsepositives:
    - Unknown
level: high
regression_tests_path: regression_data/rules/windows/registry/registry_set/registry_set_add_load_service_in_safe_mode/info.yml
simulation:
    - type: atomic-red-team
      name: Windows Add Registry Value to Load Service in Safe Mode without Network
      technique: T1112
      atomic_guid: 1dd59fb3-1cb3-4828-805d-cf80b4c3bbb5
    - type: atomic-red-team
      name: Windows Add Registry Value to Load Service in Safe Mode with Network
      technique: T1112
      atomic_guid: c173c948-65e5-499c-afbe-433722ed5bd4

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_optional_*

Stage 1: selection

selection:
    TargetObject|contains:
        - '\Control\SafeBoot\Minimal\'
        - '\Control\SafeBoot\Network\'
    TargetObject|endswith: '\(Default)'
    Details: 'Service'

Stage 2: not filter_optional_*

filter_optional_sophos:
    Image: 'C:\WINDOWS\system32\msiexec.exe'
    TargetObject|endswith:
        - '\Control\SafeBoot\Minimal\SAVService\(Default)'
        - '\Control\SafeBoot\Network\SAVService\(Default)'
filter_optional_mbamservice:
    Image|endswith: '\MBAMInstallerService.exe'
    TargetObject|endswith: '\MBAMService\(Default)'
    Details: 'Service'
filter_optional_hexnode:
    Image: 'C:\Hexnode\Hexnode Agent\Current\HexnodeAgent.exe'
    TargetObject|endswith:
        - '\Control\SafeBoot\Minimal\Hexnode Updater\(Default)'
        - '\Control\SafeBoot\Network\Hexnode Updater\(Default)'
        - '\Control\SafeBoot\Minimal\Hexnode Agent\(Default)'
        - '\Control\SafeBoot\Network\Hexnode Agent\(Default)'
    Details: 'Service'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
TargetObjectends_with\Control\SafeBoot\Minimal\Hexnode Agent\(Default)
TargetObjectends_with\Control\SafeBoot\Minimal\Hexnode Updater\(Default)
TargetObjectends_with\Control\SafeBoot\Network\Hexnode Agent\(Default)
TargetObjectends_with\Control\SafeBoot\Network\Hexnode Updater\(Default)
DetailseqService
ImageeqC:\Hexnode\Hexnode Agent\Current\HexnodeAgent.exe
TargetObjectends_with\Control\SafeBoot\Minimal\SAVService\(Default)
TargetObjectends_with\Control\SafeBoot\Network\SAVService\(Default)
ImageeqC:\WINDOWS\system32\msiexec.exe
DetailseqService
Imageends_with\MBAMInstallerService.exe
TargetObjectends_with\MBAMService\(Default)

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
Detailseq
  • Service
TargetObjectends_with
  • \(Default) corpus 2 (sigma 2)
TargetObjectmatch
  • \Control\SafeBoot\Minimal\
  • \Control\SafeBoot\Network\