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

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

These attacks were caused by botnets (computers infected with malware and programmed to attack other vulnerable computers).

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 WordPress sites. One of these is by trying to guess the site admin’s login username and password. This can be achieved with software tools that can work through hundreds of login permutations in minutes.

If you’re using obvious login details, your website can be an easy target for hackers.

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

Botnets are typically used to blast out mass spam emails.

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 globe 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. Image source: SecureList.com)

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

Coverage of this mass brute-force attack was reported by all the major webhosting companies, as well as the leading technology publications, such as Forbes, TechNews Daily, PC Magazine, Tech Crunch, BBC News, 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 an obvious target for hacking attacks

(Powering millions of websites and blogs around the world makes WordPress an obvious target for hacking)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

To understand what makes WordPress a very secure web platform, read this article: Is WordPress A Secure Website Platform?

Useful Information

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, 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)

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

Every blog with a security vulnerability can be seen as an opportunity to hackers. A compromised website or blog offers malicious users with a valuable resource for distributed denial of service attacks, spreading malware and as a source of information theft.

If hackers can find a vulnerability in your security, that site can then be used as a “bot” in a planned cyber-attack against more highly-valued sites.

Additional undesirable effects of having your website hacked include getting blacklisted by Google, having stealthy spam links advertising things like viagra, porn, etc. inserted into your content, redirecting visitors to phishing sites, drive-by downloads (adding malicious scripts on your visitors’ computers), and many other nasty things.

The truth is that malicious bots are probably trying to hack into your website or blog at this very moment. Whether they can achieve this depends on how hard you will make it for hackers to keep persisting until they either find a way to break in, or give up and decide to look for a less secure target.

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

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

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

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

Hackertarget - WordPress Security Scan

(Hackertarget – WP security scan results. Image source: Hackertarget.com)

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

WordPress Security Scan(Source: BlogDefender.com)

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

If your website is powered by WordPress and you are not preventive steps to harden your site, we can practically guarantee that, at some point, someone will attempt to hack your website, because these attacks are systematically targeting WordPress sites around the world!

Whenever a website is broken into, webmasters can find themselves completely “locked out” of their own site, or notice that their files have been altered or even that their content has been entirely wiped out. Often, most sites will be infected with malicious scripts or viruses without the owner’s knowledge or awareness.

To avoid the heartache and aggravation that comes with discovering that your site has been hacked into, we have listed below 10 essential and effective security measures that will help to prevent your WordPress site from being brute force attacked.

Disclaimer

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

***

Security Measure #1 – Contact Your Hosting Company

Contact your webhosting provider and ask them exactly what precautions are in place to protect your site from being attacked, and what they are doing to make sure that your files and data are being backed up.

It is important to make sure that your webhosting service provider backs up your server files and that, if disaster strikes, you can easily get your files back.

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

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

A proper 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 plugins, themes and software components are up-to-date,
  • etc …

A proper WP maintenance routine looks like this …

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

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

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 backup process here: Backup, Copy And Protect Your WordPress Web Site With Backup Creator Plugin For WordPress

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

the worldwide brute force attack on WordPress is mostly an attempt to compromise site administrator panels by exploiting WordPress sites using “admin” as their username.

For website security purposes, don’t set up sites with the username admin. This is the first thing hackers will test. If your site’s username is “admin”, change this immediately.

We have created a detailed step-by-step tutorial on how to change your WordPress username here: How To Change Your WP Username From Admin To Another User Name

Security Measure #4 – Avoid Weak Passwords

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 unlock your site.

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

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

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

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

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

Security Measure #5 – Deny Access To Your WP Config File

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

wp-config.php

(WordPress WP Config file)

If hackers break into your site, they will typically look 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 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 your wp-config.php file from being easily accessed. 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, then just rename them.

Security Measure #7 – Update Your WordPress Software, Plugins And Themes To Their Latest Version

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

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress comes with a built-in editor that lets the site administrator edit theme and plugin files from the dashboard area.

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible via the WordPress admin menu)

The WordPress theme editor allows anyone accessing your blog’s admin area to view and modify your theme templates, and cause havoc on your site.

If you want to prevent unauthorized 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 – Secure Your WordPress Uploads Directory

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

Normally, this folder is visible to online users. All someone has to do to view the contents in your site’s “uploads” folder is visit the directory using their web browser …

(WordPress uploads folder)

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

If any directories in your website have vulnerabilities that can be exploited by malicious users, this can threaten 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 file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to get professional assistance if you are unsure about what to do.

Security Measure #10 – Use Security Plugins

There are a number of security plugins for WordPress available that specifically address most security issues faced by WordPress website owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your website from malicious software, preventing injections of code into files, etc.

Many 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 issues that could lead to hackers accessing your files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WordPress complete security software

(SecureScanPro – WP security software solution)

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 look at using is BlogDefender.

Blog Defender WordPress Security Suite

Blog Defender(Blog Defender WordPress Security Solution)

Blog Defender is a package 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 and easily …

Blog Defender Security Product SuiteIf you don’t want to buy 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 basic maintenance tasks like making sure that your WordPress software, WordPress plugins and themes are kept up-to-date, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

No matter what kind of business you run or plan to run online and how small you think your web presence is, you cannot afford to ignore the importance of securing your website.

As one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on website security to all WordPress users following the large-scale 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 information in this 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 professional WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

Also, do yourself a favor and subscribe to WPCompendium.org to be notified whenever we publish new articles on WordPress security and reviews of 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

***