Impacket WMIExec
Purpose
Use this skill for narrowly scoped WMI execution validation when the rules of engagement explicitly allow remote management checks.
Phase Fit
- Primary: Validation and Controlled Impact Demonstration
- Secondary: Retest and Closure
Use When
- Need to validate whether an approved credential has WMI-based execution rights on a specific host.
- Need a management-plane alternative to SMB service creation.
- Need a repeatable retest after WMI or host hardening changes.
Avoid When
- Remote execution or WMI testing is not explicitly approved.
- Host stability or management-plane sensitivity is uncertain.
Inputs
- Approved Windows host
- Authorized credential or hash context
- Stop conditions and evidence boundaries
Procedure
- Scope the check to the single approved host.
- Validate only the management-plane access needed to prove the boundary.
- Avoid persistence, broad reconnaissance, or unnecessary commands.
- Stop once the hypothesis is answered.
- Preserve the exact host and auth context for retest.
Command Syntax
Replace sample domains, hosts, and credentials with approved in-scope values.
# Interactive shell via WMI
wmiexec.py contoso.com/auditor:'<password>'@10.10.10.100
# Execute a specific command and exit
wmiexec.py contoso.com/auditor:'<password>'@10.10.10.100 'whoami /all'
# Pass-the-Hash
wmiexec.py -hashes :<NTLM_hash> contoso.com/administrator@10.10.10.100
# Pass-the-Ticket (Kerberos)
KRB5CCNAME=administrator.ccache wmiexec.py -k -no-pass dc01.contoso.com
# No-output mode (fire-and-forget)
wmiexec.py contoso.com/auditor:'<password>'@10.10.10.100 -nooutput 'cmd /c ipconfig > C:\Windows\Temp\out.txt'
Evidence to Capture
- Whether WMI execution succeeded for the approved credential
- Exact host, account, and management path used
- Minimal reproduction path for retest
Safety Boundaries
- Do not widen scope beyond the approved host.
- Avoid unnecessary command execution after the boundary is confirmed.