Cyber Trainer Passwords & Auth
Passwords & Auth · Chapter 05

Multi-factor authentication

Turning on MFA stops the vast majority of automated account takeovers. But not all MFA is equal, and attackers have adapted. Here's how each method works and where its limits are.

MFA methods compared

MethodHow it worksWeak spotsPhishing-resistant?
SMS or voice codeA one-time code is texted or read out to your phone number.SIM swapping, number porting, interception, and you can be tricked into reading it out.no
Email code or linkA code or magic link sent to your inbox.Only as strong as your email account.no
Authenticator app (TOTP)An app calculates a new 6-digit code every 30 seconds from a shared secret.Codes can be phished and relayed in real time.no
Push notificationApprove a prompt in an app (Microsoft Authenticator, Duo, Okta Verify)."MFA fatigue": spamming prompts until someone taps Approve. Number matching reduces this.partly
Security key / passkey (FIDO2)The device signs a challenge that's tied to the real website's address.Losing the key (keep a backup); account recovery processes.yes
Smart card / certificateA certificate on a card or device proves identity (PIV, CAC).Cost and management overhead.yes
Any MFA beats noneEven SMS codes stop the automated credential-stuffing and spraying attacks from Chapter 04. But for email, admin and finance accounts, aim for phishing-resistant methods: passkeys or security keys (Chapter 06).

How authenticator app codes work

When you scan the QR code to set up an authenticator app, you're saving a shared secret key. The app and the website then each compute the same code independently, with no network connection, using TOTP (Time-based One-Time Password, RFC 6238):

  1. Take the current time and count how many 30-second steps have passed since 1 January 1970.
  2. Compute HMAC-SHA1(secret, step count): a keyed hash (Chapter 05 of the crypto primer).
  3. "Dynamically truncate" the 20-byte result down to a 6-digit number.
A working authenticator
------

Try it: in Google or Microsoft Authenticator, choose to add an account by entering a setup key, paste the secret above, and the app shows the same code as this page. Delete the entry afterwards.

Why TOTP can still be phishedThe code isn't tied to the website you type it into. A fake site can ask for it and pass it to the real site within its 30-second window. That's exactly what the next section shows.

Adversary-in-the-middle phishing

Modern phishing kits (Evilginx, Tycoon 2FA and others) don't just copy a login page. They sit between you and the real site as a reverse proxy, so you see the genuine pages and complete real MFA, while the attacker captures the result.

Step through an AiTM attack
The fix: phishing-resistant MFA. A passkey or security key checks the website's real address as part of the cryptography, so it simply won't produce a valid signature for micros0ft-365.com. More in Chapter 06.

Other ways attackers get around MFA

📲 MFA fatigue (push bombing)

The attacker has the password and triggers dozens of push prompts, often late at night, until the user taps Approve. Used in the 2022 Uber breach. Fix: number matching (type the number shown on screen), limits on prompts, and reporting unexpected prompts.

🔁 SIM swapping

The attacker convinces your mobile network to move your number to their SIM, then receives your SMS codes. Fix: avoid SMS for important accounts and add a PIN or port-out protection with your network.

🍪 Session cookie theft

After you sign in, the site gives your browser a session cookie. Infostealer malware or an AiTM proxy that steals it skips MFA entirely. Fix: device-bound sessions, short session lifetimes, and checking device health.

☎️ Helpdesk resets

"I've lost my phone, please reset my MFA." Attackers impersonating staff caused the 2023 MGM Resorts breach. Fix: strong identity verification before any reset.

🗣️ "Read me the code"

A caller pretending to be your bank asks for "the code we just sent to verify you". Fix: never share a one-time code. Genuine organisations won't ask for it.

🚪 Legacy protocols

Old email protocols (IMAP, POP, basic auth) may not support MFA at all, leaving a side door open. Fix: disable legacy authentication.

Knowledge check