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 for millions of businesses and loved by thousands of website developers and website designers, it’s inevitable that at some point in time, WordPress will come under attack from hackers wanting to score a “big win”.

In early 2013 a global brute force attack struck WordPress installations on virtually every web host in existence.

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

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

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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site admin’s login username and password. This is achieved with scripts and software that automatically tries to guess hundreds of login combinations in minutes.

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

This is called a “brute-force” login attack.

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)

”Botnets” are networks of computers that have been infected with malicious code, 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 often used to blast out mass spam emails.

Below is a screenshot taken from an online security monitoring site showing the locations of the command centers of ZeuS – a botnet that has been actively compromising computer networks all around the globe since 2009 …

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

(ZeuS is a botnet that has been actively compromising computer networks all around the world since 2009. Image: SecureList.com)

These botnet attacks on WordPress are well organized and highly distributed. Over 90,000 IP addresses were identified by a number of hosting companies in the initial attack alone, when the web was flooded with millions of attempts to force their way into WordPress site admin areas. The attacks then continued, with over 30,000 WordPress sites and blogs being hacked every day.

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

WordPress is the world's most used content management system making it an obvious target for attempted hacker attacks

(WordPress is the world’s most used content management system which makes it a target for attempted hacker attacks)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are lots of great reasons why you should use WordPress if you are concerned at all about the security of your online presence.

We explain why WordPress is a secure web platform in this article: Is WordPress A Secure Website Platform?

Important

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

Mike Little, the co-founder of WordPress, 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 – Ten Security Measures

Every blog with a vulnerability has some potential value to hackers. A vulnerable site not only provides wannabe hackers opportunities to improve their skills and win “respect” among their peers, but it can also be a resource for denial of service attacks, spreading malware and as a source of information theft.

If a malicious user can discover a way to gain any form of control of your web site, the web site can then be employed as part of a larger network of “bots” to target more valued websites.

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

The reality is that brute-force software bots are probably looking for weaknesses and trying to hack into your website while you are reading this at this very moment. Whether they will achieve this will depend on how hard or easy you can make things for hackers to continue trying until they can work out how to get in, or are forced to give up and decide to look for a less secure target.

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

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

Website Security Scan(Website Security Scan Product image: Hackertarget.com)

You will see that the test will yield a number of results and information about your WordPress setup …

Website Security Check

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

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

WordPress Security Scan(Image source: BlogDefender.com)

Being able 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 in your site can be potentially valuable information to hackers, as this informs them about potentially exploitable vulnerabilities, especially where site owners haven’t updated their files.

If your website is driven by WordPress and you are not preventive steps to bullet-proof your site, we can practically guarantee that, at some time in the near future, someone will attempt to hack your website, because these brute force attacks are systematically targeting WordPress installations all the world!

Whenever a website gets compromised, webmasters can 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. Typically, sites will become infected with malicious software or viruses without the owner even being aware of it.

To avoid the heartache (and significant financial loss) of discovering that your website or blog has been hacked into, below are 10 essential and effective security measures that will help to prevent your WordPress site from brute force attacks.

Important

Note: A few of the measures below require some technical skills to modify core WordPress or server files. If you are not technical-minded, 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 Webhosting Service

Contact your webhosting company and ask them what security measures they offer to help prevent your site from being attacked, and what is done to make sure that your WordPress sites get regularly backed up.

It is important to check that your hosting provider backs up your server files and that, if disaster strikes, you can easily get back your files.

Security Measure #2 – Perform Regular WordPress Backups And Keep Your Website Or Blog Regularly Updated

Never rely on your hosting service for site backups. Instead, learn how to maintain your WordPress site or get this done for you and maintain a habit of performing a complete WordPress site maintenance routine on a regular basis (e.g. daily, weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

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

A complete WP maintenance routine looks like this …

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

Again, we cannot stress enough how important it is to maintain your WordPress installation fully 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 do not want to learn how to do WordPress site 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 your heart is still beating!

If you don’t want to back up your site manually, there are a number of free and paid WordPress plugins you can use. You can read about a WordPress backup plugin that can automate your backup process here: Back Up, Duplicate & Protect Your WordPress Websites And Blogs With Backup Creator WP Plugin

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

The large scale brute force attack on WordPress is mostly an attempt to compromise site admin panels by exploiting WP installations using “admin” as the account name.

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

For a detailed step-by-step tutorial on how to change your WordPress username, go here: How To Change Your Admin User Name In WordPress To A Different User Name

Security Measure #4 – Change Your Password

A “brute force” attack occurs when a malicious script persistently hits a username and password field with different strings of characters trying to guess the right login combination that will give the hacker entry to your site.

Unless you put some measure in place to block the brute-force attack from happening (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 “cracks” the code.

Passwords that are easy to guess, therefore, are very easy targets for attacks. Make sure that you change your password combination to something that is at least eight or nine characters long, with upper and lowercase letters, combined with a few “special” characters (e.g. %, #, @, etc).

Useful Tip

You can use a password management tool like Roboform to generate difficult passwords …

You can use a password software tool like Roboform to generate strong login passwords(You can use a password software tool like Roboform to create hard-to-crack passwords)

We have created a step-by-step tutorial created especially for non-technical WordPress users on how to change your password here: What To Do If You Need To Reset Passwords In WordPress

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

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

wp-config.php

(wp-config.php)

If a hacker breaks into your WordPress website, they will 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 a hacker to change anything in your database, create a user account, upload files and take control of your site.

To protect your WordPress site from attacks and even being used as part of a bot net, therefore, you must prevent people finding 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 your install.php, upgrade.php and readme.html files.

These files can be deleted after installation. If you don’t want to delete these files, then just rename them.

Security Measure #7 – Upgrade Your WordPress Blog, Themes & 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.

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the WordPress main menu)

The WordPress theme feature lets anyone accessing your site’s admin view and edit your files, and create mayhem on your site.

To prevent unauthorized people from accessing 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 – Secure The Site’s Uploads Folder

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

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

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

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

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, this could become a serious threat to the security of your site.

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 an empty file named “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are not sure about what to do.

Security Measure #10 – Install WordPress Security Plugins

There are a number of security plugins for WordPress available that specifically address common security issues faced by WordPress website owners, such as preventing hackers from gaining access to vital areas of your site, protecting your site from botnets, preventing unauthorized file uploads, etc.

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

SecureScanPro - complete security plugin for WordPress

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

Blog Defender

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

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

BlogDefender scans you WordPress installation for potential security vulnerabilities …

Blog DefenderAnd lets you easily fix these …

Blog Defender Security Product SuiteIf you don’t want to purchase a premium 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 WP software, plugins and WP themes up-to-date, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

Regardless of the kind 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 web security.

As one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on website 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, website security is of the utmost importance if you run a WordPress site. Hopefully, this information has provided you with 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 seek help from a professional WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications whenever we publish new tutorials on WordPress security and reviews of new security plugins and solutions.

***

"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org

***

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