Detection rules › Sigma

Imports Registry Key From a File

Status
test
Severity
medium
Log source
product windows, category process_creation
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.

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1112 Modify Registry
Defense ImpairmentT1112 Modify Registry

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

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

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

FieldKindExcluded values
CommandLinematch -a
CommandLinematch -c
CommandLinematch -e
CommandLineregex_match:[^ \]

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
CommandLinematch
  • /i corpus 2 (sigma 2)
  • /s corpus 6 (sigma 3, splunk 3)
  • .reg corpus 4 (sigma 3, splunk 1)
Imageends_with
  • \regedit.exe corpus 8 (sigma 8)
OriginalFileNameeq
  • REGEDIT.EXE corpus 6 (sigma 4, splunk 2)