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 often the target of attacks by hackers, due to its popularity.

In early 2013 a worldwide brute force attack hit WordPress installations across almost every web host in existence.

These attacks were caused by botnets (computer networks infected with viruses and programmed to attack other computers with security vulnerabilities).

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

Brute Force Attacks – Definition

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. This can be done with scripts and software that can work through hundreds of login combinations in minutes.

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

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)

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

Botnets are normally used used to send mass spam emails.

The screenshot below was taken from a site that monitors online security showing the locations of the command centers of ZeuS – a botnet that has been actively infecting computer networks all around the globe since 2009 …

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

These were highly distributed and well organized botnet attacks on WordPress. Over 90,000 IP addresses were identified by a number of hosting companies just in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress users admin areas. The mass attack continued after this, with over 30,000 WordPress blogs being hacked each day.

News of this worldwide brute force attack was reported by all the major webhosting companiesand leading technology 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 is often the target of attacks by hackers, due to its popularity

(WordPress is the world’s most used content management system making it an obvious target for attempted attacks by malicious users)

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 use WordPress if you are concerned about website security.

We explain what makes WordPress a very secure platform for websites in this article: WordPress Security What Every Business Owner Needs To Know About WordPress Security

Important Info

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, made this comment 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 Site From Brute Force Attacks – Ten Security Checks

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

If someone can exploit a way to remotely take control of your blog, your website can then be used as a “bot” to attack larger and more valuable websites.

Additional undesirable results of having your website hacked include being blacklisted by Google, having spammy links promoting things like viagra, porn, etc. inserted into your content and meta data, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasty things.

The reality is that malicious bots are probably trying to break into your website at this very moment. Whether they will get into your site successfully or not, will depend on how difficult or easy you have made things for them to keep trying until they can work out a way to get in, or are forced to give up and decide to look for a more vulnerable target.

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

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

WP Security Check(Hackertarget – WordPress Security Check Image source: https://hackertarget.com/wordpress-security-scan)

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

WordPress Security Scan

(WP security scan results. Product image: Hackertarget.com)

It should be obvious after using the scanning tool that if you are able to see all of this information about your website, hackers can too.

Website Security Scan(Screenshot source: BlogDefender website)

Being able to see which version of WordPress you are using, which plugins and themes you have installed, and which files have been uploaded to certain directories are all potentially valuable information to hackers, as this informs them about any potential holes or weaknesses, especially in older versions.

If your site or blog runs on WordPress and you are not taking steps to bullet-proof your site, we can practically guarantee that, at some time in the near future, someone will attempt to hack your installation, because these brute-force attacks are systematically hitting WordPress sites worldwide!

Whenever a site is broken into, site owners will find themselves “locked out” of their own site, or notice that their files have been modified or even that their content has been entirely wiped out. Typically, most compromised sites will become infected with malicious software or viruses without the owner even being aware that this has occurred.

To avoid the heartache (and potential financial loss) that comes with having your website or blog being hacked into, below are 10 essential and effective security measures that will help to protect your WordPress site from botnet attacks.

Useful Info

Note: Some of the measures below require some technical skills to modify core WordPress or server files. If you have no web skills, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Host

Get in touch with your host and ask them what measures are in place to protect your site from brute-force attacks, and what is done to ensure that your server files and data are being backed up.

Make sure that your host is regularly backing up your sites and that, if disaster strikes, you can easily get back your files and data.

Security Measure #2 – Perform Regular WordPress Backups And Keep Your Site Regularly Up-To-Date

Never rely on your hosting provider for site backups. Instead, learn how to maintain and manage your WordPress site or get this service done for you and maintain a habit of religiously performing a complete site maintenance routine on a regular basis (e.g. daily, weekly, fortnightly, 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 plugins, themes and software components are up-to-date,
  • etc …

A proper WP site 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 WP installation completely backed up and updated is vitally important for WordPress security. Screenshot source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WP web site regularly backed up and updated. WordPress 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 WordPress site maintenance yourself, pay someone to do it but make sure it gets done. Backing up your site is the second most important thing you must do after making sure that your heart is still beating!

If you don’t want to back up your data manually, there are many plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate & Protect Your WP Sites 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 an attempt to compromise site admin panels by exploiting sites using “admin” as their account name.

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

For a simple tutorial for WordPress admin users on how to change your username, go here: How To Change Your Admin Username In WordPress

Security Measure #4 – Make Sure Your Password Is Hard To Guess

A “brute force” attack occurs when malicious software persistently hits a login or password field with different strings of characters in an attempt to guess the right combination that will unlock your website.

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

Weak passwords, therefore, become really easy targets for hacking attacks. Make sure that you change your password to a string that contains at least 8 characters long, and that includes upper and lowercase letters, combined with “special” characters (%^#$@&*).

Useful Tip

Roboform is a password management tool that lets you create secure login passwords …

You can use a password tool like Roboform to generate hard-to-guess passwords(You can use a password management program like Roboform to create passwords)

We have created a step-by-step tutorial for WordPress admin users on how to change your WordPress password here: Changing Passwords In WordPress

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 WordPress options.

WordPress WP Config file

(WP Config file)

If a hacker breaks into your site, they will normally search for your wp-config.php file, because this is the file that contains your WordPress database details, 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 accessible. 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 WP Installation Files

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

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

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

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

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress comes with a built-in editor feature that allows you to edit theme and plugin code inside the dashboard area.

In WordPress, you can access the WordPress Theme Editor by selecting Appearance > Editor in the dashboard menu …

WP Theme Editor Menu

(Accessing the WordPress theme editor via the WordPress dashboard menu)

The WordPress theme editor lets anyone accessing your site view and modify your WP theme templates, and cause mayhem on your site.

To prevent people from accessing your 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 Site’s Uploads Folder

The “uploads” folder stores all the media that gets uploaded to your site.

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

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

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

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, anyone could upload unauthorized file types or compromise 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, 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 ask help from someone with experience if you are not sure about what to do.

Security Measure #10 – Security Plugins

A number of great WordPress security plugins are available that will address many common security issues faced by WordPress site owners, such as preventing unauthorized users from accessing your site, protecting your site from botnets, preventing injections of code into files, etc.

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

SecureScanPro - security software for WordPress

(SecureScanPro – WP total security software)

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

Blog Defender Security Plugin For WordPress Web Sites

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

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

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

Blog DefenderAnd then shows you how to fix these quickly …

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

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting basic maintenance tasks like keeping your WordPress software, plugins and WordPress themes updated to their latest versions, tightening file and data protection 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 sites is something you simply cannot afford to ignore.

As one last reminder, below is the advice given by a security expert to all WordPress users following the global 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 of the utmost importance if you run a WordPress site. Hopefully, the information in this article has provided you with the initial guidelines and help you need to keep your WordPress site protected from brute-force attacks. If you need any further help or assistance with WordPress security, please consult a professional WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified whenever we publish new information on WordPress security and tutorials about new security plugins and solutions.

***

"I have used the tutorials to teach all of my clients and it has probably never been so easy for everyone to learn WordPress ... Now I don't need to buy all these very expensive video courses that often don't deliver what they promise." - Stefan Wendt, Internet Marketing Success Group

***

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