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 SecurityWordPress is the world’s most used content management system making it a natural target for hacker attacks.

In 2013 a worldwide brute-force attack began hitting WordPress installations across almost every WP host server in existence around the world.

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

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 will attempt to break into WordPress sites is by trying to guess the site admin’s login username and password. To achieve this, hackers use software tools that automatically tries to guess hundreds of login permutations in minutes.

If you’re not using strong usernames or unguessable passwords, your website could be an easy target for hacking attempts.

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

Botnet Definition

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 compromised and infected with malicious code or scripts, which can then be controlled remotely as a group, typically without the unsuspecting computer owners’ knowledge or awareness.

Botnets are regularly used to send out mass spam emails from the infected computers of unsuspecting users.

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

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

These botnet attacks on WordPress were well organized and highly distributed. Over 90,000 IP addresses were identified by a number of webhosting companies in the initial attack alone, when the web was flooded with millions of attempts to force their way into WordPress user admin areas. The brute force attacks continued after this, with over 30,000 WordPress sites 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, Tech Crunch, BBC News, and even on the official website of the US Department of Homeland Security …

Being the world's most used CMS makes WordPress an obvious target for malicious attempts by hackers

(WordPress powers millions of sites worldwide, which makes it a natural target for hackers)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

We explain what makes WordPress a very secure web platform in this article: Concerned About WordPress Security? What Every Business Owner Needs To Know About WordPress Security

Important Info

It’s important to note that, in the case of the brute-force attack described above, no specific WordPress vulnerability was being exploited (the same script was also attacking 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 Measures

Every web site with a security vulnerability has value to hackers. Every website has some value to hackers. Large, medium and small web sites, personal blogs, government web sites … even websites owned by web security and anti-hacking experts can and have been targeted.

If a hacker can access and gain remote access of your website, your website can then be employed to attack other valuable sites.

Additional undesirable consequences of having your site hacked include getting blacklisted by Google, having spammy links advertising things like gambling, cheap offers on brand names, etc. inserted in your content and meta data, 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 hackers are scouring for vulnerabilities and trying to hack into your site at this very moment. Whether they will be successful or not, will depend on how challenging you have made it for them to keep trying until they can discover a way to get in, or decide to 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 site through their WordPress security scan …

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

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

Hackertarget - WP Security Check

(website security check results. Screenshot: Hackertarget.com)

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

WordPress Security Check(Screenshot source: Blog Defender)

The ability to see what version of WordPress you are using, which plugins and themes you have installed on your site, and which files have been uploaded to certain directories can be potentially valuable information to hackers, as this can inform them about any potential security weaknesses, especially in older versions.

If your site or blog is powered by WordPress and you’re not proactive steps to bullet-proof your site, it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your installation, because these attacks are systematically targeting WordPress sites worldwide!

Typically, whenever a site gets broken into, website owners will find themselves “locked out” of their own site, or notice that their files have been vandalized or even that their content has been completely wiped out. Typically, most sites will be infected with malicious scripts or viruses without the owner’s knowledge or awareness.

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

Important Info

Note: A few of the recommended measures shown below require some technical understanding of how to modify core WordPress and server files. If you have no web 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 Webhosting Service

Get in touch with your webhosting provider and ask them exactly what systems are in place to help prevent your site from being attacked, and what is done to make sure that your WordPress sites get regularly backed up.

Check that your hosting service provider regularly backs up your server files and that, if anything happens, you can easily get your site back.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Site Frequently Maintained

Never rely only on your webhosting provider for site backups. Instead, learn how to manage your WordPress site or get this done for you and maintain a habit of performing a complete site maintenance routine on a regular basis (e.g. weekly, fortnightly, etc …)

A full 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 plugins, themes and software components are up-to-date,
  • etc …

A full WP site maintenance routine looks like this …

Maintaining your WordPress website backed up and updated is vitally important for WordPress security.(Maintaining your WP website completely backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WordPress site frequently backed up and up-to-date is. WP maintenance is not hard 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, get someone else to do it but make sure it gets done. Backing up your website is the next most important thing you must do after making sure that you still have a pulse!

If you don’t want to back up your site manually, there are many free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Back Up, Duplicate & Keep Your WP Websites And Blogs Protected With Backup Creator WordPress Plugin

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

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

For reasons of website security, avoid setting up WordPress sites with the username admin. This is the first area hackers will test. If your blog’s username is admin, change this immediately.

For a simple tutorial on how to change your username, go here: How To Change Your WordPress Admin User Name

Security Measure #4 – Choose Strong Passwords

A “brute force” attack occurs when malicious software persistently tries to guess the right combination of characters in a password and username 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 persist in attacking your site until it eventually “cracks” the code.

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

Practical Tip

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

Roboform is a password program that lets you generate really secure passwords(You can use a password software tool like Roboform to generate hard-to-crack passwords)

For a tutorial created especially for WordPress users on how to change your admin password, go here: How To Change Your Password In WordPress

Security Measure #5 – Deny Access To Your WP Config File

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

WP Config file

(wp-config.php)

If a hacker breaks into your WordPress site, they will normally try to access your wp-config.php file, because this is the file that contains your database information, 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 people 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 – Delete Or Rename Unnecessary WP Installation Files

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

You can remove these files after installation, as they are unnecessary. If you don’t want to delete these files, then just rename them.

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

Hackers search for vulnerabilities in previous versions of WordPress that can be exploited, including outdated versions of themes and plugins.

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

Security Measure #8 – Disable The Theme Editor

WordPress comes with a built-in editor feature that lets the administrator edit theme and plugin code from the dashboard.

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

WordPress Theme Editor Menu

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

The WordPress theme feature lets anyone accessing your blog’s admin view and make changes to your WP theme files, and cause mayhem on your site.

To prevent people from being able to access the 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 WordPress Uploads Folder

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

By default, this folder is visible to anyone online. All someone has to do to see the contents in your site’s “uploads” folder is visit the directory using their web browser …

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

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

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers, this can seriously threaten 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 called “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are unsure 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 unauthorized file uploads, etc.

Many 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 potential issues that could lead to hackers accessing your website files and causing damage to your site is SecureScanPro.

SecureScanPro - security plugin for WordPress

(SecureScanPro – total security software 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 great plugin you may want to look at using is BlogDefender.

Blog Defender Security Plugin

Blog Defender Security Plugin For WordPress(Blog Defender)

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

BlogDefender shows you where the security holes in your WordPress installation are …

Blog Defender WordPress Security PluginAnd then shows you how to quickly and easily fix these …

Blog Defender WordPress Security PluginIf you don’t want to purchase a premium 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 web platform, but neglecting basic maintenance tasks like keeping your WP installation, WordPress plugins and WordPress themes up-to-date, tightening file and data protection and taking other necessary precautions can expose your website 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 ignore the importance of securing your site.

As one last reminder of the importance of website security, below is the advice given by a website security expert to all WordPress users following 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, website security is of the utmost importance if you run a WordPress site. Hopefully, the information in this article has shown you what to do to 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 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.

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***