Pass Attacks (PTH/PTT)
Overview
Pass attacks leverage compromised credentials (passwords or NTLM hashes) for lateral movement in Windows networks. Once you crack a password or dump SAM hashes, you can use these credentials to authenticate to other systems without needing to crack the hash.
What are Pass Attacks?
Pass the Password: Using cracked plaintext passwords to authenticate to other systems
Pass the Hash: Using NTLM hashes directly for authentication without cracking them
Lateral Movement: Moving from one compromised system to others using valid credentials
Credential Reuse: Exploiting the fact that users often reuse passwords across systems
secretsdump.py - Credential Extraction Master
Overview
secretsdump.py is part of the Impacket suite and is used to extract credentials from Windows systems. It can dump SAM, LSA secrets, and NTDS.dit files both locally and remotely.
Installation
# Install Impacket
pip3 install impacket
# Or install from source
git clone https://github.com/SecureAuthCorp/impacket.git
cd impacket
pip3 install .
# Verify installation
secretsdump.py -hBasic Usage
Remote Credential Dumping
Local File Analysis
Advanced Options
Output Control
Specific Credential Types
Domain Controller Specific
Practical Examples
Scenario 1: Workstation Credential Dump
Scenario 2: Domain Controller NTDS Dump
Scenario 3: Pass the Hash with secretsdump
Understanding Output Formats
SAM Hash Format
Domain Credentials Format
Cached Credentials
Integration with Other Tools
Using Dumped Hashes with CrackMapExec
Hash Cracking with Hashcat
Golden Ticket Creation
Advanced Techniques
VSS (Volume Shadow Service) Method
Kerberos Authentication
LDAP Integration
Defensive Considerations
Detection Indicators
Prevention Strategies
Troubleshooting Common Issues
Access Denied Errors
Connection Issues
Large Domain Optimization
Automation Scripts
Bash Script for Multiple Targets
Python Integration
Real-World Attack Chain with secretsdump
Phase 1: Initial Access
Phase 2: Lateral Movement
Phase 3: Domain Compromise
Pass Attack Mitigations
Overview
While pass attacks are hard to completely prevent, organizations can implement several strategies to make them significantly more difficult for attackers to execute successfully.
Limit Account Re-use
Avoid Re-using Local Admin Passwords
Disable Default Accounts
Implement Least Privilege
Utilize Strong Passwords
Password Length Requirements
Avoid Common Words
Passphrase Implementation
Privilege Access Management (PAM)
Check Out/In Sensitive Accounts
Automatic Password Rotation
Session Monitoring
Additional Mitigation Strategies
Network Segmentation
Multi-Factor Authentication (MFA)
Credential Guard and Protected Users
Regular Security Audits
Monitoring and Detection
Event Log Monitoring
Behavioral Analytics
Honeypots and Decoys
Implementation Checklist
Immediate Actions
Short-term Goals (1-3 months)
Long-term Strategy (3-12 months)
Cost-Benefit Analysis
Low-Cost, High-Impact Measures
Medium-Cost, High-Impact Measures
High-Cost, High-Impact Measures
CrackMapExec (CME) - The Swiss Army Knife
Installation
Basic SMB Enumeration
Authentication Methods
Pass the Password
Pass the Hash
Advanced Authentication
Domain Authentication
Null Sessions and Guest Access
Command Execution
Basic Command Execution
Advanced Command Execution
Share Enumeration
List Shares
Access Shares
Credential Dumping
SAM Database
LSA Secrets
Module Usage
Available Modules
Common Modules
Practical Attack Scenarios
Scenario 1: Password Spraying
Scenario 2: Lateral Movement with Cracked Password
Scenario 3: Pass the Hash Attack
Other Tools for Pass Attacks
Impacket Suite
Evil-WinRM
Metasploit
Defense and Detection
Detection Indicators
Defensive Measures
Advanced Techniques
Kerberos Authentication
NTLM Relay Integration
Scripting and Automation
Bash Automation
Python Integration
Common CME Flags and Options
Authentication Flags
Execution Flags
Database and Logging
Troubleshooting Common Issues
Connection Issues
Authentication Issues
Real-World Attack Chain Example
Phase 1: Initial Compromise
Phase 2: Lateral Movement
Phase 3: Credential Harvesting
Phase 4: Privilege Escalation
Note: Always ensure proper authorization before conducting pass attacks. These techniques should only be used in authorized penetration testing scenarios or controlled lab environments.
Last updated