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, which makes it an easy target for hacking attacks.

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

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

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

What Is A Brute-Force Attack?

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 ways hackers try to break into a WordPress site. One of these is by trying to guess the site admin’s login username and password. This can be achieved using software tools and scripts that can work through hundreds of login combinations in minutes.

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

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

”Botnets” are networks of computers that have been compromised and infected with malicious scripts or software, which are then controlled remotely as a group, often without the unsuspecting computer owners’ knowledge.

Botnets are typically used to blast mass spam emails.

The screenshot below was taken from an online security monitoring site showing the locations of the command centers of ZeuS – a botnet that has been actively compromising computer networks all around the world since 2009 …

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 world since 2009. Image: SecureList.com)

These were highly distributed and well organized attacks on WordPress. Over 90,000 IP addresses were identified by a number of hosting companies in the initial attack, when millions of attempts to force their way into WordPress site administration areas took place. The attack continued after this, with over 30,000 WordPress sites and blogs being hacked every day.

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

WordPress is frequently the target of attacks by hackers

(WordPress is the world’s most used content management system which makes it an obvious target for hacking)

Does This Mean We Should Stop Using WordPress?

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

To understand why WordPress is a secure platform for websites, read this article: Are Open Source Platforms Like WordPress Secure? What Every Website Owner Needs To Know About WordPress

Useful Info

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

Mike Little, one of the co-founders 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 Website From Brute Force Attacks – Ten Security Checks

Every blog with a security vulnerability offers some value to hackers. An unsecured blog offers hackers with a resource to launch denial of service attacks, spread malware and engage in information theft.

If a malicious user can exploit a vulnerability in your security, that web site can then be used as a “bot” to attack more highly-valued sites.

Additional undesirable effects of being hacked include being blacklisted by search engines, having spammy links promoting things like gambling, cheap offers on brand names, etc. inserted into your content and page title and descriptions, redirecting visitors to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasty things.

The reality is that software-driven bots are most likely scouring for exploits and trying to break into your website right now. Whether they will get into your site will depend on how difficult you can make things for hackers to keep persisting until they either can discover how to get in, or decide to look for a more vulnerable target.

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

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

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

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

Website Security Scan

(Hackertarget – WordPress security check results. Screenshot image: Hackertarget.com)

It should be obvious after using the scanning tool that if you can freely access all of this information about your WordPress site, so can hackers.

Hackertarget - WordPress Security Scan(Image source: BlogDefender site)

Being able to see which 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 in your site can all be potentially useful information to hackers, as these can inform them about any potential holes or weaknesses, especially where the owners haven’t updated their sites.

If your site or blog runs on WordPress and you are not taking appropriate steps to harden your site, we can practically guarantee that, at some point in time, someone will attempt to hack your site, because these brute force attacks are systematically targeting WordPress sites all the world!

Whenever a website or blog gets broken into, website owners will discover much to their dismay that they have been “locked out” of their own site, or notice that their content has been modified or that everything has been entirely wiped out. Often, sites will become infected with malicious scripts or viruses without the owner even being aware that this has occurred.

To help avoid the heartache that comes with having your website or blog being 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.

Disclaimer

Note: A few of the steps below need some technical skills to modify core WordPress and server files. If you have no web coding skills, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Hosting Service Provider

Get in touch with your webhosting provider and ask them exactly what security precautions they offer to protect your site from being attacked, and what they are doing to ensure that your site files get regularly backed up.

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

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

You should never rely just on your hosting service for site backups. Instead, learn how to manage your WordPress site or get this done for you and maintain a habit of religiously performing a full WordPress site maintenance routine on a frequent basis (e.g. weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

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

A proper WP site maintenance routine looks like this …

Maintaining your WP installation fully backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website regularly backed up and updated is vitally important for WordPress security. Screenshot source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WP website backed up and up-to-date. 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 maintenance yourself, get someone else to do it but make sure this gets done. Backing up your site is the second most important thing you must do after making sure that you are still breathing!

If you don’t want to back up your site manually, there are a number of free and paid plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Backup, Copy & Protect Your WP Sites With Backup Creator Plugin For WP

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

The brute force attack on WordPress sites was mostly attempting to compromise site admin panels by exploiting installations that used “admin” as the user name.

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

We have created a tutorial created especially for WP admin users on how to change your admin username here: How To Change Your WP Admin Username

Security Measure #4 – Use A Strong Password

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

Unless you put some measure in place to block the brute force attack (see further below for a couple of effective ways to do this), the “bot” will just continue attacking your site until it eventually gets access.

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

Useful Tip

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

You can use a password software tool like Roboform to help you generate strong passwords(You can use a password management software tool like Roboform to help you generate unbreakable passwords)

We have created a simple tutorial created especially for WordPress admin users that shows you how to change your login password here: What To Do If You Need To Change Your WordPress Password

Security Measure #5 – Protect Your WP Config File

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

WP Config file

(wp-config.php)

If a hacker breaks into your website, they will normally search for your 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 a hacker 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, you must prevent people getting to 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 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 delete these files, then just rename them.

Security Measure #7 – Upgrade Your WordPress Files, Plugins And Themes To Their Latest Version

Hackers are always on the lookout for vulnerabilities in previous versions of WordPress that they can exploit, including outdated versions of themes and plugins.

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WordPress Theme Editor Menu

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

This allows anyone accessing your site’s admin to view and change your WordPress theme files, and create havoc on your site.

If you want to prevent people from being able to access the 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 Your Site’s Uploads Directory

The WordPress “uploads” folder stores 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 view all of the contents in the “uploads” directory is visit the directory using their web browser …

(WordPress uploads folder)

(WordPress uploads folder)

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

Security Measure #10 – Install Security Plugins

There are a number of great security plugins for WordPress available that will address most security issues WordPress website owners face, such as preventing hackers from accessing your site, protecting your website from brute-force attacks, preventing injections of code into files, etc.

Many WordPress plugins address some but not all areas of WordPress security. One WordPress security plugin that does a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your files and damaging your site is SecureScanPro.

SecureScanPro - WordPress security software solution

(SecureScanPro – total security software solution for WordPress)

SecureScanPro is easy to install and easy to use, and fixes most of the security areas that WordPress users need to address.

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

Blog Defender

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

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

BlogDefender scans you web site for security vulnerabilities …

Blog Defender Security Solution For WordPressAnd lets you fix these quickly …

Blog Defender Security Solution For WordPressIf you don’t want to purchase a premium security plugin like SecureScanPro or BlogDefender, then use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting simple maintenance tasks like ensuring that your WordPress installation, WordPress plugins and WordPress themes are kept updated to their latest versions, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

No matter what kind of business you run or plan to run online and how small you think your web presence is, web security is something you simply cannot ignore.

As one last reminder of the importance of website security, below is the advice given by a web security expert to all WordPress users following the mass brute force attacks 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 of the utmost importance 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 consult a WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to be notified when we publish new information on WordPress security and reviews of new security plugins.

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***

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