Brute Force Attacks
Test multiple passwords against user accounts to gain unauthorized access through credential guessing.
Brute forcing is noisier than spraying and can trigger account lockouts, so use carefully with proper delays.
Quick Reference
# Hydra SSH brute force |
Hydra
# SSH brute force |
Medusa
# SSH brute force |
NetExec (CrackMapExec)
# SMB brute force |
Metasploit
# SMB brute force |
Credential Stuffing
# Hydra with user:pass list |
Advanced Hydra Techniques
# Generate passwords on the fly (6-8 chars, alphanumeric) |
Common Workflow
# Step 1: Identify service and port |
Notes
Brute Force vs Password Spraying:
Brute Force: Many passwords, one user
- High risk of account lockout
- Very noisy and easily detected
- Faster if no lockout policy
Password Spraying: One password, many users
- Respects lockout policies
- Less noisy
- Slower but safer
Account Lockout Risks:
Brute forcing can trigger account lockouts:
- Typical threshold: 3-5 failed attempts
- Lockout duration: 30 minutes to permanent
- Can cause denial of service
Always check lockout policy first:
nxc smb 10.10.10.10 -u username -p password --pass-pol |
Tool Selection:
Hydra:
- Fast and versatile
- Supports many protocols
- Good for quick attacks
- Can be unstable with some services
Medusa:
- More stable than Hydra
- Better error handling
- Modular design
- Fewer protocols supported
NetExec:
- Best for Windows environments
- Built-in SMB, WinRM, MSSQL support
- Shows admin access clearly
- Active development
Metasploit:
- Integrated with exploitation framework
- Good for complex scenarios
- Slower than standalone tools
- Better logging and reporting
HTTP Form Brute Forcing:
When targeting web login forms:
- Inspect the form to identify field names
- Determine success/failure indicators
- Use appropriate condition string
Failure condition (F=):
hydra ... http-post-form "/login:user=^USER^&pass=^PASS^:F=Invalid credentials" |
Success condition (S=):
# HTTP redirect |
Performance Tuning:
Adjust parallel tasks based on target:
# Hydra: -t flag (default 16) |
Lower values:
- Slower but stealthier
- Less likely to trigger IDS/IPS
- Better for unstable services
Higher values:
- Faster attacks
- More network traffic
- Higher detection risk
Wordlist Recommendations:
Small lists (quick tests):
/usr/share/seclists/Passwords/Common-Credentials/10-million-password-list-top-100.txt/usr/share/seclists/Passwords/Common-Credentials/10-million-password-list-top-1000.txt/usr/share/seclists/Passwords/darkweb2017-top100.txt
Medium lists:
/usr/share/seclists/Passwords/darkweb2017-top10000.txt/usr/share/seclists/Passwords/xato-net-10-million-passwords-10000.txt
Large lists:
/usr/share/wordlists/rockyou.txt(14M passwords)/usr/share/seclists/Passwords/Leaked-Databases/rockyou.txt
Detection Avoidance:
- Use realistic delays between attempts
- Limit parallel connections
- Rotate source IPs if possible
- Brute force during business hours
- Monitor for defensive responses
- Stop if lockouts detected
Success Indicators:
Hydra:
[22][ssh] host: 10.10.10.10 login: admin password: Password123! |
Medusa:
ACCOUNT FOUND: [ssh] Host: 10.10.10.10 User: admin Password: Password123! |
NetExec:
SMB 10.10.10.10 445 DC01 [+] domain.local\admin:Password123! (Pwn3d!) |
Legal and Ethical Considerations:
- Only brute force with explicit authorization
- Respect account lockout policies
- Avoid denial of service conditions
- Document all attempts
- Follow rules of engagement
- Stop if causing system instability
Common Pitfalls:
- Not checking for account lockouts
- Using too many parallel threads
- Not monitoring target system health
- Forgetting to check for default credentials first
- Using wrong protocol or port
- Not handling special characters in passwords
- Ignoring rate limiting
Post-Success Actions:
Once credentials found:
- Verify access immediately
- Document credentials securely
- Check privilege level
- Test on other systems (password reuse)
- Continue enumeration with valid credentials