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 SecurityWhen you are the leading content management system in the world and the preferred online publishing platform for millions of businesses and loved by thousands of web developers and website designers, it’s inevitable that at some point in time, WordPress will come under attack from hackers.

In early 2013 a global brute force attack hit WordPress installations on virtually every host server in existence.

These attacks were caused by networks of infected computers programmed to attack other vulnerable installations (botnets).

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)

One of the many ways hackers use to try and break into WordPress sites is by trying to guess the site admin’s login username and password. This is done using software programs that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re not using strong usernames or unguessable passwords, your website can be easily hacked by persistent attempts to work out your site’s login details.

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)

”Botnets” are networks of computers that have been compromised and infected with malicious code, which can then be controlled remotely as a group, often without the computer owners’ knowledge.

Botnets are often used to send mass spam emails from the infected computers of compromised user accounts.

Below is a screenshot taken from an internet security monitoring site showing the locations of the command centers of ZeuS – 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.

(The Zeus botnet has been actively compromising computer networks all around the world since 2009. Screenshot: SecureList.com)

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

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

Being the world's most popular CMS makes WordPress a target for hacking

(WordPress is often the target of 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 the security of your online business.

To understand why WordPress is a secure web platform, see this article: Is WordPress A Secure Platform For Websites?

Info

It’s important to understand that, in the case of the worldwide brute-force botnet attack described above, was no specific vulnerability in WordPress being exploited (the same script was also attacking sites built using other platforms 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)

Protecting Your WordPress Website From Being Brute Force Attacked – Ten Security Points

You may think that your site is of little value to hackers, but the reality is that every website is valuable to a malicious user.

If a hacker can find a way to break in and remotely control your blog, that site can then be used as a “bot” to attack more valuable sites.

Additional undesirable consequences of being hacked and your site security compromised include being blacklisted by Google, having stealthy spam links promoting things like casinos, porn, etc. inserted in your content and meta data, malicious redirects to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasty things.

The reality is that hackers are probably trying to break into your web site as you are reading these very words. Whether they can achieve this or not, will depend on how hard you have made things for hackers to keep persisting until they either can find how to get in, or give up and go look for a less secure target.

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

If you visit Hackertarget.com and run your website through their WordPress security scan …

Website Security Scan(Hackertarget – WordPress Security Check Screenshot image: https://hackertarget.com/wordpress-security-scan)

You will see that the check will yield a number of results and information about your website setup …

WordPress Security Check

(Hackertarget – website security check results. Screenshot: Hackertarget.com)

It should be obvious after using this tool that if you can access all of this information, then hackers can too.

Hackertarget - WordPress Security Scan(Screenshot image: Blog Defender)

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 potentially useful information to hackers, as this can inform them about potentially exploitable holes or weaknesses, especially where the owners haven’t updated their sites.

If your site or blog is driven by WordPress and you’re not precautionary steps to bolster the security of your site, it’s practically guaranteed that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute-force attacks are systematically targeting WordPress sites worldwide!

Whenever a website or blog is compromised, website owners will find themselves “locked out” of their own site, or notice that their content has been modified or even entirely wiped out. Often, most sites will be infected with malicious software without the owner even being aware that a security breach has taken place.

To help avoid the heartache of having your site being hacked into, we have listed below 10 essential and effective security measures that will help to protect your WordPress site from being attacked by brute force botnet hacking attempts.

Important Info

Note: A few of the measures below need some technical understanding of how to modify core WordPress and/or server files. If you have no web coding skills, or don’t want to mess around with file code, then ask your web host or search for a professional WordPress service provider in our WordPress Services Directory.

***

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

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

Make sure that your webhosting provider regularly backs up your server files and that, if anything should happen, you can quickly and easily get back your files.

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

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

A proper WordPress maintenance routine ensures that:

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

A full WP maintenance routine looks like this …

Maintaining your WP web site backed up and updated is vitally important for WordPress security.(Maintaining your WP web site completely backed up and updated is vitally important for WordPress security. Screenshot image: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WordPress installation backed up and up-to-date. 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, 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 back up your site manually, there are many free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Back Up, Copy & Protect Your WP Websites With Backup Creator Plugin For WP

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

The large scale brute-force botnet attack on WordPress sites was mostly an attempt to compromise website administrator panels and gain access to the site by exploiting installations with “admin” as their user name.

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

We have created a tutorial on how to change your login username here: How To Change Your WordPress Username From Admin To Another Username

Security Measure #4 – Choose A Strong Password

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

Unless some measure is put into place to prevent 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 works out the combination.

Weak passwords, therefore, make really easy targets for bot attacks. Make sure that you change your password to something containing at least 8 or 9 characters long, with both upper and lowercase letters, and “special” characters (%^#$@&*).

Tip

You can use a password management software tool like Roboform to create strong passwords …

Roboform is a password management program you can use to generate strong passwords(You can use a password management tool like Roboform to generate secure login passwords)

We have created a detailed tutorial on how to change your admin password here: How To Reset Your WordPress Password

Security Measure #5 – Protect Your WP Config File

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

wp-config.php

(wp-config.php file)

If hackers break into your website, they will normally search for your 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 them 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 people from accessing 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 – Rename Or Delete Unnecessary WordPress Installation Files

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

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

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

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

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

Security Measure #8 – Disable Your Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the main menu)

This means that anyone logging into your blog’s admin area can view and change your WP theme template files, or cause mayhem on your site.

If you want to prevent people from being able to access 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 – Prevent Access To Your WordPress Uploads Directory

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

Normally, this folder is visible to anyone online. All a person needs to do to view the contents stored in your site’s “uploads” folder is navigate to your directory using their web browser …

(WordPress uploads directory)

(WordPress uploads directory)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, this could compromise 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, uploading 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 assistance if you are not sure about what to do.

Security Measure #10 – Security Plugins

A number of great WordPress security plugins are available that specifically address many common security issues faced by WordPress website owners, such as preventing hackers from gaining access to vital information about 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 plugin that does 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 - WordPress security software

(SecureScanPro – total security software for WordPress)

SecureScanPro is easy to install and easy to use, and does a great job of addressing most of the security areas that WordPress users need to address.

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

Blog Defender WordPress Security Solution

Blog Defender Security Suite For WordPress(Blog Defender Security Suite For WordPress Sites)

Blog Defender is a suite of WordPress security video tutorials, WordPress 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 Security Plugin For WordPressAnd then shows you how to fix these quickly and easily …

Blog Defender Security PluginIf you don’t want to purchase a security plugin like SecureScanPro or BlogDefender, then use various free WordPress plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting essential maintenance tasks like making sure that your WP core files, WordPress plugins and themes are kept updated to their latest versions, 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, web security is something you simply cannot afford to ignore.

As a final reminder, below is the advice given by an expert on website security to all WordPress users following the worldwide 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 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 consult a professional WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications via email when we publish new tutorials on WordPress security and tutorials about new WordPress security plugins and solutions.

***

"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)

***

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