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 SecurityWordPress often is targeted by hackers, due to its global popularity.

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

These attacks were caused by networks of infected computers programmed to attack other installations, also commonly known as “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’s administration login username and password. This can be achieved using software tools that can guess hundreds of possible login combinations in minutes.

If you’re using predictable login details, your website could be easily hacked by repeated 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)

”Botnets” are networks of computers that have been compromised and infected with malicious software, which are then controlled remotely as a group, typically without the computer owners’ knowledge or awareness.

Botnets are normally used used to blast out 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 compromising computer networks all around the world since 2009 called “Zeus” …

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

(ZeuS is a botnet that has been actively infecting computer networks all around the world since 2009. Screenshot: SecureList.com)

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

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

WordPress is often the target of malicious attacks by hackers, due to its global popularity

(WordPress is the world’s most used CMS making it a target for hacker attacks)

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

No. In fact, there are many great reasons why you should continue using WordPress if you are concerned at all about the security of your website.

To learn what makes WordPress a very secure platform for websites, read this article: Is WordPress A Secure Website Platform?

Useful Information

It’s important to note that, in the case of the 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 applications like Joomla).

Mike Little, the co-founder 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)

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

You may think that your site offers little to no value to hackers, but the reality is that to a hacker, all websites are an opportunity to gain some advantage at your expense.

If hackers can access and remotely take control of your website, that website or blog can then be used to attack more valuable web sites.

Additional undesirable effects of having your site hacked and your site security compromised include getting blacklisted by search engines, having stealthy spam links promoting things like gambling, porn, etc. inserted into your content, malicious redirects to phishing sites or other websites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasty things.

The harsh reality is that hackers are probably searching for weaknesses and trying to hack into your website or blog while you are reading this. Whether they can break into your site or not, will depend on how hard or easy you can make it for hackers to continue persisting until they either discover how to get access, or are forced to give up and decide to look for a more vulnerable target.

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

If you visit a site like Hackertarget.com and run your website through their WordPress security check …

Hackertarget - Website Security Check(WP Security Check Product image source: Hackertarget.com)

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

Hackertarget - WP Security Check

(WP security scan results. Product image source: Hackertarget.com)

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

Hackertarget - WP Security Scan(Screenshot source: 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 can all be useful information to hackers, as this informs them about any potential security weaknesses, especially where the owners haven’t updated their sites.

If your website is driven by WordPress and you are not proactive steps to toughen up your site, we can practically guarantee that, at some point, someone will attempt to hack your installation, because these brute-force attacks are systematically hitting WordPress installations worldwide!

Typically, when a website is broken into, webmasters will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been modified or even that their content has been entirely wiped out. Typically, most compromised sites will be infected with malicious scripts or viruses without the owner even being aware of it.

To help avoid the heartache that comes with having your site being hacked into, below are 10 simple, yet essential and effective security measures that will help to protect your WordPress site from being brute-force attacked.

Warning

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

***

Security Measure #1 – Contact Your Host

Get in touch with your hosting service provider and ask them exactly what precautions are in place to protect your site from being attacked, and what they are doing to ensure that your WordPress sites get regularly backed up.

Make sure that your hosting provider backs up your server files and that, if anything happens, you can easily get your site back.

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

Never rely on your hosting company for site backups. Instead, learn how to maintain and manage your WordPress site or get this service done for you and develop a habit of performing a full WordPress site maintenance routine on a frequent basis (e.g. daily, weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

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

A complete WP site maintenance routine looks like this …

Maintaining your WordPress web site backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress site frequently backed up and updated is vitally important for WordPress security. Image: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WordPress web site frequently backed up and up-to-date. WordPress maintenance is not hard to do or time-consuming, but it must be done to ensure the security of your website. 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 website is the second most important thing you must 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, Duplicate & Protect Your WP Website With Backup Creator WordPress Plugin

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

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

For reasons of website security, avoid setting up WordPress sites with the username “admin”. This is the first thing hackers will test. If your site’s username is admin, then change it immediately.

We have created a simple step-by-step tutorial created especially for non-technical admin users that shows you how to change your admin username here: Changing Your Admin User Name In WordPress

Security Measure #4 – Your Password

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

Unless some measure is put into place to prevent the brute-force attack from happening (see further below for a couple of effective suggestions for doing this), the “bot” will just continue attacking your site until it eventually works out the combination.

Weak passwords, therefore, are really easy targets for brute force attacks. Make sure that you change your password combination to a string that is at least 8 or 9 characters long, with upper and lowercase letters, and “special” characters (^%$#&@*).

Useful Tip

Roboform is a password tool that lets you easily generate strong passwords …

You can use a password program like Roboform to generate unbreakable passwords(Roboform is a password management program that lets you easily create different passwords)

We have created a simple step-by-step tutorial that shows you how to change your login password here: What To Do If You Need To Reset WordPress Passwords

Security Measure #5 – Secure Your WP Config File

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

WP Config file

(wp-config.php)

If hackers break into your WordPress site, they will try to access your 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.

To protect your WordPress site from attacks and even being used as part of a bot net, therefore, prevent people from being able to easily view 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 Installation Files

Rename or delete your install.php, upgrade.php and readme.html files.

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

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

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

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WP Theme Editor Menu

(The WordPress theme editor can be accessed using the dashboard menu)

This allows anyone accessing your site to view and modify all of your WordPress files, or create mayhem on your site.

To prevent people from accessing your WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Remove Access To The Site’s Uploads Directory

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

By default, this folder is visible to anyone online. All someone has to do to see the contents stored in your “uploads” folder is visit the directory using a web browser …

(WordPress uploads directory)

(WordPress uploads folder)

If any files stored in his folder have vulnerabilities that can be exploited by hackers or malicious users, 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, uploading a blank index.php file (this is literally a blank file called “index.php”) to your uploads directory, and so on. Again, it’s best to use a professional if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

There are a number of WordPress security plugins available that will address many common security issues WordPress site owners face, such as preventing hackers from accessing vital areas of your site, protecting your site from malicious exploits, 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 site files and causing damage to your site is SecureScanPro.

SecureScanPro - complete security plugin for WordPress

(SecureScanPro – total security software for WordPress)

SecureScanPro is easy to install and easy to use, and fixes most of the security issues that WordPress users need to address.

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

Blog Defender

Blog Defender(Blog Defender)

This product is a package of WordPress security video tutorials, plugins and tools, plus a WordPress security PDF/DOC file.

BlogDefender scans you WordPress installation for security holes …

Blog DefenderAnd lets you fix these quickly and easily …

Blog DefenderIf you don’t want to invest in a premium 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 very secure platform, but neglecting essential maintenance tasks like keeping your WordPress installation, WP plugins and WordPress themes updated to their latest versions, tightening file and data security and taking other necessary precautions can expose your site to malicious 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, website security is something you cannot ignore.

As one last reminder, below is the advice given by a website security expert to all WordPress users following the large-scale 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, 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 consult a WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

Also, please remember to subscribe to WPCompendium.org to receive notifications via email when we publish new articles on WordPress security and reviews of new security plugins.

***

"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)

***