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 SecurityBeing the world’s most used CMS makes WordPress a frequent target for attempted hacker attacks.

In early 2013, WordPress installations around the world were subjected to a global-scale brute force attack.

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

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

About Brute-Force Attacks

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 admin’s login username and password. This is achieved with software tools that automatically tries to guess hundreds of login permutations in minutes.

If you’re using predictable login details, your website can be easily hacked by persistent attempts to guess your site’s login details.

This is called a “brute-force” attack.

Botnet Definition

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)

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

Botnets are regularly used to send 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 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 infecting 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. Image source: SecureList.com)

These were highly distributed and well organized attacks on WordPress sites. Over 90,000 IP addresses were identified by a number of webhosting companies just in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress users admin areas. The worldwide brute-force attacks then continued, with over 30,000 WordPress sites being hacked each day.

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

Powering millions of websites and blogs worldwide makes WordPress an obvious target for attempted hacker attacks

(Powering millions of sites around the world makes WordPress a target for malicious attempts by hackers)

Does This Mean We Should Stop Using WordPress?

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

To learn why WordPress is a secure platform for websites, read this article: Can You Build A Secure Business Online Using WordPress?

Important Info

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

Mike Little, one of the co-founders of WordPress, 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 Being Brute Force Attacked – Ten Security Checks

You may think that your website or blog has no significant value to hackers, but the reality is that every website has some value to a malicious user.

If a hacker can discover a web security flaw, that site can then be used as part of a larger network of “bots” to target larger and more valuable web sites.

Additional undesirable consequences of having your site hacked include being blacklisted by search engines, having stealthy spam links advertising things like online meds, porn, etc. inserted into your content, malicious redirects to phishing sites, drive-by downloads (adding malicious software on your visitors’ computers), and many other nasties.

The truth is that malicious bots are scouring for security weaknesses and trying to break into your website or blog at this very moment. Whether they will hack into your site successfully or not, will depend on how hard you can make things for hackers to continue persisting until they discover how to break in, or give up and decide to look for an easier 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 website through their WordPress security scan …

Website Security Check(Hackertarget – WP Security Check Source: Hackertarget.com)

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

Hackertarget - Website Security Scan

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

It should be obvious after using this tool that if you are able to access all of this information about your blog, so can hackers.

Hackertarget - WordPress Security Scan(Screenshot: BlogDefender website)

The ability 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 be potentially 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, then we can practically guarantee that, at some point in time, your site will be hacked, or at least targeted by bots, because these attacks are systematically targeting WordPress installations worldwide!

When a website is compromised, site owners will find themselves “locked out” of their own site, or notice that their files have been vandalized or even entirely wiped out. Typically, compromised sites will become infected with malicious scripts without the owner even being aware that a security breach has taken place.

To help avoid the heartache and frustration (and significant financial loss) that comes with having your website being hacked into, below are ten essential and effective security checks that will help to prevent your WordPress site from brute-force attacks.

Useful Information

Note: A few of the measures below require some technical understanding of how to modify core WordPress and/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 search for a professional WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Web Host

Contact your host and ask them what security precautions are in place to protect your site from being attacked, and what they do to ensure that your WordPress sites get regularly backed up.

Check that your hosting company is regularly backing up your sites and that, if anything should happen, you can easily get back your site.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Site Regularly Updated

Never rely only on your web host for your site backups. Instead, learn how to maintain your WordPress site or get this done for you and develop a habit of religiously performing a full WordPress site maintenance routine frequently (e.g. daily, weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

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

A complete WP maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important it is to maintain your WP website or blog backed up and up-to-date. WP site maintenance is not hard to do or time-consuming, but it must be done to ensure the security of your website. If you do not want to learn how to do WP maintenance yourself, pay a professional 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 are still breathing!

If you don’t want to back up your files manually, there are many free and paid WordPress plugins you can use. You can read about a WordPress backup plugin that can automate your site backups here: Backup, Duplicate & Keep Your WP Web Site Protected With Backup Creator WordPress Plugin

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

the worldwide brute force attack on WordPress sites was mostly attempting to compromise website admin panels by exploiting WordPress sites with “admin” as the username.

For website security purposes, avoid setting up a WordPress site with the username admin. This is the first area hackers will test. If your site’s username is admin, you will need to change it immediately.

We have created a detailed step-by-step tutorial created especially for non-technical admin users that shows you how to change your WordPress username here: How To Change Your Admin Username In WordPress To A More Secure User Name

Security Measure #4 – Make Sure Your Password Is Secure

A “brute force” attack occurs when malicious software persistently hits a login or password field with different strings of characters trying to guess the right login combination that will unlock your website.

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

Weak passwords, therefore, become really easy targets for botnets. Make sure that you change your password to something that contains at least 8 characters long, with upper and lowercase letters, and “special” characters (e.g. %, $, *, etc).

Tip

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

You can use a password management tool like Roboform to create very secure passwords(Roboform is a password management program that lets you create strong login passwords)

For a simple step-by-step tutorial on how to change your admin password, go here: What To Do If You Need To Change WordPress Passwords

Security Measure #5 – Secure Your wp-config.php File

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

wp-config.php

(wp-config.php)

If hackers break into your website, they will try to access the wp-config.php file, because this file 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.

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 – 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, as they are unnecessary. If you don’t want to remove these files, then just rename them.

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

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

Ensure that all of your WordPress application 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 site administrators to edit plugin and theme code from the dashboard.

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the WP admin menu)

This allows anyone accessing your blog to view and edit your WP theme templates, and cause 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 The Site’s Uploads Folder

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

(WordPress uploads folder)

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

If any files stored in his folder have vulnerabilities that can be exploited by hackers or malicious users, anyone can upload unauthorized file types or compromise the security of your site.

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 file with nothing in it named “index.php”) to your uploads directory, and so on. Again, it’s best to get professional assistance if you are not sure about what to do.

Security Measure #10 – Security Plugins

There are some great WordPress security plugins 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 files from botnets, preventing injections of code into files, 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 - total security plugin for WordPress

(SecureScanPro – complete security plugin for WordPress)

SecureScanPro is easy to install and easy to use, and takes care of most of the security areas that WordPress users need to address.

Another plugin you may want to look at using is BlogDefender.

Blog Defender Security Product Suite For WordPress

Blog Defender(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 potential security holes in your WordPress site are …

Blog DefenderAnd lets you easily fix these …

Blog Defender Security Plugin For WordPressIf you don’t want to purchase a premium security plugin like SecureScanPro or BlogDefender, you can use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting basic maintenance tasks like keeping your WordPress core files, plugins and WP themes up-to-date, tightening file and data protection 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, you cannot ignore the importance of securing your websites.

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 global brute force attacks on WordPress in 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 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 professional WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to receive notifications via email when we publish new articles on WordPress security and tutorials about WordPress security plugins and solutions.

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***