Blog

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 powers millions of sites worldwide, making it an obvious target for malicious attacks by hackers.

In 2013, WordPress installations around the world were subjected to mass brute force attacks.

These attacks were caused by botnets (networks of infected computers programmed to attack other computers with security vulnerabilities).

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

About 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 WordPress sites is by trying to guess the site’s administration login username and password. This is achieved using software programs that can guess hundreds of login permutations in minutes.

If you’re using obvious 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” attack.

Botnets – What Are They?

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 infected with malicious code or scripts, which can then be controlled remotely as a group, often without the computer owners even being aware that this is going on.

Botnets are normally used used to send mass spam emails.

The screenshot below was taken from an online security monitoring site 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” …

ZeuS is a botnet that has been actively infecting computer networks all around the globe since 2009.

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

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

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

Being the world's most used CMS makes WordPress an obvious target for hacking

(WordPress is the world’s most used CMS which makes it an obvious target for attacks by hackers)

Does This Mean We Should Stop Using WordPress?

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 why WordPress is a secure web platform, see this article: Can You Build A Secure Business Online Using WordPress?

Useful Information

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

Mike Little, one of the co-founders 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)

How To Prevent Your WordPress Site From Brute Force Attacks – Ten Security Checks

You may think that your website has no significant value to hackers, but the reality is that to a hacker, all websites are an opportunity to benefit or profit at your expense.

If a hacker can exploit a way to access and take over your website, that blog can then be used as part of a larger network of “bots” to target larger and more valuable websites.

Additional undesirable results of having your website hacked and your site security compromised include getting blacklisted by Google, having stealthy spam links advertising things like online meds, cheap offers on brand names, etc. inserted in your content and meta data, redirecting visitors to phishing sites, drive-by downloads (adding malicious software on your visitors’ computers), and lots of other nasty things.

The truth is that software-driven bots are most likely scouring for exploits and trying to hack into your website at this very moment. Whether they can hack into your site or not, depends on how difficult or easy you can make it for them to continue persisting until they either work out how to break in, or give up and decide to look for an easier target.

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

Does your website run on WordPress? If so visit a site like Hackertarget.com and run your website through their WordPress security check …

WP Security Check(WP Security Check Product image: Hackertarget.com)

You will see that the scan returns various results and information about your site setup …

Hackertarget - Website Security Scan

(Hackertarget – WP security check results. Screenshot: Hackertarget.com)

It should be obvious after using the tool shown above that if you can freely access all of this information about your website, then hackers can too.

Website Security Check(Screenshot source: BlogDefender.com)

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 are all potentially valuable information to hackers, as this can inform them about potentially exploitable security vulnerabilities, especially in older versions.

If your site or blog is powered by WordPress and you’re not taking appropriate steps to bolster the security of your site, then it’s practically guaranteed that, at some point, someone will attempt to hack your site, because these brute-force attacks are systematically hitting WordPress sites worldwide!

When a website gets compromised, blog owners can find themselves completely “locked out” of their own site, or notice that their files have been interfered with or even that their content has been completely wiped out. Typically, sites will be infected with malicious scripts without the owner even being aware that this has occurred.

To help avoid the heartache and aggravation (and potential financial loss) that comes with discovering that your website or blog has been hacked into, we have listed below ten essential and effective security measures that will help to prevent your WordPress site from being brute force attacked.

Warning

Note: A few of the recommended measures below require some technical understanding of how to modify core WordPress and 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 technical provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Webhosting Company

Get in touch with your host and ask them what precautions have been put in place to help prevent your site from botnet attacks, and what is done to make sure that your site files get regularly backed up.

It is important to check that your host backs up your server files 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 Website Or Blog Regularly Maintained

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

A proper WordPress maintenance routine ensures that:

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

A complete WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important maintaining your WordPress website or blog completely backed up and up-to-date is. WordPress 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 maintenance yourself, pay someone to do it but make sure this gets done. Backing up your site is the next most important thing you must do after making sure that your heart is still beating!

If you don’t want to perform manual backups, there are many WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Back Up, Copy And Keep Your WordPress Site Protected With Backup Creator WP Plugin

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

the worldwide brute-force botnet attack on WordPress is mostly an attempt to compromise site administrator panels and gain access to the site by exploiting WP sites that used “admin” as their username.

For website security purposes, avoid installing a WordPress site with the username “admin”. This is the first thing hackers will test. If your blog’s username is admin, you need to change this immediately.

For a detailed tutorial for non-technical WordPress users on how to change your WordPress username, go here: How To Change Your WordPress Admin Username

Security Measure #4 – Use A Strong Password

A “brute force” attack occurs when a malicious script continually tries to guess the right username and password characters that will unlock your site.

Unless some measure is put into place to stop 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 works out the combination.

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

Tip

You can use a password program like Roboform to help you generate hard-to-crack passwords …

You can use a password software tool like Roboform to create difficult passwords(You can use a password tool like Roboform to help you generate very secure passwords)

We have created a detailed tutorial on how to change your admin password here: What To Do If You Need To Reset Your WordPress Password

Security Measure #5 – Prevent Access To Your WP Config File

The wp-config.php file contains important information about your WP database and is used to define advanced WordPress options.

WP Config file

(wp-config.php file)

If a hacker breaks into your site, they will look 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.

In order to protect your WordPress site from being attacked and even being used as part of a bot net, therefore, you must 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 – Rename Or Delete Unnecessary Installation Files

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

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

Security Measure #7 – Upgrade Your WordPress Software, Plugins And Themes

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

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

Security Measure #8 – Disable Your Theme Editor

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

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 dashboard menu)

This means that anyone logging into your site can see and edit your theme templates, and create havoc 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 editing your wp-config.php file.

Security Measure #9 – Prevent Access To The WordPress Uploads Folder

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

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

(WordPress uploads folder)

(WordPress has an uploads directory where media content is stored)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, this can seriously threaten the security of your site.

Protecting your directories will prevent unauthorized people 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 file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are unsure about what to do.

Security Measure #10 – Use WordPress Security Plugins

Several WordPress security plugins are available that specifically address most security issues faced by WordPress website owners, such as preventing hackers from gaining access to vital information about your site, protecting your files from botnets, preventing unauthorized file uploads, 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 potential issues that could lead to hackers accessing your files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WP total security plugin

(SecureScanPro – WP security software)

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

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

Blog Defender Security Suite

Blog Defender Security Suite For WordPress(Blog Defender)

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

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

Blog Defender Security Plugin For WordPress Websites & BlogsAnd then shows you how to fix these quickly, easily and inexpensively …

Blog Defender WordPress Security SolutionIf you don’t want to buy a 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 platform, but neglecting simple maintenance tasks like keeping your WP core files, WordPress plugins and WP themes updated to their latest versions, tightening file and data security and taking other necessary precautions can have disastrous consequences.

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

As one last reminder, below is the advice given by an expert on web security to all WordPress users following the worldwide brute-force attacks by botnets 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, this information has provided you with the initial steps you need to take to prevent brute-force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please seek help from a 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 via email when we publish new tutorials on WordPress security and tutorials about new security plugins and solutions.

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***