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.

WordPress SecurityWordPress is often the target of attacks by hackers.

In 2013, WordPress installations around the world were subjected to large-scale brute force attacks.

These attacks were caused by botnets (infected computer networks programmed to attack other vulnerable computers).

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

What Is A Brute-Force Attack?

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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. This can be done with software programs that automatically tries to guess hundreds of possible logins in minutes.

If you’re not using strong usernames or unguessable passwords, your site can be an easy target for hackers.

This is called a “brute force” attack.

Botnets – What Are They?

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.org)

A “Botnet” is a network of private computers that have been compromised and infected with malicious code, which are then controlled remotely as a group, typically without the computer owners even being aware that this is taking place.

Botnets are regularly used to blast 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 infecting computer networks all around the world since 2009 called “Zeus” …

ZeuS is a botnet that has been actively compromising computer networks all around the world since 2009.

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

These were well organized and highly distributed botnet attacks on WordPress sites. 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 attacks continued after this, with over 30,000 WordPress blogs being hacked every day.

News of this worldwide brute force attack was reported by all of the major webhosting companiesand leading technology publications, such as TechNews Daily, Forbes, PC Magazine, Tech Crunch, BBC News, and even on the official US Department of Homeland Security website …

WordPress powers millions of websites and blogs around the world, which makes it a target for hacking attacks

(Being the world’s most used content management system makes WordPress an obvious target for hackers)

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

No. In fact, there are many great reasons why you should choose WordPress if you are concerned about the security of your website.

To learn what makes WordPress a very secure platform for websites, see this article: Can You Build A Secure Business Online Using WordPress?

Useful Info

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, made the following comment about the brute force 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)

How To Protect Your WordPress Site From Being Brute Force Attacked – Ten Security Measures

You may think that the information in your website or blog offers no value to hackers, but the reality is that to a hacker, all websites provide an opportunity to benefit or profit at your expense.

If hackers can find a software flaw in your security and remotely take control of your web site, the site can then be used as a “bot” to attack other valuable web sites.

Additional undesirable consequences of being hacked include getting blacklisted by search engines, having spammy links promoting things like viagra, porn, etc. inserted in your content, redirecting visitors to phishing sites and other websites, drive-by downloads (adding malicious scripts on your visitors’ computers), and many other nasties.

The truth is that hackers are very likely trying to break into your site at this very moment. Whether they will break in successfully or not, depends on how difficult you have made things for them to keep persisting until they can discover how to get access, or decide to look for a more vulnerable target.

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

Do you own a WordPress site? If so, visit Hackertarget.com and run your website through their WordPress security check …

Hackertarget - WordPress Security Check(WP Security Scan Source: Hackertarget.com)

You will see that the check returns various results and information about your website …

Website Security Check

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

It should be obvious after using the tool shown above that if you can see all of this information, then so can hackers.

Website Security Scan(Screenshot image: Blog Defender)

Being able to see which version of WordPress you are using, which plugins and themes you have installed, and which files have been uploaded to certain directories are all valuable information to hackers, as these can inform them about potentially exploitable vulnerabilities, especially in older versions.

If your website is powered by WordPress and you’re not precautionary steps to toughen up your site, it’s practically guaranteed that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute-force attacks are systematically hitting WordPress installations worldwide!

Whenever a website is compromised, webmasters will find themselves “locked out” of their own site, or notice that their files have been vandalized or even that their content has been entirely wiped out. Typically, most compromised sites will be infected with malicious scripts or viruses without the owner’s knowledge or awareness.

To avoid the heartache of having your web site being hacked into, we have listed below 10 simple, yet essential and effective security checks that will help to protect your WordPress site from being brute-force attacked.

Info

Note: Some of the measures shown below require 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 – Contact Your Host

Get in touch with your host and ask them what security systems have been put in place to help prevent your site from botnet attacks, and what is done to make sure that your server files are regularly being backed up.

Make sure that your hosting service is backing up your server files and that, if disaster strikes, you can quickly and easily recover your site.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Site Regularly Maintained

Never rely only on your web host for site backups. Instead, learn how to maintain your WordPress site or pay someone to get this done for you and develop a habit of performing a complete WordPress site maintenance routine on a regular basis (e.g. daily, weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

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

A proper WP maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important maintaining your WordPress web site fully backed up and up-to-date is. WordPress maintenance is not hard or time-consuming, but it must be done to ensure the security of your website or blog. If you do not want to learn how to do WP maintenance yourself, pay someone to do it but make sure this gets done. Backing up your site is the next most important thing you must do after making sure that you are still breathing!

If you don’t want to back up your site manually, there are many free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Backup, Duplicate And Protect Your WordPress Sites With Backup Creator WordPress Plugin

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

The brute force attack on WordPress sites was mostly attempting to compromise website admin panels and gain access to sites by exploiting WP installations using “admin” as the user name.

For security purposes, don’t set up sites with the username “admin”. This is the first thing hackers will test. If your site’s user name is admin, you need to change this immediately.

We have created a simple step-by-step tutorial created especially for WordPress admin users that shows you how to change your username here: How To Change Your WordPress User Name From Admin To Another Username

Security Measure #4 – Choose A Strong Password

A “brute force” attack occurs when malicious software persistently tries to guess the right combination of characters in a username and password that will give the hacker entry to your site.

Unless some measure is put into place to prevent the brute force attack from happening (see further below for a couple of simple and effective ways to do this), the “bot” will just keep attacking your site until it eventually “cracks” the code.

Weak passwords, therefore, make very easy targets for hacking attacks. Make sure that you change your password combination to a string containing at least 8 characters long, and that includes upper and lowercase letters, and add a few “special” characters (%^#$@&*).

Useful Tip

Roboform is a password management software that lets you generate secure login passwords …

You can use a password management program like Roboform to generate strong passwords(You can use a password management software tool like Roboform to create really secure passwords)

We have created a simple step-by-step tutorial created especially for non-technical WP admin users on how to change your admin password here: How To Reset Your Login Password

Security Measure #5 – Prevent Access To The 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

(wp-config.php file)

If hackers break into your WordPress site, they will look for your wp-config.php file, because this is the file that contains your WordPress database information, security keys, etc. Getting access to this information would allow a hacker 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 your wp-config.php file from being easily accessible. 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

Delete or rename the install.php, upgrade.php and readme.html files from your server.

These files are not required after installation. If you don’t want to remove these files, then just rename them.

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

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

Make sure to keep your files, themes, plugins, etc. up-to-date.

Security Measure #8 – Disable Your Theme Editor

WordPress comes with a built-in editor feature that allows you to edit plugin and theme code from the dashboard area.

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor via the WordPress main menu)

The WordPress theme editor lets anyone accessing your blog view and modify your WordPress theme templates, and create mayhem on your site.

If you want to prevent people from being able to access your 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 – Prevent Access To Your Site’s Uploads Folder

The WordPress “uploads” folder contains all the media that gets uploaded to your site.

By default, this folder is visible to anyone online. All a person needs to do to view the contents in your site’s “uploads” directory is visit the directory using their web browser …

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

(WordPress uploads folder)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers, someone 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, uploading 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 consult a professional if you are not sure about what to do.

Security Measure #10 – Install WordPress Security Plugins

There are a number of security plugins for WordPress available that will address many common security issues WordPress website owners face, such as preventing unauthorized users from accessing vital areas of your site, protecting your website from malicious software, preventing unauthorized file uploads, etc.

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

SecureScanPro - total security plugin for WordPress

(SecureScanPro – complete security software 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 security plugin you may want to look at using is BlogDefender.

Blog Defender

Blog Defender WordPress Security Product Suite(Blog Defender WordPress Security Suite)

This product is a suite of WordPress security video tutorials, WordPress plugins and tools, plus a WordPress security PDF/DOC file.

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

Blog Defender Security Plugin For WordPressAnd then shows you how to quickly fix these …

Blog DefenderIf you don’t want to purchase a premium security plugin like SecureScanPro or BlogDefender, then use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting basic maintenance tasks like ensuring that your WP core files, WordPress plugins and themes are kept up-to-date, tightening file and data security and taking other necessary precautions can expose your site to malicious by hackers and bots.

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

As a final 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, website security is very important 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 seek help from a WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified when we publish new articles and tutorials on WordPress security and tutorials about WordPress security plugins and solutions.

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***

Originally published as How To Protect Your WordPress Site From A Brute-Force Attack.