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 content management system in the world and the online publishing platform of choice used by millions of websites and loved by thousands of website developers and website designers, it’s inevitable that at some point in time, WordPress will come under attack by hackers.

In 2013 a worldwide brute force attack began hitting WordPress installations across almost every WP host server in existence around the world.

These attacks were caused by computer networks infected with viruses and programmed to attack other computers, also commonly known as “botnets”.

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

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

If you’re using weak login details, your website can be an easy target for hacking attempts.

This is called a “brute-force” attack.

Botnet – What Is This?

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)

”Botnets” are networks of computers that have been infected with malicious software, which can then be controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is going on.

Botnets are often used to blast mass spam emails from computers of compromised user accounts.

The screenshot below was 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 compromising computer networks all around the world since 2009.

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

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

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

WordPress is the world's most popular CMS making it a natural target for hacking

(WordPress is the world’s most popular CMS which makes it a frequent target for hacker attacks)

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

No. In fact, there are lots of very good reasons why you should continue using WordPress if you are concerned at all about the security of your web presence.

To learn why WordPress is a secure platform for websites, see this article: Are Open Source CMS Platforms Like WordPress Secure? What Every Website Owner Needs To Know About WordPress

Important

It’s important to understand 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 attacking sites built using other web applications like Joomla).

Mike Little, one of the co-founders of WordPress, said this 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 Website From Being Brute Force Attacked – Ten Security Checks

Every web site with a security vulnerability can can provide an opportunity to hackers. A vulnerable web site presents hackers with a valuable resource to launch denial of service attacks, spread malware and engage in information theft.

If a malicious user can break in and compromise the control of your web site, that website or blog can then be used as a “bot” to attack larger and more highly-valued web sites.

Additional undesirable results of having your website hacked and your site security compromised include being blacklisted by Google, having stealthy spam links advertising things like viagra, cheap offers on brand names, etc. in your content and page title and descriptions, malicious redirects to phishing sites, drive-by downloads (adding malicious software on your visitors’ computers), and lots of other nasty things.

The truth is that malicious bots are very likely trying to break into your blog right now. Whether they will successfully hack into your site or not, will depend on how difficult or easy you have made things for hackers or bots to continue persisting until they discover how to get access, or give up and go look for a more vulnerable target.

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

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

Website Security Check(WP Security Check Source: https://hackertarget.com/wordpress-security-scan)

You will see that the test returns various results and details about your site …

Hackertarget - WP Security Scan

(Hackertarget – WP security scan results. Screenshot image: Hackertarget.com)

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

Website Security Scan(Product image source: Blog Defender)

Being able to see what 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 potentially useful information to hackers, as this informs them about exploitable holes or weaknesses, especially where the owners haven’t updated their files.

If your site or blog is driven by WordPress and you’re not precautionary steps to bolster the security of your site, it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your site, because these brute force attacks are systematically targeting WordPress sites all the world!

When a website is hacked, webmasters will discover much to their dismay that they have been “locked out” of their own site, or notice that their content has been interfered with or even entirely wiped out. Typically, compromised sites will be infected with malicious software or viruses without the owner’s knowledge or awareness.

To help avoid the heartache of having your website or blog being hacked into, below are ten simple, yet essential and effective security measures that will help to prevent your WordPress site from being brute-force attacked.

Warning

Note: A few of the measures shown below require some technical understanding of how to modify core WordPress or server files. If you have no technical skills, 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 – Contact Your Web Host

Get in touch with your webhosting service and ask them exactly what measures they offer to help prevent your site from botnet attacks, and what is done to ensure that your server files and data are being backed up.

Check that your webhosting service provider regularly backs up your sites and that, if anything goes wrong, you can easily get your files back.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Website Regularly Updated

You should never rely only on your webhosting provider for site backups. Instead, learn how to maintain and manage your WordPress site or pay someone to get this service done for you and maintain a habit of religiously performing a complete site maintenance routine on a frequent basis (e.g. daily, weekly, monthly, 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 themes, plugins and software components are up-to-date,
  • etc …

A full WordPress site maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important maintaining your WordPress site frequently backed up and up-to-date is. 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, pay someone to do it but make sure it gets done. Backing up your website is the next most important thing you must do after making sure that you are still breathing!

If you don’t want to perform manual backups, there are a number of WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Backup, Duplicate & Protect Your WordPress Websites And Blogs With Backup Creator Plugin For WP

Security Measure #3 – Make Sure That Your Username Is Not “Admin”

The mass brute force attack on WordPress is mostly an attempt to compromise site admin panels by exploiting sites with “admin” as the username.

For security purposes, avoid setting up sites with the username admin. This is the first thing hackers will test. If your blog’s user name is admin, you will should change this immediately.

We have created a simple tutorial created especially for non-technical admin users that shows you how to change your username here: Changing Your Admin Username In WordPress

Security Measure #4 – Change Your Password

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

Unless some measure is put into place to stop 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 works out the combination.

Weak passwords, therefore, become very easy targets for attacks. Make sure that you change your password combination to a string containing at least eight or nine characters long, with upper and lowercase letters, combined with a few “special” characters (e.g. %, $, @, etc).

Practical Tip

You can use a password software tool like Roboform to generate strong login passwords …

Roboform is a password program that lets you easily generate secure login passwords(You can use a password management tool like Roboform to help you generate really secure passwords)

For a tutorial on how to change your WordPress admin password, go here: How To Change Login Passwords In WordPress

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

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

wp-config.php file

(wp-config.php)

If hackers break into your WordPress website, they will typically try to access the wp-config.php file, because this file 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.

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 easily accessible. 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 Website Installation Files

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

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

Security Measure #7 – Update Your WordPress CMS, Plugins And Themes To Their Latest Version

Hackers look for vulnerabilities they can exploit in older versions of WordPress, including out-of-date versions of WordPress themes and plugins.

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the dashboard menu)

This means that anyone logging into your site’s admin area can see and make changes to all of your WP theme template files, and create havoc on your site.

To prevent unauthorized people from accessing 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 Your Site’s Uploads Directory

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

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

(WordPress uploads folder)

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

If any directories in your website have vulnerabilities that can be exploited by hackers or malicious users, this can 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, uploading a blank index.php file (this is literally a blank file named “index.php”) to your uploads directory, and so on. Again, it’s best to ask help from someone with experience if you are not sure about what to do.

Security Measure #10 – Install Security Plugins

Some great WordPress security plugins are available that specifically address most security issues WordPress website owners face, such as preventing hackers from accessing 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 does a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your website files and damaging your site is SecureScanPro.

SecureScanPro - complete security plugin for WordPress

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

Blog Defender WordPress Security Product Suite

Blog Defender(Blog Defender WordPress Security Product Suite)

This product is a package of WordPress security video tutorials, WordPress plugins and tools, plus a WordPress security PDF/DOC file.

BlogDefender scans you website for security vulnerabilities …

Blog DefenderAnd lets you fix these quickly and easily …

Blog Defender Security Product SuiteIf you don’t want to invest in a premium security plugin like SecureScanPro or BlogDefender, you can use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure platform, but neglecting essential 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 expose your site to attacks by hackers and bots.

Regardless of the type 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 one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on web security to all WordPress users following the global brute force attacks by botnets 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 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 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 receive notifications via email when we publish new tips on WordPress security and reviews of new 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

***