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 SecurityPowering millions of websites and blogs around the world makes WordPress an obvious target for hackers.

In early 2013 a global brute force attack hit WordPress installations across almost every WP host server in existence.

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

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

Brute Force Attacks – Definition

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

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

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

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/botnet)

”Botnets” are networks of computers that have been compromised and infected with malicious scripts or code, which are then controlled remotely as a group, often without the unsuspecting computer owners even being aware that this is taking place.

Botnets are often used to send mass spam emails.

The screenshot below was 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 world since 2009 …

ZeuS is 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. Screenshot image: SecureList.com)

These were highly distributed and well organized botnet attacks on WordPress sites. Over 90,000 IP addresses were identified by several hosting companies just in the initial attack, when millions of attempts to force their way into WordPress site admin areas occurred. The worldwide attack continued after this, with over 30,000 WordPress sites and blogs being hacked per day.

Coverage of this brute-force botnet attack was widely reported in 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 …

Powering millions of sites around the world makes WordPress a target for hacking attacks

(WordPress is the world’s most used content management system which makes 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 use WordPress if you are concerned about the security of your online presence.

We explain why WordPress is a secure web platform in this article: Is WordPress Secure?

Important

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

Mike Little, the co-founder of WordPress with Matt Mullenweg, 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 Prevent Your WordPress Blog From Being Brute Force Attacked – 10 Security Checks

You may think that the information in your website or blog offers little to no value to hackers, but the reality is that every website has value to a malicious user.

If a malicious user can find a way to break in and gain remote access and control of your website or blog, your site can then be employed to target larger and more highly-valued web sites.

Additional undesirable effects of having your website hacked and your site security compromised include getting blacklisted by search engines, having stealthy spam links advertising things like gambling, discounted fashion, etc. inserted in your content and meta data, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasty things.

The reality is that software-driven bots are very likely trying to hack into your website as you are reading this. Whether they can break in successfully depends on how challenging you have made things for them to keep persisting until they can either work out how to get in, or give up and decide to look for a less secure target.

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

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

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

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

WordPress Security Check

(WP security scan results. Source: Hackertarget.com)

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

WP Security Check(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 on your server can all be valuable information to hackers, as this informs them about any security vulnerabilities, especially where site owners haven’t updated their software versions.

If your site or blog is driven by WordPress and you are not taking steps to bolster the security of your site, then it’s practically guaranteed that, at some point, someone will attempt to hack your site, because these brute-force attacks are systematically targeting WordPress sites worldwide!

When a site is hacked, webmasters can discover much to their dismay that they have been “locked out” of their own site, or notice that their content has been altered or even entirely wiped out. Often, sites will be infected with malicious scripts without the owner’s knowledge or awareness.

To help avoid the heartache and frustration (and potential loss of valuable business data) that comes with discovering that your site has been hacked into, we have listed below ten simple, yet essential and effective security measures that will help to protect your WordPress site from being brute-force attacked.

Info

Note: Some of the steps listed below need some technical skills to modify core WordPress and/or server files. If you are not technical, or don’t want to mess around with file code, then ask your web host or search for a WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Host

Get in touch with your webhosting service and ask them exactly what security precautions they have put into place to help prevent your site from being attacked, and what is done to make sure that your server files and data get backed up.

Make sure that your hosting provider backs up your sites and that, if disaster strikes, you can quickly and easily get your files back.

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

You should never rely only on your webhosting provider for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this done for you and maintain a habit of religiously performing a full site maintenance routine frequently (e.g. daily, weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

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

A full WP 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 backed up and updated is vitally important for WordPress security. Image: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WordPress installation completely 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 don’t want to learn how to do WordPress maintenance yourself, get someone else 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 you are still breathing!

If you don’t want to perform manual backups, there are a number of WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Backup, Clone & Keep Your WordPress Websites Protected With Backup Creator Plugin For WordPress

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

The large scale brute force attack on WordPress sites was mostly an attempt to compromise website admin panels by exploiting sites using “admin” as their username.

For security purposes, avoid installing sites with the username admin. This is the first thing hackers will test. If your site’s username is “admin”, then change this immediately.

We have created a simple step-by-step tutorial that shows you how to change your WordPress username here: Changing Your WP Username From Admin To Another Username

Security Measure #4 – Change Your Password

A “brute force” attack occurs when malicious software continually and persistently tries to guess the right username and password character string that will give them access to your website.

Unless some measure is put into 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 gets access.

Passwords that are easy to guess, therefore, make very easy targets for hacking attacks. Make sure that you change your password to a string containing at least eight or nine characters long, and that includes upper and lowercase letters, and add a few “special” characters (%^#$@&*).

Useful Tip

Roboform is a password software that lets you create strong login passwords …

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

We have created a simple step-by-step tutorial on how to change your admin password here: Changing Your Password

Security Measure #5 – Secure Your wp-config.php File

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

wp-config.php file

(WP Config file)

If hackers break into your website, they will typically search for 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 attacks and even being used as part of a bot net, therefore, you must prevent your wp-config.php file from being easily 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 WP 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 Software, Plugins & Themes Up-To-Date

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

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

WP Theme Editor Menu

(The WordPress theme editor is accessible using the WP admin menu)

This means that anyone logging into your blog can see and modify your WP theme templates, and create havoc on your site.

If you want to prevent people from being able to access 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 – Secure Your WordPress Uploads Folder

The WordPress “uploads” folder contains all the media that gets uploaded to your site.

By default, this folder is visible to online users. All a person needs to do to view all of the contents stored in your site’s “uploads” directory is navigate to your directory using a web browser …

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

(WordPress uploads folder)

If any files stored in his folder have vulnerabilities that can be exploited by hackers, someone 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 a file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to hire a professional if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

Some great WordPress security plugins are available that will address many common security issues faced by WordPress site owners, such as preventing hackers from accessing your site, protecting your website from malicious scripts, preventing injections of code into files, etc.

Many WordPress plugins address some but not all areas of WordPress security. One WordPress 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 irreparable damage to your site is SecureScanPro.

SecureScanPro - total security plugin for WordPress

(SecureScanPro – total security software solution for WordPress)

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

Another plugin you may want to consider using is BlogDefender.

Blog Defender Security Suite

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

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

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

Blog Defender Security Product SuiteAnd lets you fix these quickly and easily …

Blog DefenderIf you don’t want to invest in a security plugin like SecureScanPro or BlogDefender, then use various free WordPress 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 up-to-date, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

No matter what 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 securing your web sites.

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

Also, please subscribe to WPCompendium.org to receive notifications whenever we publish new articles on WordPress security and reviews of WordPress security plugins.

***

"This is AMAZING! I had learnt about how to use WordPress previously, but this covers absolutely everything and more!! Incredible value! Thank you!" - Monique, Warrior Forum

***

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