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 SecurityBeing the world’s most used CMS makes WordPress an easy target for hacker attacks.

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

These attacks were caused by computer networks infected with viruses and programmed to attack other installations (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 use to try and break into WordPress sites is by trying to guess the site admin’s login username and password. This can be done using scripts and software tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re not using strong usernames or unguessable passwords, your website could be easily hacked by a malicious script’s repeated attempts to guess your site’s login details.

This is called a “brute force” attack.

What Is A Botnet?

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/botnet)

A “Botnet” is a network of private computers that have been compromised and infected with malicious software, which are then controlled remotely as a group, typically without the computer owners even being aware of this.

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

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.

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

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

News of the April 2013 mass brute force botnet 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, PC Magazine, BBC News, and even on the official US Department of Homeland Security website …

WordPress is the world's most popular CMS which makes it a target for hacking

(WordPress is often the target of attacks by hackers, due to its global popularity)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

To understand why WordPress is a secure web platform, see this article: Are Open Source CMS Platforms Like WordPress Secure?

Important Info

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

Preventing Your WordPress Site From Brute-Force Attacks – 10 Security Checks

Every website or blog with a vulnerability presents an opportunity to hackers. A vulnerable website or blog not only provides newbie hackers opportunities to improve their skills and claim “bragging rights” among their peers, but it can also be a valuable platform for distributed attacks, spreading malware and as a source of information theft.

If a malicious user can hack into and take over your website, the web site can then be used to target other valuable websites.

Additional undesirable results of having your site hacked include being blacklisted by Google, having spammy links advertising things like viagra, discounted fashion, etc. in your content, redirecting visitors to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasty things.

The harsh reality is that hackers are most likely looking for security exploits and trying to hack into your web site as you are reading this article at this very moment. Whether they can achieve this depends on how challenging you have made it for them to keep persisting until they either can work out a way to break in, or are forced to give up and go look for an easier target.

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

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

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

You will see that the scan will yield a number of results and information about your website …

Website Security Check

(WP security check results. Screenshot source: Hackertarget.com)

It should be obvious after using the tool shown above that if you can see all of this information about your WordPress site, then so can hackers.

Website Security Scan(Image source: BlogDefender website)

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 valuable information to hackers, as this informs them about any exploitable holes or weaknesses, especially where the owners haven’t updated their files.

If your site or blog runs on WordPress and you’re not proactive steps to toughen up 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!

When a website or blog gets compromised, webmasters can discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been vandalized or even that their content has been completely wiped out. Often, sites will become infected with malicious software without the owner’s knowledge or awareness.

To avoid the heartache and aggravation that comes with having your site being hacked into, below are ten simple, yet essential and effective security checks that will help to protect your WordPress site from being brute-force attacked.

Useful Info

Note: Some of the recommended measures listed below need some technical understanding of how to modify core WordPress and/or server files. If you have no web editing skills, 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 – Contact Your Web Host

Get in touch with your hosting provider and ask them what precautions they have put in place to help prevent your site from brute force attacks, and what is done to make sure that your server files and data are being backed up.

Make sure that your web host backs up your sites and that, if disaster strikes, you can easily get back your files and data.

Security Measure #2 – Perform Regular WordPress Backups And Keep Your Website Frequently Up-To-Date

Never rely on your webhosting service for site backups. Instead, learn how to manage your WordPress site or pay someone to get this service done for you and maintain a habit of religiously performing a full 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 deleted,
  • All WP files and data are free of errors, optimized and backed up,
  • All WordPress software, themes and plugins are up-to-date,
  • etc …

A proper WP site maintenance routine looks like this …

Maintaining your WordPress web site completely backed up and updated is vitally important for WordPress security.(Maintaining your WP site backed up and up-to-date is vitally important for WordPress security. Screenshot: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WordPress web site regularly backed up and updated. 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 WordPress site 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 should do after making sure that your heart is still beating!

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

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

The mass brute force botnet attack on WordPress sites was mostly an attempt to compromise website admin panels by exploiting sites that used “admin” as their username.

For website security purposes, avoid installing a WordPress site with the username admin. This is the first area hackers will test. If your blog’s user name is admin, you need to change this immediately.

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

Security Measure #4 – Choose A Strong Password

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

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

Passwords that are easy to guess, therefore, are very easy targets for hacking attacks. Make sure that you change your password to something that is at least 8 or 9 characters long, with upper and lowercase letters, combined with a few “special” characters (^%$#&@*).

Useful Tip

Roboform is a password management tool you can use to create really secure passwords …

Roboform is a password management software that lets you create different strong login passwords(Roboform is a password tool you can use to help you generate secure passwords)

For a tutorial on how to change your admin password, go here: What To Do If You Need To Reset Your Password

Security Measure #5 – Prevent The wp-config.php File From Being Visible

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.

WordPress WP Config file

(wp-config.php file)

If a hacker breaks into your WordPress site, they will normally look for 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 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, 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 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 remove these files, then just rename them.

Security Measure #7 – Upgrade Your WordPress Software, Themes & Plugins

Hackers are always on the lookout for vulnerabilities they can exploit in outdated versions of WordPress, including out-of-date versions of WP themes and plugins.

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible via the WP dashboard menu)

This means that anyone logging into your blog’s admin can see and modify your WordPress theme files, and cause havoc 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 – Prevent Access To The WordPress Uploads Directory

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

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

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

(WordPress uploads folder)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, anyone can upload unauthorized file types or compromise 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, uploading 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 hire a professional if you are unsure about what to do.

Security Measure #10 – Install Security Plugins

Several WordPress security plugins are available that will address many common security issues WordPress site owners face, such as preventing unauthorized users from gaining access to vital areas of your site, protecting your site from malicious exploits, 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 website files and damaging your site is SecureScanPro.

SecureScanPro - WP complete security software

(SecureScanPro – WordPress security software)

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 security plugin you may want to look at using is BlogDefender.

Blog Defender Security Solution For WordPress Websites & Blogs

Blog Defender(Blog Defender)

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

BlogDefender scans you WordPress installation for security holes …

Blog Defender Security Product Suite For WordPressAnd lets you quickly fix these …

Blog DefenderIf you don’t want to invest in 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 secure platform, but neglecting simple maintenance tasks like keeping your WP software, plugins and themes up-to-date, tightening file and data security and taking other necessary precautions can expose your website 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, securing your website is something you simply cannot afford to ignore.

As a final reminder of the importance of website security, below is the advice given by a web security expert to all WordPress users after the large-scale brute-force attacks by botnets 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 provided you with the initial guidelines and help you need 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 service provider in our WordPress Services Directory.

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

***

"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org

***

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