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 SecurityPowering millions of sites around the world makes WordPress an obvious target for hacking attacks.

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

These attacks were caused by botnets (infected computer networks 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. This is achieved using scripts and software that automatically tries to guess hundreds of possible logins in minutes.

If you’re using obvious usernames and passwords, your website can be an easy target for hacking attempts.

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)

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, typically without the computer owners even being aware that this is taking place.

Botnets are normally used used to blast mass spam emails from the infected computers of compromised user accounts.

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

ZeuS is a botnet that has been actively infecting computer networks all around the globe since 2009.

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

These were well organized and highly distributed 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 users administration areas. The worldwide attack continued after this, with over 30,000 WordPress sites and blogs being hacked each day.

News of this mass brute force attack was widely reported in all the major webhosting companies, as well as the leading technology publications, such as Forbes, TechNews Daily, PC Magazine, BBC News, 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 frequent target for hacking attacks

(WordPress is often the target of worldwide attacks by hackers, due to its global popularity)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are many very good reasons why you should choose WordPress if you are concerned about the security of your online business.

To learn what makes WordPress a very secure platform for websites, see this article: WordPress Security What Every Website Owner Needs To Know About WordPress Security

Important

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

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

Preventing Your WordPress Blog From Being Brute-Force Attacked – 10 Security Measures

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

If someone can discover a way to compromise the control of your website or blog, that website can then be employed as a “bot” to attack more valued websites.

Additional undesirable impacts of having your website hacked include being blacklisted by search engines, having spammy links advertising things like casinos, discounted fashion, etc. inserted into your content, redirecting visitors to phishing sites, drive-by downloads (adding malicious scripts on your visitors’ computers), and lots of other nasty things.

The harsh reality is that brute-force software bots are very likely trying to break into your site as you are reading this right now. Whether they will achieve this or not, will depend on how difficult or easy you can make things for them to continue persisting until they work out a way to get access, or give up and go look for a less protected target.

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

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

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

You will see that the scan returns a number of results and information about your site …

WordPress Security Scan

(Hackertarget – website security scan results. Source: Hackertarget.com)

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

WP Security Check(Product image source: Blog Defender)

Being able 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 be valuable information to hackers, as this can inform them about any security weaknesses, especially where the owners haven’t updated their sites.

If your site or blog is powered by WordPress and you are not precautionary steps to toughen up your site, then it’s practically guaranteed that, at some point, your site will be hacked, or at least targeted by bots, because these attacks are systematically targeting WordPress installations around the world!

Whenever a site gets broken into, webmasters can find themselves “locked out” of their own site, or notice that their content has been modified or even entirely wiped out. Often, most compromised sites will become infected with malicious software without the owner even being aware that this has occurred.

To avoid the heartache and frustration (and potential loss of valuable business data) that comes with having your website being hacked into, we have listed below 10 essential and effective security checks that will help to protect your WordPress site from being brute force attacked.

Note

Note: A few of the recommended measures below require some technical skills to modify core WordPress and/or server files. If you lack these technical skills, 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 Host

Get in touch with your hosting provider and ask them exactly what systems they offer to help prevent your site from being attacked, and what is done to make sure that your files and data are regularly being backed up.

Make sure that your hosting company is regularly backing up your sites and that, if anything should happen, you can easily get back your files and data.

Security Measure #2 – Perform Regular WordPress Backups And Keep Your Site Frequently Maintained

You should never rely only 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 maintain a habit of performing a full WordPress site maintenance routine on a regular basis (e.g. weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

  • All unnecessary files and data 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 WP site maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WP website or blog frequently backed up and up-to-date is. WordPress 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 don’t 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 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 files manually, there are many plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Back Up, Clone And Protect Your WordPress Sites With Backup Creator WordPress Plugin

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

the worldwide brute-force attack on WordPress is mostly an attempt to compromise site administrator panels by exploiting WordPress installations using “admin” as the username.

For website security purposes, don’t 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 change it immediately.

For a step-by-step tutorial created especially for non-technical WordPress admin users on how to change your admin username, go here: Changing Your Admin Username In WordPress

Security Measure #4 – Change Your Password

A “brute force” attack occurs when malicious software persistently hits a login or password field with different strings of characters trying to guess the right combination that will give them entry to your site.

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

Passwords that are easy to guess, therefore, make very easy targets for botnets. Make sure that you change your password to a string that contains at least 8 or 9 characters long, with both upper and lowercase letters, and add a few “special” characters (%^#$@&*).

Practical Tip

You can use a password management tool like Roboform to create hard-to-guess passwords …

You can use a password management program like Roboform to help you generate hard-to-guess passwords(You can use a password management software tool like Roboform to help you generate passwords)

We have created a step-by-step tutorial created especially for non-technical WordPress admin users on how to change your admin password here: How To Reset Your Password In WordPress

Security Measure #5 – Prevent The wp-config.php File From Being Found

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 file)

If a hacker breaks into your WordPress site, 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.

To protect your WordPress site from attacks and even being used as part of a bot net, therefore, prevent your wp-config.php file from being easily accessed. 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

Delete or rename 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 remove these files, then just rename them.

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

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

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

Security Measure #8 – Disable Your Theme Editor

WordPress comes with a built-in editor that allows administrators to edit plugin and theme files inside the dashboard.

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

WordPress Theme Editor Menu

(The WordPress theme editor can be accessed using the WP main menu)

This allows anyone accessing your site’s admin to see and edit all of your theme 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 editing your wp-config.php file.

Security Measure #9 – Remove Access To The WordPress Uploads Folder

The “uploads” directory contains all the media files that get uploaded to your website.

By default, this folder is visible to anyone online. All a person needs to do to view the contents stored in your “uploads” directory is navigate to your directory using their web browser …

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

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

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, this could become a serious threat to the security of your site.

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 for assistance from someone with experience if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

There are a number of WordPress security plugins available that specifically address most common security issues WordPress site owners face, such as preventing hackers from accessing your site, protecting your files from malicious software, preventing injections of code into files, etc.

Most WordPress plugins address some but not all areas of WordPress security. One security 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 - WP complete security software

(SecureScanPro – WordPress complete security software)

SecureScanPro is easy to install and easy to use, and does a great job of addressing most of the security issues that WordPress users need to address.

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

Blog Defender Security Plugin For WordPress Blogs

Blog Defender Security Solution For WordPress(Blog Defender)

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

BlogDefender scans you web site for security vulnerabilities …

Blog Defender Security Product SuiteAnd lets you fix these quickly …

Blog DefenderIf you don’t want to buy a security plugin like SecureScanPro or BlogDefender, you can use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting basic maintenance tasks like making sure that your WP installation, WordPress plugins and WordPress themes are kept up-to-date, tightening file and data security and taking other necessary precautions can expose your site to attacks 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, web security is something you cannot afford to ignore.

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 by botnets 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 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 WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications when we publish new tips on WordPress security and reviews of new WordPress security plugins.

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***

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