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 used by millions of websites and loved by thousands of web developers and website 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 April 2013, WordPress installations around the world were subjected to a worldwide brute force attack.

These attacks were caused by computer networks infected with malware and programmed to attack other sites (botnets).

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

Brute-Force Attacks – An Overview

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’s administration login username and password. This can be achieved with software tools that can work through hundreds of possible login combinations in minutes.

If you’re using obvious usernames and passwords that are easy to guess, your website can be easily hacked by repeated 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 infected with malicious software, which can then be controlled remotely as a group, typically without the computer owners even being aware that this is happening.

Botnets are regularly used to send out 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 …

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. Source: SecureList.com)

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

Coverage of the mass brute force attack was reported by all the major webhosting companies, as well as the leading technology media 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 …

WordPress powers millions of websites and blogs around the world, which makes it a frequent target for hacking attempts

(Powering millions of websites and blogs around the world makes WordPress a target for hackers)

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

No. In fact, there are lots of good reasons why you should use WordPress if you are concerned at all about website security.

We explain why WordPress is a secure web platform in this article: Is WordPress A Secure Platform For Websites?

Info

It’s important to note that, in the case of the mass brute force botnet attack described above, no specific WordPress vulnerability was being exploited (the same script was also targeting sites built using other web applications like Joomla).

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

Preventing Your WordPress Blog From Brute-Force Attacks – 10 Security Points

Every website with a vulnerability provides an opportunity to hackers. A compromised website provides malicious users with a valuable platform to launch DDoS attacks, spread malware and engage in information theft.

If hackers can exploit a security flaw that lets them remotely control your website or blog, your website can then be employed to target other valued websites.

Additional undesirable consequences of being hacked include getting blacklisted by Google, having stealthy spam links promoting things like gambling, porn, etc. inserted in your content and page title and descriptions, redirecting visitors to phishing sites and other websites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasties.

The truth is that hackers are very likely trying to break into your web site while you are reading this article. Whether they can break in will depend on how difficult you will make it for hackers to keep trying until they can either work out how to break in, or are forced to give up and decide to look for a less protected target.

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

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

Website Security Scan(WordPress Security Scan Screenshot image: Hackertarget.com)

You will see that the check will return a number of results and details about your site setup …

WP Security Check

(WordPress security scan results. Image source: Hackertarget.com)

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

Hackertarget - Website Security Scan(Image source: Blog Defender)

Being able to see what version of WordPress you are using, which plugins and themes you have installed on your site, and which files have been uploaded to certain directories in your site can all be useful information to hackers, as this informs them about exploitable security weaknesses, especially in older versions.

If your website is powered by WordPress and you are not taking steps to harden your site, we can practically guarantee 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 targeting WordPress sites worldwide!

Typically, whenever a website or blog gets broken into, blog owners will find themselves completely “locked out” of their own site, or notice that their content has been altered or that everything has been entirely wiped out. Often, sites will become infected with malicious scripts without the owner’s knowledge or awareness.

To help avoid the heartache that comes with having your web site being hacked into, we have listed below 10 essential and effective security checks that will help to protect your WordPress site from being attacked by brute-force hackers.

Info

Note: Some of the measures shown below require some technical understanding of how to modify core WordPress and server files. If you have no technical skills, or don’t want to mess around with file code, 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 Hosting Provider

Contact your host and ask them what security systems have been put into place to help prevent your site from brute-force attacks, and what they are doing to make sure that your server files and data are being backed up.

It is important to make sure that your hosting provider is backing up your sites and that, if disaster strikes, 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 Maintained

Never rely just on your host for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this done for you and maintain a habit of religiously performing a complete site maintenance routine frequently (e.g. daily, weekly, monthly, etc …)

A complete 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 proper WP site maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important maintaining your WordPress installation backed up and up-to-date 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 do not want to learn how to do WordPress site maintenance yourself, get someone else 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 you are still breathing!

If you don’t want to back up your data manually, there are a number of WordPress plugins you can use. You can read about a WordPress backup plugin that can automate your site backups here: Backup, Copy And Keep Your WordPress Website Protected With Backup Creator Plugin For WordPress

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

the worldwide brute force botnet attack on WordPress is mostly an attempt to compromise site administrator panels by exploiting WordPress sites with “admin” as the user name.

For reasons of website security, avoid installing WordPress sites with the username “admin”. This is the first thing hackers will test. If your blog’s user name is admin, then make sure you change it immediately.

For a simple step-by-step tutorial created especially for WordPress admin users on how to change your WordPress admin username, go here: Changing Your WordPress Admin User Name

Security Measure #4 – Choose A Strong Password

A “brute force” attack occurs when malicious software persistently hits a login or password field with different character strings in an attempt to guess the right combination that will give the hacker access to your website.

Unless you put some measure in place to block the brute-force attack (see further below for a couple of simple and effective suggestions for doing this), the “bot” will just persist in attacking your site until it eventually works out the combination.

Passwords that are easy to guess, therefore, make really easy targets for hackers. Make sure that you change your password to something that is at least 8 characters long, with upper and lowercase letters, and “special” characters (^%$#&@*).

Useful 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 tool like Roboform …

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

For a simple step-by-step tutorial that shows you how to change your admin password, go here: How To Change Passwords In WordPress

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

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

wp-config.php

(wp-config.php)

If a hacker breaks into your website, they will normally look for your wp-config.php file, because this file contains your WordPress database details, 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, you must prevent people from being able to easily get to 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 WordPress 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, just rename them.

Security Measure #7 – Update Your WordPress Blog, Themes & Plugins To Their Latest Version

Hackers look for vulnerabilities in previous versions of WordPress that can be exploited, including outdated versions of WP themes and plugins.

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WordPress Theme Editor Menu

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

This means that anyone logging into your blog’s admin area can view and modify your theme template files, and create havoc on your site.

To prevent unauthorized people from being able to access the 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 WordPress Uploads Directory

The “uploads” directory contains all the media that gets uploaded to your site.

By default, this folder is visible to anyone online. All someone has to do to see all of the contents in your “uploads” directory is navigate to your directory using their browser …

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

(WordPress uploads directory)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, someone can upload unauthorized file types to your site.

Protecting your directories will prevent online users from viewing 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 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 – Security Plugins

Some great WordPress security plugins are available that will address common security issues WordPress site owners face, such as preventing unauthorized users from gaining access to vital information about your site, protecting your files from malicious exploits, preventing unauthorized file uploads, 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 site files and causing damage to your site is SecureScanPro.

SecureScanPro - WP complete security software

(SecureScanPro – WordPress security plugin)

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

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

Blog Defender

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

This product is a package of WordPress security video tutorials, plugins and tools, plus WordPress security documentation in PDF and DOC formats.

BlogDefender scans you WordPress installation for security holes …

Blog DefenderAnd then shows you how to quickly fix these …

Blog Defender Security Plugin For WordPressIf you don’t want to buy a 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 simple maintenance tasks like updating your WordPress software, WordPress plugins and themes, tightening file and data security and taking other necessary precautions can expose your website to malicious by hackers and bots.

Regardless of the kind 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 web site.

As a final reminder of the importance of website security, below is the advice given by an expert on website security to all WordPress users after the global brute-force attacks by botnets 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 of the utmost importance 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 seek help from a professional WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified when we publish new tutorials on WordPress security and reviews of new WordPress security plugins.

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***

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