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 SecurityBeing the world’s most popular CMS makes WordPress a natural target for attempted hacker attacks.

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

These attacks were caused by infected computer networks programmed to attack other sites, also commonly known as “botnets”.

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

About Brute-Force Attacks

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)

One of the many ways hackers will attempt to break into WordPress sites is by trying to guess the site admin’s login username and password. This can be done with scripts and tools that automatically tries to guess hundreds of login combinations in minutes.

If you’re using easy-to-guess login details, your website could be an easy target for hackers.

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

A “Botnet” is a network of computers that have been compromised and infected with malicious software, which are then controlled remotely as a group, often without the computer owners’ knowledge.

Botnets are normally used used to send mass spam emails.

Below is a screenshot taken from an internet security monitoring site 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 compromising computer networks all around the world since 2009.

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

These were well organized and highly distributed botnet attacks on WordPress. Over 90,000 IP addresses were identified by several hosting 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 attacks continued after this, with over 30,000 WordPress sites being hacked per day.

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

WordPress is the world's most popular CMS making it a target for hacking attempts

(Powering millions of websites and blogs around the world makes WordPress an obvious target for malicious attacks by hackers)

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

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

To understand what makes WordPress a very secure platform for websites, see this article: Are Open Source CMS Platforms Like WordPress Secure?

Info

It’s important to understand that, in the case of the brute force attack described above, was no specific vulnerability in WordPress being exploited (the same script was also attacking sites built using other CMS platforms 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)

Preventing Your WordPress Website From Brute Force Attacks – 10 Security Measures

You may think that the information in your website or blog offers little to no value to hackers, but the reality is that to a hacker, all websites provide an opportunity to gain some advantage at your expense.

If a hacker can exploit a flaw in your security that allows them to gain remote access of your blog, the site can then be employed as a “bot” in a planned cyberattack against larger and more valued sites.

Additional undesirable results of having your website hacked and your site security compromised include getting blacklisted by Google, having spammy links promoting things like viagra, porn, etc. in your content and meta data, redirecting visitors to phishing sites and other websites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasties.

The reality is that hackers are most likely scouring for security weaknesses and trying to break into your blog while you are reading this article at this very moment. Whether they can achieve this will depend on how difficult or easy you can make it for hackers to keep persisting until they discover a way to get in, or give up and decide to look for a more vulnerable 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 …

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

You will see that the test returns various results and information about your website setup …

Hackertarget - WP Security Scan

(Hackertarget – website security check results. Screenshot: Hackertarget.com)

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

WP Security Check(Screenshot: BlogDefender.com)

Being able 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 are all useful information to hackers, as this can inform them about potential holes or weaknesses, especially where the owners haven’t updated their sites.

If your website is driven by WordPress and you are not taking appropriate steps to bolster the security of your site, then we can practically guarantee that, at some point, someone will attempt to hack your website, because these brute force attacks are systematically hitting WordPress installations all the world!

Typically, when a site is hacked, website owners can find themselves “locked out” of their own site, or notice that their content has been interfered with or even entirely wiped out. Often, sites will become infected with malicious scripts without the owner’s knowledge or awareness.

To avoid the heartache and aggravation of having your website being hacked into, below are 10 simple, yet essential and effective security checks that will help to prevent your WordPress site from brute force botnet attacks.

Important Info

Note: Some of the steps below need some technical understanding of how to modify core WordPress and 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 technical provider for assistance.

***

Security Measure #1 – Contact Your Web Host

Contact your web host and ask them exactly what security precautions are in place to help prevent your site from brute force attacks, and what is done to ensure that your files and data get regularly backed up.

It is important to check that your hosting provider regularly backs up your server files and that, if disaster strikes, you can quickly and easily get back your site.

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

You should never rely on your web host for site backups. Instead, learn how to maintain your WordPress site or pay someone to get this service done for you and maintain a habit of religiously performing a full site maintenance routine frequently (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 WordPress software, themes and plugins are up-to-date,
  • etc …

A full WordPress site maintenance routine looks like this …

Maintaining your WordPress website or blog completely backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website backed up and updated is vitally important for WordPress security. Source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WP website fully backed up and up-to-date. WordPress 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 WP site maintenance yourself, get someone else to do it but make sure this 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 WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Clone And Keep Your WordPress Sites Protected 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 is mostly attempting to compromise website admin panels and gain access to sites by exploiting WP sites that used “admin” as the account name.

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

We have created a simple tutorial that shows you how to change your username here: How To Change Your Admin User Name In WordPress

Security Measure #4 – Choose A Strong Password

A “brute force” attack occurs when malicious software persistently tries to guess the right username and password characters that will give them entry to your site.

Unless you put some measure in place to stop the brute force attack from happening (see further below for a couple of simple and effective ways to do this), the “bot” will just keep attacking your site until it eventually “cracks” the code.

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

You can use a password software tool like Roboform to generate very secure passwords(You can use a password program like Roboform to generate secure login passwords)

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

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

(WordPress WP Config file)

If hackers break into your WordPress site, they will normally search for the wp-config.php file, because this file contains your WordPress 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.

To protect your WordPress site from being attacked and even being used as part of a bot net, therefore, 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 – Rename Or Delete 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 and can be removed. If you don’t want to delete these files, then just rename them.

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

Hackers are always on the lookout for vulnerabilities they can exploit in previous versions of WordPress, including outdated versions of plugins and themes.

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

Security Measure #8 – Disable Your Theme Editor

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

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

WordPress Theme Editor Menu

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

This allows anyone accessing your blog to see and modify your theme files, and create mayhem 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 – Secure Your WordPress Uploads Directory

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

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

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

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

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, someone can upload unauthorized file types or compromise the security of your website.

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 an empty file 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 unsure about what to do.

Security Measure #10 – Security Plugins

Some great WordPress security plugins are available that specifically address most common security issues WordPress website owners face, such as preventing hackers from gaining access to vital information about your site, protecting your website from malicious scripts, 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 issues that could lead to hackers accessing your website files and causing damage to your site is SecureScanPro.

SecureScanPro - total security plugin for WordPress

(SecureScanPro – WordPress complete security software solution)

SecureScanPro is easy to install and easy to use, and takes care of 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

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

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

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

Blog DefenderAnd lets you easily fix these …

Blog Defender WordPress Security PluginIf you don’t want to invest in a premium security plugin like SecureScanPro or BlogDefender, you can use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure platform, but neglecting simple maintenance tasks like updating your WordPress installation, plugins and WP themes, 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, you simply cannot ignore the importance of web security.

As a final reminder, 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 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 has given you the initial steps you need to take 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 via email whenever we publish new tutorials on WordPress security and reviews of new security plugins and solutions.

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***