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

In April 2013 a mass brute-force attack struck WordPress installations across virtually every host server in existence.

These attacks were caused by networks of infected computers programmed to attack other sites (botnets).

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 admin’s login username and password. To achieve this, hackers use software tools and scripts that can work through hundreds of possible logins in minutes.

If you’re using weak user names and predictable passwords, your website can be an easy target for hackers.

This is called a “brute force” attack.

Botnet – What Is This?

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 infected with malicious code, which are then controlled remotely as a group, often without the computer owners even being aware of this.

Botnets are typically used to blast mass spam emails from computers of unsuspecting users.

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

ZeuS is a botnet that has been actively compromising 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. Screenshot: SecureList.com)

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

Coverage of this brute force attack was widely reported in 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 US Department of Homeland Security website …

Powering millions of websites and blogs worldwide makes WordPress an obvious target for malicious attacks by hackers

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

Does This Mean We Should Stop Using WordPress?

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

We explain what makes WordPress a very secure platform for websites in this article: Is WordPress A Secure Platform For Websites?

Important

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

Every site with a security vulnerability can be an opportunity to hackers. A vulnerable blog not only offers hackers opportunities to improve their skills and win “respect” from their peers, but it can also acts as a platform for stealth attacks, spreading malware and defrauding online users through information theft.

If a malicious user can find a way to take over your blog, the website can then be used as a “bot” in a planned cyberattack against larger and more valued websites.

Additional undesirable effects of having your website hacked and your site security compromised include being blacklisted by Google, having stealthy spam links promoting things like online meds, discounted fashion, etc. inserted into your content and meta data, redirecting visitors to phishing sites and other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasties.

The truth is that malicious bots are trying to break into your web site as you are reading this page right now. Whether they can get into your site or not, depends on how hard you can make things for hackers to keep persisting until they discover how to break in, or give up and decide to look for a more vulnerable target.

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

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

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

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

Hackertarget - WP Security Check

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

It should be obvious after using the tool shown above that if you can see all of this information, then hackers can too.

Hackertarget - WP Security Scan(Screenshot: BlogDefender website)

The ability to see what version of WordPress you are using, which plugins and themes you have installed, 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 holes or weaknesses, especially in older versions.

If your website is powered by WordPress and you are not taking steps to toughen up your site, it’s practically guaranteed 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 worldwide!

Typically, whenever a website or blog gets compromised, webmasters can find themselves completely “locked out” of their own site, or notice that their files have been altered or even that their content has been completely wiped out. Often, most sites will become infected with malicious software or viruses without the owner’s knowledge or awareness.

To avoid the heartache (and significant financial loss) of having your website or blog being hacked into, we have listed below ten simple, yet essential and effective security checks that will help to prevent your WordPress site from being brute force attacked.

Info

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

***

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

Contact your host and ask them exactly what systems have been put into place to help prevent your site from botnet attacks, and what they do to ensure that your server files and data get regularly backed up.

Make sure that your web host is regularly backing up your server files and that, if anything happens, you can easily get back your files and data.

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

Never rely only on your web host for site backups. Instead, learn how to maintain your WordPress site or get this done for you and develop a habit of performing a complete site maintenance routine frequently (e.g. weekly, fortnightly, etc …)

A complete WordPress maintenance routine ensures that:

  • All unnecessary files and data are removed,
  • All WP 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 installation completely backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP website or blog frequently backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WordPress website or blog frequently backed up and updated. WP maintenance is not hard to do or time-consuming, but it must be done to ensure the security of your website. If you do not want to learn how to do WordPress maintenance yourself, pay someone to do it but make sure it gets done. Backing up your site is the next most important thing you should do after making sure that you are still breathing!

If you don’t want to back up your site manually, there are many plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Backup, Duplicate & Keep Your WP Websites Protected With Backup Creator Plugin For WP

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

The large scale brute force attack on WordPress is mostly an attempt to compromise website admin panels by exploiting installations with “admin” as the user name.

For reasons of website security, don’t install sites with the username “admin”. This is the first area of potential vulnerability hackers will test. If your site’s user name is admin, then change this immediately.

We have created a simple tutorial that shows you how to change your WordPress username here: How To Change Your WP Admin User Name To A Different Username

Security Measure #4 – Choose A Strong Password

A “brute force” attack occurs when a malicious script continually and persistently hits a login or password field with different strings of characters trying to guess the right login combination that will give them entry to your website.

Unless you put some measure in place to prevent 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 works out the combination.

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

Tip

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

You can use a password program like Roboform to create very secure passwords(Roboform is a password management tool that lets you easily create very secure passwords)

For a detailed step-by-step tutorial that shows you how to change your password, go here: How To Reset Your Password

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

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

wp-config.php

(WP Config file)

If a hacker breaks into your WordPress site, they will typically look for the wp-config.php file, because this file 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, prevent your wp-config.php file from being easily accessible. 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

Delete or rename the install.php, upgrade.php and readme.html files from your server.

These files can be deleted after installation. If you don’t want to remove these files, then just rename them.

Security Measure #7 – Keep Your WordPress Installation, Plugins & Themes Up-To-Date

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

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress comes with a built-in editor that lets the administrator edit plugin and theme code from the dashboard.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the main menu)

This allows anyone accessing your blog’s admin to view and modify your theme templates, and cause havoc on your site.

If you want to prevent unauthorized people from being able to access 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 The Site’s Uploads Folder

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

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

(WordPress uploads folder)

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

If any files stored in his folder have vulnerabilities that can be exploited by hackers or malicious users, this can threaten the security of your site.

Protecting your directories will prevent unauthorized people 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 an empty file called “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 some great security plugins for WordPress available that will address most common security issues WordPress website owners face, such as preventing unauthorized users from accessing your site, protecting your site 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 website files and causing damage to your site is SecureScanPro.

SecureScanPro - total security software solution for WordPress

(SecureScanPro – security plugin for WordPress)

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

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

Blog Defender Security Product Suite For WordPress Websites & Blogs

Blog Defender(Blog Defender Security Plugin 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 shows you where the security holes in your web site are …

Blog Defender Security Product SuiteAnd lets you fix these quickly, easily and inexpensively …

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

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

As one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on website security to all WordPress users following 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, WordPress security is very important if you run a WordPress site. Hopefully, the information in this article has given you the initial steps you need to take 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 WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications via email whenever we publish new tips on WordPress security and tutorials about new WordPress 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.