Course contentsShow
← Security
Lesson 696 of 3,05215. Web Security - Authentication and SessionsFree lesson

Brute Force and Dictionary Attacks

Understand how attackers systematically guess passwords using wordlists, common patterns, and computational power.

What You'll Learn

You'll understand how attackers systematically attempt to guess passwords by trying many possible combinations or common words, and why weak passwords fall so quickly.


The Attacker's Guessing Game

A brute force attack means trying every possible password combination until you find the right one. An attacker's program might start with "a", then "b", then "c", continuing through "aa", "ab", "abc", "password123", and so on—methodically testing millions or billions of guesses.

A dictionary attack is smarter: instead of random combinations, attackers use wordlists—files containing thousands or millions of commonly used passwords like "password", "123456", "qwerty", and "admin". They might also include variations: "P@ssw0rd", "Password1", "password!", etc.

Why These Attacks Work

Think of it like picking a lock. If your lock only has 4 positions instead of 10,000, it's much easier to crack. Similarly:

  • Short passwords (6 characters or less) can be brute-forced in minutes
  • Common passwords ("iloveyou", "letmein") appear in every dictionary wordlist
  • Patterns like "Summer2023!" follow predictable formulas attackers know to try

Modern computers can test billions of password guesses per second against weak hashing algorithms. Even with proper hashing (bcrypt, scrypt, Argon2), attackers still attempt dictionary attacks—they're just slowed down significantly.

Real-World Attack Flow

  1. Attacker obtains password hashes (from a breach or SQL injection)
  2. Loads a wordlist containing millions of common passwords
  3. Hashes each password candidate using the same algorithm
  4. Compares result against stolen hashes
  5. Matches reveal cracked passwords

Key Takeaway: Brute force attacks try every combination systematically, while dictionary attacks use lists of likely passwords—both exploit weak passwords and poor hashing, which is why password length, uniqueness, and slow hash functions (covered earlier) are critical defenses.