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 SecurityWhen you are the leading CMS platform in the world and the online publishing platform of choice used by millions of businesses and loved by thousands of web developers and website designers, it’s inevitable that at some point in time, WordPress will come under attack by hackers.

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

These attacks were caused by networks of infected computers programmed to attack other vulnerable 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 ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. To attempt this, hackers use software tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re not using strong usernames or unguessable passwords, your website can be an easy target for hacking attempts.

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/botnet)

A “Botnet” is a network of private computers that have been infected with malicious code or scripts, which can then be controlled remotely as a group, often without the unsuspecting computer owners even being aware that this is going on.

Botnets are typically used to send out mass spam emails.

Below is a screenshot 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” …

ZeuS is a botnet that 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. Image source: SecureList.com)

These were highly distributed and well organized attacks on WordPress sites. Over 90,000 IP addresses were identified by a number of hosting companies in the initial attack, when millions of attempts to force their way into WordPress users admin areas took place. The large-scale brute-force attacks then continued, with over 30,000 WordPress sites and blogs being hacked per 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, Tech Crunch, BBC News, PC Magazine, and even on the official website of the US Department of Homeland Security …

WordPress powers millions of sites around the world, which makes it a natural target for hacker attacks

(WordPress is the world’s most popular CMS making it an obvious target for attacks by hackers)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

We explain why WordPress is a secure web platform in this article: Why WordPress Is A Secure Platform For Websites –

Important Info

It’s important to understand that, in the case of April 2013 mass brute-force attack described above, there was actually no WordPress vulnerability being exploited (the same script was also attacking 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)

Protecting Your WordPress Site From Being Brute Force Attacked – Ten Security Points

You may think that your website or blog offers little to no value to hackers, but the reality is that every website has value to a malicious user.

If a malicious user can exploit a security opening in your system that lets them control your blog, your website can then be used as part of a larger network of “bots” to target other highly-valued websites.

Additional undesirable impacts of having your site hacked include being blacklisted by search engines, having stealthy spam links advertising things like gambling, porn, etc. inserted in your content, redirecting visitors to phishing sites and other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasties.

The harsh reality is that hackers are most likely trying to hack into your blog as you are reading these very words. Whether they will do this successfully depends on how hard or easy you can make it for hackers to keep persisting until they discover how to break in, or are forced to decide to look for a less protected target.

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

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

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

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

WP Security Check

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

It should be obvious after using the scanning tool that if you can see all of this information about your website, hackers can too.

Hackertarget - WP Security Check(Product image: BlogDefender website)

The ability to see which version of WordPress you are using, which plugins and themes you have installed, and which files have been uploaded to certain directories are all useful information to hackers, as this informs them about exploitable security vulnerabilities, especially where the owners haven’t updated their software versions.

If your website is driven by WordPress and you’re 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 site is broken into, site owners will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been vandalized or even that their content has been entirely wiped out. Often, sites will be infected with malicious software or viruses without the owner’s knowledge or awareness.

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

Useful Info

Note: A few of the recommended measures below require some technical skills to modify core WordPress and/or server files. If you have no web skills, or don’t want to mess around with file code, then ask your web host or a professional WordPress service provider for assistance.

***

Security Measure #1 – Contact Your Webhosting Company

Get in touch with your webhosting provider and ask them what systems have been put into place to help prevent your site from being attacked, and what they are doing to make sure that your files and data get backed up.

It is important to check that your hosting service provider backs up your sites and that, if anything goes wrong, you can quickly and easily recover your files.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Website Regularly Up-To-Date

You should never rely just on your web host for site backups. Instead, learn how to manage your WordPress site or pay someone to get this service done for you and maintain a habit of performing a complete WordPress site maintenance routine on a frequent basis (e.g. weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

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

A complete WordPress maintenance routine looks like this …

Maintaining your WordPress site backed up and updated is vitally important for WordPress security.(Maintaining your WordPress web site backed up and updated is vitally important for WordPress security. Screenshot source: WPTrainMe.com)

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

If you don’t want to back up your files manually, 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: Back Up, Copy & Keep Your WordPress Websites And Blogs Protected With Backup Creator Plugin For WP

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

the worldwide brute force botnet attack on WordPress sites was mostly attempting to compromise website administrator panels by exploiting sites using “admin” as the account name.

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

For a detailed tutorial that shows you how to change your WordPress username, go here: How To Change Your WordPress Username From Admin To A Different Username

Security Measure #4 – Use A Strong Password

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

Unless some measure is put into place to prevent the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just continue to attack your site until it eventually gets access.

Passwords that are easy to guess, therefore, are really easy targets for brute force attacks. Make sure that you change your password to a string that is at least 8 or 9 characters long, with both upper and lowercase letters, combined with a few “special” characters (^%$#&@*).

Practical Tip

You can use a password software tool like Roboform to generate secure passwords …

Roboform is a password management software that lets you generate different secure passwords(Roboform is a password software you can use to create very secure passwords)

For a simple tutorial for WordPress users that shows you how to change your admin password, go here: Changing Passwords

Security Measure #5 – Protect Your WP Config File

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

wp-config.php file

(wp-config.php file)

If a hacker breaks into your WordPress website, they will typically search for your 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 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 access 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 WP Installation Files

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

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

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

Hackers look for vulnerabilities they can exploit in outdated WordPress versions, including out-of-date versions of WordPress themes and plugins.

Make sure to always keep your WordPress application files, themes, plugins, etc. up-to-date.

Security Measure #8 – Disable The Theme Editor

WordPress comes with a built-in editor that lets the administrator edit theme and plugin code from the dashboard.

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible using the dashboard menu)

This means that anyone logging into your site’s admin area can view and edit your WordPress theme templates, or cause 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 editing your wp-config.php file.

Security Measure #9 – Remove Access To The Site’s Uploads Folder

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

Normally, this folder is visible to online users. All someone has to do to see all of the contents in the “uploads” folder is visit your directory using their browser …

(WordPress uploads folder)

(WordPress uploads folder)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by malicious users, anyone 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, uploading 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 get professional help if you are unsure about what to do.

Security Measure #10 – Security Plugins

There are some great WordPress security plugins available that specifically address most common security issues faced by WordPress website owners, such as preventing hackers from gaining access to vital information about your site, protecting your files from brute-force attacks, preventing unauthorized file uploads, etc.

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

SecureScanPro - WP complete security plugin

(SecureScanPro – WP total 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 plugin you may want to consider using is BlogDefender.

Blog Defender

Blog Defender Security Suite For WordPress(Blog Defender)

Blog Defender is a suite of WordPress security video tutorials, WordPress plugins and tools, plus WordPress security documentation in PDF and DOC formats.

BlogDefender scans you web site for security weaknesses …

Blog Defender Security Solution For WordPressAnd then shows you how to fix these quickly, easily and inexpensively …

Blog Defender WordPress Security SolutionIf you don’t want to purchase a premium 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 installation, plugins and themes updated to their latest versions, tightening file and data security and taking other necessary precautions can expose your website to attacks 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, securing your web sites is something you simply cannot ignore.

As one last reminder of the importance of website security, below is the advice given by a web security expert to all WordPress users after the large-scale 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, this article has shown you what to do 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 service provider in our WordPress Services Directory.

Also, please subscribe to WPCompendium.org to be notified when we publish new tutorials on WordPress security and tutorials about new security plugins.

***

"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

***