Security

Brute force attack

A brute force attack is a method that automatically and systematically tries many combinations of passwords, keys or codes until it finds the right one.

In this post

A brute force attack is a method of getting into an account by trying passwords, one after another, until one works. It is carried out by a program that can attempt thousands of combinations per minute, without tiring and without needing a break. It requires no special skill. Just patience, computing power and a password that the victim chose in a predictable way. It is the oldest and simplest attack, and it is still one of the most widely used.

The name refers to the absence of any intelligence. It is like trying every key on a huge key ring in a lock, one by one, until one of them opens it. With a simple lock, you get lucky quickly. With a complex lock, it could take centuries. That is why defence relies, to a large extent, on making every attempt expensive, slow and unlikely to succeed.

A brute force attack means trying keys until one opens the lock. If your password is short and common, it opens straight away. If it is long and unique, it never opens.

What is a brute force attack?

In security, a brute force attack stands in contrast to attacks that exploit a flaw in a program. Here there is no bug to exploit. You simply keep trying until you succeed. The more possible combinations there are, the more time is needed. A four-digit PIN has ten thousand combinations, which a program tries in seconds. A long phrase made up of several words has so many that they cannot be tried in a lifetime.

Automation changes the scale of a brute force attack. A single computer can try thousands of passwords per second against a stolen file, and a network of infected machines can launch attempts against thousands of websites at once. That is why the login pages of any website, even little-known ones, receive attempts every day. To bots, every website looks the same and they make no distinction between large and small.

What attackers are after with a brute force attack

An open account is worth whatever it lets you do. On a website, the attacker can insert spam links or adverts, install malware for visitors or use the server to attack others. In an email account or a social network, they can steal personal data and impersonate the victim to their contacts. And on a server they can add the machine to a network of controlled computers, as happened with thousands of websites in 2013.

Online and offline brute force

A password’s resistance to brute force depends above all on its length. Every extra character multiplies the number of possible combinations. A short password full of symbols can fall in hours, while a long phrase of unrelated words can take centuries even with powerful hardware. That is why current recommendations favour long phrases over convoluted sequences. It also matters whether the attack is online or offline. Online, the attacker tries against a login form and every attempt goes through the server, which can slow it down. Offline, they work with a stolen copy of the encrypted passwords and try on their own computer without limits. There, the way the system stored them is what counts. If it used a fast method, such as MD5, a modern graphics card with tools such as Hashcat or John the Ripper can try billions of combinations per second. If it uses a slow method designed for the purpose, the speed drops dramatically. That is one of the reasons why leaks from poorly protected databases are so dangerous.

Why a long phrase is safer than a short password

Variants of the brute force attack

Simple or pure attack

A simple brute force attack tries every possible combination of characters, one after another. It is the slowest, but it eventually works against short passwords. A password of eight lowercase letters has around two hundred billion combinations, which a modern graphics card can run through in seconds if the attacker has the hash and the system uses a fast algorithm.

Hybrid brute force

A hybrid brute force attack starts from common words and adds common numbers or symbols to them, such as a year or an exclamation mark at the end. It exploits the fact that most people apply the same tricks to strengthen their password, so a city name followed by the current year and an exclamation mark falls in minutes with the transformation rules that come with auditing tools.

Reverse attack or password spraying

The reverse attack, also called password spraying, turns the logic around. Instead of trying many passwords against one user, it tries one very popular password against thousands of users. That way it avoids lockouts caused by repeated attempts on the same account. This variant is a reminder that it is not enough for a password to be hard for a particular attacker to guess, it also must not be among the ones people use most.

Dictionary attack

Instead of trying every combination, a list of common words and passwords is used, with the typical variations. It is much faster and very effective against passwords made up of real words, names, dates or football teams. Anyone with a password like football2024 is in the second batch of hits of any list, and falls in a matter of seconds. The lists are refined with every data leak. Every time a large website loses its passwords, attackers learn how people choose them. That is why modern recommendations stress length and originality, not adding odd symbols to a common word. A phrase of four random words is much harder to guess than a word with a number at the end.

Credential stuffing

Credential stuffing is a more effective and very widespread version. Instead of inventing passwords, real email and password pairs are used, stolen in leaks from other websites, and tried on different services. It works because many people reuse the same password everywhere. A failure at any website ends up opening the victim’s accounts at banks, email providers and shops.

The defence is the same as against classic brute force, plus one more measure. Do not reuse passwords. With a password manager, each service has its own, and a leak at one does not affect the others. And a second authentication factor turns a stolen password into half a key, which on its own opens nothing. These are the two most effective measures for ordinary users.

Slow and distributed attempts

To avoid being stopped by lockouts, some attackers spread their attempts across thousands of different addresses, with pauses between them. Each address makes only a few attempts, so none of them looks suspicious.

Added together, those few attempts per address turn into thousands. This technique makes it hard for the defence to rely on blocking specific addresses, and it forces you to look at the overall activity and not just at each source.

That is why modern protections combine several signals. How many attempts fail in total against the same account, from which locations, with what timing pattern and with which technical characteristics. Protection services that see the traffic of millions of websites have an advantage, because they recognise the patterns of a wave before it reaches each individual site.

How a website defends itself against a brute force attack

Passwords, attempt limits and a second factor

The defence against brute force starts with credentials. Long and unique passwords for every account with privileges, and a username that is not the obvious one. Then, a limit on failed attempts, which temporarily blocks anyone who fails several times. And finally, a second factor for administrators and editors. With these three layers, a brute force attack becomes useless in practice.

Which layers protect an account against brute force

Other measures complement the protection of the login form. Reducing the visibility of the login page, for example by changing its address, makes it harder for bots to find. Web application firewalls filter suspicious traffic before it reaches the server. And email alerts when someone logs in from a new location make it possible to react. None of these replaces strong passwords, but they reduce the noise and the load.

Slow hashes and salt on the server

Whoever programs the website has one more defence, the way passwords are stored. Algorithms designed for the purpose, such as bcrypt, scrypt or Argon2, are deliberately slow and force the attacker to spend much more time on each attempt. Each password also gets a salt, a random value that is different for every user, which prevents the use of precomputed tables and forces the attacker to go after accounts one by one.

Monitoring the load on the server

It is also wise to monitor server performance during an attack. An intense attack can slow the website down even if it does not get in, because every attempt consumes server resources. If the website suddenly becomes slow for no reason, or the provider warns of abnormal usage, review the access logs. It is common to discover a wave of attempts against the administration page as the cause of the slowness.

Other targets and signs of mass login attempts

Mass attempts against other targets

Brute force is not only used against the accounts of a website. It is also used to crack weak encryption keys, mobile phone PINs, captured wireless network passwords and protected files. In each case the principle is the same, trying until the combination is found, and so is the defence, using long keys and limiting the number of attempts.

How to tell whether you are under attack

Access logs and security tools show the failed attempts. You will see many in a row, with different usernames or always the same one, from a variety of addresses. Hundreds of attempts a day are normal for any website. What should worry you is one of them succeeding, or seeing successful logins from unexpected places, such as a country where nobody on the team works.

Also check whether your own passwords have appeared in leaks. Use a breach lookup service to see if your email address has appeared in known data thefts, and change the passwords of the accounts involved and of any other where you reused them. A password manager makes the change easier, and it can audit weak or repeated passwords. It is half an hour’s work with a big payoff. To clean up a hacked website it is not enough to delete what you can see, you also have to find the backdoors.

A wave of attacks against the WordPress admin user

In April 2013, several web hosting companies began to detect an abnormal increase in login attempts on WordPress administration pages. One of them, HostGator, said it had seen more than 90,000 different addresses involved. The attackers tried the admin username with around a thousand common passwords, including admin, 123456 or 12345678. Security services and international media quickly picked up the story.

The goal was not to take over a particular website, but to recruit thousands of servers. A hosting server is much more powerful than a home computer, so a network made up of compromised websites would be very powerful. Experts warned that it could be used to launch flooding attacks. The US cybersecurity agency issued an alert, and the founder of WordPress urged people to stop using the admin username.

The practical lesson of that wave against WordPress was clear. Obvious usernames and common passwords were the biggest weak point. Administrators who already had a different username and a strong password were not at risk. Many websites changed those habits as a result of the episode, and WordPress eventually stopped suggesting the admin username in new installations. But attempts still happen every day against every website.

This case also showed the limits of blocking by address. The founder of WordPress pointed out that filtering suspicious addresses was of little use, because the network could change address on every attempt. A deeper defence was needed, based on strong credentials and additional protections. That idea is still the foundation of login page security more than ten years later.

History of trial and error attacks

The idea of systematically trying every possibility predates computers. During the Second World War, the machine known as the bombe, designed by Alan Turing and Gordon Welchman at Bletchley Park, automatically checked the possible rotor positions of the Enigma machine to decrypt German messages.

In 1998 the Electronic Frontier Foundation built Deep Crack, a machine costing around 250,000 dollars that found a DES encryption key in 56 hours. It proved that a 56-bit key was no longer secure and accelerated the adoption of AES, with much longer keys. Since then computing power has kept growing, and the only lasting answer has been to make keys longer and every attempt slower.

Frequently asked questions

Frequently asked questions about Brute force attack

What is a brute force attack?

It is a method of getting into an account by trying many passwords, one after another, until one works. It is done by a program that can attempt thousands of combinations per minute. It requires no special skill, just patience, computing power and a predictable password.

Where does the name brute force attack come from?

The name refers to the fact that there is no intelligence or trick involved, only massive repetition until something works. It is like trying every key on a huge key ring in a lock until one of them opens it.

Why does a brute force attack work?

Because many people choose short, common or predictable passwords. Attackers do not try combinations at random, but start with the most common ones, such as 123456 or the name of the site. A long and unique password makes the method unworkable in practice.

What types of brute force attack exist?

The most common are the simple attack, which tries every possible combination, the dictionary attack, which tries common words, the hybrid attack, which adds numbers or symbols to those words, and the reverse attack, which tries one common password against many users. Credential stuffing, which reuses leaked username and password pairs, is also considered a variant.

How does a website defend itself against a brute force attack?

With long and unique passwords, a username that is not the obvious one, a limit on failed attempts, a second factor for the most powerful accounts and alerts about suspicious logins. Many security extensions, firewalls and hosting providers include these protections.

What is the difference between a brute force attack and credential stuffing?

In a brute force attack, invented passwords or passwords from a dictionary are tried. In credential stuffing, real username and password pairs are tried, stolen in leaks from other websites. The second usually succeeds more often, because many people reuse their passwords.

What is a dictionary attack within a brute force attack?

It is a variant in which words from a list are tried, with common variations such as adding a number at the end. It is faster than trying every possible combination and works well against passwords that are real words or dates.

Can a brute force attack in progress be detected?

Yes. It shows up as many failed attempts in a row, from the same addresses or from many different ones, especially on the login page. Server logs and security tools reveal it. If there is a warning, it is wise to tighten the limits and review the accounts.

I protect your website's login against brute force

I can limit login attempts, strengthen your passwords and add two-step verification to stop this type of attack.

About the author

Javier Afán

WordPress developer specialised in security, WooCommerce, and hacked website recovery.

I work on WordPress from a technical angle focused on security, architecture, and the decisions that really affect a project's continuity.