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 popular CMS makes WordPress a frequent target for attempted hacker attacks.

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

These attacks were caused by botnets (networks of infected computers 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)

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. This is done with software tools that can guess hundreds of possible login combinations in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be an easy target for hackers.

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.org)

A “Botnet” is a network of computers that have been infected with malicious scripts or software, which are then controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is taking place in their machine.

Botnets are regularly used to blast mass spam emails.

The screenshot below was taken from a site that monitors online security showing the locations of the command centers of ZeuS – a botnet that has been actively infecting computer networks all around the world since 2009 …

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

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

These ongoing botnet attacks are highly distributed and well organized. Over 90,000 IP addresses were identified by several hosting companies just in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress site administration areas. The large-scale attack continued after this, with over 30,000 WordPress blogs being hacked per day.

News of the large-scale brute-force attack was reported by all of 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 …

Being the world's most popular CMS makes WordPress a target for attempted hacking attacks

(WordPress is the world’s most popular CMS which makes it a frequent target for malicious attacks by hackers)

Does This Mean WordPress Is Not Secure And We Should Stop Using It?

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

To learn what makes WordPress a very secure platform for websites, see this article: Is WordPress Secure? What Every Blog Owner Needs To Know About WordPress Security

Important Info

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

Mike Little, the co-founder 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 Website From Brute-Force Attacks – Ten Security Points

You may think that your website is of little value to hackers, but the reality is that to a hacker, all websites are an opportunity to gain some advantage at your expense.

If hackers can find a security flaw that allows them to gain complete control of your web site, your web site can then be used to attack more valued sites.

Additional undesirable results of having your site hacked include getting blacklisted by Google, having stealthy spam links promoting things like online meds, porn, etc. in your content, malicious redirects to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasty things.

The reality is that malicious bots are most likely trying to break into your website or blog right now. Whether they will successfully break into your site depends on how hard or easy you will make it for hackers or bots to continue persisting until they can discover how to get access, or are forced to decide to look for an easier target.

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

If you visit a site like Hackertarget.com and run your site through their WordPress security check …

Hackertarget - WP Security Scan(WP Security Check Product image source: Hackertarget.com)

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

Hackertarget - WP Security Check

(Hackertarget – WordPress security check results. Screenshot source: Hackertarget.com)

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

WP Security Scan(Screenshot image: BlogDefender.com)

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 on your server are all useful information to hackers, as this informs them about exploitable security weaknesses, especially in older versions.

If your site or blog runs on WordPress and you’re not taking steps to toughen up your site, then it’s practically guaranteed that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically hitting WordPress installations all the world!

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

To help avoid the heartache (and potential loss of valuable business data) of discovering that your site has been hacked into, below are 10 essential and effective security checks that will help to protect your WordPress site from being attacked by brute force botnet hacking attempts.

Info

Note: Some of the measures shown below require some technical skills to modify core WordPress and/or server files. If you are not technical-minded, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Hosting Service

Get in touch with your hosting company and ask them exactly what systems are in place to protect your site from being attacked, and what they do to ensure that your server files get backed up.

Make sure that your webhosting provider regularly backs up your sites and that, if disaster strikes, you can easily recover your files and data.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Site Regularly Up-To-Date

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

A complete 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 proper WP site maintenance routine looks like this …

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

Again, we cannot stress enough how important it is to maintain your WP website or blog frequently backed up and updated. WordPress maintenance is not hard to do 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, pay a professional to do it but make sure this gets done. Backing up your site is the next most important thing you should do after making sure that your heart is still beating!

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: Back Up, Clone & Keep Your WP Websites Protected With Backup Creator WordPress Plugin

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

the worldwide brute force attack on WordPress sites was mostly an attempt to compromise website administrator panels and gain access to the site by exploiting installations with “admin” as their username.

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 blog’s user name is “admin”, then make sure you change it immediately.

We have created a detailed step-by-step tutorial for WordPress users that shows you how to change your admin username here: Changing Your WordPress Username From Admin To A Different Username

Security Measure #4 – Change Your Password

A “brute force” attack occurs when a malicious script continually tries to guess the right combination of characters in a username and password that will give them access to your site.

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 keep attacking your site until it eventually gets access.

Weak passwords, therefore, make really easy targets for attacks. Make sure that you change your password combination to something that is at least 8 characters long, with both upper and lowercase letters, and “special” characters (^%$#&@*).

Useful Tip

You can use a password software tool like Roboform to help you generate hard-to-guess passwords …

Roboform is a password software you can use to help you generate secure login passwords(Roboform is a password program that lets you easily generate very secure passwords)

We have created a detailed step-by-step tutorial on how to change your WordPress admin password here: What To Do If You Need To Change WordPress Passwords

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

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 hackers break into your WordPress site, they will typically look for your 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.

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 Installation Files

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

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

Security Measure #7 – Update Your WordPress CMS, Themes & Plugins

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

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

Security Measure #8 – Disable Your Theme Editor

WordPress comes with a built-in editor feature that allows the administrator to edit plugin and theme files inside the dashboard area.

In WordPress, you can access the WordPress Theme Editor by selecting Appearance > Editor from the dashboard menu …

WordPress Theme Editor Menu

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

This means that anyone logging into your site’s admin can view and edit your theme files, and cause mayhem on your site.

If you want to prevent unauthorized people from accessing 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 – Remove Access To Your Site’s Uploads Folder

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

Normally, this folder is visible to all users online. All someone has to do to see the contents stored in the “uploads” folder is visit the directory using a web browser …

(WordPress has an uploads directory where media content is 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 could become a serious threat to 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, adding 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 ask for assistance from someone with experience if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

Some great WordPress security plugins are available that specifically address most common security issues faced by WordPress website owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your site from botnets, preventing injections of code into files, etc.

Many 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 site files and causing damage to your site is SecureScanPro.

SecureScanPro - total security plugin for WordPress

(SecureScanPro – total security software for WordPress)

SecureScanPro is easy to install and easy to use, and addresses 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 WordPress Security Solution

Blog Defender Security Product Suite For WordPress(Blog Defender)

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

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

Blog DefenderAnd lets you fix these quickly …

Blog Defender Security Plugin For WordPressIf 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 secure web platform, but neglecting simple maintenance tasks like updating your WordPress installation, plugins and WordPress themes, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

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

As one last reminder, below is the advice given by an expert on web security to all WordPress users after 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, website security is very important if you run a WordPress site. Hopefully, the information in this article will help 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 WordPress technical provider in our WordPress Services Directory.

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

***

"I have used the tutorials to teach all of my clients and it has probably never been so easy for everyone to learn WordPress ... Now I don't need to buy all these very expensive video courses that often don't deliver what they promise." - Stefan Wendt, Internet Marketing Success Group

***