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 an easy target for malicious attacks by hackers.

In April 2013 a global brute-force attack hit WordPress installations across almost every web host in existence.

These attacks were caused by infected computer networks programmed to attack other computers (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 WordPress sites. One of these is by trying to guess the site’s administration login username and password. This can be achieved with scripts and tools that can work through hundreds of login combinations in minutes.

If you’re using obvious login details, your website can be easily hacked by persistent attempts to guess your site’s login details.

This is called a “brute-force” attack.

Botnet Definition

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)

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

Botnets are regularly used to send mass spam emails from computers of unsuspecting users.

The screenshot below was 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 globe since 2009 called “Zeus” …

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

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

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

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

Being the world's most used content management system makes WordPress a target for hacker attacks

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

Does This Mean We Shouldn’t Use WordPress Anymore?

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

We explain what makes WordPress a very secure platform for websites in this article: Is WordPress Secure?

Info

It’s important to note that, in the case of the mass brute force botnet attack described above, no specific WordPress vulnerability was 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 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)

Protecting Your WordPress Blog From Brute-Force Attacks – 10 Security Points

Every blog with a security vulnerability offers some value to hackers. An unsecured web site not only presents newbie hackers opportunities to improve their skills and win “respect” from their peers, but it can also acts as a valuable platform for distributed attacks, distributing malware and participating in information theft.

If someone can exploit a security vulnerability in your system that lets them gain remote control of your web site, your site can then be employed as a “bot” to attack larger and more valuable web sites.

Additional undesirable results of having your website hacked and your site security compromised include being blacklisted by Google, having spammy links advertising things like gambling, discounted fashion, etc. inserted in your content, malicious redirects to phishing sites, drive-by downloads (adding malicious software on your visitors’ computers), and many other nasties.

The reality is that hackers are most likely scouring for security weaknesses and trying to break into your site while you are reading this article at this very moment. Whether they will achieve this or not, will depend on how hard or easy you will make it for hackers or bots to keep trying until they find a way to get in, or are forced to give up and decide to look for an easier 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 - Website Security Scan(WP Security Scan Product image: Hackertarget.com)

You will see that the check returns a number of results and details about your website setup …

Hackertarget - Website Security Check

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

It should be obvious after using the above tool that if you can see all of this information, then hackers can too.

Hackertarget - Website Security Check(Product image source: Blog Defender)

The ability 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 on your server can all be potentially useful information to hackers, as these can inform them about potential security weaknesses, especially in older versions.

If your site or blog runs on WordPress and you are not taking steps to bullet-proof your site, then it’s practically guaranteed that, at some point, your site will be hacked, or at least targeted by bots, because these attacks are systematically hitting WordPress installations worldwide!

When a website is hacked, webmasters can discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been altered or even that their content has been entirely wiped out. Often, most compromised sites will become infected with malicious scripts or viruses without the owner’s knowledge or awareness.

To help avoid the heartache (and significant financial loss) of having your website or blog being hacked into, we have listed below 10 simple, yet essential and effective security measures that will help to prevent your WordPress site from brute force botnet attacks.

Important

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

***

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

Get in touch with your webhosting provider and ask them what systems have been put in place to protect your site from being attacked, and what is done to make sure that your server files and data get backed up.

Make sure that your webhosting provider is regularly backing up your sites and that, if anything happens, you can easily recover your files and data.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Or Blog Regularly Updated

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

A proper WordPress maintenance routine ensures that:

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

A proper WP maintenance routine looks like this …

Maintaining your WordPress website or blog regularly backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP site fully backed up and up-to-date is vitally important for WordPress security. Source: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WP web site completely backed up and up-to-date. WordPress 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 maintenance yourself, get someone else 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. Learn about a WordPress backup plugin that can fully automate your site backups here: Backup, Copy & Keep Your WordPress Web Site Protected With Backup Creator Plugin For WP

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

The brute-force botnet attack on WordPress sites was mostly attempting to compromise site admin panels by exploiting WP installations with “admin” as their account name.

For security purposes, avoid installing sites with the username admin. This is the first area of potential vulnerability hackers will test. If your blog’s username is admin, you will need to change this immediately.

We have created a simple step-by-step tutorial that shows you how to change your login username here: Changing Your Admin User Name In WordPress

Security Measure #4 – Your Password

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

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

Passwords that are easy to guess, therefore, become really easy targets for hackers. Make sure that you change your password to something containing at least 8 characters long, and that includes upper and lowercase letters, combined with a few “special” characters (^%$#&@*).

Useful Tip

Roboform is a password program you can use to help you generate different secure passwords …

You can use a password management tool like Roboform to generate difficult passwords(Roboform is a password management program that lets you generate strong login passwords)

We have created a simple step-by-step tutorial that shows you how to change your password here: What To Do If You Need To Reset Your Password In WordPress

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

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.

WordPress WP Config file

(wp-config.php file)

If a hacker breaks into your website, they will 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 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 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 Blog 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 – Keep Your WordPress Site, Plugins And Themes Up-To-Date

Hackers are always on the lookout for vulnerabilities they can exploit in older versions of WordPress, including outdated versions of WordPress plugins and themes.

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress installations come with a built-in editor that lets site administrators edit theme and plugin files from the dashboard area.

In WordPress, you can access your WordPress Theme Editor by selecting Appearance > Editor in your admin menu …

WP Theme Editor Menu

(Accessing the WordPress theme editor via the dashboard menu)

The WordPress theme editor feature allows anyone accessing your site to view and edit your WP theme templates, or create mayhem on your site.

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 Directory

The “uploads” folder contains all the media files that get uploaded to your website.

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

(WordPress uploads directory)

(WordPress uploads folder)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, someone can upload unauthorized file types or compromise the security of your site.

Protecting your directories will prevent unauthorized people 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 called “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone who knows what they are doing if you are unsure about what to do.

Security Measure #10 – Install WordPress Security Plugins

Several WordPress security plugins 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 files from malicious scripts, 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 issues that could lead to hackers accessing your site files and causing damage to your site is SecureScanPro.

SecureScanPro - complete security software 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 great plugin you may want to look at using is BlogDefender.

Blog Defender WordPress Security Solution

Blog Defender Security Plugin For WordPress(Blog Defender)

Blog Defender 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 DefenderAnd then shows you how to easily fix these …

Blog Defender Security Suite For WordPressIf you don’t want to buy a security plugin like SecureScanPro or BlogDefender, you can use various free WordPress 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 installation, plugins and themes up-to-date, tightening file and data security and taking other necessary precautions can have disastrous consequences.

No matter what type of business you run or plan to run online and how small you think your web presence is, you simply cannot afford to ignore the importance of securing your site.

As a final reminder of the importance of keeping your websites protected, below is the advice given by a website security expert to all WordPress users after 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 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 consult a WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified when we publish new tips on WordPress security and reviews of 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

***

Originally published as How To Protect Your WordPress Site From A Brute-Force Attack.