Bypassing 2fa With Cookies
The article explains that session cookies can be stolen via phishing and reused to bypass two-factor authentication, as demonstrated by exporting cookies from one browser and importing them into another to access an Outlook account without re-authenticating. It also describes how the Evilginx2 proxy phishing tool can capture session cookies, defeating 2FA.
Published on infosecwriteups.com
🔥Not a member? Find my posts and more on X (Twitter 🐤) — Follow me ❗
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application does not bind session cookies to the original device or IP and allows them to be reused from a different browser, so a stolen cookie grants full access without re-authentication.
Impact
An attacker who obtains a session cookie through phishing can bypass 2FA and access the victim's account, although some applications may limit cookie reuse by IP, device, or single-use restrictions.
What the attacker needed
Victim interacts with phishing site; attacker controls a domain; victim has 2FA enabled
The fix
Applications should bind session cookies to additional factors such as device fingerprint, IP address, or use single-use cookies to prevent reuse from unauthorised locations.
How it was found
- Log in to the target account (e.g., Outlook) in one browser and complete the 2FA prompt.
- Export the session cookies from that browser using a cookie editor extension.
- Import the exported cookies into a different browser.
- Visit the target site in the second browser; the imported cookie authenticates the session without requiring credentials or 2FA.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you log in with two-factor authentication (2FA), the website gives your browser a small file called a session cookie to remember that you already passed the check. If an attacker can steal that cookie, they can put it in their own browser and the website will think they are you, so they don't need your password or 2FA code. This article shows how a phishing tool can trick you into giving away that cookie.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.