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 SecurityPowering millions of sites worldwide makes WordPress an obvious target for attempted hacking attacks.

In 2013 a mass brute-force attack hit WordPress installations across almost every host server in existence.

These attacks were caused by botnets (computer networks infected with viruses and programmed to attack other computers).

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

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. To attempt this, hackers use scripts and software tools that automatically tries to guess hundreds of login combinations in minutes.

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

This is called a “brute force” attack.

What Is A Botnet?

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/botnet)

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

Botnets are often used to blast mass spam emails.

Below is a screenshot taken from an internet security monitoring site 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 world since 2009.

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

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

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

WordPress powers millions of websites and blogs around the world, which makes it a natural target for attacks by malicious users

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

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

No. In fact, there are many very good reasons why you should use WordPress if you are concerned about the security of your web presence.

To learn what makes WordPress a very secure web platform, see this article: Is WordPress A Secure Platform For Websites?

Important Info

It’s important to understand that, in the case of the brute-force botnet attack described above, no specific WordPress vulnerability was 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 with Matt Mullenweg, 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 Site From Being Brute Force Attacked – Ten Security Measures

Every website or blog with a vulnerability provides some type of opportunity to hackers. A compromised blog provides malicious users with a valuable platform to launch DDoS attacks, spread malware and engage in information theft.

If someone can find a way to break in and gain control of your blog, that blog can then be used to attack more valuable sites.

Additional undesirable consequences of being hacked include being blacklisted by Google, having stealthy spam links advertising things like gambling, porn, etc. inserted into your content, malicious redirects to phishing sites and other websites, drive-by downloads (adding malware on your visitors’ computers), and many other nasty things.

The harsh reality is that malicious bots are probably trying to hack into your site right now. Whether they can successfully get into your site will depend on how hard or easy you will make things for hackers and botnets to continue persisting until they work out how to get access, or give up and decide to look for a more vulnerable target.

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

Do you own a WordPress site? If so, visit Hackertarget.com and run your site through their WordPress security scan …

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

You will see that the check returns various results and information about your site …

Hackertarget - Website Security Check

(website security scan results. Screenshot image: Hackertarget.com)

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

Website Security Check(Screenshot: BlogDefender website)

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

If your website is driven by WordPress and you’re not preventive steps to harden your site, then it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your website, because these attacks are systematically hitting WordPress installations worldwide!

Typically, when a site gets hacked, site owners can find themselves “locked out” of their own site, or notice that their files have been interfered with or even that their content has been entirely wiped out. Often, most sites will be infected with malicious scripts or viruses without the owner even being aware that a breach has taken place.

To help avoid the heartache (and potential loss of valuable business data) of discovering that your website or blog has been hacked into, we have listed below ten simple, yet essential and effective security measures that will help to prevent your WordPress site from being attacked by brute-force botnets.

Useful Information

Note: A few of the recommended measures below require some technical understanding of how to modify core WordPress and/or server files. If you are not technical, 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 – Get In Touch With Your Web Host

Contact your hosting company and ask them what systems are in place to protect your site from being attacked, and what they are doing to ensure that your files and data get regularly backed up.

It’s important to make sure that your webhosting service backs up your server files and that, if disaster strikes, you can quickly and easily get back your files.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Site Regularly Up-To-Date

You should never rely on your hosting provider 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 WordPress site maintenance routine on a regular basis (e.g. daily, weekly, fortnightly, etc …)

A proper 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 WP themes, plugins and software components are up-to-date,
  • etc …

A complete WordPress site maintenance routine looks like this …

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

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

If you don’t want to back up your data manually, there are a number of free and paid plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate & Keep Your WordPress Web Sites Protected With Backup Creator WP Plugin

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

The large scale brute-force attack on WordPress is mostly attempting to compromise website admin panels by exploiting WP sites that used “admin” as their username.

For website security purposes, don’t install a WordPress site with the username admin. This is the first thing hackers will test. If your blog’s user name is “admin”, change this immediately.

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

Security Measure #4 – Choose Strong Passwords

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

Unless you put some measure in place to stop the brute force attack (see further below for a couple of simple and effective ways to do this), the “bot” will just continue attacking your site until it eventually breaks into your admin area.

Weak passwords, therefore, become very easy targets for bot attacks. Make sure that you change your password to something that is at least 8 or 9 characters long, with upper and lowercase letters, and “special” characters (%^#$@&*).

Practical Tip

Roboform is a password program that lets you easily generate really secure passwords …

Roboform is a password tool that lets you easily generate strong login passwords(Roboform is a password management tool that lets you create strong login passwords)

For a step-by-step tutorial that shows you how to change your WordPress admin password, go here: What To Do If You Need To Reset A Password In WordPress

Security Measure #5 – Protect Your WP Config File

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

wp-config.php file

(WP Config file)

If hackers break into your WordPress site, they will typically look for your wp-config.php file, because this is the file that contains important information about your site’s database, 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.

To protect your WordPress site from being attacked 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 – Rename Or Delete Unnecessary Installation Files

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

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

Security Measure #7 – Keep Your WordPress Blog, 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 WP themes and plugins.

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress comes with a built-in editor that lets administrators edit theme and plugin files from the dashboard.

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

WP Theme Editor Menu

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

The WordPress theme feature lets anyone accessing your blog’s admin area view and edit your WP theme templates, and create 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 – Prevent Access To Your WordPress Uploads Folder

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

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

(WordPress uploads folder)

(WordPress uploads directory)

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

Protecting your directories will prevent online users 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 called “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 – WordPress Security Plugins

A number of great security plugins for WordPress are available that will address common security issues WordPress website owners face, such as preventing hackers from gaining access to vital areas of your site, protecting your site from brute-force attacks, preventing unauthorized file uploads, etc.

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

(SecureScanPro – WordPress security software solution)

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

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

Blog Defender Security Product Suite For WordPress

Blog Defender Security Product Suite(Blog Defender)

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

BlogDefender scans you web site for potential security vulnerabilities …

Blog DefenderAnd lets you quickly fix these …

Blog Defender Security SolutionIf you don’t want to purchase a 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 updating your WordPress installation, plugins and WP themes, tightening file and data security and taking other necessary precautions can expose your website to malicious 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, securing your websites is something you cannot afford to ignore.

As one last reminder of the importance of website security, below is the advice given by a website security expert to all WordPress users following the large-scale 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 very important if you run a WordPress site. Hopefully, this article has shown you what to do to 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 whenever we publish new information on WordPress security and tutorials about new WordPress security plugins and solutions.

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***