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 frequently the target of malicious attacks by hackers, due to its popularity.

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

These attacks were caused by botnets (computers infected with viruses and programmed to attack other sites with security vulnerabilities).

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)

One of the many ways hackers will attempt to break into WordPress sites is by trying to guess the site admin’s login username and password. To do this, hackers use software tools that can guess hundreds of login possibilities in minutes.

If you’re using easy-to-guess user names and passwords, your website can be an easy target for hackers.

This is called a “brute-force” login 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)

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

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

The screenshot below was taken from an internet security monitoring site showing the locations of the command centers of ZeuS – a botnet that has been actively compromising computer networks all around the world since 2009 …

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

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

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

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

WordPress is the world's most popular content management system which makes it a frequent target for attempted hacking attacks

(WordPress powers millions of websites worldwide, making it a frequent target for hacker attacks)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

To learn why WordPress is a secure platform for websites, see this article: Why WordPress Is A Secure Platform For Websites –

Useful Information

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

Mike Little, the co-founder 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)

How To Protect Your WordPress Site From Brute-Force Attacks – 10 Security Measures

Every website or blog with a security vulnerability offers some value to hackers. An unsecured web site not only offers new hackers opportunities to improve their hacking skills and win “respect” amongst their peers, but it can also be a valuable resource for launching DDoS attacks, spreading malware and as a source of information theft.

If someone can find a security weakness in your system that allows them to gain remote access and control of your website, your website can then be employed to target other valued websites.

Additional undesirable effects 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 and page title and descriptions, malicious redirects to phishing sites, drive-by downloads (adding malware on your visitors’ computers), and many other nasty things.

The truth is that software-driven bots are most likely scouring for security exploits and trying to hack into your web site while you are reading these very words. Whether they can be successful or not, depends on how hard or easy you have made things for hackers and bots to continue trying until they either work out how to get access, or decide to look for an easier target.

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

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

Hackertarget - Website Security Scan(Hackertarget – Website Security Check Source: Hackertarget.com)

You will see that the check will display a number of results and information about your site …

WordPress Security Scan

(Hackertarget – WordPress security check results. Screenshot source: Hackertarget.com)

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

Hackertarget - Website Security Check(Screenshot image: BlogDefender website)

The ability 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 this informs them about any vulnerabilities, especially in older versions.

If your website is driven by WordPress and you’re not taking steps to bolster the security of your site, we can practically guarantee that, at some point in time, someone will attempt to hack your website, because these brute-force attacks are systematically targeting WordPress installations all the world!

When a site is broken into, 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 entirely wiped out. Often, sites will be infected with malicious scripts or viruses without the owner’s knowledge or awareness.

To help avoid the heartache of having your website or blog being hacked into, we have listed below ten simple, yet essential and effective security measures that will help to protect your WordPress site from brute force attacks.

Useful Information

Note: Some of the recommended steps below require some technical understanding of how to modify core WordPress and server files. If you are not technical, 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 – Contact Your Hosting Service

Contact your webhosting company and ask them what security systems are in place to protect your site from being attacked, and what they do to ensure that your server files and data get backed up.

Make sure that your webhosting company backs up your sites and that, if anything should happen, you can quickly and easily get back your files.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Frequently Updated

Never rely 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 develop a habit of performing a full 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 full WordPress site maintenance routine looks like this …

Maintaining your WP website backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website or blog completely backed up and up-to-date is vitally important for WordPress security. Screenshot image: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WordPress site frequently 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 WordPress maintenance yourself, get someone else to do it but make sure it gets done. Backing up your site is the next most important thing you should do after making sure that you still have a pulse!

If you don’t want to back up your site manually, there are a number of WordPress plugins you can use. You can read about a WordPress backup plugin that can automate your backup process here: Back Up, Duplicate & Keep Your WordPress Site Protected With Backup Creator Plugin For WordPress

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

The brute-force botnet attack on WordPress sites was mostly attempting to compromise website administrator panels and gain access to sites by exploiting WordPress sites that used “admin” as the username.

For security purposes, don’t set up WordPress sites with the username admin. This is the first area hackers will test. If your site’s user name is admin, change it immediately.

We have created a simple tutorial that shows you how to change your admin username here: How To Change Your WordPress Admin Username To Another Username

Security Measure #4 – Your Password

A “brute force” attack occurs when malicious software persistently hits a login or password field with different character strings in an attempt to guess the right login combination that will give the hacker access to your site.

Unless some measure is put into place to block the brute-force attack from happening (see further below for a couple of effective ways to do this), the “bot” will just persist in attacking your site until it eventually “cracks” the code.

Passwords that are easy to guess, therefore, are really easy targets for botnets. Make sure that you change your password combination to a string that contains at least 8 or 9 characters long, and that includes upper and lowercase letters, and add a few “special” characters (%^#$@&*).

Useful Tip

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

Roboform is a password tool you can use to help you generate different strong login passwords(You can use a password tool like Roboform to create strong passwords)

We have created a step-by-step tutorial created especially for non-technical admin users on how to change your admin password here: Changing Your WordPress Password

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

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

WordPress WP Config file

(WordPress WP Config file)

If hackers break into your WordPress 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 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 accessible. 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 WP 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 Files, Themes And Plugins

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

In WordPress, you can access the WordPress Theme Editor by selecting Appearance > Editor from the main menu …

WP Theme Editor Menu

(Accessing the WordPress theme editor using the main menu)

This allows anyone accessing your blog’s admin area to view and change your WordPress files, or create mayhem on your site.

To prevent unauthorized 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 – Prevent Access To The WordPress Uploads Directory

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

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

(WordPress uploads folder)

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

If any directories in your website have vulnerabilities that can be exploited by malicious users, someone could 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 an empty file called “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone with experience if you are unsure about what to do.

Security Measure #10 – Security Plugins

There are a number of great WordPress security plugins available that will address common security issues faced by WordPress website owners, such as preventing unauthorized users from accessing your site, protecting your website from brute-force attacks, preventing unauthorized file uploads, etc.

Many 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 files and damaging your site is SecureScanPro.

SecureScanPro - WordPress security plugin

(SecureScanPro – WordPress complete security plugin)

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

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

Blog Defender

Blog Defender(Blog Defender Security Suite For WordPress)

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

BlogDefender scans you web site for potential security weaknesses …

Blog Defender WordPress Security SolutionAnd lets you easily fix these …

Blog Defender WordPress Security PluginIf you don’t want to purchase 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 very secure web platform, but neglecting essential maintenance tasks like ensuring that your WordPress core files, WordPress plugins and themes are kept up-to-date, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

No matter what kind of business you run or plan to run online and how small you think your web presence is, securing your sites is something you cannot ignore.

As one last reminder, below is the advice given by an expert on website security to all WordPress users following the mass 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, the information in this article has given you the initial steps you need to take 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 when we publish new tutorials on WordPress security and reviews of new WordPress security plugins and solutions.

***

"I love the way your email series "Infinite Web Content Creation Training Series" is documented and presented. It is very absorbing and captivating. The links and tutorials are interesting and educational. This has motivated me to rewrite my content following the concepts I am learning from the email series." - Mani Raju, www.fortuneinewaste.com

***

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