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 SecurityWordPress is the world’s most popular CMS which makes it a frequent target for hacking.

In 2013 a large-scale brute force attack hit WordPress installations on almost every WP host server in existence.

These attacks were caused by computers infected with viruses and programmed to attack other vulnerable computers (called “botnets”).

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)

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 can be achieved with software programs that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re not using strong usernames or unguessable passwords, your website could be easily hacked by the software’s repeated attempts to guess your site’s login details.

This is called a “brute force” login attack.

Botnets – What Are They?

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)

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

Botnets are regularly used to blast out mass spam emails from computers of unsuspecting users.

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 …

ZeuS is a botnet that has been actively infecting 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)

The botnet attacks are well organized and highly distributed. Over 90,000 IP addresses were identified by several hosting companies just in the initial attack, when millions of attempts to force their way into WordPress site administration areas took place. The worldwide attacks continued after this, with over 30,000 WordPress sites being hacked each day.

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

WordPress is often the target of malicious attacks by hackers, due to its global popularity

(WordPress is the world’s most used CMS making it a natural target for attacks by malicious users)

Does This Mean We Should Stop Using WordPress?

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

To understand why WordPress is a secure web platform, see this article: Is WordPress Secure?

Info

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

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

Preventing Your WordPress Site From Brute Force Attacks – Ten Security Points

Every site with a vulnerability offers some value to hackers. No website is guaranteed immunity from being targeted. Large, medium and small business web sites, personal blogs, government sites … even web sites owned by online security experts can and have been targeted.

If a hacker can find a security vulnerability in your system that allows them to take over your web site, your blog can then be employed to attack larger and more valued web sites.

Additional undesirable effects of having your site hacked include getting blacklisted by search engines, having stealthy spam links promoting things like viagra, cheap offers on brand names, etc. inserted in your content, redirecting visitors to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasties.

The harsh reality is that malicious bots are most likely looking for security exploits and trying to break into your web site as you are reading this page at this very moment. Whether they will be successful or not, will depend on how hard you can make things for hackers or bots to keep persisting until they either find a way to get access, or are forced to give up and go look for a less protected target.

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

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

Hackertarget - WordPress Security Check(Hackertarget – Website Security Check Product image source: https://hackertarget.com/wordpress-security-scan)

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

WordPress Security Scan

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

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

WP Security Scan(Image source: Blog Defender)

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 can inform them about exploitable security vulnerabilities, especially where site owners haven’t updated their software versions.

If your website is powered by WordPress and you are not precautionary steps to harden your site, then 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!

Typically, when a website gets compromised, website owners can find themselves “locked out” of their own site, or notice that their files have been interfered with or that everything has been entirely wiped out. Typically, most 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 site has been hacked into, we have listed below ten simple, yet essential and effective security checks that will help to protect your WordPress site from being attacked by brute force botnet hacking attempts.

Note

Note: A few of the recommended steps below need some technical skills to modify core WordPress or server files. If you have no web editing skills, 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 – Contact Your Webhosting Company

Get in touch with your webhosting provider and ask them exactly what measures have been put into place to help prevent your site from brute-force attacks, and what they do to make sure that your WordPress sites get backed up.

Check that your webhosting company backs up your sites and that, if anything happens, you can quickly and easily get back your site.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Or Blog Frequently Updated

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

A proper WordPress maintenance routine ensures that:

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

A complete WP site maintenance routine looks like this …

Maintaining your WordPress website or blog completely backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website or blog backed up and up-to-date is vitally important for WordPress security. Screenshot source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WP site fully backed up and up-to-date is. 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 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 still have a pulse!

If you don’t want to back up your files manually, there are many WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Backup, Duplicate & Protect Your WordPress Websites With Backup Creator WordPress Plugin

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

The brute-force botnet attack on WordPress sites was mostly attempting to compromise site admin panels by exploiting installations that used “admin” as the user name.

For website security purposes, avoid setting up sites with the username “admin”. This is the first area hackers will test. If your blog’s user name is admin, then change this immediately.

We have created a step-by-step tutorial for non-technical WP admin users on how to change your login username here: Changing Your WordPress Admin Username To A Different User Name

Security Measure #4 – Make Sure Your Password Is Strong

A “brute force” attack occurs when a malicious script persistently tries to guess the right username and password character string that will give the hacker entry to your website.

Unless some measure is put into place to prevent the brute-force attack from happening (see further below for a couple of simple and 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 very easy targets for hackers. Make sure that you change your password to something that contains at least eight or nine characters long, and that includes upper and lowercase letters, combined with a few “special” characters (e.g. ^, $, *, etc).

Useful Tip

Roboform is a password management program you can use to help you generate secure login passwords …

Roboform is a password management program you can use to generate different strong login passwords(You can use a password management program like Roboform to generate secure login passwords)

We have created a detailed tutorial that shows you how to change your admin password here: Changing Your Password In WordPress

Security Measure #5 – Secure Your wp-config.php File

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

WP Config 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 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 attacks and even being used as part of a bot net, therefore, you must prevent your wp-config.php file from being accessed. 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

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

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

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

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

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

Security Measure #8 – Disable Your Theme Editor

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

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

WordPress Theme Editor Menu

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

The WordPress theme editor feature allows anyone accessing your site’s admin area to view and change your theme files, and cause havoc on your site.

If you want to prevent 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 – Secure The Site’s Uploads Directory

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

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

(WordPress uploads folder)

(WordPress uploads folder)

If any files stored in his folder have 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, 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 get professional help if you are unsure about what to do.

Security Measure #10 – Security Plugins

Some great security plugins for WordPress are available that specifically address most security issues faced by WordPress website owners, such as preventing unauthorized users from accessing your site, protecting your files from malicious scripts, preventing injections of code into files, etc.

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

SecureScanPro - security software solution for WordPress

(SecureScanPro – WP security software solution)

SecureScanPro is easy to install and easy to use, and does a great job of addressing most of the security areas that WordPress users need to address.

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

Blog Defender Security Solution For WordPress Web Sites

Blog Defender Security Suite For WordPress(Blog Defender)

This product 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 DefenderAnd then shows you how to quickly and easily fix these …

Blog Defender Security Suite For WordPress SitesIf you don’t want to invest in a 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 secure web platform, but neglecting simple maintenance tasks like updating your WordPress software, WP plugins and themes, tightening file and data security and taking other necessary precautions can expose your site to attacks 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, web security is something you cannot afford to ignore.

As a final reminder of the importance of website security, below is the advice given by a web security expert to all WordPress users following the large-scale 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, the information in this article has given you the initial steps you need to take to prevent brute-force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please consult a WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

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

***

"Learning WordPress has been a huge stumbling block for me. I've been looking for something that covers absolutely everything but doesn't cost an arm and a leg. Thank you so much ... you have just provided me with what I have been looking for! Truly appreciated!" - Tanya

***

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