Detect Rundll32 in Sumo Logic CSE
Adversaries may abuse rundll32.exe to proxy execution of malicious code. Using rundll32.exe avoids triggering security tools that allowlist it or ignore it due to high noise. Rundll32 can execute DLL payloads, Control Panel items (.cpl via Control_RunDLL), JavaScript (via mshtml,RunHTMLApplication), remote COM scriptlets, and system DLLs (zipfldr.dll, ieframe.dll). Adversaries may also export DLL functions by ordinal number or obscure function names by appending W/A character set suffixes. Widely used by InvisiMole, Latrodectus, FIN8, APT28, BoomBox, MegaCortex, QakBot, Emotet, Cobalt Strike, and many ransomware families.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1218 System Binary Proxy Execution
- Sub-technique
- T1218.011 Rundll32
- Canonical reference
- https://attack.mitre.org/techniques/T1218/011/
Sumo Detection Query
_sourceCategory=*WinEvent* OR _sourceCategory=*Sysmon* OR _sourceCategory=*endpoint*
| where EventID in ("1", "4688")
| where toLowerCase(process_name) matches "*rundll32.exe*" or toLowerCase(command_line) matches "*rundll32*"
| eval javascript_exec = if(matches(toLowerCase(command_line), ".*javascript:.*") or matches(toLowerCase(command_line), ".*mshtml.*") or matches(toLowerCase(command_line), ".*runhtmlapplication.*"), 1, 0)
| eval remote_sct = if(matches(command_line, ".*https?://.*") or matches(toLowerCase(command_line), ".*getobject\\(.*"), 1, 0)
| eval minidump_flag = if(matches(toLowerCase(command_line), ".*minidump.*"), 1, 0)
| eval control_panel = if(matches(toLowerCase(command_line), ".*control_rundll.*") or matches(toLowerCase(command_line), ".*\.cpl.*"), 1, 0)
| eval suspicious_path = if(matches(toLowerCase(command_line), ".*(temp|appdata|downloads|public|desktop).*"), 1, 0)
| eval ordinal_load = if(matches(command_line, ".*,#[0-9]+.*"), 1, 0)
| eval office_parent = if(matches(toLowerCase(parent_process), ".*(winword|excel|outlook|powerpnt)\.exe.*"), 1, 0)
| eval script_parent = if(matches(toLowerCase(parent_process), ".*(cmd|powershell|wscript|cscript|mshta)\.exe.*"), 1, 0)
| eval risk_score = javascript_exec + remote_sct + minidump_flag + (suspicious_path * (office_parent + script_parent)) + ordinal_load + office_parent + script_parent
| where risk_score > 0
| fields _messagetime, host, user, process_name, command_line, parent_process, parent_command_line, javascript_exec, remote_sct, minidump_flag, control_panel, suspicious_path, ordinal_load, office_parent, script_parent, risk_score
| sort by risk_score desc, _messagetime desc Detects T1218.011 rundll32.exe proxy execution by enriching Windows process creation events (Sysmon EID 1 or Security EID 4688) with behavioral risk indicators including JavaScript execution via mshtml, remote SCT loading, LSASS MiniDump abuse, ordinal-based DLL invocation, and suspicious parent process chains. A composite risk score surfaces highest-priority alerts.
Data Sources
Required Tables
False Positives & Tuning
- Enterprise endpoint management agents (e.g., Tanium, BigFix) that spawn rundll32.exe with shell32.dll or advpack.dll from PowerShell as part of patch management workflows
- Legitimate use of ieframe.dll or zipfldr.dll by Windows Explorer processes for archive browsing or web content rendering, occasionally triggered from script-based automation
- Developer toolchains that use mshta.exe or cscript.exe as build-step wrappers which subsequently call rundll32.exe with benign system DLLs
Other platforms for T1218.011
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Rundll32 LSASS Dump via comsvcs.dll MiniDump
Expected signal: Sysmon Event ID 1: powershell.exe then rundll32.exe with comsvcs.dll and MiniDump in command line. Sysmon Event ID 10 (Process Access): rundll32.exe accessing lsass.exe. Sysmon Event ID 11: lsass.dmp file created in Temp. Windows Defender will likely block this on patched systems.
- Test 2Rundll32 JavaScript Execution via mshtml
Expected signal: Sysmon Event ID 1: rundll32.exe with javascript: and mshtml in command line. If WScript.Shell successfully runs calc.exe, a child process creation event for calc.exe with ParentImage=rundll32.exe will appear.
- Test 3Rundll32 DLL Execution from Temp Directory
Expected signal: Sysmon Event ID 11: DLL written to Temp. Sysmon Event ID 1: rundll32.exe with ordinal (#1) and Temp path. Sysmon Event ID 7: DLL loaded by rundll32.exe. Security Event ID 4688.
References (6)
- https://attack.mitre.org/techniques/T1218/011/
- https://lolbas-project.github.io/lolbas/Binaries/Rundll32/
- https://www.carbonblack.com/2016/04/28/threat-advisory-squiblydoo-continues-trend-of-attackers-using-native-os-tools-to-live-off-the-land/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1218.011/T1218.011.md
- https://blog.f-secure.com/hunting-for-the-undefined-behavior-the-case-of-comsvcs-dll/
- https://www.elastic.co/blog/hunting-for-persistence-using-elastic-security
Unlock Pro Content
Get the full detection package for T1218.011 including response playbook, investigation guide, and atomic red team tests.