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 SecurityWhen you are the leading CMS platform in the world and the preferred online publishing platform for millions of websites and loved by thousands of web developers and web designers, it’s inevitable that at some point in time, WordPress will become an easy target for attacks by hackers wanting to score a “big win”.

In early 2013 a global brute force attack struck WordPress installations on virtually every WP host server in existence around the world.

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

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

Brute-Force Attacks – Definition

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 scripts and software tools that can work through hundreds of login permutations in minutes.

If you’re using predictable user names and passwords, your website could be easily hacked by persistent attempts to work out your site’s login details.

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

A “Botnet” is a network of private computers that have been compromised and infected with malicious code, which are then controlled remotely as a group, typically without the unsuspecting computer owners even being aware of this.

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

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

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

These were well organized and highly distributed attacks on WordPress. Over 90,000 IP addresses were identified by a number of webhosting companies in the initial attack alone, when millions of attempts to force their way into WordPress user admin areas took place. The brute-force attacks then continued, with over 30,000 WordPress blogs being hacked each day.

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

WordPress powers millions of sites around the world, making it a target for hacking attacks

(WordPress is often the target of large-scale attacks by hackers)

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

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

We explain why WordPress is a secure web platform in this article: Are Open Source CMS Platforms Like WordPress Secure?

Important

It’s important to note that, in the case of the mass brute force attack described above, was no specific vulnerability in WordPress being exploited (the same script was also attacking sites built using other CMS 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 Blog From Being Brute-Force Attacked – 10 Security Measures

Every blog with a security vulnerability offers some value to hackers. A compromised website not only offers hackers opportunities to improve their skills and win “respect” amongst their peers, but it can also acts as a resource for stealth attacks, distributing malware and participating in information theft.

If hackers can find a way to gain any form of control of your web site, the site can then be employed to attack more highly-valued websites.

Additional undesirable impacts of having your site hacked and your site security compromised include being blacklisted by Google, having spammy links promoting things like online meds, cheap offers on brand names, etc. inserted into your content and page title and descriptions, malicious redirects to phishing sites or other websites, drive-by downloads (adding malicious programs on your visitors’ computers), and lots of other nasties.

The truth is that hackers are trying to hack into your website or blog as you are reading these very words. Whether they will get into your site or not, will depend on how hard or easy you have made things for them to continue persisting until they find a way to get in, or give up and go look for a less secure target.

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

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

WordPress Security Scan(WP Security Check Screenshot source: Hackertarget.com)

You will see that the test will yield various results and details about your WordPress setup …

Hackertarget - WP Security Scan

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

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

WP Security Check(Product image: 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 are all useful information to hackers, as these can inform them about potentially exploitable security weaknesses, especially in older versions.

If your site or blog is powered by WordPress and you are not proactive steps to toughen up your site, then we can practically guarantee that, at some time in the near future, someone will attempt to hack your installation, because these attacks are systematically targeting WordPress sites all the world!

Whenever a website is hacked, website owners will find themselves “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 even being aware that a security breach has happened.

To avoid the heartache that comes with discovering that your site has been hacked into, we have listed below ten simple, yet essential and effective security measures that will help to protect your WordPress site from being attacked by brute force hackers.

Warning

Note: A few of the recommended steps listed below need some technical understanding of how to modify core WordPress and/or server files. If you are not technical, or don’t want to mess around with file code, then ask your web host or a professional WordPress service provider for help.

***

Security Measure #1 – Get In Touch With Your Web Host

Contact your hosting provider and ask them exactly what security precautions they have put in place to help prevent your site from being attacked, and what is done to make sure that your files and data are regularly being backed up.

Check that your webhosting service provider is regularly backing up your server files and that, if anything goes wrong, you can easily recover your files.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Website Or Blog Frequently Updated

Never rely only on your host 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 on a frequent basis (e.g. daily, weekly, fortnightly, etc …)

A proper 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 WordPress themes, plugins and software components are up-to-date,
  • etc …

A complete WP maintenance routine looks like this …

Maintaining your WP web site completely backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP website or blog frequently backed up and up-to-date is vitally important for WordPress security. Image: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WP website or blog completely backed up and up-to-date. WP 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 do not want to learn how to do WP site maintenance yourself, pay a professional to do it but make sure it gets done. Backing up your website is the next 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 a number of free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Backup, Clone & Keep Your WordPress Web Sites Protected With Backup Creator Plugin For WP

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

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

For reasons of website security, avoid setting up WordPress sites with the username “admin”. This is the first area hackers will test. If your site’s username is “admin”, then change this immediately.

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

Security Measure #4 – Choose A Strong Password

A “brute force” attack occurs when malicious software continually and persistently hits a username and password field with different character strings trying to guess the right login combination that will unlock your website.

Unless you put some measure in place to stop the brute force attack from happening (see further below for a couple of effective suggestions for doing this), the “bot” will just keep attacking your site until it eventually works out the combination.

Weak passwords, therefore, make very easy targets for bot attacks. Make sure that you change your password to something that is at least 8 characters long, with upper and lowercase letters, and add a few “special” characters (e.g. %, #, *, etc).

Practical Tip

Roboform is a password management tool that lets you easily create secure passwords …

Roboform is a password tool that lets you easily create different secure login passwords(Roboform is a password program that lets you easily create different secure login passwords)

For a simple tutorial for non-technical WP admin users on how to change your login password, go here: Changing Your WordPress Password

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 WordPress options.

wp-config.php file

(WP Config file)

If a hacker breaks into your site, they will typically look for the wp-config.php file, because this is the file that contains important information about your site’s database, 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.

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 easily accessed. 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 Website Installation Files

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

You can remove these files after installation. If you don’t want to delete these files, just rename them.

Security Measure #7 – Update Your WordPress Software, Plugins And Themes To Their Latest Version

Hackers are always on the lookout for vulnerabilities in earlier versions of WordPress that can be exploited, including outdated versions of themes and plugins.

Make sure to keep all of your installation files, plugins, themes, etc. up-to-date.

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the main menu)

The WordPress theme editor feature allows anyone accessing your site to view and change your WordPress files, or cause mayhem 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 – Remove Access To The WordPress Uploads Folder

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

Normally, this folder is visible to all users online. All a person needs to do to view the contents in the “uploads” directory is navigate to your directory using their browser …

(WordPress has an uploads folder where your media files are stored)

(WordPress uploads directory)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers, someone could upload unauthorized file types or compromise the security of your website.

Protecting your directories will prevent online users from viewing 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 called “index.php”) to your uploads directory, and so on. Again, it’s best to get professional help if you are not sure about what to do.

Security Measure #10 – Use Security Plugins

There are a number of great security plugins for WordPress available that will address most common security issues WordPress site owners face, such as preventing hackers from gaining access to vital information about your site, protecting your files from malicious software, preventing unauthorized file uploads, 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 files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WordPress complete security plugin

(SecureScanPro – security software solution for WordPress)

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

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

Blog Defender Security Plugin For WordPress Web Sites

Blog Defender Security Product Suite For WordPress(Blog Defender WordPress Security Solution)

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 the security weaknesses in your web site are …

Blog Defender Security Solution For WordPressAnd lets you fix these quickly, easily and inexpensively …

Blog DefenderIf you don’t want to buy a security plugin like SecureScanPro or BlogDefender, then use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting essential maintenance tasks like keeping your WP software, plugins and WordPress themes up-to-date, tightening file and data security and taking other necessary precautions can expose your website to malicious by hackers and bots.

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 simply cannot ignore.

As one last reminder, below is the advice given by a web security expert to all WordPress users following the worldwide brute-force attacks 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 given you the initial guidelines and direction 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 technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications when we publish new articles on WordPress security and tutorials about new WordPress security plugins.

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***