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 is frequently the target of malicious attacks by hackers.

In early 2013, WordPress installations around the world were subjected to a worldwide brute-force attack.

These attacks were caused by botnets (computer networks infected with malware and programmed to attack other sites with security vulnerabilities).

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)

One of the many ways hackers use to try and break into WordPress sites is by trying to guess the site admin’s login username and password. This can be done using software tools and scripts that automatically tries to guess hundreds of login combinations 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” attack.

What Is A Botnet?

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 infected with malicious software, which can then be controlled remotely as a group, typically without the computer owners even being aware that this is taking place in their device.

Botnets are typically used to blast mass spam emails.

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

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

(ZeuS is a botnet that has been actively compromising computer networks all around the globe since 2009. Image: 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 mass brute force attacks then continued, with over 30,000 WordPress blogs being hacked every day.

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

WordPress is often the target of malicious attacks by hackers

(WordPress powers millions of websites around the world, making it a frequent target for hacking attacks)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

We explain why WordPress is a secure platform for websites in this article: Is WordPress Secure? What Every Business Owner Needs To Know About WordPress Security

Info

It’s important to note that, in the case of the large-scale brute-force botnet attack described above, there was actually no WordPress vulnerability being exploited (the same script was also attacking sites built using other web applications like Joomla).

Mike Little, the co-founder of WordPress with Matt Mullenweg, made this comment 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)

How To Protect Your WordPress Site From Brute Force Attacks – 10 Security Measures

You may think that your website provides little to no value to hackers, but the reality is that all websites have value to a malicious user.

If a malicious user can exploit a way to gain control of your website or blog, that website can then be used as a “bot” to attack larger and more valued web sites.

Additional undesirable impacts of having your site hacked include being blacklisted by search engines, having stealthy spam links promoting things like gambling, porn, etc. inserted in your content, redirecting visitors to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasty things.

The reality is that brute-force software bots are most likely searching for security weaknesses and trying to hack into your website or blog as you are reading this page at this very moment. Whether they can get into your site successfully depends on how hard you have made it for hackers or bots to continue persisting until they work out how to get in, or decide to look for a less protected target.

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

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

Website Security Scan(Hackertarget – WP Security Scan Product image source: https://hackertarget.com/wordpress-security-scan)

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

Hackertarget - Website Security Check

(Hackertarget – WordPress security check results. 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, then so can hackers.

WordPress Security Scan(Product image 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 can all be potentially useful information to hackers, as this informs them about potentially exploitable security weaknesses, especially where site owners haven’t updated their software versions.

If your site or blog is powered by WordPress and you’re not taking steps to harden your site, we can practically guarantee that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically targeting WordPress sites worldwide!

Typically, whenever a website or blog is compromised, webmasters will find themselves “locked out” of their own site, or notice that their files have been modified or even that their content has been completely wiped out. Often, sites will become infected with malicious software without the owner even being aware that a breach has taken place.

To help avoid the heartache and frustration of having your site being hacked into, we have listed below 10 essential and effective security measures that will help to prevent your WordPress site from being brute-force attacked.

Useful Information

Note: A few of the recommended steps 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 file code, then ask your web host or a professional WordPress technical provider for assistance.

***

Security Measure #1 – Contact Your Host

Get in touch with your webhosting provider and ask them what security systems have been put in place to help prevent your site from botnet attacks, and what they are doing to make sure that your site files are being backed up.

Make sure that your hosting company backs up your server files and that, if anything goes wrong, you can quickly and easily get your site back.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Site Regularly Maintained

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

A full WordPress maintenance routine ensures that:

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

A proper WordPress site maintenance routine looks like this …

Maintaining your WordPress installation frequently backed up and updated is vitally important for WordPress security.(Maintaining your WP installation frequently backed up and updated is vitally important for WordPress security. Screenshot image: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WP web site 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 WP maintenance yourself, pay a professional to do it but make sure it gets done. Backing up your site is the second most important thing you should do after making sure that your heart is still beating!

If you don’t want to perform manual backups, there are many 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 Plugin For WP

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

The brute force attack on WordPress sites was mostly attempting to compromise site admin panels and gain access to the site by exploiting sites using “admin” as their user name.

For website security reasons, avoid installing WordPress sites with the username admin. This is the first area of potential vulnerability hackers will test. If your site’s username is “admin”, you will need to change it immediately.

We have created a simple tutorial that shows you how to change your WordPress username here: Changing Your Admin Username In WordPress

Security Measure #4 – Make Sure Your Password Is Hard To Guess

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

Unless you put some measure in place to block the brute force attack (see further below for a couple of simple and effective suggestions for doing this), the “bot” will just continue attacking your site until it eventually gets access.

Weak passwords, therefore, are really easy targets for brute-force attacks. Make sure that you change your password to a string that is at least eight or nine characters long, with upper and lowercase letters, combined with “special” characters (^%$#&@*).

Tip

Roboform is a password tool you can use to create different unbreakable passwords …

Roboform is a password management tool you can use to help you generate different strong login passwords(Roboform is a password management software you can use to help you generate really secure passwords)

We have created a detailed step-by-step tutorial that shows you how to change your admin password here: Changing The Login Password

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 WordPress options.

wp-config.php

(wp-config.php file)

If hackers break into your website, they will typically look for 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 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 – Rename Or Delete Unnecessary Installation Files

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

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

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

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

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

Security Measure #8 – Disable The Theme Editor

WordPress comes with a built-in editor feature that lets site administrators edit plugin and theme code inside the dashboard area.

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

WP Theme Editor Menu

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

This allows anyone accessing your site’s admin area to view and change your WordPress theme template files, and cause mayhem on your site.

To prevent unauthorized 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 – Protect The Site’s Uploads Directory

The “uploads” directory stores all the media that gets uploaded to your website.

Normally, this folder is visible to online users. All a person needs to do to view all of the contents in your “uploads” directory is navigate to your directory using their web browser …

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

(WordPress uploads folder)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, anyone could upload unauthorized file types or compromise the security of your site.

Protecting your directories will prevent online users 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 an empty file called “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone who knows what they are doing if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

Some great security plugins for WordPress are available that specifically address most common security issues faced by WordPress site owners, such as preventing hackers 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 plugin that does 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 - WP complete security software solution

(SecureScanPro – WordPress complete security plugin)

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

Another plugin you may want to consider using is BlogDefender.

Blog Defender

Blog Defender(Blog Defender Security Solution For WordPress Websites & Blogs)

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

BlogDefender scans you website for security vulnerabilities …

Blog Defender Security Suite For WordPress WebsitesAnd then shows you how to fix these quickly …

Blog DefenderIf you don’t want to buy a 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 very secure web platform, but neglecting simple maintenance tasks like updating your WordPress software, plugins and themes, 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 cannot afford to ignore the importance of securing your website.

As a final reminder, below is the advice given by an expert on website security to all WordPress users after the worldwide 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 provided you with the initial steps you need to take 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 technical provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to be notified via email whenever we publish new information on WordPress security and tutorials about new security plugins and solutions.

***

"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org

***

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