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 used CMS making it a frequent target for hacking attempts.

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

These attacks were caused by networks of infected computers programmed to attack other installations, also commonly known as “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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. To do this, hackers use software programs and scripts that automatically tries to guess hundreds of possible logins in minutes.

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

This is called a “brute force” login attack.

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)

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

Botnets are regularly used to send mass spam emails.

Below is a screenshot taken from an internet security monitoring site showing the locations of the command centers of a botnet that has been actively infecting computer networks all around the world since 2009 called “Zeus” …

The Zeus botnet 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. Image source: SecureList.com)

The ongoing botnet attacks on WordPress are highly distributed and well organized. Over 90,000 IP addresses were identified by several webhosting companies in the initial attack alone, when millions of attempts to force their way into WordPress users admin areas took place. The large-scale brute force attacks continued after this, with over 30,000 WordPress blogs being hacked every day.

News of the April 2013 worldwide brute-force botnet attack was widely reported in all of the major webhosting companiesand leading technology publications, such as TechNews Daily, Forbes, Tech Crunch, PC Magazine, BBC News, and even on the official website of the US Department of Homeland Security …

WordPress is frequently the target of malicious attacks by hackers

(WordPress often comes under attack by hackers)

Does This Mean We Should Stop Using WordPress?

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

We explain why WordPress is a secure platform for websites in this article: How Secure Is WordPress?

Useful Info

It’s important to understand that, in the case of the brute force attack described above, no specific WordPress vulnerability was being exploited (the same script was also attacking sites built using platforms like Joomla).

Mike Little, the co-founder of WordPress, made the following comment 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)

How To Protect Your WordPress Blog From Being Brute-Force Attacked – 10 Security Checks

Every website or blog with a security vulnerability can be an opportunity to hackers. A vulnerable web site not only provides new hackers opportunities to improve their skills and win “respect” amongst their peers, but it can also serve as a platform for launching stealth attacks, distributing malware and engaging in information theft.

If hackers can find a way to compromise the control of your web site, that website can then be employed to attack more valued websites.

Additional undesirable consequences of being hacked and your site security compromised include getting blacklisted by search engines, having stealthy spam links advertising things like online meds, cheap offers on brand names, etc. inserted in your content, malicious redirects to phishing sites and other websites, drive-by downloads (adding malicious scripts on your visitors’ computers), and many other nasties.

The truth is that hackers are looking for security weaknesses and trying to hack into your blog right now. Whether they can get into your site or not, depends on how hard you can make things for hackers or bots to keep persisting until they can discover a way to get access, or are forced to 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 a site like Hackertarget.com and run your site through their WordPress security check …

Hackertarget - WordPress Security Scan(WordPress Security Check Screenshot: Hackertarget.com)

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

Website Security Scan

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

It should be obvious after using the above tool that if you are able to freely access all of this information, hackers can too.

Hackertarget - Website Security Check(Screenshot: Blog Defender)

Being able 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 valuable information to hackers, as this can inform them about any security weaknesses, especially where site owners haven’t updated their sites.

If your website is driven by WordPress and you’re not taking appropriate steps to toughen up your site, it’s practically guaranteed that, at some point in time, someone will attempt to hack your installation, because these brute force attacks are systematically targeting WordPress sites worldwide!

Typically, when a website or blog is compromised, webmasters will discover much to their dismay that they have been “locked out” of their own site, or notice that their content has been altered or even entirely wiped out. Typically, sites will become infected with malicious software or viruses without the owner even being aware that this has happened.

To avoid the heartache and frustration (and potential financial loss) of having your website being hacked into, below are 10 simple, yet essential and effective security measures that will help to protect your WordPress site from being brute force attacked.

Note

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

***

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

Get in touch with your webhosting provider and ask them exactly what precautions are in place to protect your site from brute force attacks, and what they do to ensure that your files and data get backed up.

It’s important to check that your web host regularly backs up your server files and that, if disaster strikes, you can easily get your site back.

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

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

A full WordPress maintenance routine ensures that:

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

A full WordPress maintenance routine looks like this …

Maintaining your WordPress website or blog frequently backed up and updated is vitally important for WordPress security.(Maintaining your WordPress installation regularly backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WordPress web site frequently backed up and updated is. WP site maintenance is not hard to do 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 WP site maintenance yourself, get someone else to do it but make sure this gets done. Backing up your site is the second most important thing you must do after making sure that your heart is still beating!

If you don’t want to back up your data 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: Back Up, Clone And Keep Your WP Site Protected With Backup Creator Plugin For WordPress

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

The large scale brute force attack on WordPress sites was mostly attempting to compromise website administrator panels by exploiting sites using “admin” as the user name.

For reasons of website security, never set up WordPress sites with the username admin. This is the first area hackers will test. If your blog’s username is admin, then change this immediately.

We have created a step-by-step tutorial that shows you how to change your admin username here: How To Change Your WP Admin Username To A More Secure User Name

Security Measure #4 – Choose A Strong Password

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

Unless some measure is put into 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 attacking your site until it eventually “cracks” the code.

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

Practical Tip

You can use a password management tool like Roboform to help you generate very secure passwords …

You can use a password software tool like Roboform to generate strong login passwords(You can use a password management program like Roboform to help you generate passwords)

We have created a tutorial on how to change your WordPress admin password here: How To Change Your Password In WordPress

Security Measure #5 – Prevent Access To Your wp-config.php File

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.

wp-config.php file

(wp-config.php)

If hackers break into your site, they will typically try to access the 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.

To protect your WordPress site from being attacked and even being used as part of a bot net, therefore, prevent people finding your wp-config.php file. 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.

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

Security Measure #7 – Update Your WordPress Files, Plugins And Themes

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

Ensure that all of your WordPress 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 area.

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor via the main menu)

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

To prevent unauthorized people from accessing the WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Remove Access To Your WordPress Uploads Folder

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

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

(WordPress uploads directory)

(WordPress uploads directory)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, this can 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, uploading a blank index.php file (this is literally an empty file named “index.php”) to your uploads directory, and so on. Again, it’s best to consult a professional if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

Some great security plugins for WordPress are available that will address many common security issues WordPress site owners face, such as preventing hackers from accessing vital areas of your site, protecting your website from brute-force attacks, preventing injections of code into files, 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 files and damaging your site is SecureScanPro.

SecureScanPro - WP security software

(SecureScanPro – total security software for WordPress)

SecureScanPro is easy to install and easy to use, and fixes most of the security issues that WordPress users need to address.

Another security plugin you may want to consider using is BlogDefender.

Blog Defender Security Product Suite

Blog Defender(Blog Defender Security Plugin For WordPress Sites)

This product is a package of WordPress security video tutorials, plugins and tools, plus WordPress security documentation in PDF and DOC formats.

BlogDefender shows you where potential security weaknesses in your website are …

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

Blog Defender Security SuiteIf you don’t want to purchase 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 web platform, but neglecting basic maintenance tasks like making sure that your WordPress software, WordPress plugins and themes are kept updated to their latest versions, 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, you simply cannot ignore the importance of web security.

As a final reminder of the importance of keeping your websites protected, below is the advice given by an expert on web security to all WordPress users following the worldwide 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, WordPress security is very important if you run a WordPress site. Hopefully, the above article 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 WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified via email whenever we publish new articles and tutorials on WordPress security and tutorials about new WordPress security plugins and solutions.

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***