Windows regedit.exe Imports Registry Keys From .reg File

Detects regedit.exe command lines importing registry keys from .reg files on Windows.

FreeUnreviewedSigmamediumv1
title: Windows regedit.exe Imports Registry Keys From .reg File
id: c8cf4bf3-5811-41ba-8356-29b2e532afe6
related:
  - id: 0b80ade5-6997-4b1d-99a1-71701778ea61
    type: similar
  - id: 73bba97f-a82d-42ce-b315-9182e76c57b1
    type: derived
status: test
description: This rule flags process executions of regedit.exe where the command line includes imports of a registry file (e.g., /i, /s, and a .reg argument). Attackers can use this behavior to quickly modify registry settings for persistence or defense impairment by importing keys in an automated way. The detection relies on Windows process creation telemetry, including Image/OriginalFileName and command-line arguments, and excludes matches containing specific flag combinations used to reduce overlaps.
references:
  - https://lolbas-project.github.io/lolbas/Binaries/Regedit/
  - https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_regedit_import_keys.yml
author: Oddvar Moe, Sander Wiebing, oscd.community, Huntrule Team
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: :[^ \\]
  condition: all of selection_* and not all of filter_*
falsepositives:
  - Legitimate import of keys
  - Evernote
level: medium
license: DRL-1.1

What it detects

This rule flags process executions of regedit.exe where the command line includes imports of a registry file (e.g., /i, /s, and a .reg argument). Attackers can use this behavior to quickly modify registry settings for persistence or defense impairment by importing keys in an automated way. The detection relies on Windows process creation telemetry, including Image/OriginalFileName and command-line arguments, and excludes matches containing specific flag combinations used to reduce overlaps.

Known false positives

  • Legitimate import of keys
  • Evernote

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.