Brute-force login attacks: protecting your website's front door
Brute-force bots can try your login page thousands of times at machine speed. Why long random passwords beat clever ones, and the measures that slow guessing to a crawl.
Your website's login page is a door that anyone on the internet can try, as many times as they like, at machine speed. That is the brute-force attack in one sentence, and defending it does not require exotic tools. This guide covers how these attacks work, why length beats cleverness, and the handful of measures that turn a real risk into a nuisance, grounded in Cloudflare's learning center.
What a brute-force attack is
Cloudflare defines a brute-force attack as a trial-and-error method that tries every possible combination, like a thief working through all the numbers on a safe's lock. There is no clever strategy inside it - scripts or bots simply point at a website's login page and guess, over and over. Its uncomfortable strength is that, given unlimited time and no mitigation, it always works eventually. Its weakness is speed: every added character multiplies the combinations, and past a certain length, cracking a properly random password becomes unrealistic.
Not every guessing attack works this exhaustively. A dictionary attack tries words from a dictionary as passwords instead of every combination - MITRE's CAPEC catalog classifies it as a specific instance of password brute forcing - and credential stuffing, covered below, skips guessing entirely by replaying logins leaked elsewhere. The length math in this guide applies to the exhaustive kind; the defenses help against the whole family.
Length is your first defense
Because the attacker's cost grows with password length, a long random password does not just delay the attack - it moves it out of reach. This is the same advice as our admin account security guide: long, random, unique passwords generated by a manager. Unique matters for a related reason: an attacker who cracks one password may try that same login on other services, a pattern Cloudflare calls credential stuffing. One password per account means one cracked password opens exactly one door.
Slow the guesses down
The measures that protect a login page all attack the same variable: guesses per second. Cloudflare lists two for whoever runs the login system: locking out IP addresses that produce too many failed attempts, and building a delay into password checking - even a few seconds greatly weakens a brute-force attack. For a small site, your CMS, host or security layer may offer these as settings; check what yours includes and turn on what exists. One honest caveat: determined attackers spread guesses across many addresses - Cloudflare's credential-stuffing documentation describes bots making attempts that appear to come from a variety of device types and different IP addresses - so lockouts and delays thin an attack rather than end it. Password length and MFA remain the layers that hold. Two-factor authentication changes the game entirely: a correct password alone still cannot open the door, which is why enabling it ranks among Cloudflare's user-side recommendations too.
Watch the door
A brute-force campaign is noisy: repeated failed logins, sometimes thousands, against your admin page. Your host's logs or a security plugin can show that pattern, and seeing it is your cue to confirm the defenses above are actually on - not a reason to panic. Strong unique passwords, MFA and throttled guesses mean the noise stays noise.
FAQ
Can attackers really just guess my password?
They can try - that is the whole attack. But against exhaustive guessing the math favors the defender: Cloudflare notes that each added character multiplies the work, and a properly random long password can take days, months or years, making the attack impractical. Shorter-cut variants exist - dictionary attacks try real words first - which is why randomness matters as much as length.
Is a clever password like P@ssw0rd good enough?
Substitution tricks are well known to cracking tools, and dictionary attacks already include the real word you started from, so they add little. Length and randomness are what multiply the attacker's cost - a manager-generated string or a long passphrase of unrelated words beats a clever-looking short one.
Does two-factor authentication stop brute force?
It stops the outcome that matters: even a correctly guessed password cannot log in without the second factor. Cloudflare recommends enabling it alongside unique passwords. Pair it with throttling so the guessing itself is also slowed.
What is credential stuffing?
Recycling: taking a login cracked or leaked on one service and trying it on many others, per Cloudflare's definition. Unique passwords per account are the direct defense, which is why password reuse is the risky habit to break first.