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.

WordPress SecurityBeing the world’s most popular CMS makes WordPress an obvious target for hackers.

In April 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 viruses and programmed to attack other installations with security vulnerabilities).

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

What Are 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 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 software tools and scripts that can work through hundreds of login permutations in minutes.

If you’re using predictable usernames and passwords, your site could be an easy target for hacking attempts.

This is called a “brute-force” login attack.

Botnet Definition

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)

”Botnets” are networks of computers that have been compromised and infected with malicious code, which are then controlled remotely as a group, typically without the computer owners’ knowledge.

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

The screenshot below was taken from a site that monitors online security 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 infecting 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. Source: SecureList.com)

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

News of this brute-force attack was widely reported in all of 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 the world's most used content management system which makes it an obvious target for malicious attempts by hackers

(WordPress is often the target of mass malicious attacks by hackers)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

To learn what makes WordPress a very secure platform for websites, read this article: Why WordPress Is A Secure Platform For Websites –

Important Info

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

Mike Little, the co-founder of WordPress with Matt Mullenweg, said this 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 Prevent Your WordPress Blog From Brute-Force Attacks – Ten Security Points

Every website or blog with a vulnerability offers some value to hackers. A vulnerable site provides malicious users with a resource for launching distributed attacks, spreading malware and engaging in information theft.

If someone can find a way to gain remote control of your web site, your website or blog can then be employed to attack larger and more highly-valued web sites.

Additional undesirable impacts of having your site hacked and your site security compromised include being blacklisted by Google, having spammy links promoting things like gambling, discounted fashion, etc. inserted into your content and page title and descriptions, redirecting visitors to phishing sites or other websites, drive-by downloads (adding malicious software on your visitors’ computers), and many other nasty things.

The harsh reality is that malicious bots are probably trying to hack into your website at this very moment. Whether they can achieve this or not, will depend on how hard you can make things for hackers to continue trying until they either discover how to get access, or are forced to give up and decide to look for a more vulnerable target.

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

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

Hackertarget - Website Security Check(WP Security Check Image source: Hackertarget.com)

You will see that the check will return a number of results and details about your WordPress setup …

Hackertarget - WP Security Check

(WP security scan results. Product image source: Hackertarget.com)

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

WP Security Check(Image source: BlogDefender site)

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 can all be valuable information to hackers, as this informs them about any potential security vulnerabilities, especially where the owners haven’t updated their software versions.

If your site or blog is powered by WordPress and you’re not taking appropriate steps to bullet-proof your site, we can practically guarantee that, at some point in time, someone will attempt to hack your installation, because these attacks are systematically hitting WordPress sites all the world!

When a website gets broken into, website owners can find themselves completely “locked out” of their own site, or notice that their files have been interfered with or that everything has been entirely wiped out. Typically, most compromised sites will be infected with malicious software or viruses without the owner’s knowledge or awareness.

To avoid the heartache of discovering that your web site has been hacked into, we have listed below ten simple, yet essential and effective security measures that will help to prevent your WordPress site from being attacked by brute force botnets.

Info

Note: Some of the recommended measures listed below require some technical understanding of how to modify core WordPress and server files. If you are not technical-minded, or don’t want to mess around with code on your site, then ask your web host or search for a professional WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Web Host

Get in touch with your hosting company and ask them what systems have been put in place to help prevent your site from being attacked, and what is done to make sure that your server files and data are being backed up.

It’s important to check that your webhosting service provider backs up your server files and that, if anything should happen, you can quickly and easily get back your site.

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

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

A full WordPress maintenance routine ensures that:

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

A full WordPress site maintenance routine looks like this …

Maintaining your WP website regularly 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 image: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WP website or blog backed up and up-to-date. 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 maintenance yourself, get someone else to do it but make sure this gets done. Backing up your site is the second most important thing you should 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 WordPress plugins you can use. You can read about a WordPress backup plugin that can automate your site backups here: Back Up, Copy And Protect Your WP Web Site With Backup Creator WordPress Plugin

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

The brute force botnet attack on WordPress is mostly attempting to compromise site admin panels by exploiting installations using “admin” as their username.

For website security reasons, don’t install WordPress sites with the username “admin”. This is the first thing hackers will test. If your blog’s username is “admin”, then make sure you change this immediately.

We have created a detailed step-by-step tutorial on how to change your username here: How To Change Your Admin Username In WordPress To A Different Username

Security Measure #4 – Change Your Password

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

Unless some measure is put into place to stop the brute force attack from happening (see further below for a couple of effective suggestions for doing this), the “bot” will just continue attacking your site until it eventually “cracks” the code.

Weak passwords, therefore, make very easy targets for attacks. Make sure that you change your password to something that contains at least 8 characters long, and that includes upper and lowercase letters, combined with “special” characters (e.g. %, #, &, etc).

Practical Tip

You can use a password management software tool like Roboform to generate hard-to-crack passwords …

You can use a password tool like Roboform to generate unguessable passwords(You can use a password software tool like Roboform to help you generate unbreakable passwords)

For a detailed tutorial created especially for non-technical WordPress admin users on how to change your password, go here: What To Do If You Need To Reset Your WordPress Password

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

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

WordPress WP Config file

(WP Config file)

If hackers break into your site, they will look for your wp-config.php file, because this is the file that contains your database details, 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 – Delete Or Rename Unnecessary Blog Installation Files

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

These files are not required after installation. If you don’t want to delete these files, just rename them.

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

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

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

Security Measure #8 – Disable Your Theme Editor

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

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 using the WordPress main menu)

This allows anyone accessing your site’s admin area to view and modify your files, or cause havoc on your site.

If you want to prevent people from accessing your 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 – Remove Access To The Site’s Uploads Folder

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

Normally, this folder is visible to online users. All someone has to do to view the contents in the “uploads” folder is navigate to your directory using a web browser …

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

(WordPress uploads folder)

If any directories in your website have vulnerabilities that can be exploited by hackers or malicious users, anyone could upload unauthorized file types or compromise the security of 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 a file with nothing in it named “index.php”) to your uploads directory, and so on. Again, it’s best to hire a professional if you are not sure about what to do.

Security Measure #10 – Install WordPress Security Plugins

There are a number of great WordPress security plugins available that will address most common security issues WordPress site owners face, such as preventing hackers from gaining access to vital areas of your site, protecting your site from botnets, preventing unauthorized file uploads, etc.

Many WordPress plugins address some but not all areas of WordPress security. One WordPress security plugin that seems to do a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your files and causing damage to your site is SecureScanPro.

SecureScanPro - total security plugin for WordPress

(SecureScanPro – WP total security software solution)

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 consider using is BlogDefender.

Blog Defender Security Solution

Blog Defender Security Plugin(Blog Defender WordPress Security Suite)

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

BlogDefender shows you where potential security holes in your WordPress site are …

Blog Defender Security SolutionAnd then shows you how to easily fix these …

Blog DefenderIf 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 platform, but neglecting simple maintenance tasks like keeping your WP core files, WP plugins and themes up-to-date, tightening file and data protection and taking other necessary precautions can expose your website to malicious by hackers and bots.

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

As a final reminder, below is the advice given by an expert on web security to all WordPress users after the global brute force attacks by botnets 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 of the utmost importance if you run a WordPress site. Hopefully, the above 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 WordPress technical provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to receive notifications when we publish new tutorials on WordPress security and reviews of new WordPress security plugins and solutions.

***

"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

***