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
- Open (5 min)Project the RockYou chart at the top of the mini-lesson and ask the lesson's own question: about what share of the 32 million accounts used 123456? Collect estimates before reading on.
- Mini-lesson (12 min)Teach Password Attacks, first part: from the top through the spray estimate in the "Online and offline" section (stop at the box Cracking a stolen hash file), then all of "Lists from old breaches". Brute force, dictionary and rainbow table attacks appear in some choices today and are taught on Day 2; if a student asks what they mean, say they come with the next lesson. Then project the CED's Figure 4.2B (described at the bottom of this plan): one password tried against four users, beside three default pairs tried against one device.
- Do together (7 min)Problem 2 🔒 🔒 Teacher notes: sign in as a teacher to see this🔒 Teacher notes: open the full plan to see this
- On their own (12 min)Problem 1 🔒 what a stolen password gives the adversary · Problem 3 🔒 Problem 4 🔒 name the attack · Problem 5 🔒 select all: which conditions let a leaked list open the portal.
- Do together (6 min)Problem 8 🔒 Problem 3 🔒 🔒 Teacher notes: sign in as a teacher to see this🔒 Teacher notes: open the full plan to see this
- Exit check (3 min)Problem 14 🔒: what an account lockout leaves open. Have students underline the stem's word guessing and check each choice against it.
Day 2 · Cracking a stolen hash file45 min
- Open (3 min)Ask what a server does with a typed password at sign-in, from Hashing and Password Storage (it hashes the password and compares the result with the stored hash).
- Mini-lesson (10 min)Teach Password Attacks, second part: the rest of the "Online and offline" section, from the box Cracking a stolen hash file through the paragraph on salt. Project the CED's Figure 4.2C beside the Rainbow tables box. Point out that the figure's callout says "all possible passwords"; EK 4.2.B.7 and the lesson build a rainbow table from a list of common passwords, and testing every possible password is brute force.
- Do together (7 min)Problem 12 🔒: put the steps of an offline attack in order. Model it because the order fixes where each guess is checked, and the rest of the day leans on that.
- In pairs (10 min)Problem 6 🔒 Problem 7 🔒 Problem 10 🔒: one partner asks where the candidate passwords come from, and the other answers from the stem before either reads the choices.
- On their own (8 min)Problem 9 🔒 what each run can find · Problem 11 🔒 salt and the two runs · Problem 13 🔒 a lockout and a stolen file.
- Discuss (7 min)Problem 11 🔒 Problem 13 🔒 Problem 2 🔒 🔒 Teacher notes: sign in as a teacher to see this🔒 Teacher notes: open the full plan to see this
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.