Find a course

Module 3: Common VulnerabilitiesLesson 7 of 1015 min

Passwords, Authentication and Social Engineering

See how password guessing, credential stuffing and spraying work, why MFA matters, and how phishing and pretexting exploit people instead of code.

Step 1 of 10Learn

The front door is a password

Verizon's widely cited annual Data Breach Investigations Report has found year after year that stolen or weak credentials and the human element play a role in a large share of breaches. Attackers often don't need an exploit at all; they log in.

Password attacks fall into two groups.

Online attacks try passwords against a live login page or service:

  • Brute force: try every combination. Hopeless online against any reasonable password, because each attempt is slow and logged.
  • Dictionary attacks: try common passwords and variations against one account. Account lockouts and rate limiting slow these down.
  • Credential stuffing: take username-password pairs leaked from one site's breach and try them on other sites. It works because many people reuse passwords. It's automated at enormous scale, often with lists of millions of pairs.
  • Password spraying: try one very common password, such as a season plus a year plus an exclamation mark, against many accounts. By trying only one or two passwords per account, the attacker stays under lockout thresholds.

Offline attacks happen after an attacker steals password hashes, for example from a breached database. Now they can guess as fast as their hardware allows, with no lockouts. That's why services must store passwords with slow, salted hash functions such as Argon2id or bcrypt.

In penetration tests, weak and reused passwords are among the most common ways testers move from a foothold to full control of a network.

Two families of password attacksPassword attacksOnline (livelogin)brute forcedictionarycredential stuffingpassword sprayingOffline (stolenhashes)guess at full speedno lockoutsdefense: slow saltedhashes (Argon2id)

Step 2 of 10Practice · Sort into groups

Classify each attack.

Tap an item, then tap its group (or drag it there).

Step 3 of 10Learn

Why spraying works: the math of many accounts

Suppose only 1% of employees in an organization use a particular guessable password pattern. That sounds safe. But an attacker spraying that one password across 300 accounts has a high chance of at least one success.

If each account independently has probability p of using the password, the chance that at least one of n accounts does is:

P(at least one) = 1 − (1 − p)n

With p = 0.01 and n = 300: 1 − 0.99300 ≈ 1 − 0.049 ≈ 95%.

One compromised account is often all an attacker needs to get inside, read email, search shared drives and launch further attacks from a trusted address.

This math explains several modern defenses:

  • Banned-password lists reject the most common and breached passwords at the moment users choose them. Current NIST guidance (SP 800-63B) recommends checking new passwords against such lists and favors length over complexity rules or forced periodic changes.
  • Multi-factor authentication means a correct password alone isn't enough.
  • Smart detection looks for many accounts failing with the same password from the same source, a signature of spraying.

Step 4 of 10Explore

Chance that spraying finds at least one account

x is the number of accounts sprayed. p is the share of users who chose the guessed password.

00.20.40.60.81 02004006008001,000
Chance with 100 accounts
0.634
Chance with 1,000 accounts
1

Step 5 of 10Practice · Work it out

An attacker sprays one password against 200 accounts. Each account has a 0.5% chance of using it. What is the probability, as a percentage, that at least one account is compromised? Round to the nearest whole percent.

Step 6 of 10Learn

Multi-factor authentication

Multi-factor authentication (MFA) requires two or more different kinds of evidence:

  • Something you know: a password or PIN.
  • Something you have: a phone app, a hardware security key, a smart card.
  • Something you are: a fingerprint or face.

Microsoft has reported that MFA blocks well over 99% of automated account compromise attacks. But MFA methods differ in strength:

  • SMS codes are better than nothing but vulnerable to SIM swapping, where an attacker convinces a mobile carrier to move your number to their SIM card, and to phishing.
  • Authenticator app codes (time-based one-time passwords) avoid SIM swapping but can still be phished: a fake login page asks for the code and relays it instantly.
  • Push notifications can be abused through MFA fatigue: the attacker, who already has the password, triggers dozens of prompts until a tired user taps Approve. This played a part in the 2022 Uber breach. Number matching, where the user must type a number shown on the login screen, reduces it.
  • Phishing-resistant MFA, such as FIDO2 security keys and passkeys, uses public-key cryptography bound to the real website's domain. A fake site simply can't get a valid response. These are the strongest options widely available.

In tests, a common finding is MFA that's enabled for most users but missing on one legacy system, VPN or admin account: exactly the gap attackers look for.

MFA options from strongest to weakest against phishingPhishing-resistant:FIDO2 keys, passkeysbound to the real domainPush with number matchingreduces MFA fatigueAuthenticator app codescan be relayed by fakesitesSMS codesSIM swapping, phishingPassword onlystuffing, spraying,phishing

Step 7 of 10Learn

Social engineering: hacking people

Social engineering manipulates people into giving up information or access. It bypasses technical controls by exploiting trust, helpfulness, fear, urgency and authority.

Common forms:

  • Phishing: fraudulent emails that lure recipients to click a link, open an attachment or enter credentials on a fake page. Spear phishing targets specific individuals with personalized details gathered through OSINT; whaling targets executives.
  • Vishing (voice phishing) and smishing (SMS phishing): the same tricks by phone call or text. Attackers impersonate the IT help desk, a bank or a delivery company.
  • Business email compromise (BEC): impersonating an executive or supplier to request an urgent wire transfer or a change of bank details. The FBI's Internet Crime Complaint Center has repeatedly ranked BEC among the costliest types of cybercrime, with reported losses in the billions of dollars per year.
  • Pretexting: inventing a believable scenario: I'm from the auditing firm and need the vendor list today.
  • Tailgating or piggybacking: following an authorized person through a secured door.

Penetration tests may include authorized social engineering, such as simulated phishing campaigns, to measure how many people click, how many enter credentials and, most importantly, how many report the email. A fast report from one employee lets the security team warn everyone and block the attack. Good programs focus on building that reporting reflex, not on shaming people who click.

Step 8 of 10Flashcards

Social engineering tactics

Tap a card to flip it.

Step 9 of 10Practice · What would you do?

What would you do?

An employee in accounts payable receives an email that appears to come from the CEO: 'I'm in meetings all day. We need to pay a new supplier urgently before 3 p.m. Wire the amount to the attached account details and keep this confidential.' What should the employee do?

Step 10 of 10Practice · Choose one

Which authentication method best resists a phishing site that relays everything the user types to the real site in real time?