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 most popular content management system in the world and the online publishing platform of choice used by millions of websites and loved by thousands of website developers and web designers, it’s inevitable that at some point in time, WordPress will become an obvious target for attacks from hackers.

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

These attacks were caused by computers infected with malware and programmed to attack other computers, also commonly known as “botnets”.

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

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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. To do this, hackers use software tools that can work through hundreds of login permutations in minutes.

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

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 computers that have been infected with malicious code or software, which can then be controlled remotely as a group, often without the computer owners’ knowledge.

Botnets are typically used to blast out mass spam emails from the infected computers of compromised user accounts.

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 world since 2009 …

The Zeus botnet has been actively compromising computer networks all around the world 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 a number of webhosting companies in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress user administration areas. The mass brute-force attacks continued after this, with over 30,000 WordPress sites being hacked each day.

Coverage of the April 2013 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, Tech Crunch, PC Magazine, BBC News, and even on the official website of the US Department of Homeland Security …

WordPress often is targeted by hackers, due to its popularity

(WordPress often is targeted by hackers)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are lots of great reasons why you should continue using WordPress if you are concerned about the security of your online presence.

We explain why WordPress is a secure platform for websites in this article: Is WordPress Secure? What Every Business Owner Needs To Know About WordPress

Important Info

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

Mike Little, the co-founder of WordPress with Matt Mullenweg, said this about the botnet 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 Website From Brute-Force Attacks – 10 Security Points

You may think that the information in your site has no value to hackers, but the reality is that all websites are valuable to a malicious user.

If someone can access and remotely control your website or blog, your blog can then be employed as part of a larger network of “bots” to target more highly-valued web sites.

Additional undesirable impacts of being hacked include being blacklisted by search engines, having spammy links promoting things like casinos, porn, etc. inserted in your content and page title and descriptions, 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 nasty things.

The harsh reality is that hackers are very likely trying to hack into your site while you are reading this at this very moment. Whether they will achieve this will depend on how challenging you can make it for hackers to keep trying until they can either work out how to get in, or are forced to give up and go look for a more vulnerable 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 scan …

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

You will see that the scan returns a number of results and information about your WordPress installation …

Hackertarget - WordPress Security Scan

(Hackertarget – website security scan results. Product image: Hackertarget.com)

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

Hackertarget - Website Security Scan(Image source: BlogDefender.com)

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 be useful information to hackers, as this informs them about any security vulnerabilities, especially in older versions.

If your site or blog runs on WordPress and you’re not taking appropriate steps to bolster the security of your site, it’s practically guaranteed that, at some point, someone will attempt to hack your website, because these brute-force attacks are systematically hitting WordPress sites around the world!

Typically, when a site is compromised, webmasters can discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been altered or even that their content has been completely wiped out. Often, sites will be infected with malicious software or viruses without the owner’s knowledge or awareness.

To avoid the heartache (and significant loss of valuable business data) of having your web site being hacked into, we have listed below 10 essential and effective security measures that will help to protect your WordPress site from brute force botnet attacks.

Note

Note: A few of the recommended measures below need some technical understanding of how to modify core WordPress and/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 – Get In Touch With Your Host

Get in touch with your hosting service provider and ask them what security systems have been put into place to help prevent your site from brute-force attacks, and what they are doing to ensure that your WordPress sites are being regularly backed up.

It is important to check that your web host is backing up your sites and that, if disaster strikes, you can quickly and easily get your files back.

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

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

A full WordPress maintenance routine ensures that:

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

A full WordPress maintenance routine looks like this …

Maintaining your WP web site completely backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress website or blog frequently backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

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

If you don’t want to perform manual backups, there are a number of free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Duplicate & Keep Your WP Websites And Blogs Protected With Backup Creator Plugin For WordPress

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

The mass brute force botnet attack on WordPress sites was mostly an attempt to compromise website administrator panels and gain access to the site by exploiting WordPress sites using “admin” as their user name.

For security reasons, never set up sites with the username admin. This is the first thing hackers will test. If your blog’s user name is “admin”, then change it immediately.

We have created a step-by-step tutorial for non-technical WordPress admin users on how to change your login username here: How To Change Your Admin Username In WordPress To A More Secure User Name

Security Measure #4 – Choose A Strong Password

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

Unless you put some measure in place to block the brute-force attack from happening (see further below for a couple of effective ways to do this), the “bot” will just persist in attacking your site until it eventually breaks into your admin area.

Passwords that are easy to guess, therefore, are 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, combined with “special” characters (^%$#&@*).

Tip

Roboform is a password program that lets you create secure passwords …

Roboform is a password tool you can use to generate secure login passwords(Roboform is a password management program that lets you easily generate different strong passwords)

For a tutorial created especially for WordPress users that shows you how to change your password, go here: How To Reset Your WordPress Password

Security Measure #5 – Prevent Your wp-config.php File From Being Accessed

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

WP Config file

(WP Config file)

If hackers break into your WordPress website, they will typically look for 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 – Rename Or Delete Unnecessary WP Installation Files

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

You can remove these files after installation. If you don’t want to delete these files, then just rename them.

Security Measure #7 – Keep Your WordPress Site, Themes And Plugins Up-To-Date

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WP Theme Editor Menu

(The WordPress theme editor is accessible using the main menu)

The WordPress theme editor lets anyone accessing your site see and edit all of your theme template files, and cause mayhem on your site.

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 – Secure The WordPress Uploads Folder

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

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

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

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

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers, this could become a serious threat to the security of your site.

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

Security Measure #10 – Security Plugins

Several security plugins for WordPress are available that specifically address common security issues WordPress website owners face, such as preventing unauthorized users from accessing your site, protecting your files from botnets, preventing unauthorized file uploads, etc.

Many WordPress plugins address some but not all areas of WordPress security. One WordPress plugin that does a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your site files and causing damage to your site is SecureScanPro.

SecureScanPro - complete security plugin for WordPress

(SecureScanPro – complete security plugin for WordPress)

SecureScanPro is easy to install and easy to use, and takes care of most of the security issues that WordPress users need to address.

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

Blog Defender Security Product Suite

Blog Defender Security Suite For WordPress Websites & Blogs(Blog Defender Security Solution For WordPress)

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

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

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

Blog DefenderIf you don’t want to invest in a 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 essential maintenance tasks like ensuring that your WP installation, WordPress plugins and themes are kept 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, website security is something you cannot ignore.

As a final reminder of the importance of website security, below is the advice given by a security expert to all WordPress users following the large-scale 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, WordPress security is very important 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 via email when we publish new tutorials on WordPress security and tutorials about WordPress security plugins and solutions.

***

"Learning WordPress has been a huge stumbling block for me. I've been looking for something that covers absolutely everything but doesn't cost an arm and a leg. Thank you so much ... you have just provided me with what I have been looking for! Truly appreciated!" - Tanya

***

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