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 SecurityWhen you are the most popular CMS platform in the world and the preferred online publishing platform for millions of websites and loved by thousands of web developers and web designers, it’s inevitable that at some point in time, WordPress will become a prime target for attacks by hackers wanting to score a “big win”.

In early 2013 a large-scale brute force attack began hitting WordPress installations on virtually every web host in existence around the world.

These attacks were caused by botnets (computers 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 – 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)

There are many methods hackers use to try and break into WordPress sites. One of these is by trying to guess the site admin’s login username and password. This can be achieved with software programs that can guess hundreds of login possibilities in minutes.

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

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.org)

A “Botnet” is a network of computers that have been infected with malicious code or scripts, which can then be controlled remotely as a group, often without the computer owners’ knowledge or awareness.

Botnets are regularly used to send out mass spam emails from the infected computers of unsuspecting users.

Below is a screenshot 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 …

The Zeus botnet has been actively compromising computer networks all around the globe since 2009.

(The Zeus botnet has been actively infecting computer networks all around the world since 2009. Screenshot image: SecureList.com)

The botnet attacks were well organized and highly distributed. Over 90,000 IP addresses were identified by a number of webhosting companies in the initial attack alone, when millions of attempts to force their way into WordPress user admin areas took place. The brute force attacks continued after this, with over 30,000 WordPress sites being hacked every day.

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

WordPress is the world's most used content management system which makes it a natural target for attacks by hackers

(WordPress is frequently the target of large-scale malicious attacks by hackers, due to its global popularity)

Does This Mean We Shouldn’t Use WordPress Anymore?

No. In fact, there are lots of great reasons why you should choose WordPress if you are concerned about website security.

We explain what makes WordPress a very secure platform for websites in this article: How Secure Is WordPress? What Every Blog Owner Needs To Know

Info

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

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

Every web site with a vulnerability presents an opportunity to hackers. No site is safe from cyber-attacks. Large, medium and small websites, personal blogs, government web sites … even websites owned by web security experts can and have been targeted.

If hackers can exploit a security vulnerability in your system and gain stealth control of your web site, your website can then be employed as a “bot” to attack other valuable websites.

Additional undesirable impacts of having your site hacked and your site security compromised include getting blacklisted by Google, having spammy links advertising things like viagra, porn, etc. inserted in your content and meta data, malicious redirects to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasties.

The reality is that hackers are most likely trying to hack into your blog while you are reading this article. Whether they can hack into your site or not, will depend on how difficult or easy you can make it for them to continue persisting until they work out a way to get access, or are forced to decide to look for a less protected target.

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

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

Website Security Scan(Hackertarget – Website Security Scan Screenshot source: Hackertarget.com)

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

WordPress Security Check

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

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

WP Security Check(Screenshot source: BlogDefender.com)

Being able to see what 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 on your server can all be valuable information to hackers, as this can inform them about potential vulnerabilities, especially in older versions.

If your website runs on WordPress and you’re not taking steps to bolster the security of your site, then we can practically guarantee that, at some point in time, someone will attempt to hack your site, because these brute force attacks are systematically hitting WordPress installations worldwide!

Typically, when a site is compromised, blog owners will find themselves “locked out” of their own site, or notice that their files have been vandalized or even that their content has been completely wiped out. Often, sites will become infected with malicious software without the owner’s knowledge or awareness.

To avoid the heartache and frustration that comes with having your website or blog being hacked into, we have listed below ten essential and effective security checks that will help to protect your WordPress site from being attacked by brute-force botnet hacking attempts.

Useful Information

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

***

Security Measure #1 – Get In Touch With Your Webhosting Company

Contact your hosting service and ask them exactly what security measures have been put in place to protect your site from being attacked, and what they are doing to ensure that your WordPress sites get backed up.

Check that your hosting service regularly backs up your sites and that, if disaster strikes, you can easily get back your site.

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

You should never rely only on your web host for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this done for you and develop a habit of performing a full WordPress site maintenance routine on a regular basis (e.g. daily, weekly, monthly, etc …)

A complete WordPress maintenance routine ensures that:

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

A full WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important maintaining your WP web site 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 or blog. If you do not want to learn how to do WordPress site maintenance yourself, get someone else to do it but make sure it gets done. Backing up your site is the next 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 WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Clone And Protect Your WP Web Site With Backup Creator Plugin For WP

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

The mass brute force attack on WordPress is mostly an attempt to compromise site admin panels and gain access to the site by exploiting WP sites that used “admin” as the user name.

For security purposes, don’t set up sites with the username “admin”. This is the first thing hackers will test. If your site’s username is “admin”, then change it immediately.

We have created a simple step-by-step tutorial on how to change your WordPress admin username here: Changing Your Admin User Name In WordPress To A More Secure Username

Security Measure #4 – Use Strong Passwords

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

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

Weak passwords, therefore, become 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, with both upper and lowercase letters, and add 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 program like Roboform …

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

For a detailed step-by-step tutorial that shows you how to change your admin password, go here: What To Do If You Need To Reset Login 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 options for WordPress.

WordPress WP Config file

(wp-config.php file)

If a hacker breaks into your site, they will search for the 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, 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 – Delete Or Rename Unnecessary WordPress Installation Files

Rename or delete the install.php, upgrade.php and readme.html files from your server.

These files are completely unnecessary after installation and can be deleted. If you don’t want to remove these files, then just rename them.

Security Measure #7 – Update Your WordPress Site, Plugins And Themes To Their Latest Version

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

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

Security Measure #8 – Disable Your Theme Editor

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

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

WordPress Theme Editor Menu

(The WordPress theme editor can be accessed via the WP admin menu)

The WordPress theme feature lets anyone accessing your site’s admin area view and modify your WordPress theme 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 – Prevent Access To Your WordPress Uploads Directory

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

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

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

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

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, this could compromise the security of your website.

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 who knows what they are doing if you are not sure about what to do.

Security Measure #10 – Security Plugins

Some great security plugins for WordPress are available that specifically address most common security issues WordPress website owners face, such as preventing hackers from accessing your site, protecting your files from malicious software, preventing unauthorized file uploads, etc.

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

SecureScanPro - total security software for WordPress

(SecureScanPro – security software solution for WordPress)

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

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

Blog Defender Security Product Suite For WordPress

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

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

BlogDefender shows you where the security holes in your website are …

Blog Defender WordPress Security SolutionAnd lets you easily fix these …

Blog Defender Security Solution For WordPress Websites & BlogsIf you don’t want to purchase 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 very secure platform, but neglecting essential maintenance tasks like ensuring that your WP core files, plugins and WordPress themes are kept updated to their latest versions, tightening file and data security 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, you simply cannot afford to ignore the importance of website security.

As one last reminder, below is the advice given by an expert on web security to all WordPress users following the mass brute force attacks on WordPress in April 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 very important if you run a WordPress site. Hopefully, the information in 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 seek help from a professional WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

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

***

"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)

***