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 SecurityWhen you are the most popular content management system in the world and the online publishing platform of choice for millions of websites and loved by thousands of website developers and web designers, it’s inevitable that at some point in time, WordPress will come under attack by hackers wanting to score a “big win”.

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

These attacks were caused by botnets (infected computer networks 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 can be achieved with software tools that automatically tries to guess hundreds of possible logins in minutes.

If you’re using easy-to-guess login details, your site could be easily hacked by repeated attempts to work out your site’s login details.

This is called a “brute-force” 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 compromised and infected with malicious software, which are then controlled remotely as a group, often without the computer owners even being aware of this.

Botnets are often used to send mass spam emails.

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 globe since 2009.

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

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

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

WordPress often comes under attack by hackers

(Powering millions of sites around the world makes WordPress an obvious target for attempted attacks by malicious users)

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 business.

To learn why WordPress is a secure web platform, see this article: Can You Build A Secure Business Online Using WordPress?

Info

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

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

How To Protect Your WordPress Site From Being Brute-Force Attacked – Ten Security Measures

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

If hackers can find a security flaw in your system that lets them gain stealth control of your website, that site can then be employed as a “bot” in a planned cyber-attack against other valued web sites.

Additional undesirable consequences of having your site hacked and your site security compromised include getting blacklisted by search engines, having stealthy spam links promoting things like gambling, cheap offers on brand names, etc. in your content, malicious redirects to phishing sites or other websites, drive-by downloads (adding malicious programs on your visitors’ computers), and many other nasty things.

The reality is that software-driven bots are most likely trying to break into your web site while you are reading this page right now. Whether they can break in successfully or not, will depend on how challenging you have made it for hackers to continue trying until they discover a way to get access, or decide to look for a more vulnerable target.

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

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

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

You will see that the check will return various results and information about your website …

WP Security Check

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

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

WP Security Check(Screenshot 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 can all be potentially valuable information to hackers, as this informs them about any potential security weaknesses, especially where site owners haven’t updated their software versions.

If your site or blog is driven by WordPress and you’re not taking appropriate steps to bolster the security of your site, then we can practically guarantee that, at some point, someone will attempt to hack your installation, because these brute force attacks are systematically targeting WordPress sites around the world!

When a website or blog 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 content has been vandalized or that everything has been entirely wiped out. Typically, most compromised sites will become infected with malicious scripts or viruses without the owner even being aware that a security breach has happened.

To help avoid the heartache and aggravation that comes with discovering that your website has been hacked into, below are ten essential and effective security checks that will help to prevent your WordPress site from being brute-force attacked.

Disclaimer

Note: Some of the recommended measures shown below require some technical skills to modify core WordPress and/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 technical provider for assistance.

***

Security Measure #1 – Contact Your Host

Get in touch with your host and ask them what systems they have put into place to protect your site from being attacked, and what is done to ensure that your WordPress sites are being backed up.

Make sure that your web host regularly backs up your sites and that, if anything happens, you can easily get your site back.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Site Regularly Updated

You should never rely just on your webhosting service for 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 on a regular basis (e.g. daily, weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

  • All unnecessary data and files are deleted,
  • 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 complete WP maintenance routine looks like this …

Maintaining your WP web site completely 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. Screenshot image: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WordPress website fully backed up and updated is. WordPress site 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 WP site maintenance yourself, pay a professional to do it but make sure this gets done. Backing up your website is the second most important thing you must do after making sure that you are still breathing!

If you don’t want to back up your site manually, there are many free and paid plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Backup, Duplicate & Keep Your WP Sites Protected With Backup Creator WP Plugin

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

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

For reasons of website security, never set up a WordPress site with the username admin. This is the first thing hackers will test. If your site’s user name is admin, change this immediately.

For a tutorial for WordPress users on how to change your WordPress admin username, go here: Changing Your Admin User Name In WordPress

Security Measure #4 – Use A Strong Password

A “brute force” attack occurs when malicious software continually and persistently hits a login or password field with different character strings trying to guess the right login combination that will give them entry to your website.

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 ways to do this), the “bot” will just continue to attack your site until it eventually “cracks” the code.

Weak passwords, therefore, become very easy targets for botnets. Make sure that you change your password to something that contains at least eight or nine characters long, with both upper and lowercase letters, combined with a few “special” characters (^%$#&@*).

Useful Tip

Roboform is a password management program that lets you easily create different strong login passwords …

You can use a password software tool like Roboform to help you generate unguessable passwords(Roboform is a password software that lets you generate different secure passwords)

We have created a tutorial that shows you how to change your admin password here: What To Do If You Need To Reset Login Passwords In WordPress

Security Measure #5 – Protect Your WP Config File

The wp-config.php file allows WordPress to communicate with the database to store and retrieve data and is used to define advanced options for WordPress.

WordPress WP Config file

(wp-config.php file)

If hackers break into your WordPress website, they will normally look for your wp-config.php file, because this is the file that contains your WordPress database information, 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 attacks 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 Installation Files

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

These files are not required after installation. If you don’t want to delete these files, just rename them.

Security Measure #7 – Keep Your WordPress Installation, Plugins And Themes Up-To-Date

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress comes with a built-in editor that allows administrators to edit plugin and theme code inside the dashboard area.

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

WP Theme Editor Menu

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

The WordPress theme editor allows anyone accessing your site’s admin area to see and edit your WordPress theme templates, or cause mayhem on your site.

To prevent people from accessing your 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 Your WordPress Uploads Folder

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

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

(WordPress uploads folder)

(WordPress uploads directory)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, anyone can upload unauthorized file types to 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 a file with nothing in it named “index.php”) to your uploads directory, and so on. Again, it’s best to hire a professional if you are not sure about what to do.

Security Measure #10 – Use Security Plugins

There are several WordPress security plugins available that will address most security issues faced by WordPress website owners, such as preventing hackers from accessing vital areas of your site, protecting your files from malicious software, preventing injections of code into files, 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 causing irreparable damage to your site is SecureScanPro.

SecureScanPro - total security software solution for WordPress

(SecureScanPro – security software for WordPress)

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

Blog Defender

Blog Defender(Blog Defender WordPress Security Solution)

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

BlogDefender scans you WordPress installation for potential security weaknesses …

Blog Defender Security PluginAnd lets you fix these quickly and easily …

Blog DefenderIf you don’t want to invest in a security plugin like SecureScanPro or BlogDefender, then 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 updating your WordPress software, plugins and WP themes, tightening file and data protection 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 sites is something you cannot afford to ignore.

As one last reminder of the importance of keeping your websites protected, below is the advice given by a web security expert to all WordPress users following the global 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, this information will help 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 professional WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified via email whenever we publish new tutorials on WordPress security and reviews of WordPress security plugins.

***

"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com

***

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