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 often is targeted by hackers.

In April 2013 a worldwide brute-force attack struck WordPress installations on virtually every web host in existence.

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

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 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 is done with software tools that can guess hundreds of login possibilities in minutes.

If you’re using obvious usernames and passwords that are easy to guess, your site can be an easy target for hacking attempts.

This is called a “brute force” login attack.

Botnets

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)

”Botnets” are networks of computers that have been infected with malicious code or scripts, which are then controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is happening in their device.

Botnets are typically used to blast mass spam emails.

The screenshot below was 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” …

ZeuS is 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. Source: SecureList.com)

These botnet attacks were highly distributed and well organized. Over 90,000 IP addresses were identified by several webhosting companies in the initial attack alone, when the web was flooded with millions of attempts to force their way into WordPress users administration areas. The brute force attacks then continued, with over 30,000 WordPress sites being hacked per day.

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

WordPress often comes under attack by hackers, due to its global popularity

(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 platform for websites, see this article: Are Open Source Platforms Like WordPress Secure?

Info

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, 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)

How To Prevent Your WordPress Website From Being Brute Force Attacked – Ten Security Checks

You may think that your website has nothing to offer to hackers, but the reality is that to a hacker, every website provides an opportunity to benefit at your expense.

If hackers can discover a way to take over and control your blog, your blog can then be employed as part of a larger network of “bots” to target other valuable sites.

Additional undesirable results of having your site hacked include getting blacklisted by Google, having spammy links promoting things like casinos, porn, etc. inserted into your content, redirecting visitors to phishing sites or other websites, drive-by downloads (adding malicious scripts on your visitors’ computers), and lots of other nasties.

The truth is that software-driven bots are looking for vulnerabilities and trying to break into your website or blog at this very moment. Whether they can break into your site successfully will depend on how difficult or easy you have made it for them to continue trying until they discover how to break in, or are forced to give up and decide to look for a less secure target.

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

Does your website run on WordPress? If so visit Hackertarget.com and run your website through their WordPress security scan …

Hackertarget - WordPress Security Check(Hackertarget – WordPress Security Check Screenshot: Hackertarget.com)

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

WP Security Check

(Hackertarget – WordPress security scan results. Image source: Hackertarget.com)

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

WordPress Security Check(Screenshot source: BlogDefender.com)

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 can all be valuable information to hackers, as these can inform them about any vulnerabilities, especially in older versions.

If your site or blog is driven by WordPress and you’re not taking appropriate steps to bolster the security of your site, we can practically guarantee that, at some point in time, someone will attempt to hack your website, because these attacks are systematically targeting WordPress installations worldwide!

Whenever a website is hacked, 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. Often, compromised sites will be infected with malicious scripts without the owner’s knowledge or awareness.

To avoid the heartache (and significant financial loss) of discovering that your website has been hacked into, below are ten essential and effective security measures that will help to protect your WordPress site from being brute force attacked.

Useful Info

Note: A few of the recommended steps listed below require some technical skills to modify core WordPress or server files. If you lack these technical skills, or don’t want to mess around with file code, then ask your web host or search for a professional WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Hosting Provider

Get in touch with your hosting company and ask them exactly what measures have been put in place to help prevent your site from being attacked, and what they are doing to make sure that your server files get backed up.

Check that your webhosting company is backing up your server files and that, if disaster strikes, you can easily get your files back.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Or Blog Regularly Maintained

You should never rely on your webhosting company for site backups. Instead, learn how to manage your WordPress site or get this service done for you and develop a habit of religiously performing a full WordPress site maintenance routine on a regular basis (e.g. daily, weekly, monthly, etc …)

A proper WordPress maintenance routine ensures that:

  • All unnecessary files and data are removed,
  • All WP 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 WP website or blog fully backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress website or blog fully backed up and up-to-date is vitally important for WordPress security. Screenshot source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WP website fully backed up and updated is. WP site 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, get someone else to do it but make sure this 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 site manually, there are many free and paid plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Clone And Protect Your WP Sites With Backup Creator Plugin For WP

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

The large scale brute-force attack on WordPress is mostly an attempt to compromise website admin panels by exploiting WordPress sites that used “admin” as the account name.

For reasons of website security, don’t install sites with the username “admin”. This is the first area hackers will test. If your blog’s user name is admin, change it immediately.

We have created a step-by-step tutorial on how to change your admin username here: Changing Your WordPress Admin User Name To A More Secure User Name

Security Measure #4 – Use A Strong Password

A “brute force” attack occurs when malicious software continually and persistently hits a username and password field with different strings of characters trying to guess the right combination that will give them entry to your site.

Unless some measure is put into 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 breaks into your admin area.

Weak passwords, therefore, become very easy targets for hackers. Make sure that you change your password combination to something that is at least eight or nine characters long, with both upper and lowercase letters, and add a few “special” characters (e.g. %, $, &, etc).

Tip

Roboform is a password tool you can use to create different strong passwords …

Roboform is a password management program that lets you easily generate strong passwords(Roboform is a password tool that lets you easily generate strong login passwords)

For a tutorial on how to change your login password, go here: What To Do If You Need To Change Your WordPress Password

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

(wp-config.php file)

If hackers break into your WordPress site, they will normally look for your wp-config.php file, because this is the file that 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 attacks and even being used as part of a bot net, therefore, prevent your wp-config.php file from being 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 your install.php, upgrade.php and readme.html files.

These files are completely unnecessary after installation and can be removed. If you don’t want to delete these files, just rename them.

Security Measure #7 – Upgrade Your WordPress Installation, Plugins And Themes To Their Latest Version

Hackers look for vulnerabilities in outdated versions of WordPress that they can exploit, including outdated versions of WP plugins and themes.

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

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

WordPress Theme Editor Menu

(The WordPress theme editor can be accessed via the main menu)

This means that anyone logging into your blog can view and modify your WordPress theme files, and create havoc on your site.

To prevent 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 Directory

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

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

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

(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, someone could upload unauthorized file types to your site.

Protecting your directories will prevent unauthorized people 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 a file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to get professional help if you are not sure about what to do.

Security Measure #10 – Use WordPress Security Plugins

There are a number of security plugins for WordPress available that specifically address common security issues faced by WordPress site owners, such as preventing hackers from gaining access to vital information about your site, protecting your website from malicious exploits, preventing unauthorized file uploads, etc.

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

SecureScanPro - WP security software

(SecureScanPro – complete security software solution for WordPress)

SecureScanPro is easy to install and easy to use, and fixes 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 WordPress Security Plugin

Blog Defender Security Solution For WordPress Websites(Blog Defender Security Suite)

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

BlogDefender scans you website for potential security holes …

Blog DefenderAnd then shows you how to quickly and easily fix these …

Blog Defender Security Plugin For WordPress Web SitesIf you don’t want to invest in a 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 secure platform, but neglecting simple maintenance tasks like ensuring that your WordPress installation, plugins and WP themes are kept updated to their latest versions, tightening file and data security and taking other necessary precautions can expose your website to attacks by hackers and bots.

No matter what kind 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 simply cannot afford to ignore.

As a final reminder of the importance of website security, below is the advice given by a website security expert to all WordPress users after the worldwide brute force attacks 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 has shown you what to do to prevent brute force attacks on your WordPress site. 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 service provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to receive notifications via email whenever we publish new tips on WordPress security and reviews of WordPress security plugins and solutions.

***

"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com

***