Detection rules › Sigma

Exports Registry Key To a File

Status
test
Severity
low
Log source
category process_creation, product windows
Author
Oddvar Moe, Sander Wiebing, oscd.community
Source
github.com/SigmaHQ/sigma

Detects the export of the target Registry key to a file.

Known false positives

  • Legitimate export of keys

MITRE ATT&CK coverage

TacticTechniques
Discovery

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Exports Registry Key To a File
id: f0e53e89-8d22-46ea-9db5-9d4796ee2f8a
related:
    - id: 82880171-b475-4201-b811-e9c826cd5eaa
      type: similar
status: test
description: Detects the export of the target Registry key to a file.
references:
    - https://lolbas-project.github.io/lolbas/Binaries/Regedit/
    - https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f
author: Oddvar Moe, Sander Wiebing, oscd.community
date: 2020-10-07
modified: 2024-03-13
tags:
    - attack.exfiltration
    - attack.discovery
    - attack.t1012
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\regedit.exe'
        - OriginalFileName: 'REGEDIT.EXE'
    selection_cli:
        CommandLine|contains|windash: ' -E '
    filter_1:   # filters to avoid intersection with critical keys rule
        CommandLine|contains:
            - 'hklm'
            - 'hkey_local_machine'
    filter_2:
        CommandLine|endswith:
            - '\system'
            - '\sam'
            - '\security'
    condition: all of selection_* and not all of filter_*
falsepositives:
    - Legitimate export of keys
level: low

Stages and Predicates

Stage 0: condition

all of selection_* and not all of filter_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\regedit.exe'
    - OriginalFileName: 'REGEDIT.EXE'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains|windash: ' -E '

Stage 3: not filter_1

filter_1:
    CommandLine|contains:
        - 'hklm'
        - 'hkey_local_machine'

Stage 4: not filter_2

filter_2:
    CommandLine|endswith:
        - '\system'
        - '\sam'
        - '\security'

Exclusions

The rule actively suppresses these predicates.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • -E transforms: windash corpus 17 (sigma 14, elastic 3)
field:"CommandLine" kind:match value:" -E "
Imageends_with
  • \regedit.exe corpus 8 (sigma 8)
field:"Image" kind:ends_with value:"\regedit.exe"
OriginalFileNameeq
  • REGEDIT.EXE corpus 6 (sigma 4, splunk 2)
field:"OriginalFileName" kind:eq value:"REGEDIT.EXE"