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 world’s most popular CMS platform and the online publishing platform of choice for millions of websites and loved by thousands of web developers and website designers, it’s inevitable that at some point in time, WordPress will come under attack by hackers.

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

These attacks were caused by networks of infected computers programmed to attack other computers (called “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 ways hackers try to break into WordPress sites. One of these is by trying to guess the site admin’s login username and password. This is done with software tools that can guess hundreds of login permutations in minutes.

If you’re not using strong usernames or unguessable passwords, your website can be an easy target for hackers.

This is called a “brute-force” 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.org)

A “Botnet” is a network of private computers that have been compromised and infected with malicious software, which can then be controlled remotely as a group, often without the computer owners even being aware that this is going on.

Botnets are regularly used to send out mass spam emails.

The screenshot below was taken from an online security monitoring site 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 compromising computer networks all around the globe since 2009.

(ZeuS is a botnet that has been actively compromising computer networks all around the globe since 2009. Image source: SecureList.com)

These were well organized and highly distributed attacks. 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 mass attacks continued after this, with over 30,000 WordPress sites being hacked per day.

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

Powering millions of websites worldwide makes WordPress an obvious target for hacker attacks

(WordPress often is targeted by hackers)

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

No. In fact, there are lots of great reasons why you should choose WordPress if you are concerned about the security of your website.

To understand what makes WordPress a very secure platform for websites, see this article: Is WordPress Secure?

Useful Information

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

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

Protecting Your WordPress Site From Being Brute Force Attacked – 10 Security Checks

You may think that the information in your website or blog provides no value to hackers, but the reality is that to a hacker, every website provides an opportunity to gain some benefit at your expense.

If hackers can find a flaw in your security setup that allows them to access and take over your website, your website or blog can then be used as part of a larger network of “bots” to target other highly-valued websites.

Additional undesirable consequences of having your site hacked include being blacklisted by search engines, having stealthy spam links promoting things like viagra, discounted fashion, etc. inserted into your content and page title and descriptions, malicious redirects to phishing sites, drive-by downloads (adding malicious software on your visitors’ computers), and lots of other nasty things.

The reality is that software-driven bots are most likely searching for vulnerabilities and trying to hack into your site at this very moment. Whether they will get in will depend on how challenging you can make it for hackers to keep trying until they can discover how to get access, 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 Hackertarget.com and run your site through their WordPress security scan …

WordPress Security Check(Hackertarget – Website Security Scan Source: Hackertarget.com)

You will see that the scan will yield various results and details about your website …

Hackertarget - WP Security Check

(WordPress security check results. Product image source: Hackertarget.com)

It should be obvious after using the above tool that if you are able to freely access all of this information about your WordPress site, hackers can too.

Hackertarget - WordPress Security Scan(Image source: BlogDefender site)

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 can all be potentially useful information to hackers, as this informs them about potential security weaknesses, especially where the owners haven’t updated their files.

If your website is powered by WordPress and you are not taking steps to harden your site, then it’s practically guaranteed that, at some point, someone will attempt to hack your installation, because these attacks are systematically hitting WordPress sites around the world!

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

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

Warning

Note: A few of the recommended measures shown below need 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 search for a professional WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Host

Get in touch with your web host and ask them what security systems are in place to protect your site from brute-force attacks, and what they do to ensure that your server files and data get regularly backed up.

It’s important to make sure that your hosting service is regularly backing up your server files and that, if anything happens, you can quickly and easily get back your files and data.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Frequently Up-To-Date

Never rely only on your hosting provider 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 full WordPress site maintenance routine frequently (e.g. daily, weekly, monthly, etc …)

A proper WordPress maintenance routine ensures that:

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

A full WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WP website frequently backed up and updated is. WordPress 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 WordPress maintenance yourself, get someone else 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 are still breathing!

If you don’t want to back up your data manually, there are many WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Backup, Clone & Keep Your WordPress Website Protected With Backup Creator Plugin For WP

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

The brute-force botnet attack on WordPress sites was mostly attempting to compromise website admin panels by exploiting installations with “admin” as their username.

For security reasons, avoid installing sites with the username “admin”. This is the first thing hackers will test. If your blog’s user name is “admin”, change this immediately.

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

Security Measure #4 – Use A Strong Password

A “brute force” attack occurs when a malicious script persistently hits a login or password field with different strings of characters trying to guess the right combination that will unlock 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 ways to do this), the “bot” will just continue to attack your site until it eventually “cracks” the code.

Passwords that are easy to guess, therefore, become very easy targets for brute-force attacks. Make sure that you change your password combination to a string containing at least eight or nine characters long, and that includes upper and lowercase letters, and “special” characters (e.g. %, #, @, etc).

Tip

If you have trouble coming up with strong passwords or feel reluctant to set up different passwords for all your online logins, then use a password management tool like Roboform …

You can use a password tool like Roboform to help you generate difficult passwords(You can use a password management tool like Roboform to help you generate really secure passwords)

For a simple tutorial created especially for WordPress admin users on how to change your admin password, go here: Changing WordPress Passwords

Security Measure #5 – Prevent Access To Your wp-config.php 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 file

(wp-config.php file)

If a hacker breaks into your WordPress website, they will typically try to access your wp-config.php file, because this file contains your database information, 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 your wp-config.php file from being accessed. 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 Installation Files

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

These files are not required after installation. If you don’t want to remove these files, then just rename them.

Security Measure #7 – Upgrade Your WordPress Software, Plugins And Themes

Hackers search for vulnerabilities they can exploit in earlier WordPress versions, including out-of-date versions of WP plugins and themes.

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor via the WP main menu)

This means that anyone logging into your site’s admin area can see and edit all of your WordPress theme templates, and create havoc on your site.

If you want to prevent 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 – Remove Access To Your WordPress Uploads Folder

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

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

(WordPress uploads folder)

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

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, this can threaten the security of your website.

Protecting your directories will prevent unauthorized people from viewing 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 help if you are not sure about what to do.

Security Measure #10 – Install WordPress Security Plugins

A number of great WordPress security plugins are available that specifically address most security issues faced by WordPress site owners, such as preventing unauthorized users from gaining access to vital areas of your site, protecting your files from brute-force attacks, 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 issues that could lead to hackers accessing your files and damaging your site is SecureScanPro.

SecureScanPro - WP total security software solution

(SecureScanPro – WordPress security plugin)

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

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

Blog Defender WordPress Security Product Suite

Blog Defender(Blog Defender Security Suite)

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

BlogDefender shows you where potential security weaknesses in your WordPress installation are …

Blog Defender Security Suite For WordPress Websites & BlogsAnd lets you fix these quickly and easily …

Blog Defender Security Solution For WordPress BlogsIf 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 web platform, but neglecting essential maintenance tasks like making sure that your WP installation, WordPress plugins and WordPress themes are kept up-to-date, tightening file and data security and taking other necessary precautions can have disastrous consequences.

Regardless of the kind of business you run or plan to run online and how small you think your web presence is, securing your website or blog is something you simply cannot ignore.

As one last reminder, below is the advice given by a website security expert to all WordPress users after 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 very important if you run a WordPress site. Hopefully, the information in this article will help 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 professional WordPress technical provider in our WordPress Services Directory.

Also, do yourself a favor and subscribe to WPCompendium.org to receive notifications when we publish new tips on WordPress security and tutorials about new security plugins and solutions.

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***