Windows rundll32.exe calling DllRegisterServer from a non-standard DLL path

Detects rundll32.exe calling DllRegisterServer from command lines associated with non-standard DLL locations.

FreeReviewedSigma · Medium · v5
Product
windows
Category
process_creation
Author
Andreas Braathen (mnemonic.io) (SigmaHQ), DRL 1.1
Published
2023-10-17
Updated
2026-07-31
title: Windows rundll32.exe calling DllRegisterServer from a non-standard DLL path
id: 6330cfd8-c8fe-4e89-924e-dd0f8688d0f5
related:
  - id: 2569ed8c-1147-498a-9b8c-2ad3656b10ed
    type: similar
  - id: d81a9fc6-55db-4461-b962-0e78fea5b0ad
    type: derived
status: test
description: This rule flags process creation events where rundll32.exe is invoked with the export function name "DllRegisterServer". It matters because explicitly registering a DLL via rundll32 can be used to execute attacker-controlled code or perform stealthy installation actions. Detection relies on process creation telemetry containing the process image name and the full command line, and it excludes common system and Program Files locations.
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
  - https://github.com/SigmaHQ/sigma/blob/master/rules-threat-hunting/windows/process_creation/proc_creation_win_rundll32_dllregisterserver.yml
author: Andreas Braathen (mnemonic.io), Huntrule Team
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
license: DRL-1.1