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 powers millions of sites around the world, making it an obvious target for hackers.

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

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

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

Brute Force Attacks – An Overview

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 will attempt to break into a WordPress site is by trying to guess the site’s administration login username and password. This can be achieved using software programs that can work through hundreds of possible logins in minutes.

If you’re using weak usernames and passwords, your site could be easily hacked by persistent attempts to work out your site’s login details.

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

Botnets – What Are They?

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.org)

A “Botnet” is a network of private computers that have been infected with malicious scripts or software code, which are then controlled remotely as a group, typically without the computer owners’ knowledge or awareness.

Botnets are typically used to blast mass spam emails.

The screenshot below was taken from an internet security monitoring site 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 compromising computer networks all around the globe since 2009.

(ZeuS is a botnet that has been actively compromising computer networks all around the world since 2009. Screenshot source: SecureList.com)

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

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

Powering millions of websites worldwide makes WordPress a target for hackers

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

Does This Mean WordPress Is Not Secure And We Should Stop Using It?

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

We explain what makes WordPress a very secure platform for websites in this article: Is WordPress A Secure Platform For Websites?

Important

It’s important to understand that, in the case of the worldwide brute-force attack described above, there was no WordPress vulnerability being exploited (the same script was also targeting sites built using other web 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)

How To Prevent Your WordPress Website From Brute-Force Attacks – 10 Security Points

You may think that your website or blog has nothing to offer to hackers, but the reality is that all websites have some value to a malicious user.

If a hacker can exploit a vulnerability, your website or blog can then be employed to attack more valued sites.

Additional undesirable results of having your site hacked and your site security compromised include getting blacklisted by search engines, having stealthy spam links promoting things like viagra, porn, etc. inserted into your content and meta data, redirecting visitors to phishing sites and other websites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasty things.

The reality is that malicious bots are very likely searching for weaknesses and trying to break into your blog while you are reading this article. Whether they can break into your site depends on how challenging you can make things for them to continue trying until they either can discover how to get in, or give up and go look for a less protected target.

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

If you visit a site like Hackertarget.com and run your website through their WordPress security scan …

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

You will see that the scan returns various results and details about your site …

Hackertarget - WP Security Check

(WordPress security check results. Image source: Hackertarget.com)

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

Hackertarget - Website Security Check(Screenshot source: BlogDefender.com)

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 in your site can be potentially valuable information to hackers, as this informs them about potential security weaknesses, especially where site owners haven’t updated their files.

If your site or blog runs on WordPress and you’re not proactive steps to bolster the security of your site, then it’s practically guaranteed that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically hitting WordPress installations around the world!

When a site gets compromised, webmasters will find themselves completely “locked out” of their own site, or notice that their content has been interfered with or even entirely wiped out. Typically, most compromised sites will become infected with malicious scripts without the owner even being aware that a breach has taken place.

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

Disclaimer

Note: A few of the recommended measures listed below require some technical understanding of how 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 service provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Host

Contact your web host and ask them what precautions they have put into place to protect your site from being attacked, and what they are doing to make sure that your server files and data get backed up.

It’s important to make sure that your webhosting service backs up your sites and that, if disaster strikes, you can easily get your files and data back.

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

Never rely only on your webhosting service for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this done for you and develop a habit of performing a full WordPress site maintenance routine frequently (e.g. daily, weekly, monthly, etc …)

A complete WordPress maintenance routine ensures that:

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

A full WordPress site maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WP site regularly backed up and updated is. WP 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 WordPress site maintenance yourself, get someone else to do it but make sure it gets done. Backing up your site is the next most important thing you must do after making sure that your heart is still beating!

If you don’t want to back up your site manually, there are many plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Back Up, Copy & Protect Your WordPress Web Sites With Backup Creator Plugin For WordPress

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

The large scale brute force botnet attack on WordPress is mostly attempting to compromise website admin panels by exploiting sites that used “admin” as the account name.

For security reasons, don’t set up WordPress sites with the username admin. This is the first area hackers will test. If your blog’s username is admin, you should change it immediately.

For a detailed tutorial created especially for WordPress admin users on how to change your admin username, go here: Changing Your WP Username From Admin To Another User Name

Security Measure #4 – Change Your Password

A “brute force” attack occurs when malicious software persistently hits a username and password field with different character strings in an attempt to guess the right combination that will unlock your site.

Unless some measure is put into place to prevent the brute-force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just persist in attacking your site until it eventually works out the combination.

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

Practical Tip

If you have trouble coming up with strong passwords or feel reluctant to set up different passwords for all your online logins, then use a password management tool like Roboform …

Roboform is a password software that lets you easily create strong passwords(You can use a password program like Roboform to create strong login passwords)

For a simple tutorial created especially for non-technical WP admin users on how to change your login password, go here: How To Reset Passwords

Security Measure #5 – Prevent The wp-config.php File From Being Easily 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 file

(WordPress WP Config file)

If a hacker breaks into your WordPress site, they will look for the wp-config.php file, because this is the file that contains your WordPress database information, 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 being attacked and even being used as part of a bot net, therefore, you must 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 Site Installation Files

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

These files can be removed after installation. If you don’t want to delete these files, just rename them.

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

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

Make sure to keep all of your installation files, themes, plugins, etc. up-to-date.

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress installations come with a built-in editor feature that allows you to edit theme and plugin code inside the dashboard area.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the WP dashboard menu)

The WordPress theme editor feature allows anyone accessing your site to view and modify all of your WordPress files, or cause mayhem 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 Your Site’s Uploads Directory

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

By default, this folder is visible to all users online. All a person needs to do to see all of the contents stored in the “uploads” folder is visit the directory using their browser …

(WordPress uploads folder)

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

If any directories in your website have vulnerabilities that can be exploited by hackers or malicious users, this can compromise the security of your website.

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 blank file named “index.php”) to your uploads directory, and so on. Again, it’s best to get professional assistance if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

A number of WordPress security plugins are available that specifically address common security issues faced by WordPress website owners, such as preventing unauthorized users from gaining access to vital areas of your site, protecting your website from malicious exploits, preventing unauthorized file uploads, 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 causing irreparable damage to your site is SecureScanPro.

SecureScanPro - total security plugin for WordPress

(SecureScanPro – total security software for WordPress)

SecureScanPro is easy to install and easy to use, and addresses 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 For WordPress

Blog Defender(Blog Defender Security Product Suite)

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

BlogDefender shows you where potential security weaknesses in your WordPress installation are …

Blog DefenderAnd lets you quickly and easily fix these …

Blog Defender Security Plugin For WordPressIf 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 WordPress software, plugins and themes are kept up-to-date, tightening file and data security and taking other necessary precautions can expose your site 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, you cannot ignore the importance of website security.

As one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on web security to all WordPress users following the large-scale 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, website security is very important if you run a WordPress site. Hopefully, this information 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 consult a professional WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

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

***

"I love the way your email series "Infinite Web Content Creation Training Series" is documented and presented. It is very absorbing and captivating. The links and tutorials are interesting and educational. This has motivated me to rewrite my content following the concepts I am learning from the email series." - Mani Raju, www.fortuneinewaste.com

***