Detection rules › Sigma

Regsvr32 Execution From Highly Suspicious Location

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects execution of regsvr32 where the DLL is located in a highly suspicious locations

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Regsvr32 Execution From Highly Suspicious Location
id: 327ff235-94eb-4f06-b9de-aaee571324be
status: test
description: Detects execution of regsvr32 where the DLL is located in a highly suspicious locations
references:
    - Internal Research
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-05-26
tags:
    - attack.stealth
    - attack.t1218.010
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\regsvr32.exe'
        - OriginalFileName: 'REGSVR32.EXE'
    selection_path_1:
        CommandLine|contains:
            - ':\PerfLogs\'
            - ':\Temp\'
            - '\Windows\Registration\CRMLog'
            - '\Windows\System32\com\dmp\'
            - '\Windows\System32\FxsTmp\'
            - '\Windows\System32\Microsoft\Crypto\RSA\MachineKeys\'
            - '\Windows\System32\spool\drivers\color\'
            - '\Windows\System32\spool\PRINTERS\'
            - '\Windows\System32\spool\SERVERS\'
            - '\Windows\System32\Tasks_Migrated\'
            - '\Windows\System32\Tasks\Microsoft\Windows\SyncCenter\'
            - '\Windows\SysWOW64\com\dmp\'
            - '\Windows\SysWOW64\FxsTmp\'
            - '\Windows\SysWOW64\Tasks\Microsoft\Windows\PLA\System\'
            - '\Windows\SysWOW64\Tasks\Microsoft\Windows\SyncCenter\'
            - '\Windows\Tasks\'
            - '\Windows\Tracing\'
    selection_path_2:
        CommandLine|contains:
            # This is to avoid collisions with CLI starting with "C:\"
            - ' "C:\'
            - ' C:\'
            - " 'C:\\"
            - 'D:\'
    selection_exclude_known_dirs:
        CommandLine|contains:
            # Note: add additional locations that are related to third party applications
            - 'C:\Program Files (x86)\'
            - 'C:\Program Files\'
            - 'C:\ProgramData\'
            - 'C:\Users\'
            # Note: The space added here are to avoid collisions with the "regsvr32" binary full path
            - ' C:\Windows\'
            - ' "C:\Windows\'
            - " 'C:\\Windows\\"
    filter_main_empty:
        CommandLine: ''
    filter_main_null:
        CommandLine: null
    condition: selection_img and (selection_path_1 or (selection_path_2 and not selection_exclude_known_dirs)) and not 1 of filter_main_*
falsepositives:
    - Unlikely
level: high

Stages and Predicates

Stage 0: condition

selection_img and (selection_path_1 or (selection_path_2 and not selection_exclude_known_dirs)) and not 1 of filter_main_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\regsvr32.exe'
    - OriginalFileName: 'REGSVR32.EXE'

Stage 2: selection_path_1

selection_path_1:
    CommandLine|contains:
        - ':\PerfLogs\'
        - ':\Temp\'
        - '\Windows\Registration\CRMLog'
        - '\Windows\System32\com\dmp\'
        - '\Windows\System32\FxsTmp\'
        - '\Windows\System32\Microsoft\Crypto\RSA\MachineKeys\'
        - '\Windows\System32\spool\drivers\color\'
        - '\Windows\System32\spool\PRINTERS\'
        - '\Windows\System32\spool\SERVERS\'
        - '\Windows\System32\Tasks_Migrated\'
        - '\Windows\System32\Tasks\Microsoft\Windows\SyncCenter\'
        - '\Windows\SysWOW64\com\dmp\'
        - '\Windows\SysWOW64\FxsTmp\'
        - '\Windows\SysWOW64\Tasks\Microsoft\Windows\PLA\System\'
        - '\Windows\SysWOW64\Tasks\Microsoft\Windows\SyncCenter\'
        - '\Windows\Tasks\'
        - '\Windows\Tracing\'

Stage 3: selection_path_2

selection_path_2:
    CommandLine|contains:
        - ' "C:\'
        - ' C:\'
        - " 'C:\\"
        - 'D:\'

Stage 4: not selection_exclude_known_dirs

selection_exclude_known_dirs:
    CommandLine|contains:
        - 'C:\Program Files (x86)\'
        - 'C:\Program Files\'
        - 'C:\ProgramData\'
        - 'C:\Users\'
        - ' C:\Windows\'
        - ' "C:\Windows\'
        - " 'C:\\Windows\\"

Stage 5: not filter_main_*

filter_main_empty:
    CommandLine: ''
filter_main_null:
    CommandLine: null

Exclusions

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

FieldKindExcluded values
CommandLinematch 'C:\Windows\
CommandLinematch C:\Windows\
CommandLinematch "C:\Windows\
CommandLinematchC:\Program Files (x86)\
CommandLinematchC:\Program Files\
CommandLinematchC:\ProgramData\
CommandLinematchC:\Users\
CommandLineis_null(no value, null check)

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
  • "C:\
  • 'C:\
  • C:\ corpus 2 (sigma 2)
  • :\PerfLogs\ corpus 11 (sigma 11)
  • :\Temp\ corpus 14 (sigma 14)
  • D:\
  • \Windows\Registration\CRMLog
  • \Windows\SysWOW64\FxsTmp\
  • \Windows\SysWOW64\Tasks\Microsoft\Windows\PLA\System\
  • \Windows\SysWOW64\Tasks\Microsoft\Windows\SyncCenter\
  • \Windows\SysWOW64\com\dmp\
  • \Windows\System32\FxsTmp\
  • \Windows\System32\Microsoft\Crypto\RSA\MachineKeys\
  • \Windows\System32\Tasks\Microsoft\Windows\SyncCenter\
  • \Windows\System32\Tasks_Migrated\
  • \Windows\System32\com\dmp\
  • \Windows\System32\spool\PRINTERS\
  • \Windows\System32\spool\SERVERS\
  • \Windows\System32\spool\drivers\color\
  • \Windows\Tasks\
  • \Windows\Tracing\
Imageends_with
  • \regsvr32.exe corpus 65 (sigma 65)
OriginalFileNameeq
  • REGSVR32.EXE corpus 26 (sigma 17, splunk 6, elastic 3)