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 SecurityWordPress often is targeted by hackers.

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

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

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 WordPress sites. One of these is by trying to guess the site’s administration login username and password. This can be done using scripts and tools that can work through hundreds of possible logins in minutes.

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

This is called a “brute-force” login 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)

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’ knowledge.

Botnets are regularly used to blast out mass spam emails.

Below is a screenshot taken from a site that monitors online security showing the locations of the command centers of a botnet that has been actively infecting computer networks all around the world since 2009 called “Zeus” …

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

(The Zeus botnet has been actively infecting computer networks all around the globe since 2009. Image source: SecureList.com)

These botnet attacks were well organized and highly distributed. Over 90,000 IP addresses were identified by several hosting companies in the initial attack, when millions of attempts to force their way into WordPress user admin areas took place. The mass brute force attacks then continued, with over 30,000 WordPress sites being hacked each day.

News of this brute force botnet attack was reported by all the major webhosting companiesand leading technology media 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 …

WordPress powers millions of websites worldwide, making it an obvious target for hackers

(Being the world’s most popular content management system makes WordPress a target for hackers)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are lots of very good reasons why you should continue using WordPress if you are concerned at all about the security of your online presence.

To understand why WordPress is a secure web platform, read this article: Are Open Source Web Platforms Like WordPress Secure?

Info

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

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

Preventing Your WordPress Website From Brute Force Attacks – 10 Security Measures

You may think that your website or blog has no significant value to hackers, but the reality is that to a hacker, every website is an opportunity to profit or benefit at your expense.

If hackers can exploit a vulnerability and remotely take control of your site, your site can then be employed as part of a larger network of “bots” to target larger and more highly-valued websites.

Additional undesirable effects of having your website hacked include being blacklisted by Google, having stealthy spam links advertising things like casinos, porn, etc. inserted in your content and page title and descriptions, malicious redirects to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasty things.

The truth is that hackers are probably searching for vulnerabilities and trying to hack into your blog at this very moment. Whether they can achieve this will depend on how difficult or easy you have made things for them to keep persisting until they can work out a way to break in, or decide to look for a less protected target.

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

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

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

You will see that the test returns various results and information about your website setup …

Hackertarget - Website Security Check

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

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

Hackertarget - WP Security Check(Image source: BlogDefender website)

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 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 precautionary steps to harden your site, we can practically guarantee that, at some point in time, someone will attempt to hack your installation, because these attacks are systematically targeting WordPress sites around the world!

Whenever a site is broken into, webmasters can find themselves completely “locked out” of their own site, or notice that their files have been interfered with or even entirely wiped out. Typically, most sites will be infected with malicious scripts or viruses without the owner even being aware that this has taken place.

To help avoid the heartache of discovering that your website has been hacked into, below are 10 simple, yet essential and effective security checks that will help to prevent your WordPress site from being brute-force attacked.

Useful Information

Note: Some of the measures shown 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 service provider for help.

***

Security Measure #1 – Contact Your Hosting Service Provider

Get in touch with your webhosting company and ask them what security systems they have put into place to protect your site from brute force attacks, and what they do to ensure that your WordPress sites get regularly backed up.

Check that your webhosting provider regularly backs up your server files and that, if disaster strikes, you can quickly and easily recover your site.

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

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

A complete WordPress maintenance routine ensures that:

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

A full WordPress site maintenance routine looks like this …

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

Again, we cannot stress enough how important it is to maintain your WP installation completely backed up and up-to-date. WordPress site maintenance is not hard or time-consuming, but it must be done to ensure the security of your website or blog. If you don’t want to learn how to do WP site maintenance yourself, get someone else to do it but make sure it gets done. Backing up your website is the next most important thing you must 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 free and paid plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Backup, Clone And Keep Your WP Websites Protected With Backup Creator WP Plugin

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

The brute-force attack on WordPress sites was mostly attempting to compromise website admin panels by exploiting WordPress installations that used “admin” as their user name.

For reasons of website security, never set up sites with the username admin. This is the first area of potential vulnerability hackers will test. If your blog’s user name is “admin”, then make sure you change it immediately.

For a detailed step-by-step tutorial that shows you how to change your login username, go here: Changing Your WP Admin Username To Another Username

Security Measure #4 – Your Password

A “brute force” attack occurs when a malicious script continually and persistently tries to guess the right password and username 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 keep attacking your site until it eventually “cracks” the code.

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

Practical Tip

You can use a password program like Roboform to generate unbreakable passwords …

You can use a password software tool like Roboform to help you generate hard-to-guess passwords(Roboform is a password management software that lets you easily create different passwords)

For a simple step-by-step tutorial created especially for WordPress admin users that shows you how to change your WordPress admin password, go here: How To Change Your Password In WordPress

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

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.

wp-config.php

(wp-config.php file)

If a hacker breaks into your WordPress website, they will normally try to access your 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 them 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, you must 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 Installation Files

Delete or rename 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, just rename them.

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

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

Make sure to always keep your application files, themes, plugins, etc. up-to-date.

Security Measure #8 – Disable Your Theme Editor

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

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

WP Theme Editor Menu

(Accessing the WordPress theme editor using the main menu)

The WordPress theme editor lets anyone accessing your blog see and edit all of your theme files, and create 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 – Secure The Site’s Uploads Directory

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

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

(WordPress uploads folder)

(WordPress uploads folder)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, anyone 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, adding a blank index.php file (this is literally a blank file called “index.php”) to your uploads directory, and so on. Again, it’s best to get professional help if you are not sure about what to do.

Security Measure #10 – Security Plugins

Several WordPress security plugins are available that will address many common security issues faced by WordPress site owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your site from malicious exploits, preventing unauthorized file uploads, etc.

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

SecureScanPro - WordPress total security software

(SecureScanPro – WordPress security software)

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

Blog Defender Security Plugin For WordPress

Blog Defender(Blog Defender)

Blog Defender 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 DefenderAnd then shows you how to fix these quickly, easily and inexpensively …

Blog Defender Security 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 web platform, but neglecting essential maintenance tasks like keeping your WP software, plugins and themes updated to their latest versions, tightening file and data security and taking other necessary precautions can have disastrous consequences.

Regardless of the type of business you run or plan to run online and how small you think your web presence is, you simply cannot ignore the importance of securing your site.

As a final reminder of the importance of website security, below is the advice given by a website security expert to all WordPress users after 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, WordPress security is very important if you run a WordPress site. Hopefully, the information in this article has shown you what to do to prevent brute force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please consult a WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

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

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***