Brute Force Attack
Brute force attacks involve systematically trying multiple password combinations to gain unauthorized access to user accounts. This module demonstrates how weak authentication mechanisms can be exploited and the progressive security controls needed to defend against them.What is a Brute Force Attack?
A brute force attack is a trial-and-error method used to obtain information such as passwords or PINs. Attackers use automated tools to submit many passwords or passphrases with the hope of eventually guessing correctly. The attack works because:- Users often choose weak, predictable passwords
- Single words from dictionaries are common
- Patterns like “password123” or “qwerty” are frequently used
- No rate limiting allows unlimited attempts
Common Attack Vectors
- Dictionary Attacks: Using wordlists of common passwords
- Credential Stuffing: Reusing leaked credentials from other breaches
- Password Spraying: Trying a few common passwords against many accounts
- Pure Brute Force: Trying every possible character combination
How the Attack Works
The DVWA brute force module presents a simple login form that accepts username and password credentials:- Uses GET method (credentials visible in URL)
- No rate limiting
- No account lockout
- No CAPTCHA
- No delay between attempts
- Vulnerable to SQL injection (
$usernot sanitized) - Uses weak MD5 hashing
- Input sanitization with
mysqli_real_escape_string() - Fixed 2-second delay on failed login
- Still uses GET method
- Delay is predictable and only slows attacks (not prevents)
- No account lockout
- No CAPTCHA
- Still uses MD5 hashing
High Security
Improvement: Added anti-CSRF tokens and random delays.Impossible Security
Improvement: Account lockout mechanism with time-based unlock.2. Account Lockout
Temporarily disable accounts after failed attempts:4. Multi-Factor Authentication (MFA)
Require additional authentication factors:- Time-based OTP (TOTP)
- SMS codes
- Hardware tokens
- Biometric verification
5. Strong Password Policies
7. Monitoring and Alerting
Detect and respond to brute force attempts:- Capture login request
- Send to Intruder
- Set password as payload position
- Load password list
- Start attack
- Analyze responses for success
