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.

WordPress SecurityWordPress is frequently the target of malicious attacks by hackers, due to its popularity.

In April 2013 a mass brute-force attack struck WordPress installations across virtually every WP host server in existence.

These attacks were caused by botnets (infected computer networks programmed to attack other vulnerable sites).

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)

One of the many ways hackers will attempt to break into a WordPress site is by trying to guess the site’s administration login username and password. This can be achieved using software tools that can guess hundreds of login combinations in minutes.

If you’re using obvious login details, your website could be easily hacked by a software’s repeated attempts to guess your site’s login details.

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 compromised and infected with malicious code or scripts, which are then controlled remotely as a group, typically without the computer owners’ knowledge.

Botnets are regularly used to blast out mass spam emails from the infected computers of compromised user accounts.

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

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 world since 2009. Screenshot source: SecureList.com)

The botnet attacks on WordPress sites are highly distributed and well organized. Over 90,000 IP addresses were identified by a number of hosting companies just in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress site administration areas. The large-scale brute force attacks continued after this, with over 30,000 WordPress blogs being hacked every day.

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

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

(WordPress is often the target of mass malicious attacks by hackers, due to its popularity)

Does This Mean We Shouldn’t Use WordPress Anymore?

No. In fact, there are many great reasons why you should continue using WordPress if you are concerned at all about the security of your website.

We explain why WordPress is a secure web platform in this article: Why WordPress Is A Secure Platform For Websites –

Useful Info

It’s important to understand that, in the case of April 2013 brute force botnet attack described above, there was actually no WordPress vulnerability being exploited (the same script was also attacking 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 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

You may think that the information in your website has nothing to offer to hackers, but the reality is that to a hacker, all websites are an opportunity to gain some benefit at your expense.

If hackers can exploit a way to gain remote access and control of your website or blog, that site can then be used as part of a larger network of “bots” to target other valued web sites.

Additional undesirable results of having your site hacked and your site security compromised include being blacklisted by search engines, having stealthy spam links promoting things like online meds, porn, etc. in your content and page title and descriptions, malicious redirects to phishing sites and other websites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasties.

The harsh reality is that malicious bots are very likely trying to break into your blog at this very moment. Whether they can achieve this or not, depends on how hard you can make things for hackers to keep trying until they work out a way to get in, or give up and decide to look for an easier target.

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

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

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

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

WordPress Security Check

(WordPress security check results. Screenshot source: Hackertarget.com)

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

WordPress 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 are all potentially valuable information to hackers, as this can inform them about potentially exploitable security weaknesses, especially in older versions.

If your website is driven by WordPress and you’re not proactive steps to toughen up your site, then it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your site, because these attacks are systematically targeting WordPress sites all the world!

Typically, when a website is hacked, webmasters can find themselves completely “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. Typically, sites will become infected with malicious software without the owner even being aware that this has occurred.

To avoid the heartache and frustration of having your site being hacked into, we have listed below 10 simple, yet essential and effective security measures that will help to prevent your WordPress site from being attacked by brute-force botnet hacking attempts.

Useful Info

Note: A few of the steps below need some technical skills 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 service provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Host

Contact your webhosting service provider and ask them what systems have been put in place to help prevent your site from botnet attacks, and what they do to make sure that your files and data are regularly being backed up.

Check that your webhosting service backs up your server files and that, if anything happens, you can easily recover your site.

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

Never rely on your web host for your site backups. Instead, learn how to manage your WordPress site or get this done for you and maintain a habit of religiously performing a complete site maintenance routine on a regular basis (e.g. daily, weekly, fortnightly, etc …)

A complete WordPress maintenance routine ensures that:

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

A complete WordPress site maintenance routine looks like this …

Maintaining your WP web site completely backed up and updated is vitally important for WordPress security.(Maintaining your WordPress site completely backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WordPress installation regularly backed up and updated is. WordPress site maintenance is not hard 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 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 back up your files manually, there are many WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Back Up, Copy & Keep Your WP Websites And Blogs Protected With Backup Creator Plugin For WordPress

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

The mass brute force botnet attack on WordPress is mostly an attempt to compromise website administrator panels and gain access to the site by exploiting WP installations that used “admin” as their user name.

For security purposes, never set up a WordPress site with the username admin. This is the first thing hackers will test. If your site’s username is “admin”, change it immediately.

For a simple step-by-step tutorial for admin users that shows you how to change your admin username, go here: Changing Your Admin Username In WordPress

Security Measure #4 – Your Password

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

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

Weak passwords, therefore, are really easy targets for hacking 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, combined with a few “special” characters (^%$#&@*).

Useful Tip

Roboform is a password program you can use to create secure login passwords …

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

For a detailed step-by-step tutorial created especially for WordPress users that shows you how to change your admin password, go here: What To Do If You Need To Change Login Passwords In WordPress

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

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 file

(WordPress WP Config file)

If hackers break into your site, they will normally try to access your wp-config.php file, because this is the file that contains your database information, 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.

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 from being able to easily view 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 Site Installation Files

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

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

Security Measure #7 – Update Your WordPress Installation, Plugins And Themes

Hackers look for vulnerabilities in outdated versions of WordPress that they can exploit, including outdated versions of WP plugins and themes.

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress comes with a built-in editor feature that lets the site administrator edit plugin and theme code from the dashboard.

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

WP Theme Editor Menu

(The WordPress theme editor can be accessed via the WP admin menu)

This allows anyone accessing your site to view and modify your WP theme template files, or cause havoc on your site.

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

Security Measure #9 – Remove Access To The WordPress Uploads Directory

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

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

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

(WordPress has an uploads directory where all of your media files are stored)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, anyone can 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, uploading a blank index.php file (this is literally an empty file called “index.php”) to your uploads directory, and so on. Again, it’s best to get professional help if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

There are several WordPress security plugins available that will address most security issues faced by WordPress site owners, such as preventing hackers from accessing vital areas of your site, protecting your site from malicious scripts, preventing injections of code into files, 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 website files and damaging your site is SecureScanPro.

SecureScanPro - complete security software for WordPress

(SecureScanPro – WordPress total security software)

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 great plugin you may want to consider using is BlogDefender.

Blog Defender Security Plugin For WordPress

Blog Defender Security Suite(Blog Defender WordPress Security Product Suite)

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

BlogDefender scans you WordPress installation for security vulnerabilities …

Blog Defender WordPress Security Product SuiteAnd lets you easily fix these …

Blog Defender WordPress Security Product SuiteIf you don’t want to purchase a security plugin like SecureScanPro or BlogDefender, then use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting simple maintenance tasks like keeping your WP software, plugins and themes up-to-date, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

Regardless of the kind of business you run or plan to run online and how small you think your web presence is, website security 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 web security to all WordPress users following 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 very important if you run a WordPress site. Hopefully, the above information has provided you with the initial steps you need to take 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 professional WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications via email whenever we publish new articles on WordPress security and tutorials about new security plugins and solutions.

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***

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