Sigma Rule Library

Dumping of Sensitive Hives Via Reg.EXE

Detects the usage of "reg.exe" in order to dump sensitive registry hives. This includes SAM, SYSTEM and SECURITY hives.

View on GitHubOpen raw file

Detection logic

selection_img

- Image|endswith: \reg.exe
- OriginalFileName: reg.exe

selection_cli_flag

CommandLine|contains:
  - " save "
  - " export "
  - " ˢave "
  - " eˣport "

selection_cli_hive

CommandLine|re|i: (hk[l˪]m|hkey_[l˪]oca[l˪]_machine)"?\\[sˢ](y[sˢ]tem|am|ecurity)(\\|"|\s|$)

Condition

all of selection_*

Raw YAML

title: Dumping of Sensitive Hives Via Reg.EXE
id: fd877b94-9bb5-4191-bb25-d79cbd93c167
related:
    - id: 038cd51c-3ad8-41c5-ba8f-5d1c92f3cc1e
      type: obsolete
    - id: 4d6c9da1-318b-4edf-bcea-b6c93fa98fd0
      type: obsolete
status: test
description: Detects the usage of "reg.exe" in order to dump sensitive registry hives. This includes SAM, SYSTEM and SECURITY hives.
references:
    - https://www.slideshare.net/heirhabarov/hunting-for-credentials-dumping-in-windows-environment
    - https://eqllib.readthedocs.io/en/latest/analytics/aed95fc6-5e3f-49dc-8b35-06508613f979.html
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1003/T1003.md
    - https://www.wietzebeukema.nl/blog/windows-command-line-obfuscation
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1003.002/T1003.002.md#atomic-test-1---registry-dump-of-sam-creds-and-secrets
author: Teymur Kheirkhabarov, Endgame, JHasenbusch, Daniil Yugoslavskiy, oscd.community, frack113
date: 2019-10-22
modified: 2026-11-13
tags:
    - attack.credential-access
    - attack.t1003.002
    - attack.t1003.004
    - attack.t1003.005
    - car.2013-07-001
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\reg.exe'
        - OriginalFileName: 'reg.exe'
    selection_cli_flag:
        CommandLine|contains:
            - ' save '
            - ' export '
            - ' ˢave '
            - ' eˣport '
    selection_cli_hive:
        # The hive must directly follow the HKLM root. A bare '\system' also matches the reg.exe path itself (C:\Windows\System32\reg.exe) and C:\Windows\SystemTemp.
        CommandLine|re|i: '(hk[l˪]m|hkey_[l˪]oca[l˪]_machine)"?\\[sˢ](y[sˢ]tem|am|ecurity)(\\|"|\s|$)'
    condition: all of selection_*
falsepositives:
    - Dumping hives for legitimate purpouse i.e. backup or forensic investigation
level: high
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_reg_dumping_sensitive_hives/info.yml

False positives

  • Dumping hives for legitimate purpouse i.e. backup or forensic investigation

References

  • obsolete038cd51c-3ad8-41c5-ba8f-5d1c92f3cc1e
  • obsolete4d6c9da1-318b-4edf-bcea-b6c93fa98fd0

Similar rules