Detection rules › Sigma

Imports Registry Key From a File

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

Detects the import of the specified file to the registry with regedit.exe.

Known false positives

  • Legitimate import of keys
  • Evernote

MITRE ATT&CK coverage

TacticTechniques
Persistence
Defense Impairment

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Imports Registry Key From a File
id: 73bba97f-a82d-42ce-b315-9182e76c57b1
related:
    - id: 0b80ade5-6997-4b1d-99a1-71701778ea61
      type: similar
status: test
description: Detects the import of the specified file to the registry with regedit.exe.
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.persistence
    - attack.defense-impairment
    - attack.t1112
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\regedit.exe'
        - OriginalFileName: 'REGEDIT.EXE'
    selection_cli:
        CommandLine|contains:
            - ' /i '
            - ' /s '
            - '.reg'
    filter_1:
        CommandLine|contains|windash:
            - ' -e '
            - ' -a '
            - ' -c '
    filter_2:
        CommandLine|re: ':[^ \\]'     # to avoid intersection with ADS rule
    condition: all of selection_* and not all of filter_*
falsepositives:
    - Legitimate import of keys
    - Evernote
level: medium

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:
        - ' /i '
        - ' /s '
        - '.reg'

Stage 3: not filter_1

filter_1:
    CommandLine|contains|windash:
        - ' -e '
        - ' -a '
        - ' -c '

Stage 4: not filter_2

filter_2:
    CommandLine|re: ':[^ \\]'

Exclusions

The rule actively suppresses these predicates.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • /i corpus 2 (sigma 2)
  • /s corpus 6 (sigma 3, splunk 3)
  • .reg corpus 4 (sigma 3, splunk 1)
field:"CommandLine" kind:match
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"