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 leading content management system and the preferred online publishing platform used by 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 wanting to score a “big win”.

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

These attacks were caused by computers infected with viruses and programmed to attack other vulnerable sites (called “botnets”).

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

What Are 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 a WordPress site is by trying to guess the site admin’s login username and password. To attempt this, hackers use scripts and software tools that automatically tries to guess hundreds of login permutations in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be easily hacked by a malicious software’s repeated attempts to work out your site’s login details.

This is called a “brute-force” attack.

What Is A Botnet?

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/botnet)

A “Botnet” is a network of private computers that have been infected with malicious code or scripts, which are then controlled remotely as a group, often without the computer owners even being aware that this is happening inside their machine.

Botnets are normally used used to blast out mass spam emails.

The screenshot below was taken from an internet security monitoring site showing the locations of the command centers of a botnet that has been actively compromising computer networks all around the globe since 2009 called “Zeus” …

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

These were well organized and highly distributed botnet attacks. Over 90,000 IP addresses were identified by several webhosting companies in the initial attack alone, when millions of attempts to force their way into WordPress site admin areas occurred. The worldwide brute-force attacks continued after this, with over 30,000 WordPress sites and blogs being hacked every day.

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

WordPress powers millions of websites and blogs around the world, which makes it a natural target for attacks by malicious users

(Being the world’s most popular content management system makes WordPress an obvious target for hackers)

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

To learn why WordPress is a secure web platform, see this article: Can You Build A Secure Business Online Using WordPress?

Important Info

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

Mike Little, the co-founder 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)

Protecting Your WordPress Blog From Brute-Force Attacks – 10 Security Checks

You may think that the information in your website has 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 someone can exploit a software flaw in your security, your web site can then be used to attack more highly-valued sites.

Additional undesirable impacts of having your website hacked include being blacklisted by search engines, having spammy links promoting things like casinos, discounted fashion, etc. inserted in your content and page title and descriptions, redirecting visitors to phishing sites, drive-by downloads (adding malicious scripts on your visitors’ computers), and lots of other nasties.

The reality is that hackers are searching for exploits and trying to hack into your blog while you are reading this page. Whether they can get into your site or not, depends on how hard you will make it for hackers to keep persisting until they either can work out how to get 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?

Does your website run on WordPress? If so visit Hackertarget.com and run your website through their WordPress security scan …

WP Security Scan(Hackertarget – Website Security Scan Product image source: Hackertarget.com)

You will see that the test will display various results and details about your website setup …

WordPress Security Check

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

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

Website Security Check(Screenshot: BlogDefender website)

The ability 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 can all be valuable information to hackers, as these can inform them about potentially exploitable vulnerabilities, especially where site owners haven’t updated their sites.

If your site or blog is driven by WordPress and you are not proactive steps to bullet-proof your site, we can practically guarantee that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically hitting WordPress sites around the world!

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

To avoid the heartache and frustration (and potential financial loss) of having your site being hacked into, we have listed below ten essential and effective security checks that will help to prevent your WordPress site from being brute force attacked.

Disclaimer

Note: A few of the measures below need some technical skills to modify core WordPress and server files. If you have no technical skills, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress service provider for help.

***

Security Measure #1 – Contact Your Webhosting Provider

Get in touch with your web host and ask them exactly what precautions they offer to help prevent your site from being attacked, and what they are doing to make sure that your site files are being regularly backed up.

It is important to make sure that your host backs up your sites and that, if anything should happen, you can quickly and easily get back your site.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Regularly Maintained

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

A proper WordPress maintenance routine ensures that:

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

A proper WordPress site maintenance routine looks like this …

Maintaining your WP website or blog backed up and updated is vitally important for WordPress security.(Maintaining your WordPress 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 site fully backed up and updated is. WP site maintenance is not hard or time-consuming, but it must be done to ensure the security of your website. If you do not want to learn how to do WP maintenance yourself, pay someone to do it but make sure this gets done. Backing up your website 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 site manually, there are a number of free and paid plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Backup, Duplicate & Protect Your WP Website With Backup Creator Plugin For WordPress

Security Measure #3 – Do Not Use “Admin” As Your Username

The mass brute-force botnet attack on WordPress is mostly attempting to compromise website admin panels and gain access to sites by exploiting sites with “admin” as the account name.

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

We have created a step-by-step tutorial for WordPress users that shows you how to change your login username here: Changing Your WP Username From Admin To A Different Username

Security Measure #4 – Your Password

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

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

Passwords that are easy to guess, therefore, make very easy targets for bot attacks. Make sure that you change your password combination to something containing at least eight characters long, with both upper and lowercase letters, and add a few “special” characters (%^#$@&*).

Useful Tip

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

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

We have created a simple tutorial on how to change your password here: How To Reset Login Passwords In WordPress

Security Measure #5 – Secure 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 WordPress options.

wp-config.php

(wp-config.php file)

If hackers break into your WordPress website, they will typically look for the wp-config.php file, because this file contains your database information, 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 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

Delete or rename the install.php, upgrade.php and readme.html files from your server.

These files can be removed after installation. If you don’t want to remove these files, just rename them.

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

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

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress installations come with a built-in editor feature that allows the site administrator to edit theme and plugin code from the dashboard.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor using the main menu)

This means that anyone logging into your blog can view and modify your WordPress 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 adding code to your wp-config.php file.

Security Measure #9 – Remove Access To The Site’s Uploads Folder

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

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

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

(WordPress uploads folder)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, anyone can upload unauthorized file types or compromise the security of your site.

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 seek professional help if you are unsure about what to do.

Security Measure #10 – Use WordPress Security Plugins

Several security plugins for WordPress are available that will address most common security issues WordPress site owners face, such as preventing unauthorized users from accessing your site, protecting your files from brute-force attacks, preventing unauthorized file uploads, etc.

Many WordPress plugins address some but not all areas of WordPress security. One WordPress 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 - WP total security software

(SecureScanPro – security software solution for WordPress)

SecureScanPro is easy to install and easy to use, and fixes most of the security areas that WordPress users need to address.

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

Blog Defender Security Product Suite For WordPress Web Sites

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

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

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

Blog Defender Security Solution For WordPressAnd lets you fix these quickly …

Blog DefenderIf you don’t want to invest in 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 platform, but neglecting simple maintenance tasks like updating your WordPress software, WP plugins and themes, tightening file and data security and taking other necessary precautions can expose your site to attacks by hackers and bots.

Regardless of the type of business you run or plan to run online and how small you think your web presence is, you simply cannot afford to ignore the importance of securing your web site.

As one last reminder, below is the advice given by a web security expert to all WordPress users following the mass brute-force attacks 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, 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 consult a professional WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to receive notifications via email when we publish new articles on WordPress security and tutorials about new WordPress 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)

***

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