Detection rules › Sigma

Potentially Suspicious Rundll32 Activity

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
juju4, Jonhnathan Ribeiro, oscd.community, Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects suspicious execution of rundll32, with specific calls to some DLLs with known LOLBIN functionalities

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Potentially Suspicious Rundll32 Activity
id: e593cf51-88db-4ee1-b920-37e89012a3c9
status: test
description: Detects suspicious execution of rundll32, with specific calls to some DLLs with known LOLBIN functionalities
references:
    - http://www.hexacorn.com/blog/2017/05/01/running-programs-via-proxy-jumping-on-a-edr-bypass-trampoline/
    - https://twitter.com/Hexacorn/status/885258886428725250
    - https://gist.github.com/ryhanson/227229866af52e2d963cf941af135a52
    - https://twitter.com/nas_bench/status/1433344116071583746 # dfshim.dll,ShOpenVerbShortcut
    - https://twitter.com/eral4m/status/1479106975967240209 # scrobj.dll,GenerateTypeLib
    - https://twitter.com/eral4m/status/1479080793003671557 # shimgvw.dll,ImageView_Fullscreen
author: juju4, Jonhnathan Ribeiro, oscd.community, Nasreddine Bencherchali (Nextron Systems)
date: 2019-01-16
modified: 2023-05-17
tags:
    - attack.stealth
    - attack.t1218.011
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        - CommandLine|contains|all:
              - 'javascript:'
              - '.RegisterXLL'
        - CommandLine|contains|all:
              - 'url.dll'
              - 'OpenURL'
        - CommandLine|contains|all:
              - 'url.dll'
              - 'OpenURLA'
        - CommandLine|contains|all:
              - 'url.dll'
              - 'FileProtocolHandler'
        - CommandLine|contains|all:
              - 'zipfldr.dll'
              - 'RouteTheCall'
        - CommandLine|contains|all:
              - 'shell32.dll'
              - 'Control_RunDLL'
        - CommandLine|contains|all:
              - 'shell32.dll'
              - 'ShellExec_RunDLL'
        - CommandLine|contains|all:
              - 'mshtml.dll'
              - 'PrintHTML'
        - CommandLine|contains|all:
              - 'advpack.dll'
              - 'LaunchINFSection'
        - CommandLine|contains|all:
              - 'advpack.dll'
              - 'RegisterOCX'
        - CommandLine|contains|all:
              - 'ieadvpack.dll'
              - 'LaunchINFSection'
        - CommandLine|contains|all:
              - 'ieadvpack.dll'
              - 'RegisterOCX'
        - CommandLine|contains|all:
              - 'ieframe.dll'
              - 'OpenURL'
        - CommandLine|contains|all:
              - 'shdocvw.dll'
              - 'OpenURL'
        - CommandLine|contains|all:
              - 'syssetup.dll'
              - 'SetupInfObjectInstallAction'
        - CommandLine|contains|all:
              - 'setupapi.dll'
              - 'InstallHinfSection'
        - CommandLine|contains|all:
              - 'pcwutl.dll'
              - 'LaunchApplication'
        - CommandLine|contains|all:
              - 'dfshim.dll'
              - 'ShOpenVerbApplication'
        - CommandLine|contains|all:
              - 'dfshim.dll'
              - 'ShOpenVerbShortcut'
        - CommandLine|contains|all:
              - 'scrobj.dll'
              - 'GenerateTypeLib'
              - 'http'
        - CommandLine|contains|all:
              - 'shimgvw.dll'
              - 'ImageView_Fullscreen'
              - 'http'
        - CommandLine|contains|all:
              - 'comsvcs.dll'
              - 'MiniDump'
    filter_main_screensaver:
        CommandLine|contains: 'shell32.dll,Control_RunDLL desk.cpl,screensaver,@screensaver'
    filter_main_parent_cpl:  # Settings
        ParentImage: 'C:\Windows\System32\control.exe'
        ParentCommandLine|contains: '.cpl'
        CommandLine|contains|all:
            - 'Shell32.dll'
            - 'Control_RunDLL'
            - '.cpl'
    filter_main_startmenu:
        ParentImage: 'C:\Windows\System32\control.exe'
        CommandLine|startswith: '"C:\Windows\system32\rundll32.exe" Shell32.dll,Control_RunDLL "C:\Windows\System32\'
        CommandLine|endswith: '.cpl",'
    condition: selection and not 1 of filter_main_*
falsepositives:
    - False positives depend on scripts and administrative tools used in the monitored environment
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_*

Stage 1: selection

selection:
    - CommandLine|contains|all:
          - 'javascript:'
          - '.RegisterXLL'
    - CommandLine|contains|all:
          - 'url.dll'
          - 'OpenURL'
    - CommandLine|contains|all:
          - 'url.dll'
          - 'OpenURLA'
    - CommandLine|contains|all:
          - 'url.dll'
          - 'FileProtocolHandler'
    - CommandLine|contains|all:
          - 'zipfldr.dll'
          - 'RouteTheCall'
    - CommandLine|contains|all:
          - 'shell32.dll'
          - 'Control_RunDLL'
    - CommandLine|contains|all:
          - 'shell32.dll'
          - 'ShellExec_RunDLL'
    - CommandLine|contains|all:
          - 'mshtml.dll'
          - 'PrintHTML'
    - CommandLine|contains|all:
          - 'advpack.dll'
          - 'LaunchINFSection'
    - CommandLine|contains|all:
          - 'advpack.dll'
          - 'RegisterOCX'
    - CommandLine|contains|all:
          - 'ieadvpack.dll'
          - 'LaunchINFSection'
    - CommandLine|contains|all:
          - 'ieadvpack.dll'
          - 'RegisterOCX'
    - CommandLine|contains|all:
          - 'ieframe.dll'
          - 'OpenURL'
    - CommandLine|contains|all:
          - 'shdocvw.dll'
          - 'OpenURL'
    - CommandLine|contains|all:
          - 'syssetup.dll'
          - 'SetupInfObjectInstallAction'
    - CommandLine|contains|all:
          - 'setupapi.dll'
          - 'InstallHinfSection'
    - CommandLine|contains|all:
          - 'pcwutl.dll'
          - 'LaunchApplication'
    - CommandLine|contains|all:
          - 'dfshim.dll'
          - 'ShOpenVerbApplication'
    - CommandLine|contains|all:
          - 'dfshim.dll'
          - 'ShOpenVerbShortcut'
    - CommandLine|contains|all:
          - 'scrobj.dll'
          - 'GenerateTypeLib'
          - 'http'
    - CommandLine|contains|all:
          - 'shimgvw.dll'
          - 'ImageView_Fullscreen'
          - 'http'
    - CommandLine|contains|all:
          - 'comsvcs.dll'
          - 'MiniDump'

Stage 2: not filter_main_*

filter_main_screensaver:
    CommandLine|contains: 'shell32.dll,Control_RunDLL desk.cpl,screensaver,@screensaver'
filter_main_parent_cpl:
    ParentImage: 'C:\Windows\System32\control.exe'
    ParentCommandLine|contains: '.cpl'
    CommandLine|contains|all:
        - 'Shell32.dll'
        - 'Control_RunDLL'
        - '.cpl'
filter_main_startmenu:
    ParentImage: 'C:\Windows\System32\control.exe'
    CommandLine|startswith: '"C:\Windows\system32\rundll32.exe" Shell32.dll,Control_RunDLL "C:\Windows\System32\'
    CommandLine|endswith: '.cpl",'

Exclusions

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

FieldKindExcluded values
CommandLineends_with.cpl",
CommandLinestarts_with"C:\Windows\system32\rundll32.exe" Shell32.dll,Control_RunDLL "C:\Windows\System32\
ParentImageeqC:\Windows\System32\control.exe
CommandLinematch.cpl
CommandLinematchControl_RunDLL
CommandLinematchShell32.dll
ParentCommandLinematch.cpl
ParentImageeqC:\Windows\System32\control.exe
CommandLinematchshell32.dll,Control_RunDLL desk.cpl,screensaver,@screensaver

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
  • .RegisterXLL
  • Control_RunDLL corpus 5 (sigma 3, splunk 2)
  • FileProtocolHandler
  • GenerateTypeLib
  • ImageView_Fullscreen
  • InstallHinfSection
  • LaunchApplication corpus 2 (sigma 2)
  • LaunchINFSection
  • MiniDump corpus 5 (sigma 4, chronicle 1)
  • OpenURL
  • OpenURLA
  • PrintHTML
  • RegisterOCX
  • RouteTheCall
  • SetupInfObjectInstallAction
  • ShOpenVerbApplication
  • ShOpenVerbShortcut
  • ShellExec_RunDLL corpus 3 (sigma 3)
  • advpack.dll
  • comsvcs.dll corpus 3 (sigma 2, splunk 1)
  • dfshim.dll
  • http corpus 39 (sigma 34, elastic 2, chronicle 2, splunk 1)
  • ieadvpack.dll
  • ieframe.dll
  • javascript:
  • mshtml.dll
  • pcwutl.dll
  • scrobj.dll
  • setupapi.dll
  • shdocvw.dll
  • shell32.dll corpus 3 (sigma 3)
  • shimgvw.dll
  • syssetup.dll
  • url.dll
  • zipfldr.dll