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 leading CMS platform in the world and the preferred online publishing platform for millions of businesses 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 April 2013, WordPress installations around the world were subjected to a worldwide brute-force attack.

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

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)

One of the many ways hackers will attempt to break into a WordPress site is by trying to guess the site admin’s login username and password. To achieve this, hackers use software tools that can work through hundreds of possible logins in minutes.

If you’re using predictable usernames and weak passwords that are easy to guess, your site can 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 private 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’ knowledge.

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

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 globe since 2009. Screenshot source: SecureList.com)

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

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

WordPress powers millions of sites around the world, making it a natural target for malicious attacks by hackers

(WordPress is the world’s most popular content management system making it a frequent target for hacking)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are many great reasons why you should choose WordPress if you are concerned about the security of your online business.

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

Useful Info

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, made the following 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)

Preventing Your WordPress Blog From Brute Force Attacks – 10 Security Measures

Every blog with a security vulnerability presents an opportunity to hackers. A compromised site presents malicious users with a platform for distributed attacks, spreading malware and as a source of information theft.

If a hacker can exploit a vulnerability, that website can then be used as part of a larger network of “bots” to target more valued web sites.

Additional undesirable results of having your website hacked and your site security compromised include getting blacklisted by Google, having stealthy spam links promoting things like online meds, porn, etc. inserted in your content, 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 truth is that software-driven bots are most likely trying to hack into your web site at this very moment. Whether they can break into your site or not, will depend on how difficult you have made things for hackers to keep persisting until they work out a way to get access, or are forced to give up and decide to look for a more vulnerable target.

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

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

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

You will see that the test returns various results and details about your website …

Hackertarget - WP Security Check

(website security scan results. Product image source: Hackertarget.com)

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

Hackertarget - WordPress Security Check(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 be potentially valuable information to hackers, as these can inform them about exploitable vulnerabilities, especially in older versions.

If your website runs on WordPress and you’re not taking appropriate steps to bullet-proof your site, then we can practically guarantee that, at some point, someone will attempt to hack your website, because these brute force attacks are systematically targeting WordPress installations worldwide!

Whenever a site gets hacked, site owners can find themselves “locked out” of their own site, or notice that their files have been altered or even that their content has been completely wiped out. Typically, sites will become infected with malicious software without the owner even being aware that this has taken place.

To avoid the heartache that comes with discovering that your website has been hacked into, we have listed below 10 simple, yet essential and effective security checks that will help to protect your WordPress site from being attacked by brute-force hackers.

Important Info

Note: Some of the measures below need 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 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 Web Host

Get in touch with your webhosting company and ask them exactly what systems are in place to help prevent your site from being attacked, and what they are doing to make sure that your server files and data get backed up.

Check that your hosting service provider is regularly backing up your sites and that, if anything goes wrong, you can easily get back your site.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Website Frequently Maintained

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

A full WordPress maintenance routine ensures that:

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

A proper WordPress maintenance routine looks like this …

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

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

If you don’t want to perform manual backups, there are a number of WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Backup, Clone & Protect Your WordPress Websites And Blogs With Backup Creator WP Plugin

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

the worldwide brute force attack on WordPress sites was mostly attempting to compromise website admin panels and gain access to sites by exploiting sites that used “admin” as the user name.

For reasons of website security, avoid installing WordPress sites with the username “admin”. This is the first thing hackers will test. If your blog’s username is “admin”, then make sure you change this immediately.

We have created a tutorial that shows you how to change your admin username here: How To Change Your Admin User Name In WordPress To Another Username

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when a malicious script continually hits a login or password field with different strings of characters in an attempt to guess the right combination that will give them access 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 to attack your site until it eventually “cracks” the code.

Weak passwords, therefore, make very easy targets for botnets. Make sure that you change your password combination to a string containing at least 8 or 9 characters long, with both upper and lowercase letters, and add a few “special” characters (e.g. ^, $, &, etc).

Useful Tip

You can use a password program like Roboform to create unguessable passwords …

You can use a password software tool like Roboform to help you generate difficult passwords(You can use a password program like Roboform to create strong login passwords)

For a detailed step-by-step tutorial that shows you how to change your password, go here: Changing Passwords

Security Measure #5 – Secure 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 options for WordPress.

wp-config.php

(wp-config.php file)

If hackers break into your WordPress website, they will normally try to access the wp-config.php file, because this is the file that contains your database details, 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, 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 WP Installation Files

Rename or delete 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 – Keep Your WordPress Files, Themes & Plugins Up-To-Date

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the WP main menu)

The WordPress theme editor allows anyone accessing your blog to view and edit all of your WordPress files, and create mayhem on your site.

To prevent unauthorized 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 – Prevent Access To Your WordPress Uploads Folder

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

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

(WordPress has an uploads folder where your media files are stored)

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

If any directories in your website have vulnerabilities that can be exploited by hackers, this can become a serious threat to the security of your website.

Protecting your directories will prevent unauthorized people from viewing your ‘uploads’ folder and other important directories. This can be done using plugins, setting file permissions, uploading 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 seek professional help if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

There are a number of great WordPress security plugins available that will address many common security issues faced by WordPress site owners, such as preventing hackers from gaining access to vital information about your site, protecting your files from malicious software, preventing injections of code into files, 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 files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WordPress security software solution

(SecureScanPro – WP security plugin)

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

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

Blog Defender WordPress Security Solution

Blog Defender Security Solution For WordPress(Blog Defender Security Solution For WordPress)

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

BlogDefender shows you where potential security weaknesses in your web site are …

Blog DefenderAnd then shows you how to quickly fix these …

Blog Defender Security Plugin For WordPress Websites & BlogsIf 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 very secure web platform, but neglecting essential maintenance tasks like keeping your WP core files, plugins and themes updated to their latest versions, 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, below is the advice given by an expert on website security to all WordPress users following the large-scale 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, the above 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 consult a WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified whenever we publish new tutorials on WordPress security and reviews of new WordPress security plugins and solutions.

***

"This is AMAZING! I had learnt about how to use WordPress previously, but this covers absolutely everything and more!! Incredible value! Thank you!" - Monique, Warrior Forum

***