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.

WP SecurityWordPress powers millions of websites around the world, making it a frequent target for hackers.

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

These attacks were caused by botnets (computer networks infected with malware and programmed to attack other sites).

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)

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 achieve this, hackers use software programs that automatically tries to guess hundreds of login possibilities in minutes.

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

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

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

Botnets are normally used used to blast 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 compromising computer networks all around the world since 2009 …

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 globe since 2009. Screenshot image: SecureList.com)

These were highly distributed and well organized attacks. Over 90,000 IP addresses were identified by several hosting companies in the initial attack alone, when millions of attempts to force their way into WordPress users admin areas occurred. The mass attack then continued, with over 30,000 WordPress blogs being hacked per day.

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

Powering millions of websites and blogs around the world makes WordPress a target for attempted hacking attacks

(WordPress powers millions of websites around the world, which makes it a frequent target for attempted 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 about the security of your online presence.

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

Info

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, made this comment 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)

How To Protect Your WordPress Website From Brute Force Attacks – Ten Security Points

Every site with a vulnerability provides an opportunity to hackers. No website or blog is completely immune from being attacked by hackers. Business web sites, personal blogs, government web sites … even web sites owned by web security experts can and have been targeted.

If someone can exploit a flaw in your web security and gain complete control of your site, that web site can then be used as a “bot” in a planned cyber-attack against larger and more valued sites.

Additional undesirable consequences of having your site hacked include getting blacklisted by Google, having stealthy spam links advertising things like gambling, porn, etc. in your content and page title and descriptions, malicious redirects to phishing sites and other websites, drive-by downloads (adding malware on your visitors’ computers), and many other nasty things.

The truth is that software-driven bots are very likely looking for exploits and trying to break into your site at this very moment. Whether they can get into your site successfully will depend on how hard or easy you will make things for them to keep persisting until they work out a way to get access, or give up and go look for an easier target.

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

If you visit Hackertarget.com and run your website through their WordPress security scan …

Hackertarget - Website Security Check(Website Security Check Screenshot: Hackertarget.com)

You will see that the check will yield a number of results and information about your site setup …

Hackertarget - WordPress Security Check

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

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

Hackertarget - WP Security Scan(Screenshot source: Blog Defender)

The ability 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 on your server are all potentially valuable information to hackers, as these can inform them about any potential holes or weaknesses, especially in older versions.

If your website runs on WordPress and you are not taking appropriate steps to harden your site, it’s practically guaranteed that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically targeting WordPress sites worldwide!

Typically, whenever a site gets broken into, blog owners will discover much to their dismay that they have been “locked out” of their own site, or notice that their content has been modified or even entirely wiped out. Typically, most sites will be infected with malicious software or viruses without the owner even being aware that this has occurred.

To avoid the heartache and frustration that comes with discovering that your website has been hacked into, below are ten simple, yet essential and effective security checks that will help to protect your WordPress site from being attacked by brute force hackers.

Important Info

Note: A few of the recommended steps below require some technical skills to modify core WordPress and/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 a professional WordPress technical provider for help.

***

Security Measure #1 – Get In Touch With Your Host

Contact your webhosting service and ask them exactly what security precautions have been put in place to protect your site from being attacked, and what is done to make sure that your files and data are being regularly backed up.

Make sure that your web host backs up your sites and that, if anything happens, you can easily get back your site.

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

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

A full WordPress maintenance routine ensures that:

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

A complete WP maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important maintaining your WP website or blog frequently backed up and updated 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 don’t want to learn how to do WordPress maintenance yourself, pay a professional to do it but make sure it gets done. Backing up your website is the next most important thing you should do after making sure that your heart is still beating!

If you don’t want to back up your files manually, there are a number of plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Back Up, Duplicate & Protect Your WordPress Site With Backup Creator Plugin For WordPress

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

The mass brute-force botnet attack on WordPress sites was mostly attempting to compromise website administrator panels and gain access to sites by exploiting sites with “admin” as their 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”, then change it immediately.

For a tutorial created especially for admin users on how to change your admin username, go here: How To Change Your WordPress User Name From Admin To A Different Username

Security Measure #4 – Change Your Password

A “brute force” attack occurs when malicious software persistently hits a username and password field with different character strings in an attempt to guess the right combination that will give the hacker entry to your site.

Unless some measure is put into 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 continue attacking your site until it eventually gets access.

Passwords that are easy to guess, therefore, are very easy targets for hacking attacks. Make sure that you change your password combination to something that is at least eight characters long, with upper and lowercase letters, combined with a few “special” characters (e.g. ^, $, @, etc).

Useful Tip

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

Roboform is a password management software you can use to help you generate secure passwords(You can use a password management program like Roboform to help you generate really secure passwords)

We have created a simple step-by-step tutorial that shows you how to change your admin password here: What To Do If You Need To Change Your Password

Security Measure #5 – Prevent The wp-config.php File From Being Easily Visible

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

(wp-config.php)

If a hacker breaks into your website, they will typically search for your wp-config.php file, because this is the file that 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 being attacked and even being used as part of a bot net, therefore, you must 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 – Rename Or Delete Unnecessary Website Installation Files

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

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

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

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

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

Security Measure #8 – Disable The Theme Editor

WordPress comes with a built-in editor that allows the administrator to edit plugin and theme files from the dashboard.

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

WP Theme Editor Menu

(The WordPress theme editor can be accessed using the WP main menu)

This allows anyone accessing your blog’s admin to view and modify your WordPress files, or cause 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 – Remove Access To The WordPress Uploads Directory

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

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

(WordPress uploads directory)

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

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, this can seriously threaten 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 blank file called “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

There are some great WordPress security plugins available that will address common security issues faced by WordPress website owners, such as preventing hackers from accessing vital areas of your site, protecting your files from malicious scripts, preventing injections of code into files, etc.

Most 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 - WP security software solution

(SecureScanPro – WordPress total security software solution)

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

Another great security plugin you may want to consider using is BlogDefender.

Blog Defender Security Plugin For WordPress Websites

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

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

BlogDefender scans you WordPress installation for security weaknesses …

Blog DefenderAnd then shows you how to quickly and easily fix these …

Blog Defender Security Product SuiteIf you don’t want to buy a 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 secure web platform, but neglecting essential maintenance tasks like making sure that your WordPress software, plugins and WordPress themes are kept updated to their latest versions, tightening file and data security and taking other necessary precautions can expose your website to malicious 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, web security is something you simply cannot afford to ignore.

As one last reminder, below is the advice given by an expert on website security to all WordPress users following the worldwide 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, 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 WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified whenever we publish new articles and tutorials on WordPress security and reviews of new security plugins.

***

"This is AMAZING! I had learnt about how to use WordPress previously, but this covers absolutely everything and more!! Incredible value! Thank you!" - Monique, Warrior Forum

***