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 is often the target of attacks by hackers.

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

These attacks were caused by networks of infected computers programmed to attack other computers (called “botnets”).

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

Brute Force Attacks – An Overview

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 use to try and break into a WordPress site is by trying to guess the site admin’s login username and password. To achieve this, hackers use scripts and tools that can guess hundreds of possible login combinations in minutes.

If you’re using weak login details, your website can be easily hacked by repeated attempts to guess 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.org)

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, typically without the computer owners even being aware that this is going on.

Botnets are normally used used to send 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 a botnet that has been actively compromising computer networks all around the world since 2009 called “Zeus” …

ZeuS is a botnet that has been actively compromising computer networks all around the globe since 2009.

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

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

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

WordPress is often the target of malicious attacks by hackers

(Powering millions of websites worldwide makes WordPress a target for malicious attempts by 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 website security.

To learn why WordPress is a secure web platform, read this article: Why WordPress Is A Secure Platform For Websites –

Useful Info

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

Mike Little, one of the co-founders 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)

How To Prevent Your WordPress Website From Being Brute Force Attacked – 10 Security Points

You may think that your site is of little value to hackers, but the reality is that every website has some value to a malicious user.

If a hacker can find a way to break in and take over your site, your website can then be employed as a “bot” to attack more highly-valued websites.

Additional undesirable consequences of having your site hacked and your site security compromised include being blacklisted by Google, having spammy links advertising things like gambling, cheap offers on brand names, etc. in your content and page title and descriptions, malicious redirects to phishing sites, drive-by downloads (adding malware on your visitors’ computers), and many other nasties.

The truth is that hackers are looking for weaknesses and trying to break into your site as you are reading this page. Whether they can break in successfully will depend on how difficult you can make things for hackers and botnets to continue trying until they work out a way to break in, or decide to look for a less protected target.

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

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

Hackertarget - WP Security Scan(Hackertarget – Website Security Check Screenshot image: Hackertarget.com)

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

Hackertarget - Website Security Check

(Hackertarget – WP security scan results. Image source: Hackertarget.com)

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

Website Security Scan(Product image: BlogDefender.com)

The ability 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 on your server can be potentially useful information to hackers, as this can inform them about potentially exploitable security vulnerabilities, especially where the owners haven’t updated their files.

If your site or blog is powered by WordPress and you are not taking 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 worldwide!

Whenever a website or blog is compromised, site owners can find themselves completely “locked out” of their own site, or notice that their files have been interfered with or even that their content has been entirely wiped out. Often, sites will be infected with malicious scripts without the owner even being aware that a breach has taken place.

To avoid the heartache and aggravation of discovering that your website or blog has been hacked into, we have listed below 10 simple, yet essential and effective security checks that will help to protect your WordPress site from being attacked by brute-force botnets.

Disclaimer

Note: A few of the steps below need some technical skills to modify core WordPress or server files. If you have no web coding skills, or don’t want to mess around with file code, then ask your web host or search for a professional WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Host

Contact your host and ask them what security precautions have been put in place to help prevent your site from being attacked, and what is done to ensure that your site files get backed up.

Make sure that your hosting service is regularly backing up your sites and that, if anything should happen, you can easily get your files and data back.

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

Never rely only on your webhosting provider for your site backups. Instead, learn how to manage your WordPress site or get this service done for you and maintain a habit of religiously performing a complete WordPress site maintenance routine frequently (e.g. weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

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

A full WP maintenance routine looks like this …

Maintaining your WP installation fully backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress web site backed up and up-to-date is vitally important for WordPress security. Screenshot: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WordPress website or blog backed up and updated. WP 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 WordPress maintenance yourself, pay a professional to do it but make sure this gets done. Backing up your site 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 plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate And Keep Your WordPress Sites Protected With Backup Creator WP Plugin

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

The brute-force botnet attack on WordPress is mostly an attempt to compromise site admin panels by exploiting WordPress installations with “admin” as their account name.

For security purposes, avoid installing sites with the username admin. This is the first area hackers will test. If your site’s username is admin, you need to change it immediately.

We have created a simple step-by-step tutorial that shows you how to change your username here: Changing Your WP Admin User Name To A Different Username

Security Measure #4 – Change Your Password

A “brute force” attack occurs when malicious software continually tries to guess the right password and username character string that will give them access to your website.

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

Weak passwords, therefore, are really easy targets for bot attacks. Make sure that you change your password to something that is at least 8 characters long, and that includes upper and lowercase letters, and “special” characters (^%$#&@*).

Tip

Roboform is a password management software you can use to help you generate secure passwords …

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

We have created a tutorial on how to change your admin password here: Changing Your Password

Security Measure #5 – Prevent Access To Your wp-config.php File

The wp-config.php file contains information about your blog’s database 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 try to access your wp-config.php file, because this file contains important information about your site’s database, 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.

In order to protect your WordPress site from attacks and even being used as part of a bot net, therefore, prevent people from accessing 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 your install.php, upgrade.php and readme.html files.

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

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

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the main menu)

This means that anyone logging into your blog’s admin can view and edit your WP theme template files, or cause havoc 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 Your WordPress Uploads Directory

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

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

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

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

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

Protecting your directories will prevent unauthorized people 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 unsure about what to do.

Security Measure #10 – WordPress Security Plugins

There are a number of great WordPress security plugins available that will address common security issues faced by WordPress site owners, such as preventing hackers from accessing vital areas of your site, protecting your website from brute-force attacks, preventing unauthorized file uploads, etc.

Many 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 potential issues that could lead to hackers accessing your site files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WordPress total security software solution

(SecureScanPro – security software solution for WordPress)

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

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

Blog Defender WordPress Security Suite

Blog Defender WordPress Security Plugin(Blog Defender Security Plugin)

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

BlogDefender scans you website for potential security holes …

Blog DefenderAnd then shows you how to quickly fix these …

Blog Defender Security Product Suite For WordPressIf you don’t want to invest in a premium 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 installation, plugins and WP themes, tightening file and data security and taking other necessary precautions can have disastrous consequences.

No matter what type of business you run or plan to run online and how small you think your web presence is, website security is something you simply cannot ignore.

As one last reminder, below is the advice given by an expert on website security 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 of the utmost importance if you run a WordPress site. Hopefully, this article will help prevent brute force attacks on your WordPress site. 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.

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

***

"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.