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 popular CMS which makes it a frequent target for attempted hacking attacks.

In 2013 a worldwide brute-force attack struck WordPress installations on almost every WP hosting server in existence.

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

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

Brute Force Attacks – Definition

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 methods hackers use to try and break into a WordPress site. One of these is by trying to guess the site admin’s login username and password. This can be done using software tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re using weak usernames and passwords that are easy to guess, your website could be easily hacked by the script’s persistent attempts to work out your site’s login details.

This is called a “brute force” login attack.

What Is A Botnet?

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)

”Botnets” are networks of computers that have been compromised and infected with malicious software, which can then be controlled remotely as a group, typically without the unsuspecting computer owners even being aware of this.

Botnets are typically used to send out mass spam emails from computers of compromised user accounts.

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

The Zeus botnet has been actively compromising computer networks all around the globe since 2009.

(ZeuS is a botnet that has been actively compromising computer networks all around the world since 2009. Screenshot: SecureList.com)

These were highly distributed and well organized botnet attacks. Over 90,000 IP addresses were identified by several hosting companies in the initial attack, when millions of attempts to force their way into WordPress site admin areas occurred. The mass attack then continued, with over 30,000 WordPress blogs being hacked per day.

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

WordPress is the world's most used content management system making it a frequent target for hackers

(WordPress is often the target of attacks by hackers)

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

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

To understand why WordPress is a secure web platform, see this article: Are Open Source Platforms Like WordPress Secure?

Important Info

It’s important to understand that, in the case of the mass brute force attack described above, there was no WordPress vulnerability being exploited (the same script was also targeting sites built using other CMS platforms like Joomla).

Mike Little, the co-founder of WordPress with Matt Mullenweg, made this comment 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)

How To Prevent Your WordPress Blog From Being Brute-Force Attacked – 10 Security Points

You may think that the information in your website provides little to no value to hackers, but the reality is that every website has some value to a malicious user.

If someone can exploit a way to compromise the control of your site, your web site can then be used to target other valuable web sites.

Additional undesirable consequences of having your website hacked include getting blacklisted by search engines, having stealthy spam links advertising things like casinos, cheap offers on brand names, etc. inserted in your content, malicious redirects to phishing sites, drive-by downloads (adding malware on your visitors’ computers), and many other nasty things.

The reality is that software-driven bots are probably trying to break into your web site as you are reading this article at this very moment. Whether they will do this successfully depends on how hard you will make things for them to continue trying until they either find a way to break in, or decide to look for a less secure target.

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

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

Website Security Scan(Hackertarget – Website Security Scan Screenshot image: Hackertarget.com)

You will see that the scan returns various results and information about your site setup …

Hackertarget - WordPress Security Check

(Hackertarget – WordPress security scan results. Source: Hackertarget.com)

It should be obvious after using the tool shown above that if you are able to access all of this information about your website, hackers can too.

Hackertarget - WordPress Security Scan(Screenshot: BlogDefender.com)

Being able to see what 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 all be valuable information to hackers, as these can inform them about potential security vulnerabilities, especially where the owners haven’t updated their files.

If your website runs on WordPress and you’re not precautionary steps to toughen up your site, then it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your website, because these brute force attacks are systematically hitting WordPress installations around the world!

Typically, whenever a website or blog gets hacked, webmasters will find themselves completely “locked out” of their own site, or notice that their files have been vandalized or that everything has been entirely wiped out. Typically, sites will become infected with malicious software without the owner even being aware that this has happened.

To avoid the heartache and frustration (and significant financial loss) that comes with having your site 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.

Important Info

Note: Some of the measures listed below require some technical understanding of how to modify core WordPress or server files. If you are not technical-minded, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress service provider for help.

***

Security Measure #1 – Contact Your Web Host

Get in touch with your hosting provider and ask them what systems have been put into place to protect your site from being attacked, and what is done to make sure that your server files and data are being regularly backed up.

Make sure that your hosting service provider is backing up your sites and that, if disaster strikes, you can easily recover your files and data.

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

Never rely on your webhosting provider for site backups. Instead, learn how to maintain and manage your WordPress site or get this done for you and maintain a habit of religiously performing a full site maintenance routine on a regular basis (e.g. weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

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

A complete WP 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 WordPress site regularly backed up and up-to-date is vitally important for WordPress security. Source: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WordPress web site regularly backed up and up-to-date. WordPress maintenance is not hard to do 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 site maintenance yourself, get someone else to do it but make sure it gets done. Backing up your website is the second most important thing you should do after making sure that your heart is still beating!

If you don’t want to back up your data manually, there are a number of WordPress plugins you can use. You can read about a WordPress backup plugin that can automate your backup process here: Back Up, Duplicate And Keep Your WP Websites And Blogs Protected With Backup Creator Plugin For WordPress

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

The brute force attack on WordPress sites was mostly attempting to compromise site admin panels by exploiting WP sites using “admin” as the account name.

For reasons of website security, avoid setting up WordPress sites with the username admin. This is the first area of potential vulnerability hackers will test. If your blog’s user name is “admin”, then change this immediately.

We have created a step-by-step tutorial that shows you how to change your username here: How To Change Your WordPress Admin User Name

Security Measure #4 – Your Password

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

Unless some measure is put into place to stop the brute-force attack (see further below for a couple of simple and effective ways to do this), the “bot” will just persist in attacking your site until it eventually gets access.

Passwords that are easy to guess, therefore, make very easy targets for hacking attacks. Make sure that you change your password to a string containing at least 8 or 9 characters long, with upper and lowercase letters, combined with a few “special” characters (^%$#&@*).

Tip

If you have trouble coming up with strong passwords or you are reluctant to set up different passwords for all of your online logins, then use a password management tool like Roboform …

Roboform is a password program that lets you easily generate different strong login passwords(You can use a password tool like Roboform to help you generate passwords)

We have created a simple tutorial on how to change your admin password here: How To Change Your Login Password

Security Measure #5 – Prevent Access To Your wp-config.php File

The wp-config.php file contains information about your website’s database and is used to define advanced options for WordPress.

wp-config.php

(WordPress WP Config file)

If hackers break into your WordPress site, they will search for your wp-config.php file, because this file contains your database details, security keys, etc. Getting access to this information would allow someone 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 accessed. 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 your install.php, upgrade.php and readme.html files.

You can remove these files after installation, as they are unnecessary. If you don’t want to remove these files, then just rename them.

Security Measure #7 – Update Your WordPress Blog, Themes And Plugins To Their Latest Version

Hackers are always on the lookout for vulnerabilities they can exploit in previous versions of WordPress, including outdated versions of WordPress themes and plugins.

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

You can access the WordPress Theme Editor by selecting Appearance > Editor from the main menu …

WP Theme Editor Menu

(The WordPress theme editor is accessible using the main menu)

This allows anyone accessing your blog’s admin area to view and make changes to your WordPress theme templates, or create mayhem on your site.

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

Security Measure #9 – Protect The Site’s Uploads Directory

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

Normally, this folder is visible to online users. All a person needs to do to see the contents in your “uploads” folder is visit your directory using their web browser …

(WordPress has an uploads directory where media content is stored)

(WordPress uploads directory)

If any files stored in his folder have vulnerabilities that can be exploited by hackers, this can seriously threaten the security of 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 seek professional help if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

A number of WordPress security plugins are available that will address many common security issues faced by WordPress website owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your site from malicious software, preventing unauthorized file uploads, etc.

Most WordPress plugins address some but not all areas of WordPress security. One plugin that does 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 - WordPress complete security software solution

(SecureScanPro – WP security plugin)

SecureScanPro is easy to install and easy to use, and addresses most of the security issues that WordPress users need to address.

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

Blog Defender WordPress Security Suite

Blog Defender Security Solution For WordPress(Blog Defender Security Plugin For WordPress)

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

BlogDefender shows you where potential security weaknesses in your website are …

Blog Defender WordPress Security SuiteAnd then shows you how to fix these quickly and easily …

Blog Defender Security Product Suite For WordPress Web SitesIf you don’t want to purchase a premium security plugin like SecureScanPro or BlogDefender, you can use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting basic maintenance tasks like keeping your WordPress installation, WordPress plugins and WordPress themes updated to their latest versions, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

No matter what type of business you run or plan to run online and how small you think your web presence is, you cannot afford to ignore the importance of web security.

As one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on web security to all WordPress users after 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 of the utmost importance if you run a WordPress site. Hopefully, this article has provided you with the initial steps you need to take to prevent brute-force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please consult a WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

Also, do yourself a favor and subscribe to WPCompendium.org to receive notifications via email when we publish new information on WordPress security and tutorials about new security plugins.

***

"Learning WordPress has been a huge stumbling block for me. I've been looking for something that covers absolutely everything but doesn't cost an arm and a leg. Thank you so much ... you have just provided me with what I have been looking for! Truly appreciated!" - Tanya

***

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