Detection rules › Sigma

Rundll32.EXE Calling DllRegisterServer Export Function Explicitly

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Andreas Braathen (mnemonic.io)
Source
github.com/SigmaHQ/sigma

Detects when the DLL export function 'DllRegisterServer' is called in the commandline by Rundll32 explicitly where the DLL is located in a non-standard path.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Rundll32.EXE Calling DllRegisterServer Export Function Explicitly
id: d81a9fc6-55db-4461-b962-0e78fea5b0ad
related:
    - id: 2569ed8c-1147-498a-9b8c-2ad3656b10ed # Renamed rundll32
      type: similar
status: test
description: |
    Detects when the DLL export function 'DllRegisterServer' is called in the commandline by Rundll32 explicitly where the DLL is located in a non-standard path.
references:
    - https://thedfirreport.com/2023/08/28/html-smuggling-leads-to-domain-wide-ransomware/
    - https://www.virustotal.com/gui/file/94816439312563db982cd038cf77cbc5ef4c7003e3edee86e2b0f99e675ed4ed/behavior
    - https://learn.microsoft.com/en-us/windows/win32/api/olectl/nf-olectl-dllregisterserver
author: Andreas Braathen (mnemonic.io)
date: 2023-10-17
tags:
    - attack.stealth
    - attack.t1218
    - detection.threat-hunting
logsource:
    category: process_creation
    product: windows
detection:
    selection_image:
        - Image|endswith: '\rundll32.exe'
        - OriginalFileName: 'RUNDLL32.EXE'
    selection_cmdline:
        CommandLine|contains: 'DllRegisterServer'
    filter_main_legit_paths:
        CommandLine|contains:
            - ':\Program Files (x86)'
            - ':\Program Files\'
            - ':\Windows\System32\'
            - ':\Windows\SysWOW64\'
    condition: all of selection_* and not 1 of filter_main_*
falsepositives:
    - Legitimate usage as part of application installation, but less likely from e.g. temporary paths.
    - Not every instance is considered malicious, but this rule will capture the malicious usages.
level: medium

Stages and Predicates

Stage 0: condition

all of selection_* and not 1 of filter_main_*

Stage 1: selection_image

selection_image:
    - Image|endswith: '\rundll32.exe'
    - OriginalFileName: 'RUNDLL32.EXE'

Stage 2: selection_cmdline

selection_cmdline:
    CommandLine|contains: 'DllRegisterServer'

Stage 3: not filter_main_legit_paths

filter_main_legit_paths:
    CommandLine|contains:
        - ':\Program Files (x86)'
        - ':\Program Files\'
        - ':\Windows\System32\'
        - ':\Windows\SysWOW64\'

Exclusions

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

FieldKindExcluded values
CommandLinematch:\Program Files (x86)
CommandLinematch:\Program Files\
CommandLinematch:\Windows\SysWOW64\
CommandLinematch:\Windows\System32\

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
  • DllRegisterServer corpus 3 (sigma 2, splunk 1)
Imageends_with
  • \rundll32.exe corpus 95 (sigma 95)
OriginalFileNameeq
  • RUNDLL32.EXE corpus 62 (sigma 35, splunk 21, elastic 6)