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 SecurityPowering millions of websites and blogs around the world makes WordPress an obvious target for attempted hacker attacks.

In 2013 a worldwide brute-force attack struck WordPress installations across almost every WP hosting server in existence.

These attacks were caused by botnets (networks of infected computers 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 will attempt to break into WordPress sites is by trying to guess the site’s administration login username and password. This is done using software programs that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re using obvious login details, your website could be an easy target for hackers.

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)

A “Botnet” is a network of computers that have been infected with malicious code, which are then controlled remotely as a group, typically without the computer owners’ knowledge or awareness.

Botnets are normally used used to blast 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 globe since 2009 called “Zeus” …

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 globe since 2009. Screenshot image: SecureList.com)

These were highly distributed and well organized attacks. Over 90,000 IP addresses were identified by several webhosting 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 brute force attack was reported by all the major webhosting companiesand leading technology publications, such as Forbes, TechNews Daily, Tech Crunch, BBC News, PC Magazine, and even on the official US Department of Homeland Security website …

Being the world's most popular content management system makes WordPress an obvious target for hacking

(Being the world’s most popular CMS makes WordPress an obvious target for hacking attempts)

Does This Mean WordPress Is Not Secure And We Should Stop Using It?

No. In fact, there are lots of good reasons why you should use WordPress if you are concerned at all about website security.

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

Useful Info

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

Mike Little, one of the co-founders of WordPress, made the following comment 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 Site From Being Brute-Force Attacked – Ten Security Points

Every blog with a vulnerability offers some value to hackers. If you think that the information in your site is of no interest to hackers, think again. Business web sites, personal blogs, government web sites … even sites owned by web security experts can and have been targeted.

If someone can break in and gain any form of control of your blog, your blog can then be employed to attack more valuable web sites.

Additional undesirable results of being hacked include getting blacklisted by Google, having stealthy spam links advertising things like gambling, cheap offers on brand names, etc. inserted into your content, malicious redirects to phishing sites or other websites, drive-by downloads (adding malicious scripts on your visitors’ computers), and many other nasties.

The truth is that brute-force software bots are very likely searching for security exploits and trying to hack into your website or blog as you are reading this article. Whether they can break in successfully or not, depends on how difficult or easy you have made things for hackers and bots to continue persisting until they can either find how to break in, or are forced to give up and decide to look for a more vulnerable target.

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

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

Hackertarget - Website Security Scan(Hackertarget – WP Security Check Screenshot image: https://hackertarget.com/wordpress-security-scan)

You will see that the scan returns various results and information about your WordPress installation …

Hackertarget - Website Security Scan

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

It should be obvious after using the tool shown above that if you can freely access all of this information about your WordPress website, then so can hackers.

Hackertarget - WP Security Check(Screenshot source: Blog Defender)

The ability to see what 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 these can inform them about any potential vulnerabilities, especially in older versions.

If your site or blog runs on WordPress and you’re not preventive steps to bolster the security of your site, then we can practically guarantee that, at some point in time, someone will attempt to hack your website, because these attacks are systematically targeting WordPress installations worldwide!

Whenever a website or blog is hacked, blog owners can find themselves “locked out” of their own site, or notice that their content has been interfered with or even entirely wiped out. Often, compromised sites will be infected with malicious scripts without the owner’s knowledge or awareness.

To avoid the heartache (and significant loss of valuable business data) of discovering that your web site has been hacked into, we have listed below 10 simple, yet essential and effective security checks that will help to protect your WordPress site from being brute-force attacked.

Warning

Note: A few of the steps shown below require some technical skills to modify core WordPress and server files. If you are not technical, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress service provider for assistance.

***

Security Measure #1 – Contact Your Host

Contact your host and ask them what security measures are in place to help prevent your site from brute force attacks, and what they are doing to make sure that your server files and data are being backed up.

It’s important to check that your webhosting provider is regularly backing up your sites and that, if anything happens, you can easily recover your files.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Website Or Blog Regularly Maintained

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

A complete WordPress maintenance routine ensures that:

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

A proper WordPress site maintenance routine looks like this …

Maintaining your WP site completely backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP website frequently backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WP site completely backed up and up-to-date. WordPress maintenance is not hard 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 a professional to do it but make sure this gets done. Backing up your website is the second 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. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Duplicate And Protect Your WordPress Site With Backup Creator WordPress Plugin

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

The mass brute-force botnet attack on WordPress is mostly attempting to compromise site administrator panels and gain access to sites by exploiting WordPress installations using “admin” as their username.

For reasons of website security, never install sites with the username “admin”. This is the first area hackers will test. If your blog’s username is admin, then change it immediately.

For a simple tutorial created especially for WP admin users that shows you how to change your WordPress admin username, go here: Changing Your Admin Username In WordPress

Security Measure #4 – Avoid Weak Passwords

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

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

Weak passwords, therefore, make really easy targets for attacks. Make sure that you change your password to a string that contains at least eight characters long, and that includes upper and lowercase letters, combined with “special” characters (e.g. ^, #, *, etc).

Useful Tip

You can use a password tool like Roboform to generate hard-to-guess passwords …

You can use a password tool like Roboform to generate  passwords(Roboform is a password management tool that lets you generate different passwords)

For a step-by-step tutorial created especially for non-technical WP admin users on how to change your WordPress password, go here: What To Do If You Need To Change WordPress Passwords

Security Measure #5 – Prevent Access To Your wp-config.php 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.

WP Config file

(wp-config.php)

If a hacker breaks into your WordPress website, they will typically look for your wp-config.php file, because this file contains your database information, 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.

In order to protect your WordPress site from being attacked and even being used as part of a bot net, therefore, 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 – Delete Or Rename Unnecessary Installation Files

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

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

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

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

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WP Theme Editor Menu

(The WordPress theme editor is accessible via the WP main menu)

The WordPress theme editor allows anyone accessing your site’s admin area to view and make changes to all of your theme templates, and create havoc on your site.

If you want 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 – Remove Access To Your Site’s Uploads Folder

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

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

(WordPress uploads directory)

(WordPress has an uploads directory where media content is stored)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, anyone could upload unauthorized file types or compromise the security of your website.

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 a file with nothing in it 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 – Security Plugins

There are a number of WordPress security plugins available that specifically address many common security issues faced by WordPress website owners, such as preventing unauthorized users 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 security plugin that does a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your site files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WP total security software

(SecureScanPro – WP total security software solution)

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

Another great security plugin you may want to consider using is BlogDefender.

Blog Defender Security Plugin

Blog Defender Security Suite For WordPress(Blog Defender)

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

BlogDefender shows you where potential security weaknesses in your web site are …

Blog Defender Security Suite For WordPressAnd then shows you how to easily fix these …

Blog Defender Security Suite For WordPress BlogsIf you don’t want to buy 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 simple maintenance tasks like keeping your WP installation, WP plugins and WP themes up-to-date, tightening file and data security and taking other necessary precautions can have disastrous consequences.

Regardless of the type of business you run or plan to run online and how small you think your web presence is, you cannot ignore the importance of securing your website.

As one last reminder, below is the advice given by a security expert to all WordPress users after the worldwide brute-force attacks 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, WordPress security is very important if you run a WordPress site. Hopefully, the information in this 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.

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 and solutions.

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***