Sub topic 11
Brute force, dictionary, spraying and credential stuffing
This chapter covers the four password attacks that the A+ Core 2 (220-1102) exam expects you to tell apart. It assumes you know what a user account, a password hash and a lockout policy are. It also assumes you have read the earlier chapter on the threat vocabulary. The next chapter covers MFA and access controls, which are the main countermeasures.
Why the four attacks get confused
All four attacks try to log in as someone else by guessing or reusing a password. They differ in two things: where the guesses come from, and how many accounts each guess is tried against. Exam scenarios usually describe the pattern of failed logins and expect you to name the attack. If you can read the pattern, you can name the attack.
Online and offline attacks
An attack is online when the attacker sends guesses to a live login page or service. The service can count failures, lock the account and write log entries. Online attacks are slow and noisy.
An attack is offline when the attacker already holds stolen password hashes and tests guesses on their own hardware. No lockout applies, because no login service is involved. Offline attacks can be very fast. A hash is a one-way scrambled form of a password, so the attacker hashes each guess and compares the results.
This distinction explains why account lockout helps against online guessing but does nothing once a hash database has leaked.
Brute force
A brute force attack tries every possible combination of characters until one works. It needs no prior knowledge of the password. It guarantees success given enough time, but the time grows very quickly with length and character variety.
A simple calculation shows the effect of length. The script below computes how many guesses a brute force attack needs in the worst case.
def keyspace(alphabet_size: int, length: int) -> int:
"""Number of possible passwords of exactly this length."""
return alphabet_size ** length
# 26 lowercase letters only
print("6 lowercase letters:", keyspace(26, 6))
# 94 printable ASCII characters
print("12 mixed characters:", keyspace(94, 12))
guesses_per_second = 1_000_000_000 # an offline attacker with fast hardware
seconds = keyspace(94, 12) / guesses_per_second
years = seconds / (60 * 60 * 24 * 365)
print("Worst case for 12 mixed characters: about", round(years), "years")Six lowercase letters give about 308 million combinations, which falls in under a second at a billion guesses per second. Twelve mixed characters give roughly 4.8 × 10^23 combinations, which takes about 15 million years at the same speed. Length matters more than complexity rules.
Signs of a brute force attack:
- Thousands of failed logins against one account in a short time.
- Guesses that look random or sequential, such as aaaa, aaab, aaac.
- An account locked out repeatedly.
Dictionary attack
A dictionary attack tries words from a prepared list instead of every combination. The list holds common passwords, words from a language, names, and common substitutions such as p@ssw0rd. It is much faster than brute force because people choose predictable passwords. It fails against a long random password that is not on any list.
Signs of a dictionary attack:
- Many failed logins against one account.
- Guesses that are real words or well-known passwords, such as password1, letmein and qwerty.
A hybrid attack is a common variant. It takes dictionary words and adds numbers or symbols, such as Summer2026!. This is why a password built from a word plus a year is weak.
Password spraying
Password spraying tries one or a few common passwords against many accounts. The attacker picks a password such as Welcome1 or Spring2026 and tries it on every username in a list. Then the attacker waits and tries the next password.
Spraying is built to avoid lockout. A lockout policy counts failures per account, and spraying makes only one or two failures per account. Each account sees almost nothing unusual.
Signs of password spraying:
- A single source tries one login against many different accounts.
- Each account shows only one or two failures.
- Attempts are spaced out in time to stay under lockout limits.
- The same password appears across the attempts.
Credential stuffing
Credential stuffing takes username and password pairs leaked from one site and tries them on other sites. It works because many people reuse the same password everywhere. The attacker does not guess anything. Each pair was a valid login somewhere, and the attacker tests whether it is valid elsewhere.
Signs of credential stuffing:
- A burst of logins using real email addresses as usernames.
- A high rate of failures, but also a few successes with no password variation.
- The company was not breached. The credentials came from a different breach.
Automated tools perform stuffing at scale, often from many different IP addresses, which makes IP-based blocking weak.
Comparing the four attacks
| Attack | Source of guesses | Targets | Typical pattern | Best defenses |
|---|---|---|---|---|
| Brute force | Every possible combination | Usually one account | Many failures on one account | Long passwords, lockout, MFA |
| Dictionary | Wordlist of common passwords | Usually one account | Many failures, real words | Unique long passphrases, banned-password lists, MFA |
| Password spraying | One or few common passwords | Many accounts | One or two failures per account | Banned-password lists, monitoring across accounts, MFA |
| Credential stuffing | Leaked username and password pairs | Accounts on a different site | Valid-looking pairs, reused logins | Unique passwords per site, MFA, breach monitoring |
The diagram below shows a quick way to choose between them.
Countermeasures for the exam
The exam asks for the best technician response. Match the control to the weakness:
- Strong, long passwords or passphrases. They defeat brute force and dictionary attacks by enlarging the search space and avoiding wordlists.
- Unique password per site. It defeats credential stuffing, because a leak elsewhere gives the attacker nothing. A password manager makes this practical.
- Account lockout and login throttling. They slow brute force and dictionary attacks against a live service. They do little against spraying.
- Multi-factor authentication (MFA). It helps against all four, because a correct password alone is not enough to log in.
- Banned-password lists. They block the common passwords that dictionary and spraying attacks depend on.
- Log monitoring and alerts. They reveal patterns across accounts, which is the only way to see spraying.
- Password changes after a breach. Force a reset when credentials are known to be exposed.
Edge cases and common errors
- Credential stuffing versus brute force. Both produce many failures. If the scenario says the credentials were exposed in another company's breach, or the user reused a password, choose credential stuffing.
- Spraying versus dictionary. Both use common passwords. Look at the target count. Many accounts with few tries each is spraying. One account with many tries is a dictionary attack.
- Offline cracking. If a database of hashes was stolen, lockout does not apply. Long passwords and salted, slow hashing are the defense, and the exam focuses on the password length side.
- Complexity rules alone. Requiring a symbol and a number does not stop dictionary attacks, because Password1! follows the rules and is still on every wordlist.
- Default credentials. Attackers also try vendor defaults such as admin and admin on routers and devices. Changing default passwords is a standard hardening step.
Technician response
When a user reports repeated lockouts or you see odd login activity, work through these steps:
- Identify the pattern in the logs: one account or many, and the speed and spacing of attempts.
- Reset the password of any affected account and confirm the user's other sites do not share it.
- Enable or require MFA on the account.
- Check whether the account was actually accessed by reviewing successful logins and their source.
- Report the incident to the security team following company policy, and document it.
Exercise
A security log shows one source address making a single login attempt, using the password Spring2026!, against 400 different employee accounts over six hours. No account has more than two failures. Which attack is this, and why does account lockout not stop it?
Show answer
This is password spraying. It tries one common password across many accounts, so each account stays below the lockout threshold. MFA, banned-password lists and monitoring across accounts are better defenses.
Exercise
A retailer announces a breach. Two weeks later, a different company sees a spike of successful logins from unfamiliar locations, using employees' personal email addresses and the same passwords those employees used at the retailer. Name the attack and give the most effective user-level countermeasure.
Show answer
This is credential stuffing. The best user-level countermeasure is a unique password for every site, ideally stored in a password manager, together with MFA.
Exercise
An attacker has stolen a file of password hashes and tests guesses on their own computer. Does account lockout protect the users? What attribute of a password helps most?
Show answer
No. The attack is offline, so no login service exists to count failures or lock accounts. Password length (a long passphrase) helps most, because it greatly increases the number of guesses needed.