Remote Execution in Active Directory
With valid credentials or hashes on a domain host, several execution primitives are available. Each leaves a different footprint and requires different rights. The choice matters depending on what defensive tooling is present and what access level you have on the target.
Local administrator access is required for most of these techniques. Confirm this first with a quick nxc check before running anything interactive.
SMB 10.10.10.20 445 WS01 [+] corp.local\jsmith:Password1! (Pwn3d!)
WMI execution
WMI-based execution does not drop a binary to disk and does not create a visible service. It is the least noisy of the common remote execution methods. impacket-wmiexec spawns a semi-interactive shell through WMI command invocation.
C:\Windows\system32> whoami corp\jsmith C:\Windows\system32> hostname WS01
PSExec
PSExec drops a service binary to the ADMIN$ share and creates a temporary service for code execution. This gives a SYSTEM-level shell but is noisy — it generates service creation events and leaves artefacts in the registry. Use when stealth is not a concern or when WMI is blocked.
C:\Windows\system32> whoami nt authority\system
SMBExec
SMBExec executes commands by creating and immediately deleting a service on the target — it does not drop a binary to disk. Output is written to a temporary file on the target and read back over SMB. Slower than wmiexec but more reliable in restricted environments where ADMIN$ write is blocked.
C:\Windows\system32> whoami nt authority\system
WinRM execution
WinRM gives a PowerShell-based remote session over port 5985 or 5986. The target account must be in the Remote Management Users group or have explicit WinRM access. evil-winrm provides a feature-rich interface including file upload/download and in-memory script loading.
*Evil-WinRM* PS C:\Users\jsmith\Documents>
nxc command execution
nxc supports inline command execution across multiple hosts in a single pass. Use this for quick collection tasks or to run commands across a subnet before establishing an interactive session.
SMB 10.10.10.20 445 WS01 corp\jsmith SMB 10.10.10.30 445 WS02 corp\jsmith
Execution method comparison
Method | Privilege required | Disk artefact | Shell level |
|---|---|---|---|
wmiexec | Local admin | None | User context |
psexec | Local admin | Service binary | SYSTEM |
smbexec | Local admin | None | SYSTEM |
evil-winrm | Remote Management Users | None | User context |
After gaining execution on a new host, run Situational Awareness to map what the new context can reach, then Credential Harvesting to collect hashes and tickets from LSASS and credential stores on the new host.
References
-
Impacket — GitHubgithub.com/fortra/impacket (opens in new tab)
wmiexec, psexec, smbexec execution reference
-
NetExec (nxc) — GitHubgithub.com/Pennyw0rth/NetExec (opens in new tab)
SMB and WMI execution modules
-
evil-winrm — GitHubgithub.com/Hackplayers/evil-winrm (opens in new tab)
WinRM shell with upload/download and Kerberos support
Was this helpful?
Your feedback helps improve this page.