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 powers millions of websites and blogs around the world, which makes it a natural target for hackers.

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

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

If you’re using predictable usernames and passwords that are easy to guess, your website can be easily hacked by the malicious script’s repeated attempts to guess your site’s login details.

This is called a “brute-force” login attack.

What Are Botnets

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)

”Botnets” are networks of computers that have been infected with malicious code or scripts, which can then be controlled remotely as a group, often without the computer owners’ knowledge or awareness.

Botnets are typically 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 ZeuS – a botnet that has been actively infecting 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.

(ZeuS is a botnet that has been actively infecting computer networks all around the world since 2009. Source: 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, when millions of attempts to force their way into WordPress user administration areas occurred. The large-scale brute force attacks continued after this, with over 30,000 WordPress blogs being hacked per day.

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

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

(WordPress powers millions of websites and blogs worldwide, which makes it a frequent target for attempted hacking attacks)

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

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

To understand what makes WordPress a very secure web platform, read this article: Is WordPress Secure? What Every Business Owner Needs To Know About WordPress

Important Info

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

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

How To Prevent Your WordPress Blog From Being Brute Force Attacked – Ten Security Points

Every website or blog with a security vulnerability offers some value to hackers. A vulnerable website or blog presents hackers with a resource to launch denial of service attacks, spread malware and use your website to steal information from innocent people.

If a hacker can exploit a way to take over and control your site, the website can then be employed as part of a larger network of “bots” to target more valuable sites.

Additional undesirable effects of having your site hacked include being blacklisted by search engines, having spammy links advertising things like gambling, porn, etc. in your content and page title and descriptions, malicious redirects to phishing sites and other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasties.

The truth is that hackers are probably scouring for exploits and trying to hack into your website or blog right now. Whether they will do this successfully or not, depends on how hard or easy you have made things for them to keep persisting until they can discover how to get in, or are forced to give up and decide to look for an easier target.

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

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

WP Security Check(Hackertarget – WordPress Security Scan Image source: https://hackertarget.com/wordpress-security-scan)

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

Hackertarget - WP Security Check

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

It should be obvious after using this tool that if you can see all of this information about your site, so can hackers.

Hackertarget - WordPress Security Check(Screenshot: BlogDefender site)

The ability 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 potentially valuable information to hackers, as this informs them about potential holes or weaknesses, especially in older versions.

If your website runs on WordPress and you’re not precautionary steps to bullet-proof your site, it’s practically guaranteed that, at some point, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically hitting WordPress sites worldwide!

Typically, whenever a site is hacked, webmasters can find themselves “locked out” of their own site, or notice that their files have been altered or even that their content has been entirely wiped out. Often, most sites will be infected with malicious software without the owner’s knowledge or awareness.

To help avoid the heartache and frustration (and significant financial loss) that comes with discovering that your site has been hacked into, below are 10 simple, yet essential and effective security measures that will help to prevent your WordPress site from brute force botnet attacks.

Note

Note: Some of the steps shown below need some technical skills to modify core WordPress or 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 technical provider for help.

***

Security Measure #1 – Contact Your Hosting Service Provider

Get in touch with your hosting company and ask them exactly what systems are in place to protect your site from being attacked, and what is done to ensure that your server files and data are being regularly backed up.

It is important to make sure that your hosting company regularly backs up your server files and that, if anything goes wrong, you can quickly and easily recover your files.

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

You should never rely just on your host for 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 site maintenance routine on a frequent basis (e.g. daily, weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

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

A complete WP maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important it is to maintain your WP installation completely backed up and up-to-date. 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 WordPress maintenance yourself, pay someone to do it but make sure this gets done. Backing up your website is the next most important thing you should do after making sure that your heart is still beating!

If you don’t want to back up your site manually, there are a number of WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Copy & Protect Your WordPress Websites And Blogs With Backup Creator Plugin For WordPress

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

The large scale brute force botnet attack on WordPress sites was mostly an attempt to compromise website administrator panels by exploiting WP sites that used “admin” as the username.

For security purposes, don’t set up sites with the username admin. This is the first thing hackers will test. If your blog’s user name is “admin”, you need to change this immediately.

We have created a detailed step-by-step tutorial created especially for WordPress admin users on how to change your username here: How To Change Your Admin Username In WordPress To A Different Username

Security Measure #4 – Your Password

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

Unless some measure is put into place to stop the brute force attack from happening (see further below for a couple of effective ways to do this), the “bot” will just keep attacking your site until it eventually gets access.

Weak passwords, therefore, are really easy targets for brute-force attacks. Make sure that you change your password combination to a string that is at least 8 or 9 characters long, and that includes upper and lowercase letters, and “special” characters (^%$#&@*).

Practical Tip

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

You can use a password tool like Roboform to help you generate very secure passwords(You can use a password program like Roboform to generate really secure passwords)

We have created a simple tutorial on how to change your password here: What To Do If You Need To Change Your Password

Security Measure #5 – Prevent Access To Your wp-config.php File

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

WP Config file

(WP Config file)

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

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 accessed. 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 WP 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 Installation, Plugins & Themes Up-To-Date

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the dashboard menu)

This allows anyone accessing your site to view and edit your WordPress files, or create mayhem on your site.

If you want to prevent people from being able to access your 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 Site’s Uploads Folder

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

Normally, this folder is visible to online users. All someone has to do to see the contents stored in your site’s “uploads” folder is visit your directory using their browser …

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

(WordPress has an uploads folder where your media files are stored)

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

Protecting your directories will prevent online users from viewing 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 get professional help if you are not sure about what to do.

Security Measure #10 – Use Security Plugins

There are several WordPress security plugins available that specifically address most security issues faced by WordPress website owners, such as preventing hackers from accessing your site, protecting your website from malicious exploits, preventing unauthorized file uploads, etc.

Many 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 issues that could lead to hackers accessing your files and causing damage to your site is SecureScanPro.

SecureScanPro - total security plugin for WordPress

(SecureScanPro – complete security software solution for WordPress)

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

Another plugin you may want to consider using is BlogDefender.

Blog Defender Security Product Suite For WordPress Websites & Blogs

Blog Defender(Blog Defender Security Solution)

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

BlogDefender scans you WordPress installation for security weaknesses …

Blog DefenderAnd then shows you how to easily fix these …

Blog DefenderIf you don’t want to purchase 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 secure platform, but neglecting essential maintenance tasks like updating your WordPress software, plugins and WordPress themes, tightening file and data protection and taking other necessary precautions can expose your website to attacks by hackers and bots.

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

As a final reminder of the importance of keeping your websites protected, below is the advice given by an expert on website security to all WordPress users after the global 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 of the utmost importance 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 consult a WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

Also, do yourself a favor and subscribe to WPCompendium.org to be notified via email whenever we publish new information on WordPress security and tutorials about WordPress security plugins and solutions.

***

"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)

***