How To Protect Your WordPress Site From A Brute-Force Attack

Learn how to protect your WordPress site from being brute-force attacked, or having its security compromised by hackers or bots.

WP SecurityWordPress is the world’s most used CMS making it a target for attempted hacker attacks.

In early 2013, WordPress installations around the world were subjected to a worldwide brute-force attack.

These attacks were caused by computer networks infected with viruses and programmed to attack other sites (called “botnets”).

How To Protect Your WordPress Site From A Brute-Force Attack

Brute-Force Attacks – An Overview

A brute-force attack is a technique used to break an encryption or authentication system by trying all possibilities.

(Source: Chinese University Of Hong Kong)

One of the many ways hackers use to try and break into a WordPress site is by trying to guess the site’s administration login username and password. To attempt this, hackers use scripts and tools that automatically tries to guess hundreds of login possibilities in minutes.

If you’re using obvious login details, your website could be an easy target for hacking attempts.

This is called a “brute force” attack.

Botnet Definition

A botnet is a number of Internet-connected computers communicating with other similar machines in an effort to complete repetitive tasks and objectives. This can be as mundane as keeping control of an Internet Relay Chat (IRC) channel, or it could be used to send spam email or participate in distributed denial-of-service attacks. The word botnet is a combination of the words robot and network.

(Source: Wikipedia/botnet)

A “Botnet” is a network of private computers that have been infected with malicious scripts or software, which are then controlled remotely as a group, typically without the computer owners’ knowledge.

Botnets are typically used to send out mass spam emails.

Below is a screenshot taken from a site that monitors online security showing the locations of the command centers of a botnet that has been actively compromising computer networks all around the globe since 2009 called “Zeus” …

The Zeus botnet has been actively infecting computer networks all around the world since 2009.

(The Zeus botnet has been actively infecting computer networks all around the world since 2009. Screenshot: SecureList.com)

These were well organized and highly distributed botnet attacks. Over 90,000 IP addresses were identified by a number of hosting companies just in the initial attack, when millions of attempts to force their way into WordPress site admin areas occurred. The large-scale attacks continued after this, with over 30,000 WordPress sites and blogs being hacked every day.

Coverage of the April 2013 brute force attack was widely reported in all of the major webhosting companies, as well as the leading technology publications, such as TechNews Daily, Forbes, Tech Crunch, BBC News, PC Magazine, and even on the official US Department of Homeland Security website …

WordPress is the world's most popular CMS which makes it an obvious target for hacking attacks

(WordPress powers millions of sites worldwide, which makes it an obvious target for hacking attempts)

Does This Mean WordPress Is Not Secure And We Should Stop Using It?

No. In fact, there are lots of good reasons why you should choose WordPress if you are concerned at all about website security.

To understand what makes WordPress a very secure platform for websites, see this article: Are Open Source CMS Platforms Like WordPress Secure?

Useful Info

It’s important to note that, in the case of the worldwide brute-force attack described above, was no specific vulnerability in WordPress being exploited (the same script was also targeting sites built using platforms like Joomla).

Mike Little, one of the co-founders of WordPress, said this about the botnet attacks:

It is a “simple” script that attempts to login using the admin login and a generated password. So if your password is too short or based on dictionary words it will be guessed and then the script can login legitimately and do whatever it wants including installing scripts (as plugins) or editing files. The attack tries to guess your password, if it succeeds, the most secure site in the world is wide open because they have your password.

(MikeLittle.org)

Preventing Your WordPress Blog From Brute-Force Attacks – Ten Security Checks

You may think that your site is of little value to hackers, but the reality is that every website is valuable to a malicious user.

If a hacker can exploit a security flaw in your system that lets them gain access and control of your blog, the web site can then be used as part of a larger network of “bots” to target other highly-valued web sites.

Additional undesirable effects of being hacked include being blacklisted by search engines, having spammy links advertising things like viagra, discounted fashion, etc. in your content and meta data, malicious redirects to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasties.

The harsh reality is that software-driven bots are scouring for weaknesses and trying to hack into your web site as you are reading this article right now. Whether they will break into your site successfully or not, depends on how difficult or easy you will make things for hackers to keep persisting until they either work out how to get access, or give up and go look for a less protected target.

How Much Information Are You Broadcasting To Hackers About Your Site?

If you visit Hackertarget.com and run your website through their WordPress security scan …

WP Security Check(Website Security Check Screenshot source: https://hackertarget.com/wordpress-security-scan)

You will see that the test returns various results and details about your website …

Hackertarget - Website Security Scan

(website security check results. Product image: Hackertarget.com)

It should be obvious after using this scanning tool that if you can freely access all of this information, so can hackers.

WordPress Security Scan(Product image source: BlogDefender website)

The ability to see which version of WordPress you are using, which plugins and themes you have installed on your site, and which files have been uploaded to certain directories can be useful information to hackers, as this informs them about any security weaknesses, especially in older versions.

If your site or blog is powered by WordPress and you are not taking appropriate steps to bullet-proof your site, then we can practically guarantee that, at some point, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically hitting WordPress installations worldwide!

When a site gets compromised, webmasters can discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been altered or even that their content has been entirely wiped out. Often, most compromised sites will become infected with malicious software or viruses without the owner even being aware of it.

To avoid the heartache (and potential financial loss) that comes with having your website or blog being hacked into, we have listed below 10 simple, yet essential and effective security measures that will help to prevent your WordPress site from being brute force attacked.

Note

Note: Some of the measures listed below need some technical understanding of how to modify core WordPress and/or server files. If you have no technical skills, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Host

Contact your webhosting provider and ask them exactly what precautions have been put in place to help prevent your site from botnet attacks, and what they are doing to make sure that your server files get regularly backed up.

It is important to check that your web host regularly backs up your server files and that, if disaster strikes, you can quickly and easily get your files back.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Site Frequently Up-To-Date

Never rely only on your hosting service for site backups. Instead, learn how to manage your WordPress site or get this service done for you and maintain a habit of religiously performing a complete WordPress site maintenance routine frequently (e.g. daily, weekly, fortnightly, etc …)

A complete WordPress maintenance routine ensures that:

  • All unnecessary data and files are removed,
  • All files and data are free of errors, optimized and backed up,
  • All WordPress themes, plugins and software components are up-to-date,
  • etc …

A complete WordPress site maintenance routine looks like this …

Maintaining your WordPress website regularly backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP website regularly backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WP installation completely backed up and up-to-date. WP maintenance is not hard or time-consuming, but it must be done to ensure the security of your website. If you don’t want to learn how to do WordPress maintenance yourself, get someone else to do it but make sure this gets done. Backing up your site is the second most important thing you should do after making sure that you are still breathing!

If you don’t want to perform manual backups, there are a number of plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate And Protect Your WP Websites With Backup Creator WordPress Plugin

Security Measure #3 – Make Sure That Your Username Is Not “Admin”

The mass brute-force botnet attack on WordPress is mostly an attempt to compromise website admin panels by exploiting installations that used “admin” as the user name.

For security reasons, never install WordPress sites with the username “admin”. This is the first thing hackers will test. If your site’s username is admin, you will should change this immediately.

We have created a tutorial that shows you how to change your admin username here: Changing Your WordPress User Name From Admin To A Different User Name

Security Measure #4 – Use Strong Passwords

A “brute force” attack occurs when malicious software continually tries to guess the right username and password characters that will give them entry to your site.

Unless you put some measure in place to prevent the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just continue to attack your site until it eventually gets access.

Weak passwords, therefore, make very easy targets for bot attacks. Make sure that you change your password to something that contains at least eight characters long, with upper and lowercase letters, and “special” characters (%^#$@&*).

Practical Tip

You can use a password software tool like Roboform to generate secure login passwords …

You can use a password program like Roboform to help you generate hard-to-guess passwords(Roboform is a password program you can use to generate secure login passwords)

For a tutorial on how to change your admin password, go here: Changing Your Login Password

Security Measure #5 – Protect Your wp-config.php File

The wp-config.php file allows WordPress to communicate with the database to store and retrieve data and is used to define advanced options for WordPress.

wp-config.php file

(wp-config.php file)

If a hacker breaks into your WordPress site, they will try to access the wp-config.php file, because this is the file that contains your database information, security keys, etc. Getting access to this information would allow them to change anything in your database, create a user account, upload files and take control of your site.

In order to protect your WordPress site from being attacked and even being used as part of a bot net, therefore, prevent people from being able to easily access your wp-config.php file. This requires knowing how to edit database information, move files around in your server and changing access permissions.

Security Measure #6 – Rename Or Delete Unnecessary Installation Files

Rename or delete the install.php, upgrade.php and readme.html files from your server.

These files can be deleted after installation. If you don’t want to delete these files, just rename them.

Security Measure #7 – Keep Your WordPress Software, Themes & Plugins Up-To-Date

Hackers search for vulnerabilities they can exploit in outdated WordPress versions, including out-of-date versions of themes and plugins.

Ensure that all of your WordPress application files, themes, plugins, etc. are always up to date.

Security Measure #8 – Disable The WordPress Theme Editor

WordPress comes with a built-in editor that allows the site administrator to edit plugin and theme files from the dashboard.

In WordPress, you can access the WordPress Theme Editor by selecting Appearance > Editor in your dashboard menu …

WP Theme Editor Menu

(Accessing the WordPress theme editor using the admin menu)

The WordPress theme editor lets anyone accessing your site see and make changes to all of your files, and cause havoc on your site.

If you want to prevent unauthorized people from accessing the WordPress Theme editor, you will need to disable it. This can be done by adding code to your wp-config.php file.

Security Measure #9 – Protect Your Site’s Uploads Folder

The WordPress “uploads” folder contains all the media files that get uploaded to your blog.

By default, this folder is visible to online users. All someone has to do to view all of the contents in the “uploads” folder is visit your directory using a web browser …

(WordPress uploads directory)

(WordPress has an uploads directory where your media files are stored)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by malicious users, anyone can upload unauthorized file types to your site.

Protecting your directories will prevent online users from viewing your ‘uploads’ folder and other important directories. This can be done using plugins, setting file permissions, adding a blank index.php file (this is literally an empty file named “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone who knows what they are doing if you are not sure about what to do.

Security Measure #10 – Use Security Plugins

Several WordPress security plugins are available that specifically address common security issues WordPress website owners face, such as preventing unauthorized users from accessing your site, protecting your website from malicious scripts, preventing injections of code into files, etc.

Many WordPress plugins address some but not all areas of WordPress security. One WordPress plugin that does a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your files and causing damage to your site is SecureScanPro.

SecureScanPro - WordPress complete security software

(SecureScanPro – total security plugin for WordPress)

SecureScanPro is easy to install and easy to use, and does a great job of fixing most of the security areas that WordPress users need to address.

Another great security plugin you may want to consider using is BlogDefender.

Blog Defender

Blog Defender Security Suite For WordPress(Blog Defender)

This product is a suite of WordPress security video tutorials, plugins and tools, plus WordPress security documentation in PDF and DOC formats.

BlogDefender shows you where potential security holes in your WordPress site are …

Blog Defender Security Suite For WordPress Websites & BlogsAnd lets you fix these quickly and easily …

Blog Defender Security Product Suite For WordPress WebsitesIf you don’t want to invest in a security plugin like SecureScanPro or BlogDefender, you can use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure web platform, but neglecting essential maintenance tasks like keeping your WP installation, WP plugins and themes up-to-date, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

Regardless of the kind of business you run or plan to run online and how small you think your web presence is, website security is something you cannot afford to ignore.

As one last reminder, below is the advice given by an expert on web security to all WordPress users following the worldwide brute force attacks by botnets on WordPress in April 2013 …

Owners of websites based on WordPress CMS must improve at least basic security settings and implement best practices such as the use of robust passwords and the accurate management of “admin” accounts.

Pierluigi Paganini, Chief Information Security Officer, Security Affairs

***

As you can see, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, the above article will help keep your WordPress site protected from brute force attacks. If you need any further help or assistance with WordPress security, please consult a WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications via email whenever we publish new information on WordPress security and reviews of WordPress security plugins.

***

"I have used the tutorials to teach all of my clients and it has probably never been so easy for everyone to learn WordPress ... Now I don't need to buy all these very expensive video courses that often don't deliver what they promise." - Stefan Wendt, Internet Marketing Success Group

***