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 frequently comes under attack by hackers, due to its global popularity.

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

These attacks were caused by computers infected with viruses and programmed to attack other sites (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. To do this, hackers use scripts and tools that automatically tries to guess hundreds of possible logins in minutes.

If you’re using weak user names and weak passwords that are easy to guess, your site can be easily hacked by persistent attempts to work out your site’s login details.

This is called a “brute-force” login 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 infected with malicious software, which can then be controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is taking place.

Botnets are often used to blast mass spam emails from the infected computers of unsuspecting users.

The screenshot below was taken from a site that monitors online security 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” …

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 world since 2009. Screenshot image: SecureList.com)

These were well organized and highly distributed attacks on WordPress. Over 90,000 IP addresses were identified by several webhosting companies in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress users administration areas. The brute-force attacks continued after this, with over 30,000 WordPress blogs being hacked every day.

News of this brute force botnet attack was widely reported in all of the major webhosting companies, as well as the leading technology 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 …

WordPress is often the target of malicious attacks by hackers, due to its popularity

(WordPress often is targeted by hackers, due to its popularity)

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

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

We explain why WordPress is a secure platform for websites in this article: Can You Build A Secure Business Online Using WordPress?

Important

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

Mike Little, the co-founder of WordPress with Matt Mullenweg, made this comment 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 site with a security vulnerability offers some value to hackers. A compromised blog not only provides hackers opportunities to improve their skills and claim “bragging rights” amongst their peers, but it can also be a valuable platform for launching DDoS attacks, distributing malware and as a source for creating information theft.

If a malicious user can exploit a vulnerability in your security setup and gain complete control of your blog, the website or blog can then be employed as part of a larger network of “bots” to target more valuable web sites.

Additional undesirable effects of having your website hacked include getting blacklisted by Google, having stealthy spam links advertising things like viagra, discounted fashion, etc. inserted in your content, redirecting visitors to phishing sites, drive-by downloads (adding malicious scripts on your visitors’ computers), and many other nasty things.

The harsh reality is that malicious bots are very likely searching for weaknesses and trying to break into your site at this very moment. Whether they can hack into your site or not, will depend on how difficult you have made things for them to continue trying until they can work out a way to break in, or are forced to give up and go look for an easier target.

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

Do you own a WordPress site? If so, visit Hackertarget.com and run your website through their WordPress security scan …

Hackertarget - WordPress Security Check(Hackertarget – Website Security Scan Product image: Hackertarget.com)

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

Website Security Check

(website security scan results. Screenshot: 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, so can hackers.

Hackertarget - WP Security Scan(Screenshot image: Blog Defender)

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 are all potentially useful information to hackers, as this informs them about potentially exploitable holes or weaknesses, especially where site owners haven’t updated their sites.

If your site or blog is powered by WordPress and you are not precautionary steps to harden your site, we can practically guarantee that, at some point, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically hitting WordPress installations around the world!

Typically, whenever a website or blog is hacked, webmasters will find themselves completely “locked out” of their own site, or notice that their content has been vandalized or that everything has been entirely wiped out. Typically, compromised sites will become infected with malicious scripts without the owner even being aware that this has occurred.

To help avoid the heartache of having your website or blog being hacked into, we have listed below 10 essential and effective security measures that will help to protect your WordPress site from being attacked by brute-force hackers.

Note

Note: Some of the measures below need 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 a professional WordPress technical provider for help.

***

Security Measure #1 – Contact Your Webhosting Service Provider

Contact your web host and ask them exactly what systems have been put into place to protect your site from being attacked, and what is done to ensure that your site files get backed up.

It’s important to check that your host backs up your sites and that, if anything goes wrong, you can quickly and easily get your site back.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Website Or Blog Regularly Updated

You should 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 maintain a habit of religiously performing a complete WordPress site maintenance routine frequently (e.g. weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

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

A proper WordPress site maintenance routine looks like this …

Maintaining your WP site regularly backed up and updated is vitally important for WordPress security.(Maintaining your WordPress installation frequently backed up and up-to-date is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WP installation completely backed up and up-to-date is. 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 WP maintenance yourself, pay a professional to do it but make sure it gets done. Backing up your website is the second most important thing you should do after making sure that you are still breathing!

If you don’t want to perform manual backups, there are many plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Backup, Copy And Protect Your WordPress Sites With Backup Creator Plugin For WP

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

the worldwide brute-force botnet attack on WordPress is mostly an attempt to compromise website admin panels by exploiting installations using “admin” as the username.

For security purposes, avoid setting up WordPress 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 it immediately.

We have created a detailed step-by-step tutorial for admin users on how to change your username here: How To Change Your Admin Username In WordPress

Security Measure #4 – Choose A Strong Password

A “brute force” attack occurs when a malicious script continually hits a username and password field with different strings of characters in an attempt to guess the right combination that will unlock your website.

Unless you put some measure in place to stop the brute force attack (see further below for a couple of effective ways to do this), the “bot” will just continue attacking your site until it eventually breaks into your admin area.

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

Tip

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

Roboform is a password software you can use to generate strong passwords(Roboform is a password software you can use to generate different secure passwords)

We have created a simple step-by-step tutorial for non-technical admin users that shows you how to change your WordPress password here: What To Do If You Need To Change Passwords In WordPress

Security Measure #5 – Deny 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 WordPress options.

WP Config file

(wp-config.php file)

If hackers break into your website, they will search for your wp-config.php file, because this file contains important information about your site’s database, 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 being attacked and even being used as part of a bot net, therefore, prevent people from being able to easily view 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 Website Installation Files

Delete or rename 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, then just rename them.

Security Measure #7 – Keep Your WordPress Site, Themes And Plugins Up-To-Date

Hackers look for vulnerabilities in older versions of WordPress that can be exploited, including out-of-date versions of plugins and themes.

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 feature that lets the administrator edit plugin and theme code from the dashboard area.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the admin menu)

This allows anyone accessing your blog to view and edit your WordPress files, or cause mayhem on your site.

If you want to prevent people from accessing your 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 Directory

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

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

(WordPress uploads folder)

(WordPress uploads directory)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers, this can seriously threaten 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 get professional assistance if you are not sure about what to do.

Security Measure #10 – Use Security Plugins

There are some great security plugins for WordPress available that will address 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 software, preventing injections of code into files, etc.

Most WordPress plugins address some but not all areas of WordPress security. One security plugin that does a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your website files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - total security software solution for WordPress

(SecureScanPro – total security software for WordPress)

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

Blog Defender

Blog Defender(Blog Defender Security Suite For WordPress)

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

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

Blog Defender WordPress Security Product SuiteAnd then shows you how to quickly fix these …

Blog Defender Security Plugin For WordPress WebsitesIf you don’t want to buy a 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 secure platform, but neglecting basic maintenance tasks like keeping your WordPress core files, plugins and WP themes up-to-date, tightening file and data protection and taking other necessary precautions can expose your site 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, website security is something you cannot ignore.

As a final reminder, below is the advice given by a security expert 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, website security is very important if you run a WordPress site. Hopefully, the information in this article has provided you with the initial guidelines and help you need to keep your WordPress site protected from brute force attacks. If you need any further help or assistance with WordPress security, please consult a professional WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

Also, please remember to subscribe to WPCompendium.org to receive notifications whenever we publish new tips on WordPress security and reviews of new WordPress security plugins and solutions.

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***