Get a Pentest and security assessment of your IT network.

Cyber Security

Website Password Brute Force Attacks

TL;DR

Brute force attacks try every possible password combination to gain access to your website. Common attack vectors include login forms, API endpoints, and weak security questions. Protect yourself with strong passwords, account lockout policies, multi-factor authentication (MFA), rate limiting, CAPTCHAs, and monitoring for suspicious activity.

Understanding Brute Force Attacks

A brute force attack is a trial-and-error method used by attackers to guess usernames and passwords. They use automated tools to systematically try many combinations until they find the correct one. The speed of an attack depends on factors like password complexity, account lockout policies, and the attacker’s resources.

Common Attack Vectors

  1. Login Forms: This is the most obvious target. Attackers use bots to submit numerous login attempts with different username/password combinations.
    • Standard Login Pages: The primary entry point for attackers.
    • Forgotten Password Forms: Can be used to enumerate valid usernames, even if the attacker doesn’t know the password. Repeated requests can reveal user existence.
  2. API Endpoints: If your website uses APIs for authentication (e.g., mobile apps, third-party integrations), these endpoints are vulnerable.
    • Unprotected APIs: APIs without proper rate limiting or authentication checks are easy targets.
    • Weak API Keys: Easily guessable or stolen API keys can bypass traditional password protection.
  3. SSH (Secure Shell): While not directly a website component, SSH access to your server is often targeted.
    • Default Credentials: Using default usernames and passwords for SSH accounts.
    • Weak Passphrases: Easily guessable or cracked passphrases.
  4. FTP (File Transfer Protocol): Similar to SSH, FTP access can be compromised.
    • Anonymous Login: Allowing anonymous logins without proper restrictions.
    • Weak Credentials: Easily guessable or cracked usernames and passwords.
  5. Security Questions: Often overlooked, security questions can be easily researched online.
    • Publicly Available Information: Attackers may find answers on social media or public records.
    • Predictable Answers: Common questions with predictable answers (e.g., mother’s maiden name).

Protecting Your Website

  1. Strong Passwords: Enforce strong password policies.
    • Minimum Length: Require passwords of at least 12 characters.
    • Complexity: Mandate a mix of uppercase and lowercase letters, numbers, and symbols.
    • Regular Changes: Encourage users to change their passwords periodically.
  2. Account Lockout Policies: Limit the number of failed login attempts.
    • Threshold: After a certain number of incorrect attempts (e.g., 5-10), lock the account for a specified period (e.g., 30 minutes).
    • IP Blocking: Temporarily block IP addresses that exceed the failed login attempt threshold.
  3. Multi-Factor Authentication (MFA): Add an extra layer of security.
    • TOTP (Time-Based One-Time Password): Use authenticator apps like Google Authenticator or Authy.
    • SMS Verification: Send a code to the user’s mobile phone. (Less secure than TOTP).
  4. Rate Limiting: Restrict the number of requests from a single IP address.
    • Login Attempts: Limit the number of login attempts per minute/hour.
    • API Requests: Control the rate of API calls to prevent abuse.
    • # Example using Nginx to limit requests from a single IP address
      limit_req_zone $binary_remote_addr zone=mylimit:10m;
      
      server {
          ...
          location /login {
              limit_req zone=mylimit burst=5 nodelay;
              ...
          }
      }
  5. CAPTCHAs: Distinguish between humans and bots.
    • reCAPTCHA: Google’s CAPTCHA service.
    • Honeypots: Hidden fields that are filled in by bots but not by legitimate users.
  6. Web Application Firewall (WAF): Filter malicious traffic.
    • ModSecurity: An open-source WAF for Apache and Nginx.
    • Cloudflare: A cloud-based WAF service.
  7. Monitoring & Logging: Track suspicious activity.
    • Failed Login Attempts: Monitor logs for excessive failed login attempts from specific IP addresses or usernames.
    • Unusual Activity: Look for patterns that indicate a brute force attack (e.g., rapid-fire requests, access from unusual locations).
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation