Skip to content
Visual explainer 2h to learn 4 steps

MFA & phishing-resistant authentication

Compare MFA factors and explain why FIDO2 passkeys resist phishing.

By Invicly Tech, , in Cyber Security Fundamentals. About 10 minutes to read.

Topic 20 of 49

In short

Multi-factor authentication combines factors from different categories: something you know, have or are. SMS and push can be phished or fatigued, while FIDO2 passkeys bind the login to the real site and resist phishing by design.

Explained simply

A password alone is weak because it can be guessed, reused or stolen. Multi-factor authentication (MFA) asks for proof from at least two different kinds of evidence: something you know (a password or PIN), something you have (a phone or security key) and something you are (a fingerprint or face).

Two passwords are not MFA, because both are the same kind. The point is that an attacker who steals your password from a breach still does not have your phone or your security key.

Not all second factors are equally strong. A code sent by SMS can be stolen if someone takes over your phone number. A code from an app can be typed into a fake website. A push notification can be approved by mistake. Passkeys and security keys are built so that a fake website simply cannot use them.

MFA blocks the vast majority of automated account takeover attacks. But attackers adapt, so defenders choose phishing-resistant methods for the most important accounts and protect the recovery process, which is often the weakest link.

Press Play on a diagram to walk through it one step at a time.

CompareMFA methods
SMS / TOTP
  • Widely supported
  • Phishable codes
  • SIM-swap risk
  • Better than nothing
Push
  • Convenient
  • MFA fatigue risk
  • Approve prompts
  • Add number matching
FIDO2 passkey
  • Phishing resistant
  • Bound to the site
  • No shared secret
  • Strongest option
SequenceWhy a phishing proxy fails against a passkey
User's browser
Fake site (proxy)
Real site
  1. 1Opens login-examp1e.com
    User's browser to Fake site (proxy): Opens login-examp1e.com
  2. 2Relays login for the user
    Fake site (proxy) to Real site: Relays login for the user
  3. 3WebAuthn challenge for example.com
    Real site to Fake site (proxy): WebAuthn challenge for example.com
  4. 4Passes challenge on
    Fake site (proxy) to User's browser: Passes challenge on
  5. 5No passkey for this origin: refuses
    User's browser to Fake site (proxy): No passkey for this origin: refuses
  6. 6Nothing valid to relay; login fails
    Fake site (proxy) to Real site: Nothing valid to relay; login fails

In depth

How TOTP codes are made

TOTP (time-based one-time password, RFC 6238) is what apps like Google Authenticator or Microsoft Authenticator use. At setup, the site creates a random secret and shows it as a QR code. Your app and the server both store this secret.

To make a code, each side takes the current Unix time divided by 30 (the time step), computes an HMAC-SHA1 of that number with the secret, and turns part of the result into a 6-digit code. Because both sides share the secret and roughly the same clock, they get the same code without talking to each other. Servers usually accept one step either side to allow for clock drift.

Weaknesses: the secret sits on the server, so a server breach can expose it. And the code is just text, so a user can be tricked into typing it into a fake site that forwards it to the real one within the 30 seconds.

FlowFrom shared secret to 6-digit code
  1. 1
    Shared secret

    Set up once via QR code

  2. 2
    Time counter

    floor(unix time / 30)

  3. 3
    HMAC-SHA1

    Of counter, keyed with secret

  4. 4
    Truncate

    Pick 4 bytes, mod 10^6

  5. 5
    Code

    Same on phone and server

How each factor gets defeated

SMS codes can be stolen through SIM swapping, where an attacker convinces a mobile carrier to move your number to their SIM, and through weaknesses in the phone network itself. TOTP and SMS codes can both be phished in real time by adversary-in-the-middle (AiTM) kits: a fake login page that relays everything to the real site, including the code, and keeps the session cookie it gets back.

Push approvals face MFA fatigue (also called prompt bombing). The attacker, who already has the password, triggers dozens of prompts, often at night, until the tired user taps Approve. In the 2022 Uber breach, an attacker combined repeated push prompts with a message pretending to be IT support. Number matching, where the user must type a number shown on the login screen, defeats blind approvals; Microsoft made it mandatory for Authenticator in 2023.

Even strong MFA does not help once a session cookie is stolen, for example by infostealer malware. That needs short sessions and device-bound session protections.

  • SIM swap: protect your carrier account with a PIN
  • AiTM phishing: relays codes and steals session cookies
  • Fatigue: enable number matching and limit prompts
  • Signal: many denied pushes, then one approval

Why FIDO2 and passkeys resist phishing

FIDO2 is made of two standards: WebAuthn, the browser API, and CTAP, how the browser talks to an authenticator like a security key or phone. At registration, the authenticator creates a new key pair just for that website. The private key stays in the authenticator; the site stores only the public key.

At login, the site sends a random challenge. The authenticator signs it, and the signed data includes the origin (the exact website) that the browser saw. Two things stop phishing. First, the browser will only use a credential for the site it was created for, so on login-examp1e.com there is no matching passkey to use. Second, even if data were relayed, the signature names the wrong origin and the real site rejects it.

Nothing secret is stored on the server, nothing is typed by the user, and nothing can be read out and replayed. A passkey is a FIDO credential; it may be synced across devices (iCloud Keychain, Google Password Manager) or bound to one hardware key.

Rolling out MFA and protecting recovery

Start with the accounts that matter most: administrators, email, remote access (VPN), cloud consoles and finance staff. Require phishing-resistant methods (FIDO2 security keys or passkeys, or certificate-based smart cards) for admins first, then extend to everyone.

The recovery and enrolment path is where many attacks now go. If a caller can persuade the help desk to reset MFA, the strongest factor does not matter; the 2023 MGM Resorts attack reportedly began with a call to the IT help desk. Require identity verification for resets, such as a video call with ID, or a manager's approval, and alert when MFA methods are changed.

Also watch the logs. Useful detections: a new MFA method registered shortly after a password reset, sign-ins that passed MFA from an unusual country or hosting provider, and many MFA denials followed by success. Disable legacy protocols (like basic authentication for email) that skip MFA entirely.

Learn it in 4 short steps

About 30m each. Track them with a timer in your plan.

  1. 1
    Name the three factor categories~30m
  2. 2
    Compare SMS, TOTP, push and FIDO2~30m
  3. 3
    Explain MFA fatigue attacks~30m
  4. 4
    Explain passkeys at a high level~30m

Key points

  • Factors are something you know, have or are.
  • True MFA uses factors from different categories.
  • SMS and TOTP codes can be phished.
  • FIDO2 passkeys resist phishing by binding to the origin.

Key terms

Tap a card to flip it. 0/4 known

Examples

Creating and checking TOTP codes

Step 1: generate a random Base32 secret, as a site does at enrolment. Step 2: create the provisioning URI; this is what the QR code contains, and scanning it adds the account to an authenticator app. Step 3: get the current code. Step 4: verify it as the server would; valid_window=1 accepts one 30-second step before or after to allow for clock drift. Step 5: store the secret encrypted on the server, because anyone with it can generate valid codes.

python
import pyotp

secret = pyotp.random_base32()
totp = pyotp.TOTP(secret)   # 6 digits, 30 s steps, HMAC-SHA1
print(totp.provisioning_uri(name="alice@example.com", issuer_name="ExampleCorp"))
# otpauth://totp/ExampleCorp:alice%40example.com?secret=...&issuer=ExampleCorp
code = totp.now()
print(code, totp.verify(code, valid_window=1))   # e.g. 492039 True

Investigating a possible MFA fatigue attack

A user reports many push prompts at 2 a.m. Step 1: in your identity provider's sign-in logs, filter for that user over the last 24 hours. Step 2: look for a pattern: a correct password from an unfamiliar IP, then 20 or more MFA denials, then one approval. Step 3: if there was an approval, treat it as a compromise: revoke all sessions and refresh tokens, reset the password, and remove any new MFA methods the attacker registered. Step 4: check what the session accessed, such as mailbox rules or file downloads. Step 5: enable number matching and limit how many prompts can be sent in a short time.

Quick reference

  • Factors: something you know, have, are; MFA needs two different categories
  • Strength (weakest to strongest): SMS, voice, TOTP, push with number matching, FIDO2/passkey
  • TOTP: HMAC-SHA1 of floor(time/30) with a shared secret, 6 digits
  • AiTM phishing relays passwords and codes and steals the session cookie
  • Passkeys are bound to the site's origin, so fake sites cannot use them
  • Alert on: many MFA denials then approval, new MFA method after reset
  • Protect help desk MFA resets with strong identity checks
  • Disable legacy authentication protocols that bypass MFA

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Which pair counts as true multi-factor authentication?

Question 2

2An attacker uses a fake login page that relays everything to the real site in real time. Which method still stops them?

Question 3

3What best defends against MFA fatigue attacks on push notifications?

Question 4

4Why is the help desk an important part of MFA security?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    List the MFA methods enabled on three of your own accounts (email, bank, cloud). Rank them from weakest to strongest and pick one to upgrade.

  2. Exercise 2medium

    Implement the TOTP algorithm yourself in Python using only the standard library, and check it matches pyotp for the same secret.

  3. Exercise 3hard

    Write detection logic for MFA fatigue from an identity log export (CSV with time, user, ip, result where result is mfa_denied, mfa_approved or password_ok). Flag users with 5 or more denials followed by an approval within 30 minutes.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Is SMS MFA better than nothing?
Yes. It still blocks most automated attacks that only have a password. But move important accounts to an authenticator app, a passkey or a security key when you can.
What happens if I lose my security key or phone with my passkeys?
You use a backup method you set up earlier, such as a second security key, synced passkeys on another device or recovery codes. Always register at least two strong methods for important accounts.
Are passkeys the same as passwords stored in a password manager?
No. A passkey is a private key that signs a challenge and is never sent to the site. A stored password is still a shared secret that can be typed into a fake site.
Can MFA be bypassed?
Yes, by real-time phishing proxies, stolen session cookies, MFA fatigue or help desk social engineering. Phishing-resistant methods and good recovery processes close most of these gaps.

Go deeper

ShareXLinkedInWhatsApp