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 is the world’s most used CMS making it an easy target for attempted attacks by malicious users.

In 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 sites).

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

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 use to try and break into a WordPress site is by trying to guess the site’s administration login username and password. This is done using scripts and tools that can work through hundreds of login possibilities in minutes.

If you’re using easy-to-guess login details, your site could be an easy target for hacking attempts.

This is called a “brute force” 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 software, which can then be controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is taking place.

Botnets are typically used to blast out mass spam emails.

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 infecting computer networks all around the globe since 2009 …

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

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

These were highly distributed and well organized botnet attacks on WordPress. Over 90,000 IP addresses were identified by a number of hosting companies in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress users administration areas. The mass brute force attacks continued after this, with over 30,000 WordPress blogs being hacked per day.

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

WordPress is the world's most used CMS which makes it a target for hackers

(WordPress is often the target of worldwide malicious attacks by hackers)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are lots of very good reasons why you should use WordPress if you are concerned at all about the security of your online business.

We explain what makes WordPress a very secure web platform in this article: Is WordPress Secure?

Info

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

Mike Little, one of the co-founders of WordPress, made the following comment about the botnet 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 Site From Brute-Force Attacks – 10 Security Checks

You may think that the information in your site has nothing to offer to hackers, but the reality is that to a hacker, every website provides an opportunity to benefit or profit at your expense.

If a malicious user can hack into and remotely take control of your website or blog, that web site can then be used as part of a larger network of “bots” to target more valued sites.

Additional undesirable consequences of having your website hacked and your site security compromised include getting blacklisted by Google, having stealthy spam links promoting things like casinos, porn, etc. inserted in your content, redirecting visitors to phishing sites or other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasties.

The harsh reality is that software-driven bots are probably looking for exploits and trying to hack into your website as you are reading this. Whether they will do this successfully or not, will depend on how hard you can make things for hackers or bots to keep persisting until they can either discover a way to break in, or give up and go look for a more vulnerable target.

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

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

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

You will see that the scan will return various results and details about your website …

WordPress Security Scan

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

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

Hackertarget - Website Security Check(Screenshot source: BlogDefender website)

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 valuable information to hackers, as these can inform them about any potential security weaknesses, especially where the owners haven’t updated their sites.

If your website runs on WordPress and you’re not proactive steps to bolster the security of your site, then we can practically guarantee that, at some point, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically targeting WordPress installations all the world!

Typically, whenever a site gets hacked, webmasters can find themselves “locked out” of their own site, or notice that their files have been altered or even entirely wiped out. Often, most compromised sites will be infected with malicious software without the owner even being aware that a security breach has happened.

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

Note

Note: A few of the steps below need some technical skills to modify core WordPress or server files. If you are not technical-minded, 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 – Get In Touch With Your Hosting Service

Get in touch with your webhosting service and ask them exactly what measures they offer to help prevent your site from botnet attacks, and what is done to ensure that your server files and data are being backed up.

Check that your hosting provider backs up your sites and that, if disaster strikes, you can quickly and easily get your site back.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Or Blog Frequently Maintained

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

A full WordPress maintenance routine ensures that:

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

A complete WP site maintenance routine looks like this …

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

Again, we cannot stress enough how important it is to maintain your WordPress site 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 site maintenance yourself, pay someone 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 your heart is still beating!

If you don’t want to perform manual backups, there are many plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Back Up, Copy & Protect Your WordPress Web Site With Backup Creator Plugin For WordPress

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

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

For website security reasons, avoid setting up a WordPress site with the username “admin”. This is the first area hackers will test. If your blog’s username is “admin”, then make sure you change this immediately.

We have created a step-by-step tutorial for non-technical WP admin users on how to change your WordPress admin username here: Changing Your WP Admin User Name To Another User Name

Security Measure #4 – Use A Strong Password

A “brute force” attack occurs when malicious software continually tries to guess the right combination of characters in a username and password that will unlock your website.

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

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

Useful Tip

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

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

We have created a tutorial created especially for WordPress users that shows you how to change your WordPress password here: How To Reset Your Login Password

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

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

wp-config.php file

(wp-config.php)

If a hacker breaks into your website, they will typically try to access the 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 being attacked and even being used as part of a bot net, therefore, prevent your wp-config.php file from being accessed. 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 Website Installation Files

Delete or rename 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, then just rename them.

Security Measure #7 – Update Your WordPress Site, Plugins & Themes

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the main menu)

The WordPress theme editor feature allows anyone accessing your blog’s admin to see and make changes to all of your WP theme templates, or cause mayhem on your site.

To prevent people from accessing 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 – Protect Your WordPress Uploads Directory

The “uploads” directory stores all the media files that get uploaded to your site.

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

(WordPress uploads folder)

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

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

Security Measure #10 – Use Security Plugins

A number of great security plugins for WordPress are available that specifically address most common security issues WordPress site owners face, such as preventing hackers from accessing vital areas of your site, protecting your site from malicious software, preventing unauthorized file uploads, etc.

Most WordPress plugins address some but not all areas of WordPress security. One 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 - WP security software

(SecureScanPro – security software for WordPress)

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

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

Blog Defender WordPress Security Solution

Blog Defender Security Product Suite For WordPress(Blog Defender Security Suite For WordPress)

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 then shows you how to fix these quickly …

Blog Defender Security Plugin For WordPress SitesIf you don’t want to buy a 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 platform, but neglecting simple maintenance tasks like keeping your WP software, WP plugins and themes up-to-date, tightening file and data security and taking other necessary precautions can have disastrous consequences.

Regardless of the type 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 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 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, WordPress security is very important if you run a WordPress site. Hopefully, the information in this article will help keep your WordPress site protected from brute force attacks. If you need any further help or assistance with WordPress security, please seek help from a professional WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

Also, do yourself a favor and subscribe to WPCompendium.org to be notified via email when we publish new articles and tutorials on WordPress security and reviews of new security plugins.

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***