WordPress, the world’s most popular content management system (CMS), powers a vast swathe of the internet. This popularity, while a testament to its versatility and ease of use, also makes it a prime target for malicious actors. One of the most common and persistent threats facing WordPress websites is the brute force attack. This article will delve into what these attacks are, how they work, and, most importantly, how to effectively defend your site against them.

What is a Brute Force Attack?

A brute force attack, in its simplest form, is a trial-and-error method used to gain unauthorized access to a system. Think of it like a burglar trying every possible key combination on a lock until they find the one that works. In the context of WordPress, attackers target the login page, attempting to guess usernames and passwords until they successfully breach the site’s defences.

How Brute Force Attacks Work on WordPress

There are several common variations of brute force attacks targeting WordPress:

  1. Dictionary Attacks:
    • Mechanism: Attackers use a pre-compiled list (a “dictionary”) of common usernames and passwords. These dictionaries can contain millions of entries, ranging from simple words (“password,” “123456”) to leaked credentials from other data breaches.
    • Why They Work: Many users, unfortunately, choose weak and easily guessable passwords. This makes dictionary attacks surprisingly effective, especially against sites with poor password policies.
    • Example: A script might try “admin” as the username, then cycle through passwords like “password123,” “qwerty,” “admin1,” and so on, from the dictionary.
  2. Automated Login Attempts (Credential Stuffing):
    • Mechanism: This is a more sophisticated form of dictionary attack. Attackers use automated tools (bots) to rapidly submit login attempts, often leveraging lists of usernames and passwords obtained from data breaches on other websites.
    • Why They Work: The principle of “password reuse” is the attacker’s best friend here. If a user has used the same username and password combination on multiple sites, and one of those sites is compromised, their WordPress site is also vulnerable.
    • Example: A bot might try the username/password pair “john.doe@example.com” / “P@

wOrd1″ (obtained from a leaked database) against thousands of WordPress sites simultaneously.

  1. Password Spraying:
    • Mechanism: This technique is a twist on the standard brute-force approach. Instead of trying many passwords against a single username, attackers try a single, commonly used password against many usernames.
    • Why they work: Password spraying is often used to avoid account lockouts, which are often triggered by multiple failed login attempts for a single user. By spreading the attempts across many usernames, attackers can fly under the radar of basic security measures.
    • Example: The attacker may have acquired or guessed a list of usernames such as, admin, administrator, john.doe, jane.doe, support. The attacker will then try a password such as “Password123” against all of these usernames.

The “Admin” User Problem: A Massive Security Hole

One of the biggest vulnerabilities in older WordPress installations (and a persistent issue with improperly configured sites) is the default “admin” username. This is akin to leaving the front door of your house unlocked and labelled “Enter Here.”

  • Why it’s a problem: Attackers know that many WordPress sites have an “admin” user. This immediately eliminates half the guesswork in a brute force attack – they only need to crack the password.
  • The Solution: Never, ever use “admin” as a username. During WordPress installation, choose a unique and unpredictable username. If you already have an “admin” user, create a new administrator account with a strong username and password, then delete the old “admin” account. This is a fundamental security step.

Defence Strategies: Building Your WordPress Fortress

Protecting your WordPress site from brute force attacks requires a multi-layered approach. Here’s a breakdown of essential defence strategies:

  1. Strong Passwords (and Password Management):
    • Complexity: Use long passwords (at least 12 characters, ideally more) that include a mix of uppercase and lowercase letters, numbers, and symbols. Avoid dictionary words or personal information.
    • Uniqueness: Never reuse passwords across different websites.
    • Password Managers: Use a reputable password manager (like 1Password, LastPass, Bitwarden, or KeePass) to generate and securely store strong, unique passwords for all your accounts. This eliminates the temptation to reuse passwords and makes it much harder for attackers to succeed.
  2. Limit Login Attempts:
    • Plugins: Install a security plugin like Wordfence Security, iThemes Security (formerly Better WP Security), Sucuri Security, or All In One WP Security & Firewall. These plugins offer features to limit the number of failed login attempts from a single IP address within a specific timeframe.
    • Configuration: Configure the plugin to lock out users (or IP addresses) after a reasonable number of failed attempts (e.g., 3-5 attempts). Set an appropriate lockout duration (e.g., 15-60 minutes).
  3. Two-Factor Authentication (2FA):
    • Added Security Layer: 2FA adds an extra layer of security beyond just a username and password. It typically requires a code generated by an app on your smartphone (like Google Authenticator or Authy) or sent via SMS.
    • Plugin Integration: Most security plugins (mentioned above) offer 2FA integration. Enable it for all administrator accounts, and ideally for all user accounts if possible.
  4. Web Application Firewall (WAF):
    • Traffic Filtering: A WAF sits between your website and the internet, filtering incoming traffic and blocking malicious requests, including those associated with brute force attacks.
    • Cloud-Based Solutions: Consider cloud-based WAF services like Cloudflare, Sucuri, or Wordfence (which offers a WAF as part of its premium features). These services provide robust protection and often include additional security features like DDoS mitigation.
  5. Change the Default Login URL:
    • Obscurity: By default, the WordPress login page is located at wp-login.php or /wp-admin. Changing this URL makes it harder for automated bots to find your login page.
    • Plugins: Plugins like WPS Hide Login or Rename wp-login.php allow you to easily change the login URL to something custom.
  6. Keep WordPress, Themes, and Plugins Updated:
    • Security Patches: Updates often include security patches that fix vulnerabilities that attackers could exploit. Enable automatic updates for WordPress core, themes, and plugins whenever possible.
    • Vulnerability Scanners: Security plugins often include vulnerability scanners that can identify outdated software or known security issues.
  7. Regular Backups:
    • Disaster Recovery: Even with the best defences, there’s always a small chance of a successful attack. Regular backups (stored off-site) ensure that you can quickly restore your website to a working state if it’s compromised.
    • Backup Plugins: Use a reliable backup plugin like UpdraftPlus, BackupBuddy, or VaultPress.
  8. Monitor Login Activity:
    • Suspicious Behavior: Regularly review your website’s login logs for any suspicious activity, such as multiple failed login attempts from unfamiliar IP addresses.
    • Security Plugins: Security plugins often provide logging and reporting features that make it easier to monitor login attempts.
  9. Disable XML-RPC:
    • Potential Vulnerability: XML-RPC is a WordPress feature that allows remote publishing and management of your site. However, it can also be exploited by attackers for brute-force attacks.
    • Disable if Not Needed: If you don’t use features that rely on XML-RPC (like the WordPress mobile app or certain third-party services), it’s best to disable it. You can do this using a plugin like “Disable XML-RPC” or by adding code to your .htaccess file.
  10. Use a Captcha:
    • Bot Deterrent: Implement a CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) on your login page. This helps distinguish between human users and automated bots.
    • Plugin Options: Many plugins, including some of the security plugins mentioned earlier, offer CAPTCHA integration. reCAPTCHA by Google is a popular and effective choice.

Conclusion: Vigilance is Key

Brute force attacks are a constant threat to WordPress websites. However, by implementing the defence strategies outlined above, you can significantly reduce your risk and create a much more secure online presence. Remember that security is an ongoing process, not a one-time fix. Stay vigilant, keep your software updated, and regularly review your security measures to ensure your WordPress site remains protected.

SHould you require any help making sure your WordPress site is as secure as possible, please feel free to contact tom@mailmen.co.za.