Detection rules › Sigma
Imports Registry Key From a File
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
| Tactic | Techniques |
|---|---|
| Persistence | |
| Defense Impairment |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event 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.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
CommandLine | match | -a | excludes:CommandLine field:"CommandLine" value:" -a " |
CommandLine | match | -c | excludes:CommandLine field:"CommandLine" value:" -c " |
CommandLine | match | -e | excludes:CommandLine field:"CommandLine" value:" -e " |
CommandLine | regex_match | :[^ \] | excludes:CommandLine field:"CommandLine" value:":[^ \]" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
CommandLine | match |
| field:"CommandLine" kind:match |
Image | ends_with |
| field:"Image" kind:ends_with value:"\regedit.exe" |
OriginalFileName | eq |
| field:"OriginalFileName" kind:eq value:"REGEDIT.EXE" |