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 SecurityWordPress powers millions of websites and blogs worldwide, which makes it a target for hacker attacks.

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

These attacks were caused by infected computer networks programmed to attack other vulnerable installations (called “botnets”).

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

Brute Force Attacks – An Overview

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 methods hackers use to try and break into WordPress sites. One of these is by trying to guess the site admin’s login username and password. This can be achieved with software programs and scripts that automatically tries to guess hundreds of login possibilities in minutes.

If you’re using weak user names and passwords that are easy to guess, your website could be an easy target for hackers.

This is called a “brute force” attack.

What Are Botnets

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)

”Botnets” are networks of computers that have been compromised and infected with malicious code, which are then controlled remotely as a group, often without the computer owners’ knowledge.

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

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

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

(The Zeus botnet has been actively infecting computer networks all around the globe since 2009. Image source: SecureList.com)

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

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

Being the world's most used CMS makes WordPress a target for attacks by hackers

(Powering millions of websites around the world makes WordPress a target for hacking attempts)

Does This Mean We Should Stop Using WordPress?

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

To understand why WordPress is a secure platform for websites, read this article: WordPress Security What Every Website Owner Needs To Know About WordPress Security

Important

It’s important to understand that, in the case of April 2013 large-scale brute force 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, 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 Blog From Brute Force Attacks – Ten Security Measures

You may think that the information in your website or blog has no significant value to hackers, but the reality is that all websites are valuable to a malicious user.

If someone can hack into and gain remote control of your site, the site can then be employed as a “bot” in a planned cyber attack against larger and more valuable websites.

Additional undesirable impacts of being hacked and your site security compromised include getting blacklisted by Google, having stealthy spam links advertising things like casinos, cheap offers on brand names, etc. inserted into your content and page title and descriptions, malicious redirects to phishing sites, drive-by downloads (adding malware on your visitors’ computers), and lots of other nasties.

The reality is that brute-force software bots are looking for vulnerabilities and trying to hack into your web site while you are reading this. Whether they will hack into your site successfully depends on how hard or easy you will make things for them to continue persisting until they discover a way to get access, or give up and decide to look for a less secure target.

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

If you visit Hackertarget.com and run your site through their WordPress security scan …

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

You will see that the test will return various results and information about your site …

Hackertarget - WordPress Security Check

(website security scan results. Screenshot source: Hackertarget.com)

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

Hackertarget - WordPress Security Check(Screenshot image: Blog Defender)

Being able 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 can be potentially useful information to hackers, as this informs them about potential vulnerabilities, especially where the owners haven’t updated their software versions.

If your site or blog is driven by WordPress and you are not proactive steps to bolster the security of your site, then we can practically guarantee that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute-force attacks are systematically targeting WordPress sites worldwide!

Typically, when a site gets hacked, blog owners will find themselves completely “locked out” of their own site, or notice that their files have been interfered with or even that their content has been completely wiped out. Typically, compromised sites will become infected with malicious scripts without the owner’s knowledge or awareness.

To help avoid the heartache of discovering that your website has been hacked into, we have listed below ten simple, yet essential and effective security measures that will help to prevent your WordPress site from brute force botnet attacks.

Important Info

Note: Some of the recommended steps below require some technical understanding of how to modify core WordPress and/or server files. If you have no technical skills, 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

Contact your host and ask them exactly what measures have been put in place to protect your site from botnet attacks, and what they do to ensure that your server files and data get backed up.

Check that your hosting company regularly backs up your sites and that, if anything should happen, you can quickly and easily get back your site.

Security Measure #2 – Perform Regular WordPress Backups And Keep Your Site Regularly Maintained

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

A full WordPress maintenance routine ensures that:

  • All unnecessary files and data are deleted,
  • All WordPress files and data 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 website backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website or blog fully backed up and updated is vitally important for WordPress security. Screenshot: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WordPress web site regularly backed up and up-to-date. WordPress maintenance is not hard 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 site maintenance yourself, pay someone to do it but make sure it gets done. Backing up your website is the next most important thing you must do after making sure that your heart is still beating!

If you don’t want to back up your site manually, there are many free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Backup, Copy And Protect Your WP Website With Backup Creator Plugin For WordPress

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

The brute force attack on WordPress is mostly an attempt to compromise website admin panels by exploiting sites with “admin” as the username.

For reasons of website security, 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, then change this immediately.

We have created a simple step-by-step tutorial on how to change your login username here: Changing Your WordPress Admin User Name To A Different Username

Security Measure #4 – Use 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 in an attempt to guess the right combination that will give them entry to your site.

Unless some measure is put into place to block 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 works out the combination.

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

Useful Tip

Roboform is a password tool that lets you easily create different unguessable passwords …

You can use a password management tool like Roboform to create secure login passwords(You can use a password management tool like Roboform to generate secure passwords)

We have created a simple step-by-step tutorial for WordPress users that shows you how to change your password here: Changing Passwords

Security Measure #5 – Prevent Access To Your WP Config File

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

wp-config.php file

(WordPress WP Config file)

If hackers break into your WordPress site, they will search for your wp-config.php file, because this file 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 being attacked and even being used as part of a bot net, therefore, prevent your wp-config.php file from being accessible. 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

Rename or delete the install.php, upgrade.php and readme.html files from your server.

These files are not required after installation and can be deleted. If you don’t want to delete these files, just rename them.

Security Measure #7 – Update Your WordPress Site, Plugins & Themes To Their Latest Version

Hackers are always on the lookout for vulnerabilities they can exploit in outdated versions of WordPress, including outdated 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 the administrator to edit plugin and theme code inside the dashboard.

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

WordPress Theme Editor Menu

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

This means that anyone logging into your site’s admin area can view and edit your WP theme templates, and cause havoc 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 adding code to your wp-config.php file.

Security Measure #9 – Secure Your Site’s Uploads Folder

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

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

(WordPress uploads directory)

(WordPress uploads folder)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by malicious users, this can seriously threaten 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, 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 use a professional if you are unsure about what to do.

Security Measure #10 – Security Plugins

There are some great security plugins for WordPress available that specifically address common security issues WordPress website owners face, such as preventing hackers from gaining access to vital information about your site, protecting your files from malicious scripts, preventing injections of code into files, etc.

Most WordPress plugins address some but not all areas of WordPress security. One WordPress 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 damaging your site is SecureScanPro.

SecureScanPro - complete security software solution for WordPress

(SecureScanPro – WP total security software)

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

Blog Defender

Blog Defender Security Plugin For WordPress(Blog Defender)

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

BlogDefender scans you WordPress installation for potential security weaknesses …

Blog Defender WordPress Security PluginAnd lets you quickly and easily fix these …

Blog Defender WordPress Security SuiteIf you don’t want to invest in 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 web platform, but neglecting basic maintenance tasks like updating your WordPress software, plugins and themes, tightening file and data protection 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, securing your site is something you cannot afford to ignore.

As one last reminder, below is the advice given by an expert on website security to all WordPress users after the worldwide 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, the information in this article will help prevent brute-force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please seek help from a professional WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

Also, don’t forget to subscribe to WPCompendium.org to receive notifications via email when we publish new information on WordPress security and tutorials about new security plugins and solutions.

***

"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.