Security operations

How to Prevent a Brute Force Attack: 10 Controls That Work

A brute force attack is just guessing, repeated millions of times. These ten controls make guessing slow, expensive, and useless even when it succeeds.

Cysoro Security TeamPublished · 10 min read
guess • guess • guess BLOCKED after 5 tries SECURITY OPERATIONS Stop brute force Lock the door before the guesses land.
Quick answer

Prevent a brute force attack by requiring long, unique passphrases of at least 15 characters, adding phishing-resistant multi-factor authentication, limiting failed logins to a small number per account and per IP address, disabling password login on SSH, and monitoring failed-login spikes. No single control stops every variant, so layer several of them together.

Key takeaways

  • Long, unique passphrases and MFA remove most of the value from guessing passwords.
  • Rate limiting, lockouts, and CAPTCHAs slow attackers down; per-account and per-IP limits work together.
  • Monitor failed logins and act fast when you see a spike, a new geography, or a distributed pattern.

A brute force attack is not clever. It is patient. Software tries password after password, hour after hour, until one works — and modern computers can try millions of guesses a second against a stolen password file. The good news is that a handful of ordinary controls make that patience useless.

What is a brute force attack?

A brute force attack is an automated attempt to log in by systematically trying many passwords, PINs, or keys until one is accepted. The attacker needs no inside knowledge, only a login page and a list of guesses to try.

MITRE ATT&CK lists brute force as technique T1110, under credential access. It breaks the technique into four sub-techniques: password guessing, password cracking, password spraying, and credential stuffing. Each one dodges a different defense, which is why you need more than one control.

Online guessing runs against a live login form, API, or SSH server, where every guess costs a network round trip. Offline cracking runs against a stolen password hash, where the attacker can try millions of guesses a second on a single graphics card, or rent that power by the hour in the cloud. The second case is far faster, which is why password storage matters as much as login controls.

Short, common passwords fall first. A password like a season plus a year, or a keyboard pattern, appears in every guessing list ever built. A long, random, unique passphrase does not appear in those lists at all, and that difference is the whole defense.

Four ways attackers guess passwords Passwordguessingmany passwords,one accountStopped by:lockouts Passwordcrackingoffline, againsta stolen hashStopped by:long passwords,strong hashing Passwordsprayingfew commonpasswords, manyaccountsStopped by: MFA,breach screening Credentialstuffingstolen passwordsreused elsewhereStopped by:unique passwords One control never stops all four. Layer them.
The four brute force variants in MITRE ATT&CK T1110, and what stops each one. Illustration by Cysoro.

How does a brute force attack work?

An attacker starts with a target and a guessing list. The list comes from breached passwords, common passwords, dictionary words, and patterns built from the target's own website, such as company names and product names.

Against a live login, the attacker automates the form: try a password, read the error, try the next. Rate limits and lockouts slow this down, so attackers spread guesses across many IP addresses and many accounts. That is password spraying, and it is designed to stay under each account's failure threshold.

Against a stolen hash, there is no login page to slow anything down. The attacker hashes each guess with the same algorithm and compares it to the stolen value. Weak hashing makes this fast; modern salted hashing with a high cost, such as Argon2id or bcrypt, makes each guess expensive and buys time.

Success looks quiet. A guessed password gives a normal login, so the attacker can then set up mail forwarding, add a recovery address, or move sideways. That is why detection matters: a login that works after 200 failures from a new country is not a normal login.

How do you know you are under a brute force attack?

You know from your logs, not from a single event. Look for a sudden rise in failed logins, the same account failing from many IP addresses, or many accounts failing from one address.

  • Failed-login spikes: a sharp rise in failures on one account, one service, or one time window.
  • Distributed sources: failures spread across many IP addresses, countries, or user agents, which suggests a botnet rather than one machine.
  • Off-hours attempts: login storms at 3 a.m. local time, when real users are asleep.
  • Admin accounts first: attackers often try administrator, root, and service accounts before ordinary users.
  • Success after many failures: a login that succeeds after dozens of failures deserves a closer look, not a shrug.

If you see these signs, treat it as an active attack, not background noise. Check whether any account actually logged in, force password resets for affected accounts, and review the account for new forwarding rules or devices.

Why do long, unique passwords stop brute force attacks?

Length is the strongest property a password has. Every extra character multiplies the number of guesses an attacker must try, and that multiplication grows faster than computing power does.

NIST SP 800-63B-4, finalized in July 2025, requires at least 15 characters when a password is the only authentication factor, and at least 8 characters when it is used only as part of multi-factor authentication. Verifiers should accept passwords of at least 64 characters, and they must not impose composition rules or force periodic changes.

That last point surprises people. Forced complexity rules push users toward predictable patterns, and forced rotation pushes them toward small variations of the same password. Length, uniqueness, and screening against known breached passwords do the real work.

Use a password manager to generate and store a different long password for every account. A manager also protects you in a second way: it will not autofill on a fake login page, which is an extra warning. You can check a password's strength with our free password strength checker.

Generate a strong one with the password generator, and screen new passwords against a blocklist of commonly used, expected, or compromised passwords. Tell the user why a password was rejected.

If a password already appears in a known breach, it is already on an attacker's list. Test yours with the pwned password checker.

Does MFA stop a brute force attack?

Multi-factor authentication is the best single defense against password guessing, because a correctly guessed password is no longer enough on its own. OWASP puts it plainly: MFA is by far the best defense against the majority of password-related attacks.

Not all second factors are equal. A hardware security key or a passkey is phishing-resistant: it is bound to the real website, so a fake login page cannot reuse it. One-time codes and push approvals are better than nothing, but codes can be phished and push prompts can be worn down by repeated requests.

Turn MFA on for every account that supports it, starting with email, cloud admin consoles, VPNs, and remote access. Email matters most, because a compromised mailbox lets an attacker reset passwords elsewhere.

MFA does not stop the guessing itself, so keep your rate limits and monitoring in place. What it does is make a successful guess worthless, which removes the attacker's reason to keep trying.

How do rate limiting and lockouts work?

Rate limiting and lockouts make online guessing slow and expensive. NIST SP 800-63B-4 requires verifiers to limit consecutive failed attempts on one authenticator to no more than 100, by disabling that authenticator. Lower limits are allowed, and most teams use far fewer.

Use both per-account and per-IP limits. A per-account limit stops guessing against one user. A per-IP limit stops one machine from spraying thousands of accounts. Together they cover the two main variants.

Be careful with lockouts that are too strict. If an attacker can lock every account by failing a few times on each, your lockout policy becomes a denial-of-service tool. NIST suggests softening the blow with a bot-detection challenge before attempts, a growing delay after each failure, and risk-based checks using IP address, geography, and device data.

A practical setup for most teams is 5 failed attempts, then a delay that grows from 30 seconds toward an hour, with a CAPTCHA after a few failures. Let locked-out users recover through the forgotten-password flow, and alert your team when lockouts spike. NIST's current password guidance is published in SP 800-63B-4.

ControlWhat it stopsWhere it appliesCost to users
Long passwordsOffline crackingEvery accountLow, with a manager
MFAGuessed passwords being usedEmail, VPN, admin consolesLow, with passkeys
Rate limitingOnline guessing volumeLogin forms, APIs, SSHLow
Account lockoutRepeated guessing on one accountEvery loginMedium if too strict
CAPTCHAAutomated guessingAfter a few failuresLow if shown late
MonitoringAttacks you have not noticedAll authentication logsNone for users
Five layers that stop brute force attacks 1Long, unique passwords15+ characters, one per account, screened against breach lists 2Phishing-resistant MFApasskeys or security keys, so a guessed password is not enough 3Rate limits and lockoutsper-account and per-IP limits, with growing delays 4Bot checks and CAPTCHAchallenge automation after a few failures, not on every login 5Monitoring and alertsfailed-login spikes, new geographies, and success after failures
Defense in depth against brute force attacks. Illustration by Cysoro.

How do you protect SSH from brute force attacks?

An SSH server on a public IP address gets password guesses constantly, often within minutes of being exposed. The most effective fix is to stop accepting passwords at all and log in with a key instead.

  1. Generate a key pair on your own machine and copy the public key to the server.
  2. Test key login before you change anything, so you cannot lock yourself out.
  3. Set PasswordAuthentication no in the server configuration, then restart the service.
  4. Disable root login over SSH, and use a named account with sudo instead.
  5. Move SSH off port 22 if you like, but treat that as noise reduction, not security.
  6. Add fail2ban or an equivalent to block addresses that fail repeatedly, as a second layer.

If you must allow password login, require MFA for SSH, limit who can reach the port by firewall, and monitor failed attempts daily. Key-only login is simpler and stronger than any of those workarounds.

How do you protect web logins and APIs?

Web logins and APIs need the same layers, tuned for how users actually sign in. Start with the account controls above, then add the web-specific ones.

Put a web application firewall or bot-management layer in front of public login pages. It can block known bad IP addresses, challenge suspicious automation, and absorb the volume before it reaches your application.

Require MFA for privileged accounts first, then roll it out to everyone. Privileged accounts are the ones attackers try first, and they are the ones whose compromise hurts most.

For APIs, use tokens or keys with short lifetimes, rotate them on a schedule, and rate-limit by key as well as by IP address. Never accept a password as an API credential if a token will do, and log every failed authentication attempt with the key identifier.

Hide whether the username or the password was wrong. A login error that says the account does not exist tells an attacker which accounts are real. Use one generic message for both cases. Our spear phishing guide explains why stolen credentials are so valuable once an attacker has them.

What should you do if a brute force attack succeeds?

Act within minutes. A guessed password gives the attacker a normal-looking login, so speed matters more than embarrassment, and the attacker counts on victims staying quiet.

  1. Force a password reset for the affected account, from a trusted device, and sign out all sessions.
  2. Check for changes the attacker may have made: new mail-forwarding rules, added recovery addresses, new MFA devices, and new API keys.
  3. Review the logs for what the account did after login, and whether other accounts were tried from the same source.
  4. Block the source addresses involved, and tighten the rate limits that let the attack through.
  5. Tell your team, even if nothing seemed to happen. Others probably received the same treatment.

If money moved or sensitive data was accessed, report it to your bank and to the FBI's Internet Crime Complaint Center. Keep the logs: they are the evidence that shows what happened and when.

What mistakes make brute force attacks easier?

The biggest mistake is reusing passwords. Credential stuffing only works because people reuse the same password across sites, so one breach becomes many logins. A password manager fixes this completely.

The second mistake is short passwords with forced complexity. A password like a season plus a year and an exclamation mark looks complex and falls in seconds. A passphrase of four unrelated words is longer, easier to remember, and far harder to guess.

The third mistake is leaving default credentials in place. Routers, cameras, and test servers ship with known usernames and passwords, and attackers try those first. Change every default before a device touches the network.

The fourth mistake is storing passwords weakly. If your service stores passwords with a fast, unsalted hash, a breach hands attackers an offline cracking target. Use a modern salted hashing scheme with a cost as high as practical, and keep the details in your small business cybersecurity checklist review.

MITRE's brute force technique page lists the mitigations defenders use most, including MFA, account lockout, and password policies aligned to NIST.

The bottom line

Brute force attacks succeed against short, reused passwords on unprotected logins. They fail against long, unique passphrases protected by MFA, rate limits, and monitoring. You do not need exotic tools; you need the ordinary controls, turned on everywhere, and kept on.

Start today with the highest-value step: turn on MFA for email and admin accounts, then set a 15-character minimum and a password manager for everyone. Check your own passwords with the free pwned password checker and replace anything that already appears in a breach.

Frequently asked questions

What is a brute force attack in simple terms?

A brute force attack is an automated attempt to log in by trying many passwords, one after another, until one works. The attacker does not need to know anything about you in advance, only a login page and enough time or computing power.

How long does a brute force attack take?

It depends on the password and the target. A short, common password can fall in seconds against a stolen password hash, while a long, random, unique passphrase can take far longer than is practical. Online attacks are slower because each guess needs a network round trip.

Does two-factor authentication stop brute force attacks?

It stops a correctly guessed password from being enough on its own, which is why CISA and NIST recommend it. It does not stop the guessing itself, so you still need rate limiting and monitoring to keep the noise down.

What is the difference between brute force and credential stuffing?

Brute force guesses many passwords against one account. Credential stuffing tries passwords stolen in earlier breaches against many accounts. Password spraying is a third variant that tries a few common passwords across many accounts to avoid lockouts.

How many failed logins should trigger a lockout?

NIST SP 800-63B-4 sets an upper bound of 100 consecutive failed attempts before the authenticator must be disabled, and lower limits are allowed. Many teams use 5 to 10 failures with a growing delay, which stops casual guessing without locking real users out often.

Should I change my password regularly to stop brute force attacks?

No. NIST now says verifiers should not force periodic password changes, because forced changes push people toward weak, predictable passwords. Change a password when there is evidence it was compromised, and make it long and unique.

Can a brute force attack target SSH?

Yes. Any SSH server on a public IP address gets password guesses constantly. The most effective fix is to stop accepting passwords entirely and log in with a key instead, then block password authentication in the server settings.

Sources

  1. NIST — SP 800-63B-4, Digital Identity Guidelines: Authentication and Authenticator Management
  2. MITRE ATT&CK — Technique T1110: Brute Force
  3. CISA — Known Exploited Vulnerabilities Catalog
  4. Indiana Office of Technology — Cybersecurity Best Practices: Password and Passphrase Management
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against NIST SP 800-63B-4, MITRE ATT&CK T1110, and CISA guidance on credential attacks.

How we write and fact-check →

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free