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 SecurityWordPress is the world’s most used CMS which makes it a target for attempted hacking attacks.

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

These attacks were caused by botnets (networks of infected computers programmed to attack other sites with security vulnerabilities).

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 methods hackers use to try and break into a WordPress site. One of these is by trying to guess the site admin’s login username and password. This can be achieved with software tools that automatically tries to guess hundreds of login permutations in minutes.

If you’re using predictable user names and predictable passwords, your site can be easily hacked by repeated attempts to guess your site’s login details.

This is called a “brute force” login attack.

What Are Botnets

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 are then controlled remotely as a group, often without the unsuspecting computer owners’ knowledge or awareness.

Botnets are regularly used to send 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 infecting computer networks all around the world since 2009 called “Zeus” …

The Zeus botnet has been actively infecting computer networks all around the globe since 2009.

(The Zeus botnet has been actively compromising computer networks all around the globe since 2009. Image: 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 user administration areas occurred. The mass brute force attacks then continued, with over 30,000 WordPress blogs being hacked per day.

Coverage of this brute force attack was widely reported in all of 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 sites worldwide, making it a natural target for attempted hacker attacks

(Being the world’s most used content management system makes WordPress a target for hacking attempts)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

We explain what makes WordPress a very secure web platform in this article: Are Open Source CMS Platforms Like WordPress Secure?

Important

It’s important to understand 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 CMS applications like Joomla).

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

Preventing Your WordPress Blog From Being Brute Force Attacked – 10 Security Checks

Every website or blog with a security vulnerability can be an opportunity to hackers. A compromised blog not only provides new hackers opportunities to improve their skills and win “respect” from their peers, but it can also acts as a resource for launching DDoS attacks, spreading malware and participating in information theft.

If someone can exploit a web software flaw that allows them to gain complete control of your web site, the web site can then be employed as a “bot” in a planned cyber-attack against larger and more highly-valued web sites.

Additional undesirable effects of being hacked include being blacklisted by search engines, having spammy links advertising things like gambling, porn, etc. inserted into your content and meta data, malicious redirects to phishing sites and other websites, drive-by downloads (adding malicious software on your visitors’ computers), and lots of other nasty things.

The truth is that software-driven bots are trying to hack into your blog as you are reading this at this very moment. Whether they will do this successfully or not, will depend on how hard or easy you will make things for hackers to continue trying until they work out how to get in, or are forced to give up and decide to look for a less secure target.

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

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

Hackertarget - WordPress Security Check(Hackertarget – WP Security Check Screenshot image: Hackertarget.com)

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

Hackertarget - WP Security Scan

(WP security check results. Source: Hackertarget.com)

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

Website Security Check(Screenshot: BlogDefender.com)

The ability to see which 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 be potentially useful information to hackers, as this informs them about any exploitable holes or weaknesses, especially where the owners haven’t updated their software versions.

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

When a website gets compromised, blog owners can discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been vandalized or even entirely wiped out. Often, compromised sites will be infected with malicious software without the owner’s knowledge or awareness.

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

Warning

Note: A few of the steps 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 file code, then ask your web host or a professional WordPress service provider for help.

***

Security Measure #1 – Contact Your Hosting Service

Contact your webhosting company and ask them exactly what systems have been put into place to help prevent your site from brute force attacks, and what they do to ensure that your WordPress sites get regularly backed up.

Check that your hosting company is backing up your sites and that, if disaster strikes, you can quickly and easily recover your files.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Website Or Blog Frequently Maintained

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

A full WordPress maintenance routine ensures that:

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

A full WordPress 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 website or blog completely backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WordPress installation regularly 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 or blog. If you don’t want to learn how to do WordPress 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 are still breathing!

If you don’t want to perform manual backups, there are many plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Backup, Copy And Protect Your WP Websites With Backup Creator Plugin For WP

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

The large scale brute force attack on WordPress sites was mostly an attempt to compromise site admin panels and gain access to sites by exploiting WP installations using “admin” as the username.

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

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

Security Measure #4 – Use Strong Passwords

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

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

Weak passwords, therefore, make very easy targets for brute-force attacks. Make sure that you change your password to a string containing at least 8 characters long, and that includes upper and lowercase letters, combined with a few “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 management program like Roboform …

You can use a password program like Roboform to generate unguessable passwords(Roboform is a password management software you can use to create different passwords)

We have created a step-by-step tutorial created especially for WordPress users that shows you how to change your admin password here: What To Do If You Need To Reset Your Password

Security Measure #5 – Protect Your WP Config File

The wp-config.php file allows WordPress to communicate with the database to store and retrieve data and is used to define advanced options for WordPress.

wp-config.php file

(WordPress WP Config file)

If a hacker breaks into your WordPress site, they will 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 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 find 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 the install.php, upgrade.php and readme.html files from your server.

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

Security Measure #7 – Upgrade Your WordPress Site, Plugins And Themes To Their Latest Version

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

Make sure to keep all of your files, themes, plugins, etc. up-to-date.

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the admin menu)

This allows anyone accessing your blog’s admin to view and change your WordPress files, or cause mayhem on your site.

To prevent unauthorized people from accessing 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 – Protect Your Site’s Uploads Folder

The “uploads” folder stores all the media files that get uploaded to your blog.

By default, this folder is visible to all users online. All a person needs to do to see the contents in your “uploads” directory is visit your directory using their web browser …

(WordPress has an uploads folder where media content is stored)

(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 could compromise the security of your website.

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 file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to ask help from someone who knows what they are doing if you are not sure about what to do.

Security Measure #10 – Security Plugins

There are a number of great WordPress security plugins available that will address many common security issues WordPress website owners face, such as preventing unauthorized users from accessing your site, protecting your website from malicious scripts, preventing unauthorized file uploads, 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 files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - security software for WordPress

(SecureScanPro – complete security plugin 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 great plugin you may want to look at using is BlogDefender.

Blog Defender Security Suite For WordPress Websites

Blog Defender WordPress Security Product Suite(Blog Defender)

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

BlogDefender shows you where the security holes in your WordPress site are …

Blog Defender Security SuiteAnd then shows you how to fix these quickly and easily …

Blog Defender Security Product SuiteIf you don’t want to buy a premium security plugin like SecureScanPro or BlogDefender, you can use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure platform, but neglecting simple maintenance tasks like keeping your WP core files, 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 attacks 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, securing your sites is something you simply cannot ignore.

As a final reminder of the importance of keeping your websites protected, below is the advice given by an expert on website security to all WordPress users after the worldwide 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 very important if you run a WordPress site. Hopefully, this article has provided you with the initial guidelines and direction you need 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 WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications whenever we publish new articles on WordPress security and tutorials about 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.