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 sites worldwide, which makes it a frequent target for hacking attacks.

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

These attacks were caused by botnets (networks of infected computers programmed to attack other sites with security vulnerabilities).

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. This is done with software programs and scripts that automatically tries to guess hundreds of possible logins in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be easily hacked by persistent attempts to work out your site’s login details.

This is called a “brute force” attack.

Botnets – What Are They?

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)

”Botnets” are networks of computers that have been compromised and infected with malicious software, which can then be controlled remotely as a group, often without the computer owners even being aware that this is going on.

Botnets are typically used to send out mass spam emails from computers of unsuspecting users.

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 compromising computer networks all around the globe since 2009 …

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

These were highly distributed and well organized botnet attacks. Over 90,000 IP addresses were identified by several webhosting companies in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress user admin areas. The worldwide attack then continued, with over 30,000 WordPress sites and blogs being hacked every day.

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

Being the world's most used content management system makes WordPress an obvious target for hacking

(Being the world’s most used CMS makes WordPress a target for hacking)

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

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

We explain what makes WordPress a very secure web platform in this article: Is WordPress Secure?

Important Info

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

Mike Little, the co-founder of WordPress, 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)

Preventing Your WordPress Site From Being Brute-Force Attacked – Ten Security Points

Every web site with a vulnerability has some degree of value to hackers. No website or blog is guaranteed immunity from being attacked by hackers. Corporate websites, personal blogs, government sites … even web sites owned by online security experts can and have been targeted.

If hackers can find a flaw in the system, that website or blog can then be employed as a “bot” in a planned cyberattack against more valuable web sites.

Additional undesirable results of having your site hacked and your site security compromised include getting blacklisted by search engines, having spammy links advertising things like online meds, porn, etc. in your content and page title and descriptions, redirecting visitors to phishing sites, drive-by downloads (adding malicious software on your visitors’ computers), and many other nasties.

The reality is that malicious bots are most likely looking for vulnerabilities and trying to break into your blog while you are reading this page right now. Whether they can achieve this or not, depends on how challenging you have made it for hackers to keep persisting until they find how to get access, or give up and go look for a less protected target.

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

If you visit a site like Hackertarget.com and run your site through their WordPress security check …

Hackertarget - WordPress Security Check(WP Security Check Screenshot source: Hackertarget.com)

You will see that the check returns various results and information about your WordPress site …

Hackertarget - WordPress Security Scan

(Hackertarget – WordPress security check results. Image source: Hackertarget.com)

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

WP Security Check(Screenshot image: BlogDefender website)

Being able to see which 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 are all potentially useful information to hackers, as these can inform them about potentially exploitable security weaknesses, especially in older versions.

If your site or blog is powered by WordPress and you are not proactive steps to bolster the security of your site, then it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your website, because these brute-force attacks are systematically hitting WordPress installations all the world!

When a site gets 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 interfered with or even that their content has been completely wiped out. Often, most compromised sites will be infected with malicious scripts without the owner’s knowledge or awareness.

To help avoid the heartache (and potential financial loss) that comes with discovering that your website or blog has been hacked into, we have listed below ten essential and effective security measures that will help to protect your WordPress site from brute force attacks.

Important Info

Note: Some of the recommended measures listed below require some technical skills to modify core WordPress and 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 technical provider for help.

***

Security Measure #1 – Get In Touch With Your Hosting Provider

Get in touch with your web host and ask them what security systems have been put in place to protect your site from being attacked, and what they do to ensure that your server files get regularly backed up.

Make sure that your hosting company backs up your server files and that, if disaster strikes, you can easily get back your site.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Website Or Blog Frequently Updated

You should never rely just on your host for your site backups. Instead, learn how to maintain your WordPress site or pay someone to get this done for you and develop a habit of performing a full site maintenance routine frequently (e.g. weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

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

A proper WordPress maintenance routine looks like this …

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

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

If you don’t want to back up your site manually, there are a number of plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Clone And Protect Your WordPress Sites With Backup Creator WP Plugin

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

The large scale brute force attack on WordPress sites was mostly an attempt to compromise site administrator panels and gain access to sites by exploiting installations that used “admin” as their account name.

For security reasons, never set up WordPress sites with the username admin. This is the first thing hackers will test. If your site’s user name is “admin”, you need to change this immediately.

For a tutorial on how to change your username, go here: Changing Your Admin Username In WordPress To A Different Username

Security Measure #4 – Your Password

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

Unless you put some measure in 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 works out the combination.

Weak passwords, therefore, make very easy targets for brute force attacks. Make sure that you change your password combination to something containing at least 8 or 9 characters long, and that includes upper and lowercase letters, and “special” characters (%^#$@&*).

Tip

Roboform is a password management program that lets you generate different secure passwords …

Roboform is a password software you can use to help you generate secure login passwords(You can use a password tool like Roboform to generate strong passwords)

For a simple tutorial created especially for non-technical WordPress users on how to change your WordPress password, go here: How To Reset Your Password In WordPress

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

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

wp-config.php

(wp-config.php)

If hackers break into your website, they will normally try to access the wp-config.php file, because this is the file that 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.

In order to protect your WordPress site from being attacked and even being used as part of a bot net, therefore, prevent people getting to 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 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, just rename them.

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

Hackers look for vulnerabilities in earlier versions of WordPress that they can exploit, including out-of-date versions of WP plugins and themes.

Ensure that all of your WordPress software 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 lets site administrators edit plugin and theme files inside the dashboard.

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

WP Theme Editor Menu

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

The WordPress theme editor allows anyone accessing your site to view and edit your WP theme templates, and cause mayhem on your site.

To prevent people from being able to access your WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Secure Your WordPress Uploads Folder

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

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

(WordPress uploads folder)

(WordPress uploads directory)

If any directories in your website have vulnerabilities that can be exploited by malicious users, someone can upload unauthorized file types to your site.

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 an empty file called “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are unsure about what to do.

Security Measure #10 – Security Plugins

There are several WordPress security plugins available that will address many common security issues WordPress website owners face, such as preventing unauthorized users from accessing your site, protecting your website from malicious scripts, preventing unauthorized file uploads, etc.

Many WordPress plugins address some but not all areas of WordPress security. One WordPress 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 - complete security plugin for WordPress

(SecureScanPro – WordPress total security software solution)

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

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

Blog Defender Security Plugin

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

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

BlogDefender scans you website for security holes …

Blog DefenderAnd lets you easily fix these …

Blog Defender WordPress Security Product SuiteIf you don’t want to purchase a premium 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 secure web platform, but neglecting basic maintenance tasks like updating your WordPress software, WordPress plugins and themes, tightening file and data security and taking other necessary precautions can expose your website 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, you cannot ignore the importance of securing your websites.

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 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 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 consult a professional WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

Also, do yourself a favor and subscribe to WPCompendium.org to receive notifications when we publish new tutorials on WordPress security and tutorials about new WordPress security plugins and solutions.

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***