Password Attack Methodology & Workflow
Password Attack Methodology Workflow
A structured approach is vital for effective and efficient password attacks during a penetration test.
Phase
Goal
Techniques & Tools
Output/Next Steps
1. Information Gathering & Target Identification
Identify accounts, services, and policies.
User enumeration (e.g., AD, SMB, web forms), service fingerprinting (nmap), password policy analysis (manual testing, ADRecon).
List of valid/likely usernames, list of target services, established password policy.
2. Wordlist Generation & Customization
Create a highly relevant, customized wordlist.
cewl, CUPP, username-anarchy, policy filtering (grep), rule-based mutations (hashcat rules).
A high-quality, targeted wordlist and/or mutation rules file.
3. Offline Password Cracking (if hashes are obtained)
Crack acquired hashes quickly using high-speed tools.
Hashcat, John the Ripper, pypykatz, secretsdump.py.
Cracked plaintext passwords, or partially cracked lists.
4. Online Password Attacks
Attempt login against services with generated credentials.
Hydra, Medusa, CrackMapExec, evil-winrm, nmap scripts.
Successful logins, or a list of services where account lockouts occurred.
5. Post-Exploitation / Local Credential Hunting
Search the compromised system for cached or stored credentials/hashes.
Windows: mimikatz, PowerShell commands, findstr. Linux: grep, history files, configuration files.
New set of credentials/hashes for further lateral movement.
Login Brute-Forcing
What is Brute Forcing?
A trial-and-error method is used to crack passwords, login credentials, or encryption keys by systematically testing every possible character combination.
Factors Influencing Brute Force Attacks
Complexity of the password or key: Higher complexity (length, character set) increases time exponentially.
Computational power available to the attacker: Measured in keyspace/hashes per second (KPS/HPS).
Security measures in place: Account lockout policies, CAPTCHA, and multi-factor authentication (MFA).
How Brute Forcing Works
Start: The attacker initiates the brute force process.
Generate Possible Combination: The software generates a potential password or key combination.
Apply Combination: The generated combination is attempted against the target system.
Check if Successful: The system evaluates the attempted combination.
Access Granted (if successful): The attacker gains unauthorised access.
End (if unsuccessful): The process repeats until the correct combination is found or the attacker gives up.
Types of Brute Forcing
Attack Type
Description
Best Used When
Defensive Consideration
Simple Brute Force
Tries every possible character combination in a set.
Impractical for modern systems; used against short or very weak keys.
Rate limiting and CAPTCHA implementation.
Dictionary Attack
Uses a pre-compiled list of common or leaked passwords.
The password is likely weak or common.
Strict password complexity and auditing against common wordlists.
Hybrid Attack
Combines dictionary attacks with rule-based mutations (e.g., appending numbers, capitalizing).
Target uses modified common passwords (e.g., Summer2025!).
Requires highly customized rule sets to defend against effectively.
Credential Stuffing
Uses leaked username:password pairs from other breaches.
Target may reuse passwords across multiple services.
Enforce unique, strong passwords and use MFA.
Password Spraying
Attempts a few common passwords across many accounts before moving to the next password.
Account lockout policies are in place, trying to avoid locking a single account.
Enforce minimum 12-character passwords; monitor organization-wide failed logins.
Rainbow Table Attack
Uses precomputed tables of password hashes.
Cracking a large number of unsalted password hashes (less effective today).
Always use modern, salted hashing algorithms (Argon2, bcrypt).
Reverse Brute Force
Targets a known password against multiple usernames.
Password reuse is suspected among employees.
Enforce strong, unique passwords and monitor widespread attempts using a single common password.
Distributed Brute Force
Distributes attempts across multiple machines (Botnet, cloud infrastructure).
Password is complex, and one machine isn't enough.
Implement rate limiting and geographical IP filtering.
Default Credentials
Device
Username
Password
Notes
Linksys Router
admin
admin
Often used on consumer-grade devices.
Netgear Router
admin
password
Common default for older equipment.
TP-Link Router
admin
admin
Often used for initial setup.
Cisco Router
cisco
cisco
Default for IOS devices.
Ubiquiti UniFi AP
ubnt
ubnt
Common for UniFi devices during setup.
Tomcat Manager
tomcat
s3cret
Check deployment guides for specifics.
Brute-Forcing Tools
Hydra
Fast network login cracker supporting protocols like FTP, SSH, HTTP, RDP, VNC, and more.
Medusa
Massively parallel, modular login brute-forcer.
Custom Wordlists & Filtering
Wordlist Generation and Mutation
CUPP (Common User Passwords Profiler)
Creates wordlists based on personal information (name, pet, birthday, partner's name, etc.)
Username Anarchy
Generates potential usernames based on common naming conventions.
Cewl
Extracts keywords from a target website to create a relevant dictionary.
Password Policy Filtering
Use grep to filter a large wordlist (wordlist.txt) to match a known policy, improving attack efficiency.
Policy Requirement
Grep Regex Pattern
Explanation
Minimum Length (8 chars)
grep -E '^.{8,}$' wordlist.txt
At least 8 characters long.
At Least One Uppercase Letter
grep -E '[A-Z]' wordlist.txt
Contains an uppercase letter.
At Least One Digit
grep -E '[0-9]' wordlist.txt
Contains a digit.
At Least One Special Character
grep -E '[!@#$%^&*()_+-=[]{};':",.<>/?]' wordlist.txt
Contains a special character.
Combined Policy (8 chars, Upper, Lower, Digit)
grep -E '^.{8,}$' wordlist.txt | grep -E '[A-Z]' | grep -E '[a-z]' | grep -E '[0-9]'
Pipes filters together for a highly targeted list.
Exclude Common Patterns
grep -v -i 'password|admin|123' wordlist.txt
Excludes words like "password" or "admin" (case-insensitive).
Remote Password Attacks
These attacks target network services, which are often detected via nmap.
Local Credential Hunting
Windows Local Password Attacks
Linux Local Password Attacks
Cracking Passwords (Offline)
Hashcat (GPU-Accelerated)
John the Ripper (CPU-Optimised)
File Hash Extraction
File Type
Tool
Command
pdf2john.pl
pdf2john.pl PDF.pdf > pdf.hash
ZIP/RAR
zip2john/rar2john
zip2john ZIP.zip > zip.hash
BitLocker
bitlocker2john
bitlocker2john -i Backup.vhd > backup.hashes
Decryption (Fallback)
Mitigation & Defence Strategies
A good pentester understands how to defend against the attacks they perform.
Hashing & Salting: Use strong, modern, and slow hashing algorithms such as Argon2, bcrypt, or scrypt (not MD5 or SHA-1), and ensure hashes are properly salted.
Account Lockout & Rate Limiting: Implement policies to lock accounts after a small number of failed attempts (e.g., 5). Apply rate limiting at the network level (e.g., WAF) to throttle connection attempts from a single IP.
Multi-Factor Authentication (MFA): The single most effective countermeasure against credential-based attacks. Enforce MFA for all critical accounts.
Strong Password Policy: Enforce a minimum length of at least 12 characters and actively check new passwords against leaked password lists (e.g., using Have I Been Pwned's dataset).
Principle of Least Privilege (PoLP): Limit what a user can access if their account is compromised.
Monitoring & Alerting: Monitor login attempts and failed logins. Look for patterns indicative of password spraying (a single password failing across many accounts) or credential stuffing (known bad IPs attempting logins).
Last updated