DCOM Lateral Movement
DCOM-based execution uses Windows Component Object Model infrastructure to invoke methods on remote hosts. Unlike PSExec it does not create a service and unlike WMI it uses a different set of RPC interfaces — making it a useful alternative when specific execution methods are blocked or monitored. It requires local admin on the target and port 135 (RPC endpoint mapper) plus high dynamic ports to be reachable.
impacket-dcomexec supports three DCOM objects: ShellWindows (default), MMC20, and ShellBrowserWindow. ShellWindows is the most reliable across modern Windows versions. ShellBrowserWindow does not work on Windows 11. MMC20 triggers Defender alerts on Windows Server 2025.
Semi-interactive shell via DCOM
Without a command argument, impacket-dcomexec drops into a semi-interactive shell. Output is written to a temp file on the target and retrieved over SMB — the same mechanism as wmiexec.
C:\Windows\system32> whoami corp\jsmith C:\Windows\system32> hostname WS01
Pass-the-Hash
C:\Windows\system32> whoami corp\jsmith
Single command execution
Pass a command directly to execute without an interactive session. Use -nooutput when the command does not need to return output — this skips the SMB output retrieval step and is faster for fire-and-forget commands like adding a user or staging a file.
DCOM execution runs in the context of the authenticated user, not SYSTEM. If you need SYSTEM-level access on the target, use PSExec or SMBExec instead. For a comparison of all remote execution methods see Remote Execution in Active Directory.
References
-
Impacket — GitHubgithub.com/fortra/impacket (opens in new tab)
dcomexec.py — -object, -shell-type, -nooutput flag reference
Was this helpful?
Your feedback helps improve this page.