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 often comes under attack by hackers.

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

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

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

About 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. This can be done using scripts and software that can guess hundreds of login permutations in minutes.

If you’re not using strong usernames or unguessable passwords, your site can be an easy target for hackers.

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

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

Botnets are regularly used to send out 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 …

ZeuS is a botnet that 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. Screenshot image: SecureList.com)

The ongoing botnet attacks on WordPress sites were highly distributed and well organized. Over 90,000 IP addresses were identified by a number of hosting companies in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress user admin areas. The large-scale attack then continued, with over 30,000 WordPress sites and blogs being hacked per day.

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

Being the world's most popular content management system makes WordPress a target for malicious attacks by hackers

(WordPress powers millions of websites around the world, which makes it a frequent target for hacking attempts)

Does This Mean WordPress Is Not Secure And We Should Stop Using It?

No. In fact, there are many good reasons why you should choose WordPress if you are concerned at all about the security of your website.

To learn what makes WordPress a very secure web platform, see this article: How Secure Is 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 attacking sites built using other platforms like Joomla).

Mike Little, the co-founder of WordPress with Matt Mullenweg, made the following 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 Blog From Brute-Force Attacks – 10 Security Checks

Every website with a security vulnerability can be seen as a potential opportunity to hackers. A compromised website presents hackers with a valuable platform to launch denial of service attacks, spread malware and use your website to defraud innocent people.

If a malicious user can access and gain remote access of your website, your website or blog can then be employed as a “bot” to attack other valued websites.

Additional undesirable effects of having your website hacked include getting blacklisted by search engines, having stealthy spam links advertising things like casinos, porn, etc. in your content, malicious redirects to phishing sites or other websites, drive-by downloads (adding malicious software on your visitors’ computers), and many other nasties.

The truth is that malicious bots are very likely trying to hack into your web site at this very moment. Whether they will successfully get in depends on how difficult you will make things for them to continue trying until they can discover a way to get in, or give up and decide to look for a less secure target.

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

Do you own a WordPress site? If so, visit Hackertarget.com and run your website through their WordPress security scan …

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

You will see that the check returns a number of results and details about your site …

Hackertarget - WordPress Security Scan

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

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

Hackertarget - WP Security Check(Screenshot source: 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 in your site can be potentially useful information to hackers, as this informs them about any exploitable vulnerabilities, especially where site owners haven’t updated their sites.

If your site or blog is driven by WordPress and you are not taking steps to harden your site, then 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 targeting WordPress installations all the world!

Typically, whenever a website or blog is compromised, site owners 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 that everything has been entirely wiped out. Typically, most sites will become infected with malicious scripts without the owner even being aware that this has taken place.

To avoid the heartache (and significant loss of valuable business data) of discovering that your website has been hacked into, we have listed below 10 simple, yet essential and effective security measures that will help to protect your WordPress site from brute-force botnet attacks.

Important

Note: Some of the recommended steps below require 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 technical provider for help.

***

Security Measure #1 – Contact Your Host

Contact your webhosting company and ask them exactly what security measures they offer to help prevent your site from being attacked, and what they do to ensure that your server files and data are being backed up.

It’s important to check that your webhosting provider regularly backs up your sites and that, if disaster strikes, you can easily recover your site.

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

Never rely just on your webhosting company 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 performing a full WordPress site maintenance routine on a regular 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 WordPress plugins, themes and software components are up-to-date,
  • etc …

A proper WordPress maintenance routine looks like this …

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

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

If you don’t want to perform manual backups, there are a number of plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Back Up, Duplicate & Protect Your WP Web Sites With Backup Creator WordPress Plugin

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

The large scale brute force attack on WordPress sites was mostly an attempt to compromise website administrator panels by exploiting WordPress installations that used “admin” as their username.

For security purposes, avoid installing WordPress sites with the username “admin”. This is the first thing hackers will test. If your site’s username is admin, change it immediately.

For a step-by-step tutorial that shows you how to change your username, go here: How To Change Your WordPress User Name From Admin To A More Secure User Name

Security Measure #4 – Make Sure Your Password Is Strong

A “brute force” attack occurs when a malicious script persistently hits a username and password field with different strings of characters in an attempt to guess the right login combination that will give the hacker access to your website.

Unless some measure is put into place to block 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 to attack your site until it eventually works out the combination.

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

Useful Tip

You can use a password software tool like Roboform to generate very secure passwords …

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

For a detailed step-by-step tutorial created especially for WordPress admin users that shows you how to change your WordPress admin password, go here: What To Do If You Need To Change Your WordPress Password

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

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 a hacker breaks into your website, they will normally look for 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 someone 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 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 Installation Files

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

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

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

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

Ensure that all of your WordPress 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 you to edit theme and plugin files from the dashboard area.

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

WP Theme Editor Menu

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

The WordPress theme editor allows anyone accessing your blog to see and edit all of your WP theme templates, or cause 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 – Protect The WordPress Uploads Directory

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

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

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

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

If any files stored in his folder have vulnerabilities that can be exploited by malicious users, this can become a serious threat to the security of your website.

Protecting your directories will prevent unauthorized people from accessing 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 blank file named “index.php”) to your uploads directory, and so on. Again, it’s best to consult a professional if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

A number of security plugins for WordPress are available that specifically address most common security issues faced by WordPress website owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your site from malicious software, preventing injections of code into files, 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 issues that could lead to hackers accessing your files and causing damage to your site is SecureScanPro.

SecureScanPro - security software solution for WordPress

(SecureScanPro – total security plugin for WordPress)

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

Blog Defender

Blog Defender Security Suite For WordPress Blogs(Blog Defender Security Plugin)

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

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

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

Blog Defender Security Plugin For WordPress BlogsIf you don’t want to buy a premium security plugin like SecureScanPro or BlogDefender, then use various free WP 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 updating your WordPress installation, plugins and WP themes, tightening file and data security and taking other necessary precautions can expose your site to attacks by hackers and bots.

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

As one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on web security to all WordPress users following the large-scale brute force attacks by botnets 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 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 seek help from 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 tips on WordPress security and tutorials about WordPress security plugins.

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***

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