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 SecurityWordPress is often the target of malicious attacks by hackers.

In April 2013, WordPress installations around the world were subjected to a worldwide brute-force attack.

These attacks were caused by infected computer networks 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)

There are many methods hackers use to try and break into WordPress sites. One of these is by trying to guess the site’s administration login username and password. This is done with software tools that can work through hundreds of login permutations in minutes.

If you’re using weak usernames and weak passwords that are easy to guess, your site can be an easy target for hackers.

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

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

Botnets are often used to blast mass spam emails.

The screenshot below was taken from an internet security monitoring site showing the locations of the command centers of a botnet that has been actively infecting computer networks all around the world since 2009 called “Zeus” …

ZeuS is 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 globe since 2009. Image: SecureList.com)

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

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

Powering millions of sites worldwide makes WordPress a target for hacker attacks

(WordPress is often the target of large-scale attacks by hackers)

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

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

To learn why WordPress is a secure platform for websites, read this article: Can You Build A Secure Business Online Using WordPress?

Info

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

Mike Little, the co-founder 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)

Protecting Your WordPress Blog From Being Brute Force Attacked – Ten Security Measures

Every site with a vulnerability offers some degree of potential value to hackers. All websites have value to hackers. Large, medium and small websites, personal blogs, government sites … even websites owned by web security experts can and have been targeted.

If someone can exploit a weakness in the security, the site can then be used as a “bot” in a planned cyber-attack against larger and more 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, discounted fashion, etc. inserted in your content and meta data, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasty things.

The truth is that hackers are trying to break into your web site as you are reading this at this very moment. Whether they will do this successfully will depend on how hard you will make things for hackers to continue trying until they either find a way to get access, or give up and go look for a less secure 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 website through their WordPress security scan …

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

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

WordPress Security Check

(Hackertarget – WP security scan results. Image source: Hackertarget.com)

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

Hackertarget - WP Security Check(Product image source: BlogDefender website)

Being able 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 on your server can all be potentially useful information to hackers, as this can inform them about potential holes or weaknesses, especially in older versions.

If your site or blog runs on WordPress and you’re not preventive steps to toughen up your site, we can practically guarantee that, at some point in time, someone will attempt to hack your website, because these brute force attacks are systematically hitting WordPress sites worldwide!

Whenever a website or blog is compromised, site owners will find themselves “locked out” of their own site, or notice that their files have been vandalized or even that their content has been completely wiped out. Typically, sites will become infected with malicious scripts without the owner even being aware that this has happened.

To avoid the heartache and frustration (and significant financial loss) of discovering that your website 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.

Disclaimer

Note: A few of the steps below require some technical skills to modify core WordPress and server files. If you have no technical skills, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress service provider in our WordPress Services Directory.

***

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

Contact your hosting provider and ask them what measures they offer to help prevent your site from brute force attacks, and what they are doing to make sure that your server files get regularly backed up.

It’s important to make sure that your web host regularly backs up your server files and that, if disaster strikes, you can quickly and easily recover your files and data.

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

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

A proper WordPress maintenance routine ensures that:

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

A full WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WP installation backed up and up-to-date is. WordPress 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 WP maintenance yourself, get someone else 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 perform manual backups, there are many WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Back Up, Clone And Protect Your WordPress Web Sites With Backup Creator Plugin For WordPress

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

The brute-force botnet attack on WordPress sites was mostly attempting to compromise website admin panels and gain access to the site by exploiting sites using “admin” as the username.

For reasons of website security, don’t install WordPress 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 detailed tutorial on how to change your admin username, go here: How To Change Your WP Username From Admin To Another User Name

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when a malicious script continually and persistently tries to guess the right combination of password and username characters that will give them access to your site.

Unless some measure is put into place to block the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just continue to attack your site until it eventually “cracks” the code.

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

Tip

If you have trouble coming up with strong passwords or you are reluctant to set up different passwords for all of your online logins, then use a password tool like Roboform …

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

For a detailed tutorial that shows you how to change your admin password, go here: What To Do If You Need To Change The Login Password

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

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.php file

(wp-config.php)

If hackers break into your site, they will search for the 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 easily 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 Installation Files

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

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

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

Hackers are always on the lookout for vulnerabilities they can exploit in earlier WordPress versions, including out-of-date versions of WP plugins and themes.

Make sure to keep your WordPress installation files, themes, plugins, etc. up-to-date.

Security Measure #8 – Disable The WordPress Theme Editor

WordPress comes with a built-in editor that allows you to edit plugin and theme files inside the dashboard.

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

WP Theme Editor Menu

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

The WordPress theme feature lets anyone accessing your site’s admin view and modify all of your theme template files, or create mayhem on your site.

To prevent 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 The WordPress Uploads Folder

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

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

(WordPress uploads folder)

(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 malicious users, anyone could upload unauthorized file types to 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, 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 get professional assistance if you are unsure about what to do.

Security Measure #10 – Use WordPress Security Plugins

There are a number of great WordPress security plugins available that specifically address many common security issues WordPress site owners face, such as preventing hackers from accessing your site, protecting your website from malicious scripts, preventing unauthorized file uploads, etc.

Many WordPress plugins address some but not all areas of WordPress security. One WordPress plugin that seems to do 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 - security software solution for WordPress

(SecureScanPro – WordPress security software)

SecureScanPro is easy to install and easy to use, and addresses most of the security issues that WordPress users need to address.

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

Blog Defender Security Solution For WordPress Websites

Blog Defender WordPress Security Plugin(Blog Defender Security Plugin For WordPress)

Blog Defender is a package of WordPress security video tutorials, plugins and tools, plus WordPress security documentation in PDF and DOC formats.

BlogDefender shows you where the security weaknesses in your WordPress site are …

Blog DefenderAnd lets you quickly fix these …

Blog DefenderIf you don’t want to buy a security plugin like SecureScanPro or BlogDefender, you can use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting basic maintenance tasks like keeping your WP software, WordPress plugins and WP themes up-to-date, tightening file and data protection and taking other necessary precautions can expose your site to attacks by hackers and bots.

No matter what type of business you run or plan to run online and how small you think your web presence is, you cannot afford to ignore the importance of securing your site.

As one last reminder, below is the advice given by an expert on web security to all WordPress users after the global brute force attacks by botnets 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, website security is of the utmost importance if you run a WordPress site. Hopefully, the information in 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 consult a WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to receive notifications via email when we publish new articles on WordPress security and reviews of new WordPress security plugins and solutions.

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***