PsExec and SMB Lateral Movement
SMB-based lateral movement is the most common technique in Windows environments. All methods use port 445 and valid credentials or hashes, and work against any host where the account has local admin access. The main approaches covered here:
Impacket psexec, smbexec, and wmiexec for remote shells from Linux
Sysinternals PsExec for shell access from a Windows foothold
Direct SMB share operations for file read, write, and staging
Credential spraying with nxc to find where credentials are valid across the network
Impacket psexec
Impacket's psexec creates a service on the remote host, uploads a binary via SMB, and returns an interactive shell as SYSTEM. It is noisy (a new service is created and event logs record it), but it gives you an immediate SYSTEM shell.
C:\Windows\system32>whoami nt authority\system
Impacket smbexec and wmiexec
Both are quieter alternatives to psexec. smbexec creates a service but does not write a binary to disk. wmiexec uses WMI to run commands and leaves no service artifacts: it is the preferred method when you want to avoid detection.
wmiexec runs commands as the authenticated user, not SYSTEM. If you need SYSTEM-level access on the remote host, use psexec. If you only need to run commands or transfer data, wmiexec is preferable because it generates fewer artifacts.
Sysinternals PsExec
The original PsExec from Sysinternals runs from a Windows foothold. Requires SMB access and admin credentials. Accepts passwords but not hashes directly: use mimikatz pth to inject a hash first, then run PsExec in the spawned process.
SMB file access and share operations
Direct SMB share access lets you read and write files on remote hosts without needing a shell. Use this to drop payloads, read sensitive files, or stage data for exfiltration.
Spraying credentials across multiple hosts
Before moving to a specific target, verify which hosts accept the credentials. nxc makes this fast: it tests the credential against every host in a range and flags where you have admin.
When you have a local Administrator hash, always try --local-auth across the entire subnet first. Many environments reuse the same local Administrator password across workstations, and a single hash can give you access to dozens of hosts. For lateral movement using Kerberos tickets instead of hashes see Pass-the-Hash and Pass-the-Ticket.
References
-
psexec, smbexec, wmiexec, smbclient implementations
-
PsExec: Microsoft SysinternalsDOCS: PsExec: Microsoft Sysinternals, learn.microsoft.com/en-us/sysinternals/downloads/psexec (opens in new tab)
Official Sysinternals PsExec documentation and download
-
NetExec (nxc): GitHubREPO: NetExec (nxc): GitHub, github.com/Pennyw0rth/NetExec (opens in new tab)
SMB credential testing and lateral movement automation