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 SecurityWhen you are the most popular content management system in the world and the preferred online publishing platform used by millions of websites and loved by thousands of web developers and web designers, it’s inevitable that at some point in time, WordPress will become a prime target for attacks by hackers wanting to score a “big win”.

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

These attacks were caused by computer networks infected with viruses and programmed to attack other vulnerable sites (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 ways hackers try to break into WordPress sites. One of these is by trying to guess the site’s administration login username and password. This is done using software programs that automatically tries to guess hundreds of possible logins in minutes.

If you’re using easy-to-guess usernames and predictable passwords, your website can be easily hacked by a malicious script’s persistent attempts to work out your site’s login details.

This is called a “brute force” login attack.

Botnet – What Is This?

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 private computers that have been compromised and infected with malicious software, which are then controlled remotely as a group, often without the unsuspecting computer owners even being aware of this.

Botnets are typically 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” …

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 globe since 2009. Screenshot image: SecureList.com)

The botnet attacks were well organized and highly distributed. Over 90,000 IP addresses were identified by several hosting companies in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress user admin areas. The brute force attacks continued after this, with over 30,000 WordPress sites being hacked every day.

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

WordPress often is targeted by hackers

(WordPress is often the target of worldwide attacks by hackers)

Does This Mean We Shouldn’t Use WordPress Anymore?

No. In fact, there are many great reasons why you should use WordPress if you are concerned about website security.

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

Useful Info

It’s important to understand 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 CMS applications like Joomla).

Mike Little, one of the co-founders of WordPress, said this 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)

Protecting Your WordPress Website From Brute-Force Attacks – Ten Security Checks

You may think that your site is of no interest to hackers, but the reality is that every website has some value to a malicious user.

If someone can find a flaw in your web software, that web site can then be used as a “bot” to attack more highly-valued websites.

Additional undesirable consequences of having your site hacked and your site security compromised include getting blacklisted by Google, having stealthy spam links advertising things like viagra, porn, etc. inserted in your content and meta data, redirecting visitors to phishing sites, drive-by downloads (adding malicious software on your visitors’ computers), and many other nasties.

The harsh reality is that hackers are very likely trying to hack into your web site at this very moment. Whether they can successfully get in or not, depends on how difficult or easy you have made things for them to keep persisting until they can find how to get in, or give up and decide to look for an easier 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 - Website Security Check(Hackertarget – WordPress Security Scan Product image: Hackertarget.com)

You will see that the scan will return various results and information about your website setup …

Hackertarget - WordPress Security Scan

(WP security scan results. Screenshot image: Hackertarget.com)

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

Website Security Scan(Product image: BlogDefender website)

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 are all useful information to hackers, as this informs them about any potential security vulnerabilities, especially in older versions.

If your site or blog runs on WordPress and you are not taking appropriate steps to bullet-proof your site, we can practically guarantee 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, blog owners 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. Typically, most sites will become infected with malicious software or viruses without the owner’s knowledge or awareness.

To avoid the heartache of discovering that your website or blog has been hacked into, below are ten essential and effective security measures that will help to prevent your WordPress site from botnet attacks.

Disclaimer

Note: Some of the recommended measures below need some technical understanding of how to modify core WordPress or server files. If you have no web skills, or don’t want to mess around with file code, then ask your web host or a professional WordPress technical provider for help.

***

Security Measure #1 – Get In Touch With Your Webhosting Service

Get in touch with your hosting provider and ask them exactly what measures they have put in place to protect your site from botnet attacks, and what is done to ensure that your files and data get backed up.

Make sure that your webhosting service regularly backs up your sites and that, if disaster strikes, you can easily get back your site.

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

You should never rely on your webhosting provider for site backups. Instead, learn how to maintain your WordPress site or pay someone to get this done for you and maintain a habit of performing a complete site maintenance routine on a regular basis (e.g. weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

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

A complete WordPress site maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WordPress website completely backed up and updated is. WP site maintenance is not hard to do 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 WordPress maintenance yourself, pay someone to do it but make sure it gets done. Backing up your website is the next most important thing you should do after making sure that you still have a pulse!

If you don’t want to perform manual backups, there are many free and paid plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Backup, Copy And Protect Your WP Websites And Blogs With Backup Creator Plugin For WordPress

Security Measure #3 – Do Not Use “Admin” As The Admin Username

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

For reasons of website security, don’t install a WordPress site with the username “admin”. This is the first area of potential vulnerability hackers will test. If your blog’s user name is admin, you should change this immediately.

We have created a tutorial for non-technical admin users on how to change your admin username here: Changing Your WP Admin Username

Security Measure #4 – Make Sure Your Password Is Secure

A “brute force” attack occurs when a malicious script persistently tries to guess the right combination of characters in a password and username that will give them access to your website.

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 suggestions for doing this), the “bot” will just keep attacking your site until it eventually “cracks” the code.

Weak passwords, therefore, are really easy targets for hacking attacks. Make sure that you change your password to something that is at least eight or nine characters long, with upper and lowercase letters, and add a few “special” characters (%^#$@&*).

Tip

Roboform is a password tool you can use to help you generate very secure passwords …

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

We have created a simple tutorial created especially for WordPress admin users that shows you how to change your WordPress admin password here: What To Do If You Need To Change Your WordPress Password

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

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

wp-config.php

(wp-config.php file)

If a hacker breaks into your WordPress site, they will normally look for the 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, you must prevent people finding 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 – Delete Or Rename Unnecessary Installation Files

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

You can remove these files after installation. If you don’t want to remove these files, just rename them.

Security Measure #7 – Keep Your WordPress Site, Themes And Plugins Up-To-Date

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress installations come with a built-in editor that lets the administrator edit plugin and theme code inside the dashboard.

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

WordPress Theme Editor Menu

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

This allows anyone accessing your blog to view and modify your theme templates, and cause mayhem on your site.

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 WordPress Uploads Folder

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

By default, this folder is visible to online users. All someone has to do to see the contents stored in the “uploads” directory is visit the directory using a 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 files stored in his folder have vulnerabilities that can be exploited by hackers, this can become a serious threat to the security of your website.

Protecting your directories will prevent online users 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 a blank 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 – WordPress Security Plugins

Some great security plugins for WordPress are available that will address most security issues WordPress website owners face, such as preventing unauthorized users from accessing your site, protecting your site from malicious software, preventing injections of code into files, etc.

Most 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 potential issues that could lead to hackers accessing your files and damaging your site is SecureScanPro.

SecureScanPro - total security plugin for WordPress

(SecureScanPro – WP security plugin)

SecureScanPro is easy to install and easy to use, and fixes 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(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 installation are …

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

Blog Defender Security Solution For WordPressIf you don’t want to invest in a 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 web platform, but neglecting essential maintenance tasks like making sure that your WordPress software, WordPress plugins and themes are kept up-to-date, tightening file and data security and taking other necessary precautions can have disastrous consequences.

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

As one last reminder, below is the advice given by an expert on web security to all WordPress users after the mass 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 has shown you what to do to 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 WordPress service provider in our WordPress Services Directory.

Also, please remember to subscribe to WPCompendium.org to receive notifications when we publish new tutorials on WordPress security and tutorials about new 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

***