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 world’s most popular CMS platform and the preferred online publishing platform for millions of businesses and loved by thousands of web developers and web designers, it’s inevitable that at some point in time, WordPress will become a prime target for attacks by hackers wanting to score a “big win”.

In early 2013 a mass brute force attack struck WordPress installations across almost every WP host server in existence around the world.

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

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

Brute Force Attacks – An Overview

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 done with scripts and tools that can guess hundreds of login combinations in minutes.

If you’re using predictable usernames and passwords that are easy to guess, your website could be an easy target for hackers.

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)

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

Botnets are regularly used to send out mass spam emails from the infected computers of unsuspecting users.

Below is a screenshot taken from a site that monitors online security 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 infecting computer networks all around the globe since 2009.

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

These ongoing botnet attacks on WordPress were 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 users admin areas. The worldwide brute-force attacks then continued, with over 30,000 WordPress blogs being hacked each day.

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

Being the world's most popular CMS makes WordPress a target for hacking attacks

(WordPress is often the target of malicious attacks by hackers)

Does This Mean We Should Stop Using WordPress?

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 what makes WordPress a very secure platform for websites, see this article: Why WordPress Is A Secure Platform For Websites –

Important

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, made the following 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 Protect Your WordPress Website From Being Brute-Force Attacked – 10 Security Measures

You may think that the information in your website or blog offers no value to hackers, but the reality is that all websites are valuable to a malicious user.

If a malicious user can exploit a vulnerability in the setup, that web site can then be used as part of a larger network of “bots” to target other valuable sites.

Additional undesirable consequences of having your site hacked and your site security compromised include being blacklisted by search engines, having stealthy spam links promoting things like viagra, discounted fashion, etc. in your content and meta data, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasties.

The harsh reality is that brute-force software bots are very likely scouring for security weaknesses and trying to hack into your site right now. Whether they can get in or not, will depend on how difficult you can make it for hackers and botnets to keep persisting until they work out how to get access, or give up and go look for an easier target.

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

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

Hackertarget - Website Security Scan(Hackertarget – WordPress Security Check Source: https://hackertarget.com/wordpress-security-scan)

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

Hackertarget - Website Security Check

(WP security check results. Image source: Hackertarget.com)

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

Hackertarget - WordPress Security Check(Source: Blog Defender)

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 can all be useful information to hackers, as this informs them about any exploitable security weaknesses, especially in older versions.

If your website is powered by WordPress and you’re not taking steps to bullet-proof your site, we can practically guarantee that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute-force attacks are systematically targeting WordPress installations worldwide!

Whenever a website or blog is broken into, webmasters can find themselves completely “locked out” of their own site, or notice that their content has been modified or that everything has been entirely wiped out. Typically, sites will be infected with malicious scripts or viruses without the owner even being aware that a security breach has taken place.

To avoid the heartache and aggravation that comes with having your site being hacked into, below are ten simple, yet essential and effective security measures that will help to protect your WordPress site from being brute-force attacked.

Important

Note: Some of the recommended steps listed 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 search for a professional WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Web Host

Contact your hosting provider and ask them what security precautions are in place to protect your site from brute-force attacks, and what is done to make sure that your WordPress sites get regularly backed up.

Check that your webhosting service provider backs up your sites and that, if anything should happen, you can quickly and easily get your files back.

Security Measure #2 – Perform Regular WordPress Backups And Keep Your Site Frequently Maintained

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

A full WordPress maintenance routine ensures that:

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

A full WP site maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WordPress installation regularly backed up and updated is. WP maintenance is not hard 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, get someone else to do it but make sure this gets done. Backing up your website is the next most important thing you should do after making sure that you are still breathing!

If you don’t want to perform manual backups, 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 site backups here: Back Up, Duplicate & Protect Your WordPress Websites And Blogs With Backup Creator WP Plugin

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

The mass brute force attack on WordPress sites was mostly an attempt to compromise website administrator panels and gain access to the site by exploiting sites using “admin” as their username.

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

For a simple step-by-step tutorial that shows you how to change your WordPress username, go here: Changing Your Admin Username In WordPress To A Different User Name

Security Measure #4 – Your Password

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

Unless some measure is put into place to stop the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just persist in attacking your site until it eventually works out the combination.

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

Useful Tip

Roboform is a password software you can use to help you generate different hard-to-crack passwords …

You can use a password management tool like Roboform to create very secure passwords(You can use a password management program like Roboform to generate really secure passwords)

We have created a step-by-step tutorial for WP admin users on how to change your admin password here: What To Do If You Need To Change Your Password In WordPress

Security Measure #5 – Deny Access To 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 WordPress options.

WordPress WP Config file

(WP Config file)

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

Delete or rename the install.php, upgrade.php and readme.html files from your server.

These files are completely unnecessary after installation and can be removed. If you don’t want to delete these files, then just rename them.

Security Measure #7 – Keep Your WordPress Files, Themes & Plugins Up-To-Date

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WordPress Theme Editor Menu

(The WordPress theme editor can be accessed via the main menu)

The WordPress theme editor lets anyone accessing your blog’s admin area see and edit all of your WordPress theme files, or cause havoc on your site.

To prevent unauthorized people from being able to access the 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 – Remove Access To The Site’s Uploads Directory

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

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

(WordPress uploads folder)

(WordPress uploads folder)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, anyone can upload unauthorized file types or compromise the security of your website.

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, adding 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 get professional help if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

Several security plugins for WordPress are available that will address many common security issues WordPress website owners face, such as preventing hackers from accessing vital areas of your site, protecting your files from botnets, preventing injections of code into files, etc.

Most WordPress plugins address some but not all areas of WordPress security. One WordPress security 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 - WordPress complete security software

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

Blog Defender Security Plugin For WordPress Blogs

Blog Defender(Blog Defender Security Suite For WordPress)

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

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

Blog DefenderAnd then shows you how to fix these quickly and easily …

Blog Defender Security Product SuiteIf 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 simple maintenance tasks like making sure that your WP installation, plugins and themes are kept updated to their latest versions, tightening file and data security and taking other necessary precautions can expose your website 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, website security is something you cannot ignore.

As a final reminder, below is the advice given by an expert on website security 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, website security is very important if you run a WordPress site. Hopefully, the above article will help 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.

Also, please subscribe to WPCompendium.org to receive notifications via email when we publish new information 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

***