π§Password Spraying from Linux
π Overview
Password spraying is one of the most effective methods for gaining initial domain credentials in Active Directory environments. This technique involves testing a small number of common passwords against a large list of usernames, staying below account lockout thresholds while maximizing the chance of success.
π― Attack Methodology
β οΈ Critical Prerequisites
Password Policy Knowledge: Essential for safe execution
Valid User List: Accurate username enumeration completed
Lockout Threshold: Must stay below the limit (typically 3-5 attempts)
Attack Timing: Space attempts based on lockout duration
π Attack Flow
User List Preparation: Clean, validated username list
Password Selection: Common, policy-compliant passwords
Attack Execution: Systematic credential testing
Success Validation: Verify discovered credentials
Documentation: Log all activities and results
π§ rpcclient Password Spraying
π Basic Methodology
Success Indicator:
Authority Namein responseBash One-Liner: Efficient automation approach
Filtering: Grep for successful authentications only
π Single Password Spray
π Example Successful Output
π§ Enhanced Script with Logging
π« Kerbrute Password Spraying
β‘ Key Advantages
Speed: Fastest password spraying method
Stealth: Minimal event generation
Kerberos-Based: Uses native authentication protocol
Clear Output: Easy to identify successful logins
π Basic Kerbrute Spraying
π Example Kerbrute Output
π Multiple Password Spraying
π¨ CrackMapExec Password Spraying
πͺ Key Features
SMB-Based: Uses SMB protocol for authentication
Bulk Testing: Efficient user list processing
Success Filtering: Easy identification of valid credentials
Immediate Validation: Built-in credential verification
π Basic CrackMapExec Spraying
π Example Successful Output
β
Credential Validation
π§ Advanced CrackMapExec Script
π Local Administrator Password Reuse
π― Attack Concept
Local administrator accounts often have the same password across multiple systems due to:
Gold Images: Automated deployments using templates
Management Ease: Admins using same password everywhere
Legacy Practices: Old password policies still in effect
π Target Prioritization
High-Value Servers: SQL, Exchange, file servers
Domain Controllers: If accessible (high impact)
Management Systems: SCCM, monitoring tools
Jump Boxes: Administrative workstations
π₯ Hash-Based Spraying
Example Output:
π§ Comprehensive Local Admin Hunting
β οΈ Important Flags
--local-auth: Prevents domain account lockouts--threads: Controls connection speed-H: Uses NTLM hash instead of password
π― HTB Academy Lab Walkthrough
π Lab Question
"Find the user account starting with the letter 's' that has the password Welcome1. Submit the username as your answer."
π Step-by-Step Solution
1οΈβ£ Connect to Attack Host
2οΈβ£ Gather User List with enum4linux
3οΈβ£ Method 1: rpcclient Password Spray
4οΈβ£ Method 2: Kerbrute Password Spray (Recommended)
5οΈβ£ Method 3: CrackMapExec
6οΈβ£ Expected Results
Based on the lab content, you should see:
enum4linux output (userlist creation):
Password spraying results:
β
Answer: sgage
sgage7οΈβ£ Verification
π Tool Comparison
Tool
Speed
Stealth
Accuracy
Features
Best Use Case
rpcclient
Medium
Medium
High
Simple, reliable
Script automation
Kerbrute
Fast
High
High
Kerberos-based, minimal logs
Large-scale spraying
CrackMapExec
Medium
Low
High
Validation, local auth
Comprehensive testing
π‘οΈ Security Considerations
π¨ Event Generation
Tool
Event IDs Generated
Detection Risk
rpcclient
4625 (failures), 4624 (success)
Medium
Kerbrute
4768 (TGT requests), 4771 (Pre-auth failed)
Low
CrackMapExec
4625 (failures), 4624 (success), 4648 (explicit logon)
High
π Defense Evasion
Timing: Space attempts based on lockout policy
User Selection: Avoid high-privilege accounts initially
Password Selection: Use policy-compliant passwords
Monitoring: Watch for defensive responses
π Detection Indicators
Multiple authentication failures from single source
Sequential login attempts across user list
Unusual authentication timing (outside business hours)
High volume of Event ID 4625 in short timeframe
π Password Selection Strategy
π― Common Effective Passwords
π Password Policy Compliance
π Attack Documentation Template
π Spray Session Log
π― Success Tracking
β‘ Quick Reference Commands
π§ One-Liner Sprays
π Result Extraction
π Key Takeaways
β
Attack Best Practices
Know the Policy: Essential for safe execution
Multiple Tools: Use different methods for verification
Proper Timing: Space attempts to avoid lockouts
Documentation: Log everything for client reporting
β οΈ Critical Warnings
Never Exceed Lockout Threshold: Typically 3-5 attempts max
Monitor Bad Password Counts: Check account status before spraying
Avoid High-Value Accounts: Don't target admin accounts initially
Space Attempts: Wait lockout duration + buffer between sprays
π― Post-Success Actions
Immediate Validation: Verify all discovered credentials
Privilege Assessment: Check user permissions and group memberships
Access Expansion: Use credentials for further enumeration
Documentation: Record all findings for reporting
Password spraying success requires patience, methodology, and respect for account lockout policies - one successful credential can open the entire domain.
Last updated