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 world’s most popular content management system and the preferred online publishing platform used by millions of websites and loved by thousands of web developers and website designers, it’s inevitable that at some point in time, WordPress will become a prime target for attacks from hackers wanting to score a “big win”.

In early 2013 a worldwide brute-force attack began hitting WordPress installations on almost every host server in existence.

These attacks were caused by computer networks infected with malware and programmed to attack other sites (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 WordPress sites. One of these is by trying to guess the site’s administration login username and password. This can be done using software tools that automatically tries to guess hundreds of possible logins in minutes.

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

This is called a “brute force” login 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)

A “Botnet” is a network of computers that have been infected with malicious code or software, which are then controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is happening in their device.

Botnets are often 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 infecting 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.

(The Zeus botnet has been actively infecting computer networks all around the globe since 2009. Screenshot: SecureList.com)

The ongoing botnet attacks on WordPress sites were highly distributed and well organized. Over 90,000 IP addresses were identified by several hosting 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 brute-force attacks continued after this, with over 30,000 WordPress blogs being hacked every day.

Coverage of the April 2013 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, Tech Crunch, BBC News, PC Magazine, and even on the official US Department of Homeland Security website …

Powering millions of websites and blogs worldwide makes WordPress a target for hacker attacks

(WordPress is frequently the target of attacks by hackers)

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

No. In fact, there are lots of great reasons why you should use WordPress if you are concerned at all about the security of your online presence.

To understand what makes WordPress a very secure web platform, read this article: How Secure Is WordPress?

Important Info

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, made the following comment 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)

Protecting Your WordPress Blog From Being Brute Force Attacked – 10 Security Checks

Every blog with a vulnerability offers some value to hackers. No web site is immune from a cyber-attack. Large, medium and small web sites, personal blogs, government sites … even sites owned by online security and anti-hacking experts can and have been targeted.

If someone can exploit a way to take over and control your website or blog, that website or blog can then be employed as a “bot” in a planned cyber-attack against more valued web sites.

Additional undesirable consequences of having your site hacked include getting blacklisted by Google, having spammy links promoting things like viagra, cheap offers on brand names, etc. in your content and meta data, redirecting visitors to phishing sites and other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasties.

The reality is that hackers are trying to hack into your site as you are reading this page at this very moment. Whether they will successfully hack in depends on how challenging you can make it for hackers to keep trying until they discover how to get access, or give up and go look for a more vulnerable target.

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

Does your website run on WordPress? If so visit Hackertarget.com and run your website through their WordPress security scan …

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

You will see that the scan will display a number of results and information about your site setup …

Hackertarget - WordPress Security Check

(Hackertarget – website security check results. Screenshot source: Hackertarget.com)

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

Hackertarget - Website Security Scan(Product image source: 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 in your site are all valuable information to hackers, as this informs them about exploitable holes or weaknesses, especially in older versions.

If your website runs on WordPress and you are not preventive steps to bullet-proof your site, it’s practically guaranteed 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 sites worldwide!

Whenever a website or blog is compromised, site owners can find themselves “locked out” of their own site, or notice that their files have been altered or even entirely wiped out. Often, compromised sites will become infected with malicious scripts without the owner even being aware that a security breach has happened.

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

Disclaimer

Note: Some of the recommended measures below need some technical understanding of how to modify core WordPress and/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 search for a professional WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Hosting Service

Get in touch with your webhosting service provider and ask them what systems have been put in place to help prevent your site from being attacked, and what they are doing to make sure that your server files get regularly backed up.

Make sure that your hosting company is regularly backing up your server files and that, if anything happens, you can quickly and easily get your site back.

Security Measure #2 – Perform Regular WordPress Backups And Keep Your Website Or Blog Frequently Updated

Never rely on your hosting provider for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this done for you and maintain a habit of performing a full WordPress site maintenance routine frequently (e.g. daily, weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

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

A full WP maintenance routine looks like this …

Maintaining your WP website or blog backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress website fully backed up and up-to-date is vitally important for WordPress security. Image: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WordPress site completely 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 or blog. If you do not want to learn how to do WP site maintenance yourself, get someone else to do it but make sure this gets done. Backing up your site is the next most important thing you must do after making sure that you are still breathing!

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 backup process here: Backup, Copy & Protect Your WP Site With Backup Creator Plugin For WordPress

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

The brute-force attack on WordPress is mostly an attempt to compromise website admin panels by exploiting sites with “admin” as the user name.

For reasons of website security, avoid installing a WordPress site with the username admin. This is the first thing hackers will test. If your blog’s username is “admin”, you should change this immediately.

For a tutorial that shows you how to change your admin username, go here: Changing Your Admin User Name In WordPress To A More Secure Username

Security Measure #4 – Change Your Password

A “brute force” attack occurs when a malicious script continually hits a username and password field with different character strings trying to guess the right combination that will unlock your site.

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 keep attacking your site until it eventually works out the combination.

Weak passwords, therefore, become very easy targets for hacking attacks. Make sure that you change your password to a string that contains at least eight or nine characters long, with upper and lowercase letters, and “special” characters (^%$#&@*).

Useful 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 management program like Roboform …

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

For a detailed step-by-step tutorial on how to change your admin password, go here: How To Reset Passwords

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

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

wp-config.php

(wp-config.php file)

If hackers break into your WordPress site, they will typically try to access 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 them 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 being attacked and even being used as part of a bot net, therefore, you must prevent people finding your wp-config.php file. 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 Blog Installation Files

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

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

Security Measure #7 – Keep Your WordPress Blog, Plugins & Themes Up-To-Date

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor via the WP admin menu)

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

To prevent unauthorized people from accessing the WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Protect The Site’s Uploads Directory

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

By default, this folder is visible to anyone online. All someone has to do to see the contents in your site’s “uploads” folder is navigate to your directory using their web browser …

(WordPress uploads folder)

(WordPress uploads folder)

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

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 file with nothing in it named “index.php”) to your uploads directory, and so on. Again, it’s best to consult a professional if you are unsure about what to do.

Security Measure #10 – Security Plugins

There are a number of security plugins for WordPress available that will address common security issues faced by WordPress site owners, such as preventing hackers from accessing vital areas of your site, protecting your files from malicious exploits, 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 irreparable damage to your site is SecureScanPro.

SecureScanPro - WordPress security software solution

(SecureScanPro – WP total security software)

SecureScanPro is easy to install and easy to use, and addresses 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 Sites

Blog Defender Security Suite For WordPress(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 WordPress site for security weaknesses …

Blog Defender WordPress Security Product SuiteAnd then shows you how to quickly and easily fix these …

Blog Defender WordPress Security PluginIf 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 very secure web platform, but neglecting basic maintenance tasks like updating your WordPress installation, plugins and themes, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

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

As a final reminder of the importance of website security, below is the advice given by an expert on website security to all WordPress users after the mass 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, this article will help keep your WordPress site protected from brute force attacks. If you need any further help or assistance with WordPress security, please consult a professional WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

Also, please remember to subscribe to WPCompendium.org to be notified via email when we publish new tutorials on WordPress security and tutorials about new security plugins.

***

"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org

***