impacket_psexec
Run commands on a remote Windows host via SMB by creating a temporary Windows service. Requires admin credentials.
Instructions
Execute a command remotely on a Windows host via SMB using Impacket psexec.
psexec uploads a service binary to the target via SMB admin shares, creates and starts a Windows service, and executes the specified command.
Args: target: Target IP address or hostname. domain: Domain name (use "." for local accounts). username: Username for authentication. command: Command to execute on the remote host (e.g. "whoami"). password: Password for authentication (redacted in logs). hashes: NTLM hash for pass-the-hash (format: LM:NT). Alternative to password. timeout: Override scan timeout in seconds.
Returns: Command execution result with output.
WARNING: - This is a destructive operation that creates a service on the target. - Highly detectable — creates Windows Event IDs 7045, 4688. - Requires admin credentials and SMB access (port 445). - Requires explicit human authorization.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | ||
| hashes | No | ||
| target | Yes | ||
| command | Yes | ||
| timeout | No | ||
| password | No | ||
| username | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||