Lesson plan: Password Attacks

AP Cybersecurity · Unit 4 Securing Devices · Topic 4.2 Authentication · Practice set

At a glance

Suggested time
2 class periods (45 min)
Pacing
Second of four sets for Topic 4.2. The CED gives Topic 4.2 five class periods; this plan suggests 1 for Hashing and Password Storage, 2 for this set, 1 for Authentication Factors and MFA and 1 for Login Settings. The split across the four sets is this plan's suggestion. Day 1 covers online attacks and leaked credentials, day 2 offline cracking.
Before this set
Hashing and Password Storage: a server stores a hash of each password and checks a typed password by hashing it and comparing, and salt is a few random bits hashed with each user's password. This set's lesson keeps that lesson's game studio and its 80,000 player accounts.
Skills
1.B Determine ways adversaries exploit vulnerabilities to compromise an asset.

The one idea: Two questions name a password attack: what checks each guess, and where the guesses come from. A live sign-in service checking the guesses makes the attack online (password spraying, credential stuffing). The adversary's own computer working on a stolen hash file makes it offline (brute force, dictionary, rainbow table), and no lockout reaches it.

Day by day

Day 1 · Guesses at the sign-in page45 min

Day 2 · Cracking a stolen hash file45 min

Differentiation

If students are struggling
Before day 2's pairs, put a three-row table on the board (brute force, dictionary, rainbow table) with one column, where the candidates come from, and work Problem 6 🔒 together with it. Hold Problem 11 🔒 for homework.
Extension
From the lesson's RockYou counts, estimate how many of the studio's 80,000 accounts a spray of the top five passwords opens, the most a five-failure lockout allows before it locks an account (560,179 of 32 million is about 1.75 percent, so about 1,400). Then ask how the studio would spot it.
Vocabulary support
online and offline attack, authentication portal, password spraying, credential stuffing, default credentials, hash-cracking tool, brute force attack, dictionary attack, rainbow table, salt, account lockout.

From the course framework

LO 4.2.B Explain how password attacks exploit vulnerabilities.

  • 4.2.B.1 If an adversary can compromise the password of a legitimate user, and that user's organization has not enabled MFA or other authentication protections, then the adversary can act within that organization with all the access and rights available to the user.
  • 4.2.B.2 Password attacks can be classified as online or offline. Online password attacks attempt user:password combinations in an active authentication portal. Offline password attacks have captured a user:password database and can run password attacks against the database on their own computer. This method bypasses any account lock out protections that may be in place.
  • 4.2.B.3 Many users reuse the same passwords (or variations of the same password) for all the services and accounts they have, despite warnings not to. When an organization's user database is stolen, the usernames, emails, and passwords are sold to adversaries or posted online. Adversaries often begin an attempt to compromise an account by trying stolen or leaked credentials for a target individual.
  • 4.2.B.4 Many users set passwords that are easy to guess, and adversaries will attempt to guess common passwords for a user's account. Password spraying is an attack where an adversary attempts a common password against many different user accounts.
  • 4.2.B.5 Some services and devices (e.g., switches, routers, and IoT devices) are preconfigured with a default administrative user and password. Credential stuffing is an attack where an adversary attempts to gain access to these services or devices using common default credentials or account credentials that have been stolen.
  • 4.2.B.6 Offline password attacks use automated hash-cracking tools to hash possible passwords and compare them against a captured hash. Although hashes can't be reversed, an adversary can use these tools to hash many potential passwords and compare them to the target hash. If an adversary finds a hash that matches, they can use the password that generated the hash to login to the user's account. Offline attacks include: Brute force attacks, where an adversary uses an automated tool to test all the potential passwords that a user could have; Dictionary attacks, where an adversary uses an automated tool to test a list of common passwords
  • 4.2.B.7 A rainbow table attack uses a list of common passwords to generate a rainbow table. A rainbow table is a table that contains each potential password and its hash. The table is then sorted by the hashes, and the adversary uses an automated tool to search the list of hashes for the captured hash. If the hashes match, then the adversary has found a password that generates the same hash, and the password will allow the adversary to login to the user's account.

LO 4.2.A Explain why hashes (also called hash outputs, checksums, message digests, or digests) are used to store passwords.

  • 4.2.A.6 If two users had the same password, then their passwords would have identical hashes in the user:password directory. To prevent this, a few random bits (called salt) are hashed with a user's password to generate the hash. Each user's salt is unique, so even if two users have the same password they will have a different password hash because they have different salt.

Framework example: Figure 4.2B (printed page 105): on the left, one password, Summer1234!, tried against User 1 through User 4 (password spraying); on the right, the pairs admin/admin, default/1234 and root/toor tried against one target device (credential stuffing). Figure 4.2C (printed page 106): a stolen table of user names and password hashes above a rainbow table of six passwords and their hashes; User 2's hash matches the hash of Summ3rFun!, so that string signs in as User 2.