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 most popular content management system in the world and the preferred online publishing platform 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 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 vulnerable installations).

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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. This can be achieved using scripts and software tools that automatically tries to guess hundreds of login possibilities in minutes.

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

This is called a “brute force” attack.

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)

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

Botnets are normally used used to send mass spam emails.

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 world since 2009 …

The Zeus botnet has been actively compromising 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. Image: SecureList.com)

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

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

WordPress powers millions of websites and blogs around the world, making it a natural target for malicious attacks by hackers

(Being the world’s most popular CMS makes WordPress a target for hacking)

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 at all about the security of your website.

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

Important

It’s important to understand that, in the case of April 2013 large-scale brute-force attack described above, there was no WordPress vulnerability being exploited (the same script was also targeting sites built using applications like Joomla).

Mike Little, the co-founder of WordPress, 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 Website From Brute-Force Attacks – 10 Security Points

Every blog with a vulnerability can be an opportunity to hackers. A vulnerable web site offers hackers with a platform to launch DDoS attacks, spread malware and engage in information theft.

If a hacker can exploit a vulnerability, the site can then be employed as a “bot” to attack more valued websites.

Additional undesirable effects of having your site hacked and your site security compromised include being blacklisted by Google, having spammy links promoting things like online meds, discounted fashion, etc. inserted in your content, redirecting visitors to phishing sites, drive-by downloads (adding malicious scripts on your visitors’ computers), and many other nasty things.

The reality is that brute-force software bots are most likely scouring for security weaknesses and trying to break into your blog right now. Whether they can successfully break in or not, depends on how hard you will make things for them to continue trying until they discover how to break in, or are forced to decide to look for a less protected target.

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

If you visit Hackertarget.com and run your website through their WordPress security scan …

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

You will see that the scan will return various results and information about your site setup …

WP Security Scan

(Hackertarget – website security scan results. Product image source: Hackertarget.com)

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

Hackertarget - Website Security Scan(Source: Blog Defender)

The ability 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 are all useful information to hackers, as these can inform them about potential security weaknesses, especially where site owners haven’t updated their software versions.

If your site or blog is powered by WordPress and you’re not preventive steps to toughen up your site, then it’s practically guaranteed that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these brute-force attacks are systematically targeting WordPress installations worldwide!

When a website gets broken into, webmasters will find themselves “locked out” of their own site, or notice that their files have been modified or even that their content has been completely wiped out. Often, most compromised sites will be infected with malicious software without the owner’s knowledge or awareness.

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

Disclaimer

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

***

Security Measure #1 – Contact Your Hosting Service

Contact your host and ask them what security systems are in place to protect your site from being attacked, and what is done to ensure that your files and data are regularly being backed up.

Make sure that your hosting service backs up your server files and that, if anything happens, you can easily get back your site.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Or Blog Regularly Maintained

Never rely only on your host for your site backups. Instead, learn how to manage your WordPress site or get this done for you and develop a habit of religiously 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 files and data are deleted,
  • All data and files are free of errors, optimized and backed up,
  • All software, plugins and themes are up-to-date,
  • etc …

A proper WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WP installation completely backed up and updated is. WordPress maintenance is not hard to do or time-consuming, but it must be done to ensure the security of your website. If you don’t want to learn how to do WordPress site 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 should do after making sure that your heart is still beating!

If you don’t want to back up your site manually, there are many plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Back Up, Clone And Keep Your WordPress Websites And Blogs Protected With Backup Creator Plugin For WordPress

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

The mass brute force attack on WordPress sites was mostly an attempt to compromise website administrator panels by exploiting WordPress installations using “admin” as the account name.

For website 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 will need to change it immediately.

We have created a tutorial that shows you how to change your admin username here: Changing Your Admin User Name In WordPress

Security Measure #4 – Choose Strong Passwords

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

Unless you put some measure in place to prevent 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 breaks into your admin area.

Weak passwords, therefore, are very easy targets for botnets. Make sure that you change your password to a string that contains at least 8 characters long, with upper and lowercase letters, and “special” characters (e.g. %, #, @, etc).

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

You can use a password program like Roboform to generate  passwords(Roboform is a password program that lets you easily generate strong login passwords)

For a detailed tutorial for non-technical admin users on how to change your WordPress 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 Easily Visible

The wp-config.php file allows WordPress to communicate with the database to store and retrieve data and is used to define advanced WordPress options.

WP Config file

(wp-config.php file)

If hackers break into your 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 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 attacks and even being used as part of a bot net, therefore, you must 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

Rename or delete 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, just rename them.

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

Hackers search for vulnerabilities in outdated versions of WordPress that can be exploited, including out-of-date versions of plugins and themes.

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

Security Measure #8 – Disable Your Theme Editor

WordPress installations come with a built-in editor feature that allows you to edit plugin and theme code from the dashboard.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the dashboard menu)

The WordPress theme feature lets anyone accessing your blog view and edit your WP theme templates, and create havoc on your site.

If you want to prevent unauthorized people from accessing 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 – Protect Your WordPress Uploads Folder

The WordPress “uploads” directory contains all the media that gets uploaded to your website.

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

(WordPress uploads folder)

(WordPress uploads folder)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, anyone can upload unauthorized file types to your site.

Protecting your directories will prevent unauthorized people 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 blank file named “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 – Security Plugins

A number of great WordPress security plugins are available that will address many common security issues WordPress site owners face, such as preventing hackers from accessing 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 WordPress security 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 damaging your site is SecureScanPro.

SecureScanPro - WP total security plugin

(SecureScanPro – total security software solution for WordPress)

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

Another great plugin you may want to look at using is BlogDefender.

Blog Defender WordPress Security Suite

Blog Defender Security Plugin(Blog Defender Security Product Suite)

Blog Defender 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 holes …

Blog Defender Security Suite For WordPress Websites & BlogsAnd lets you fix these quickly, easily and inexpensively …

Blog Defender Security Product SuiteIf you don’t want to invest in 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 secure platform, but neglecting simple maintenance tasks like making sure that your WP software, plugins and themes are kept up-to-date, tightening file and data security 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 simply cannot ignore the importance of securing your website or blog.

As a final reminder, below is the advice given by an expert on website security to all WordPress users after the worldwide 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, the information in 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 WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified whenever we publish new articles and tutorials on WordPress security and reviews of new WordPress security plugins.

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***

Originally published as How To Protect Your WordPress Site From A Brute-Force Attack.