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 most popular content management system in the world and the online publishing platform of choice 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 become a target for attacks by hackers wanting to score a “big win”.

In 2013, WordPress installations around the world were subjected to large-scale brute-force attacks.

These attacks were caused by botnets (computer networks infected with viruses and programmed to attack other sites with security vulnerabilities).

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)

There are many ways hackers try to break into WordPress sites. One of these is by trying to guess the site admin’s login username and password. This is achieved using software programs that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re using predictable usernames and passwords that are easy to guess, your website can be easily hacked by persistent attempts to work out your site’s login details.

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)

A “Botnet” is a network of computers that have been compromised and infected with malicious code, which are then controlled remotely as a group, typically without the unsuspecting computer owners’ knowledge or awareness.

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

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

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

These were well organized and highly distributed botnet attacks on WordPress. Over 90,000 IP addresses were identified by several webhosting 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 the April 2013 mass brute-force botnet attack was reported by all the major webhosting companies, as well as the leading technology media publications, such as Forbes, TechNews Daily, Tech Crunch, BBC News, PC Magazine, and even on the official website of the US Department of Homeland Security …

WordPress is the world's most used CMS making it a frequent target for hacking attempts

(Being the world’s most popular CMS makes WordPress a target for attempted attacks by malicious users)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

To understand why WordPress is a secure web platform, see this article: Is WordPress Secure?

Useful Information

It’s important to understand that, in the case of the worldwide brute-force botnet attack described above, there was actually no WordPress vulnerability 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 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 – Ten Security Measures

You may think that your site has nothing to offer to hackers, but the reality is that to a hacker, all websites are an opportunity to benefit or profit at your expense.

If someone can exploit a way to take over and control your blog, the site can then be employed to attack larger and more highly-valued websites.

Additional undesirable consequences of being hacked include getting blacklisted by Google, having stealthy spam links advertising things like online meds, cheap offers on brand names, etc. in your content and meta data, malicious redirects to phishing sites, drive-by downloads (adding malicious software on your visitors’ computers), and lots of other nasties.

The truth is that malicious bots are probably scouring for exploits and trying to break into your website at this very moment. Whether they can get in successfully depends on how difficult you have made things for them to keep persisting until they work out how to get in, or are forced to decide to look for a less secure target.

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

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

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

You will see that the scan returns various results and information about your site …

Website Security Scan

(WP security scan results. Product image: Hackertarget.com)

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

WP Security Check(Screenshot image: 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 on your server can all be potentially useful information to hackers, as these can inform them about potential vulnerabilities, especially where site owners haven’t updated their files.

If your site or blog is powered by WordPress and you’re not proactive steps to harden your site, then it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your site, because these attacks are systematically hitting WordPress sites around the world!

When a site gets broken into, website owners can find themselves “locked out” of their own site, or notice that their files have been altered or even entirely wiped out. Often, compromised sites will be infected with malicious scripts without the owner’s knowledge or awareness.

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

Disclaimer

Note: Some of the steps below need some technical understanding of how to modify core WordPress and server files. If you are not technical-minded, or don’t want to mess around with file code, then ask your web host or a professional WordPress technical provider for help.

***

Security Measure #1 – Get In Touch With Your Webhosting Service

Contact your webhosting company and ask them exactly what security precautions have been put into place to protect your site from brute force attacks, and what is done to make sure that your site files are regularly being backed up.

It is important to make sure that your web host is backing up your sites and that, if anything happens, you can easily get your files and data back.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Website Or Blog Regularly Maintained

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

A proper WordPress maintenance routine ensures that:

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

A proper WordPress maintenance routine looks like this …

Maintaining your WP installation completely backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP web site 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 regularly backed up and updated. WP site 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 site maintenance yourself, pay a professional 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 still have a pulse!

If you don’t want to back up your site manually, 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, Copy & Protect Your WP Websites With Backup Creator WP Plugin

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

The brute force botnet attack on WordPress is mostly attempting to compromise website administrator panels and gain access to sites by exploiting WordPress sites using “admin” as the account 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 site’s username is “admin”, then change this immediately.

We have created a detailed step-by-step tutorial created especially for WordPress users that shows you how to change your WordPress admin username here: How To Change Your WordPress User Name From Admin To Another Username

Security Measure #4 – Change Your Password

A “brute force” attack occurs when a malicious script persistently tries to guess the right username and password character string that will unlock your site.

Unless you put some measure in place to stop the brute-force attack from happening (see further below for a couple of simple and effective suggestions for doing this), the “bot” will just keep attacking your site until it eventually gets access.

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

Tip

Roboform is a password management software that lets you easily generate very secure passwords …

You can use a password management tool like Roboform to create difficult passwords(You can use a password management software tool like Roboform to create strong passwords)

We have created a detailed tutorial on how to change your admin password here: Changing A Password In WordPress

Security Measure #5 – Prevent Your wp-config.php File From Being Accessed

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

wp-config.php file

(wp-config.php file)

If hackers break into your WordPress site, they will typically try to access the wp-config.php file, because this file contains important information about your site’s database, 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.

In order to protect your WordPress site from being attacked and even being used as part of a bot net, therefore, you must 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 – Delete Or Rename Unnecessary Installation Files

Delete or rename 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 – Update Your WordPress Site, Themes And Plugins

Hackers look for vulnerabilities they can exploit in earlier WordPress versions, including out-of-date versions of themes and plugins.

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

Security Measure #8 – Disable The Theme Editor

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

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the WordPress main menu)

This allows anyone accessing your blog to view and modify your theme files, and cause mayhem 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 editing your wp-config.php file.

Security Measure #9 – Prevent Access To The WordPress Uploads Directory

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

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

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

(WordPress uploads directory)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers, anyone could upload unauthorized file types or compromise the security of your website.

Protecting your directories will prevent online users from viewing 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 called “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

A number of WordPress security plugins are available that will address most security issues WordPress site owners face, such as preventing unauthorized users from accessing vital areas of your site, protecting your website from malicious scripts, preventing unauthorized file uploads, etc.

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

SecureScanPro - security plugin for WordPress

(SecureScanPro – WP security software)

SecureScanPro is easy to install and easy to use, and fixes 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 Security Product Suite For WordPress Sites

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

Blog Defender is a suite of WordPress security video tutorials, WordPress plugins and tools, plus WordPress security documentation in PDF and DOC formats.

BlogDefender scans you web site for potential security holes …

Blog Defender WordPress Security SolutionAnd then shows you how to fix these quickly …

Blog Defender Security SuiteIf you don’t want to invest in a security plugin like SecureScanPro or BlogDefender, you can use various free 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 keeping your WP installation, WordPress plugins and themes up-to-date, tightening file and data security 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, website security is something you cannot ignore.

As a final reminder of the importance of website security, below is the advice given by a security expert to all WordPress users following the large-scale brute force attacks by botnets 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 above information 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 seek help from a professional WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications via email whenever we publish new articles on WordPress security and reviews of new WordPress security plugins and solutions.

***

"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)

***