[PSEXEC]

Execute processes remotely on Windows systems for administration, incident response, and security testing

Difficulty: Intermediate
Category: Essential

Security Warning

PsExec is a powerful tool that can be used maliciously. It's commonly used by ransomware and APT groups for lateral movement. Always use responsibly and only on systems you own or have explicit permission to access.

Key Features

Remote Execution
Execute commands and programs on remote Windows systems
User Contexts
Run as different users including SYSTEM account
No Installation
No need to install software on target systems
Interactive Sessions
Establish interactive command shells on remote systems

Basic Usage

Remote Command Execution

# Execute command on remote system
psexec \\192.168.1.100 -u Administrator -p password cmd.exe

# Run as SYSTEM account
psexec \\target-pc -s cmd.exe

# Interactive session
psexec \\remote-host -i -u domain\\user -p password

File Execution

# Execute local file on remote system
psexec \\target -c -f C:\\tools\\malware_scanner.exe

# Run PowerShell script remotely
psexec \\target powershell.exe -File C:\\scripts\\cleanup.ps1

# Execute on multiple systems
psexec @computers.txt -u admin -p pass cmd /c "netstat -an"

Advanced Options

OptionDescriptionExample
-sRun as SYSTEM accountpsexec \\target -s cmd
-iInteractive sessionpsexec \\target -i cmd
-cCopy file to remote systempsexec \\target -c tool.exe
-fForce copy even if existspsexec \\target -c -f app.exe
-dDon't wait for terminationpsexec \\target -d service.exe
-wSet working directorypsexec \\target -w C:\\temp cmd

Security Use Cases

๐Ÿšจ Incident Response

Execute containment and analysis tools on infected systems.

# Deploy EDR agent
psexec \\infected-pc -c edr-agent.exe

๐Ÿงช Penetration Testing

Demonstrate lateral movement capabilities in security assessments.

# Execute payload
psexec \\target-host -u admin -p pass payload.exe

๐Ÿ”ง System Administration

Remote system maintenance and configuration tasks.

# Install updates
psexec \\workstation -s wuauclt /detectnow

๐Ÿ” Forensic Collection

Deploy forensic tools on remote systems for evidence gathering.

# Memory dump
psexec \\target -c winpmem.exe memory.dmp

Security Considerations

Credentials in Commands: Passwords appear in command line history and process lists
Network Traffic: Creates SMB connections that may be logged and monitored
Service Creation: Temporarily creates a service on target system (PSEXESVC)
EDR Detection: Commonly flagged by endpoint detection systems

Get PsExec

Download PsExec as part of the PsTools suite

Download PsExec.exe