TapCub is live — analytics, insights and live chat, free on one platform
Glossary

Brute Force Attack: How It Works and How to Prevent It

A brute force attack tries many passwords until one works. Attack types, how long guessing takes, why per-account lockout is not enough, and what it looks like in traffic.

Su He Reviewed by Ethan Brooks Also called brute force Last updated Nov 19, 2026 Glossary

Quick answer

A brute force attack uses software to try many passwords or keys until one works. It needs no vulnerability, only unlimited guesses, so defence limits guesses, slows them down or makes a correct guess insufficient on its own.

Formula: time to try all = possible values ÷ guesses per second

What is a brute force attack?

A brute force attack is an attack in which software tries many passwords or keys until one works. It needs no vulnerability in the target, only the ability to keep guessing. MITRE ATT&CK describes it as systematically guessing passwords, either by talking to a service that checks credentials (an online attack) or offline against data the attacker already stole, such as password hashes.

Prevention comes down to two things: make each guess expensive or limited (rate limits, lockouts, challenges) and make a correct guess useless on its own (a second factor). This page covers how the attack works, what it costs an attacker, which defences cost what, and what it looks like in website traffic.

Types of password-guessing attacks

MITRE groups four sub-techniques under brute force. They differ in what the attacker already has.

TypeWhat the attacker doesWhy it worksWhat it looks like at a login form
Password guessingMany passwords against one accountThe account has a weak or short passwordMany failures on one username
Password crackingGuesses offline against stolen hashesNo limit on attempts once hashes leakNothing at all: it happens off your site
Password sprayingOne or a few common passwords across many accountsStays under per-account lockoutsOne failure per account, across thousands of accounts
Credential stuffingLeaked username-password pairs tried on other sitesPeople reuse passwordsOne try per pair, many IPs, high volume

Credential stuffing is the follow-up to credential harvesting: harvesting obtains the pairs, stuffing uses them. Both are usually run by a botnet so that requests come from many addresses.

How long does guessing take?

Sample data with assumed rates: an online attacker is limited by the login endpoint to 1,000 guesses per second; an offline attacker with stolen fast-hash data can try 10 billion (10^10) guesses per second.

PasswordPossible valuesOnline at 1,000/sOffline at 10^10/s
8 lowercase letters26^8 = 208,827,064,576about 6.6 yearsabout 21 seconds
8 letters and digits (62 characters)62^8 = 218,340,105,584,896about 6,900 yearsabout 6.1 hours
8 from all 95 printable characters95^8 = 6,634,204,312,890,625about 210,000 yearsabout 7.7 days
12 lowercase letters26^12 = 95,428,956,661,682,176about 3 million yearsabout 110 days

Two conclusions follow. First, length matters more than character variety: 12 lowercase letters outlast 8 characters from the whole keyboard offline. Second, the online column is only safe because the endpoint limits guesses. Real attackers do not try every value; they try common passwords first, which is why a short, popular password falls in seconds regardless of the tables above. Offline cracking is worst: you cannot rate-limit it, so protect the hashes with a slow password-hashing function and treat any database leak as an incident.

Why per-account lockout is not enough

Sample data: an attacker tries one common password against 10,000 accounts, one attempt each. If 1% of accounts use that password, 10,000 × 1% = 100 accounts are taken over. Every account saw exactly one failed attempt, so a rule such as "lock after 5 failures" never fires. Per-account counters see guessing; they do not see spraying or stuffing. You need counters on the source (IP, network, device) and on the whole endpoint as well.

Defences and what each costs

DefenceStopsCost or weakness
Rate limiting by account and by sourceFast guessingDistributed attackers use many sources; see rate limiting
Failed-attempt capSlow, targeted guessingLockouts can be abused to lock real users out; NIST allows at most 100 consecutive failures per account and suggests gentler measures near the limit
Increasing delay after failuresGuessing, with less lock-out abuseSlows legitimate users who mistype
CAPTCHA or other challengeSimple scriptsFriction; advanced bots can pass
Multi-factor authenticationA correct guessed passwordDoes not stop the traffic, only the takeover
Breached-password check and no reuseStuffing, weak passwordsNeeds a password list lookup at sign-up and sign-in
Bot detection on the login routeKnown automationMisses clean-looking traffic; see bot mitigation
Slow password hashingOffline crackingAdds compute at every login
Alerts on login-failure volumeSlow responseOnly tells you; someone must act

The pattern is layers. No single row is enough, and each limit has a price in friction or in the chance of locking out the wrong person. OWASP's guidance lists account lockout, delays, IP blocking, CAPTCHA and log monitoring and says attackers can bypass any one of them, so it recommends combining several; NIST SP 800-63B likewise pairs rate limiting with gentler throttling options.

Common misconceptions

  • "A long lockout is safe." A permanent lock after 3 failures lets anyone lock any user out by guessing wrong on purpose. MITRE notes that overly strict lockouts can cause denial of service.
  • "Strong passwords alone solve it." They help against guessing and cracking but not against phishing or reused passwords.
  • "It only targets big sites." Automated tools scan for login forms everywhere.
  • "HTTPS stops it." Encryption protects the password in transit; an attacker sending guesses over HTTPS is still sending guesses.
  • "Failed logins are a security-only metric." A flood of requests to one URL also distorts your traffic numbers.

How it shows up in website statistics

Attack traffic that runs a browser engine or JavaScript shows up in page analytics as a burst to the login URL: many one-page sessions, no further navigation, often no referrer, and unusual device or location mixes. Tools that just post to the form and never load the page do not run your analytics script at all and leave no trace in it; you find those in server and gateway logs.

What TapCub does and does not do

TapCub is a measurement product, not a security product. It does not block logins, lock accounts or protect your authentication endpoint, and nothing here is security or legal advice. What it can do is show the traffic shape.

  1. See the burst. In Web analytics › Pages, look for a sudden jump in views of the login URL that is out of proportion to real sign-ins.
  2. Check the source. In Web analytics › Sources, a spike of direct visits with no referrer or UTM tags, concentrated on one page, is one pattern consistent with automation, not proof of it.
  3. Look at recognised bots. In Web analytics › Bots, TapCub separates the bots it recognises into their own report, so they do not inflate human numbers. This covers recognised crawlers and automation that runs your script, not every attacker. With only the page script, you see only bots that execute JavaScript; request-level data needs server collection or a log import.
  4. Set an alert. A monitor in All-platform analytics › Operations › Monitors can watch pageviews or visitors per hour and notify you. It only notifies; it takes no action.
  5. Keep the real defence elsewhere. TapCub's own collection endpoint rate-limits hits by key, IP and site, and drops over-limit events; that protects TapCub's collector, not your login page.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Su He

Data Analyst

Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is a brute force attack?

It is an attack where software tries many passwords or keys until one works. Online attacks guess through a login form; offline attacks guess against stolen password hashes with no attempt limit.

How do you prevent a brute force attack?

Use layers: rate limits by account and source, gentle lockouts or delays, multi-factor authentication, breached-password checks, bot detection on the login route and slow password hashing.

Does account lockout stop brute force attacks?

It stops guessing against one account but not password spraying or credential stuffing, which try one password per account. Lockout can also be abused to lock real users out.

How long does it take to brute force a password?

It depends on length, character set and speed. At 10 billion guesses a second offline, 8 lowercase letters take about 21 seconds and 12 lowercase letters about 110 days.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics