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 SecurityWhen you are the world’s most popular CMS platform and the online publishing platform of choice for millions of websites and loved by thousands of web developers and web designers, it’s inevitable that at some point in time, WordPress will come under attack by hackers wanting to score a “big win”.

In 2013 a worldwide brute-force attack struck WordPress installations on virtually every host server in existence around the world.

These attacks were caused by botnets (computers infected with viruses and programmed to attack other computers 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)

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. To achieve this, hackers use scripts and tools that automatically tries to guess hundreds of login permutations in minutes.

If you’re using predictable user names and passwords, your site could be an easy target for hackers.

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

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

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

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 compromising computer networks all around the globe since 2009 called “Zeus” …

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

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

These were well organized and highly distributed botnet attacks. Over 90,000 IP addresses were identified by a number of webhosting companies in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress site administration areas. The mass attacks then continued, with over 30,000 WordPress sites being hacked each day.

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

WordPress is often the target of malicious attacks by hackers, due to its global popularity

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

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

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

To understand what makes WordPress a very secure platform for websites, read this article: Is WordPress Secure?

Useful Information

It’s important to understand that, in the case of April 2013 worldwide brute-force 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 Blog From Being Brute-Force Attacked – Ten Security Points

Every web site with a security vulnerability offers some degree of value to hackers. No blog Business websites, personal blogs, government web sites … even web sites owned by online security experts can and have been targeted.

If a hacker can find a way to break in and compromise the control of your website or blog, the web site can then be employed to target other valued websites.

Additional undesirable results of having your site hacked and your site security compromised include being blacklisted by search engines, having spammy links advertising things like viagra, discounted fashion, etc. inserted into your content, redirecting visitors to phishing sites or other websites, drive-by downloads (adding malicious programs on your visitors’ computers), and lots of other nasty things.

The harsh reality is that hackers are trying to hack into your web site at this very moment. Whether they will break in will depend on how difficult you will make it for hackers to continue persisting until they work out a way to get access, or are forced to give up and go look for an easier target.

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

Does your website run on WordPress? If so visit a site like Hackertarget.com and run your site through their WordPress security check …

WordPress Security Check(WordPress Security Check Source: https://hackertarget.com/wordpress-security-scan)

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

WordPress Security Check

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

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

WordPress Security Scan(Screenshot image: 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 all be valuable information to hackers, as this informs them about any potential security weaknesses, especially where the owners haven’t updated their sites.

If your site or blog runs on WordPress and you’re not preventive steps to harden your site, we can practically guarantee that, at some point, someone will attempt to hack your site, because these brute force attacks are systematically targeting WordPress sites worldwide!

When a website or blog is compromised, site owners can find themselves “locked out” of their own site, or notice that their content has been vandalized or that everything has been entirely wiped out. Often, compromised sites will be infected with malicious software or viruses without the owner’s knowledge or awareness.

To avoid the heartache that comes with having your site being hacked into, below are ten essential and effective security measures that will help to protect your WordPress site from brute force attacks.

Disclaimer

Note: A few of the steps below require some technical skills to modify core WordPress and/or server files. If you are not technical, 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 – Contact Your Host

Get in touch with your hosting provider and ask them exactly what security measures they have put in place to protect your site from botnet attacks, and what is done to ensure that your files and data get regularly backed up.

Check that your host is backing up your server files and that, if anything should happen, you can quickly and easily recover your site.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Regularly Up-To-Date

You should never rely on your webhosting company 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 complete WordPress site maintenance routine frequently (e.g. weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

  • All unnecessary files and data are removed,
  • All WP data and files are free of errors, optimized and backed up,
  • All 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 completely backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website or blog regularly backed up and up-to-date is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WordPress website or blog regularly backed up and up-to-date. WP 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 do not want to learn how to do WP maintenance yourself, pay someone to do it but make sure this gets done. Backing up your website 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 plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Backup, Clone And Keep Your WP Sites Protected With Backup Creator WP Plugin

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

The mass brute force attack on WordPress sites was mostly an attempt to compromise website admin panels by exploiting installations with “admin” as the account name.

For reasons of website security, avoid setting 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 tutorial for WordPress admin users that shows you how to change your admin username, go here: How To Change Your WP User Name From Admin To A Different User Name

Security Measure #4 – Use A Strong Password

A “brute force” attack occurs when malicious software continually hits a username and password field with different character strings trying to guess the right combination that will give the hacker access to your site.

Unless you put some measure in place to block the brute force attack from happening (see further below for a couple of simple and effective ways to do this), the “bot” will just continue to attack your site until it eventually works out the combination.

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

Tip

You can use a password management tool like Roboform to help you generate unguessable passwords …

Roboform is a password software you can use to generate different strong passwords(You can use a password program like Roboform to create hard-to-guess passwords)

We have created a detailed tutorial that shows you how to change your admin password here: What To Do If You Need To Reset Login Passwords In WordPress

Security Measure #5 – Prevent Access To Your wp-config.php File

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 site, they will look for your wp-config.php file, because this file 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 attacks and even being used as part of a bot net, therefore, 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 – Rename Or Delete Unnecessary WP Installation Files

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

These files are not required after installation. If you don’t want to remove these files, then just rename them.

Security Measure #7 – Update Your WordPress Software, Plugins & Themes To Their Latest Version

Hackers search for vulnerabilities in older versions of WordPress that they can exploit, including outdated versions of WP plugins and themes.

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

Security Measure #8 – Disable Your Theme Editor

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

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

WP Theme Editor Menu

(The WordPress theme editor is accessible using the WordPress main menu)

The WordPress theme editor feature allows anyone accessing your blog to view and edit all of your theme files, or cause 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 Site’s Uploads Folder

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

Normally, this folder is visible to anyone online. All someone has to do to view the contents in the “uploads” directory is visit the directory using their browser …

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

(WordPress uploads folder)

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 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 – WordPress Security Plugins

There are several security plugins for WordPress available that will address many common security issues WordPress website owners face, such as preventing unauthorized users 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 does a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your site files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - complete security software solution for WordPress

(SecureScanPro – security plugin for WordPress)

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

Another security plugin you may want to consider using is BlogDefender.

Blog Defender WordPress Security Product Suite

Blog Defender WordPress Security Plugin(Blog Defender Security Suite For WordPress Websites & Blogs)

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

BlogDefender shows you where the security holes in your web site are …

Blog DefenderAnd lets you fix these quickly, easily and inexpensively …

Blog DefenderIf 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 simple maintenance tasks like keeping your WordPress core files, WP plugins and WP themes updated to their latest versions, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

Regardless of the kind 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 after the global 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, this article will help prevent brute-force attacks on your WordPress site. 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 tutorials about 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

***