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 SecurityPowering millions of websites around the world makes WordPress a target for attempted attacks by hackers.

In April 2013 a worldwide brute force attack struck WordPress installations across virtually every web host in existence around the world.

These attacks were caused by networks of infected computers programmed to attack other vulnerable sites (called “botnets”).

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 using scripts and software tools that automatically tries to guess hundreds of possible logins in minutes.

If you’re using predictable user names and weak passwords that are easy to guess, your website 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)

A “Botnet” is a network of computers that have been infected with malicious code, which can then be controlled remotely as a group, typically without the computer owners’ knowledge.

Botnets are regularly 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 ZeuS – a botnet that has been actively compromising computer networks all around the world since 2009 …

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

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

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

Coverage of this brute-force attack was widely reported in all the major webhosting companies, as well as the 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 is often the target of malicious attacks by hackers

(WordPress powers millions of websites and blogs worldwide, which makes it a frequent target for hacker attacks)

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

No. In fact, there are lots of great reasons why you should use 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: Is WordPress A Secure Platform For Websites?

Useful Information

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

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

Preventing Your WordPress Website From Brute-Force Attacks – 10 Security Measures

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

If a hacker can find a security flaw, your website or blog can then be used to target more valued websites.

Additional undesirable results of having your website hacked include getting blacklisted by search engines, having stealthy spam links advertising things like online meds, cheap offers on brand names, etc. inserted into your content and page title and descriptions, malicious redirects to phishing sites, drive-by downloads (adding malware on your visitors’ computers), and many other nasties.

The truth is that malicious bots are very likely looking for exploits and trying to hack into your site at this very moment. Whether they will be successful or not, will depend on how difficult or easy you can make things for hackers to keep trying until they work out a way to get access, or give up and decide to look for an easier target.

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

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

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

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

WordPress Security Check

(Hackertarget – WordPress security check results. Product image: Hackertarget.com)

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

Website Security Scan(Image source: BlogDefender site)

The ability to see what version of WordPress you are using, which plugins and themes you have installed, and which files have been uploaded to certain directories on your server can all be valuable information to hackers, as this informs them about potential security weaknesses, especially where site owners haven’t updated their files.

If your site or blog is powered by WordPress and you’re not preventive steps to harden your site, then it’s practically guaranteed that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these brute-force attacks are systematically hitting WordPress installations around the world!

Whenever a website gets broken into, webmasters will find themselves “locked out” of their own site, or notice that their files have been interfered with or even that their content has been entirely wiped out. Often, compromised sites will become infected with malicious scripts without the owner’s knowledge or awareness.

To avoid the heartache of discovering that your website or blog has been hacked into, we have listed below ten simple, yet essential and effective security checks that will help to prevent your WordPress site from brute force attacks.

Disclaimer

Note: A few of the recommended measures below require some technical skills to modify core WordPress and/or server files. If you lack these 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 Hosting Service Provider

Contact your hosting service and ask them exactly what security measures have been put into place to protect your site from being attacked, and what is done to ensure that your server files get regularly backed up.

Make sure that your web host backs up your sites and that, if disaster strikes, you can easily recover your site.

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

Never rely just on your webhosting service for your site backups. Instead, learn how to maintain your WordPress site or pay someone to get this service done for you and develop a habit of performing a complete site maintenance routine on a frequent basis (e.g. weekly, monthly, 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 software, plugins and themes are up-to-date,
  • etc …

A proper WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important it is to maintain your WordPress installation regularly 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 or blog. If you don’t want to learn how to do WP maintenance yourself, pay a professional to do it but make sure it gets done. Backing up your site is the next 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 a number of free and paid plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Clone & Keep Your WP Website Protected With Backup Creator WordPress Plugin

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

the worldwide brute force attack on WordPress is mostly an attempt to compromise site admin panels and gain access to sites by exploiting installations that used “admin” as their username.

For reasons of website security, avoid setting up 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 it immediately.

For a simple tutorial that shows you how to change your login username, go here: Changing Your WP Username From Admin To A More Secure Username

Security Measure #4 – Your Password

A “brute force” attack occurs when a malicious script continually hits a username and password field with different character strings trying to guess the right login combination that will give the hacker access to your website.

Unless some measure is put into place to stop the brute-force attack from happening (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 works out the combination.

Weak passwords, therefore, make very easy targets for hacking attacks. Make sure that you change your password to something that contains at least eight characters long, and that includes upper and lowercase letters, and “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 program like Roboform …

Roboform is a password management software you can use to generate different secure passwords(You can use a password tool like Roboform to help you generate secure login passwords)

For a step-by-step tutorial on how to change your login password, go here: What To Do If You Need To Change The Login Password

Security Measure #5 – Deny Access To Your WP Config File

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

wp-config.php

(WordPress WP Config file)

If hackers break into your WordPress site, they will normally look for the wp-config.php file, because this is the file that contains important information about your site’s database, 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.

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 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 WordPress Installation Files

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

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 – Upgrade Your WordPress CMS, Themes And Plugins To Their Latest Version

Hackers are always on the lookout for vulnerabilities in outdated versions of WordPress that can be exploited, including outdated versions of WordPress themes and plugins.

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

Security Measure #8 – Disable Your Theme Editor

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

You can access your WordPress Theme Editor by selecting Appearance > Editor in your dashboard menu …

WP Theme Editor Menu

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

This allows anyone accessing your site’s admin to view and change your WordPress theme files, or create mayhem on your site.

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

Security Measure #9 – Prevent Access To Your Site’s Uploads Directory

The WordPress “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 all of the contents stored in the “uploads” directory is visit the directory using their web browser …

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

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

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

Protecting your directories will prevent unauthorized people from accessing 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 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 – Security Plugins

A number of great security plugins for WordPress are available that specifically address most common security issues WordPress site owners face, such as preventing hackers from accessing your site, protecting your website from brute-force attacks, preventing injections of code into files, etc.

Most WordPress plugins address some but not all areas of WordPress security. One WordPress security plugin that seems to do 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 - total security software solution for WordPress

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

Blog Defender WordPress Security Plugin

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

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

BlogDefender scans you web site for security weaknesses …

Blog DefenderAnd lets you fix these quickly, easily and inexpensively …

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

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting essential maintenance tasks like keeping your WordPress software, plugins and WordPress themes up-to-date, tightening file and data protection 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 cannot afford to ignore.

As one last reminder, below is the advice given by a security expert 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 information in 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 seek help from a WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

Also, do yourself a favor and subscribe to WPCompendium.org to receive notifications whenever we publish new information on WordPress security and reviews of WordPress security plugins and solutions.

***

"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

***