Skip to content
Account takeover Write-up Intermediate

MFA Phishing of AWS Users

AWS authentication cookies obtained through MFA phishing remain valid for about 12 hours even after the victim logs out, changes their password, or replaces their MFA device. An attacker with these cookies can maintain a multi-factor authenticated session to the AWS web console regardless of IP address, user agent, or region changes.

rhinosecuritylabs.com

Published on rhinosecuritylabs.com

Before diving into this blog post, you should consider reviewing our recent post on phishing users with MFA on AWS. The research discussed in this post was discovered during an AWS phishing engagement that Rhino was performing on a client, and our previous post goes much more in depth in how we phish users with MFA on…

Spencer Gietzen, on rhinosecuritylabs.com

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 AWS designed its authentication cookies to remain valid for long-running operations even after logout or credential changes, and does not bind them to IP address, user agent, or region.

Impact

An attacker who phishes an AWS IAM user's credentials and MFA code can use the stolen cookies to maintain a multi-factor authenticated session to the AWS web console for about 12 hours, even if the victim logs out, changes their password, or replaces their MFA device, and regardless of changes in IP address, user agent, or region.

What the attacker needed

Victim uses virtual MFA; attacker can host a reverse-proxy phishing site; victim enters credentials and MFA code

The fix

AWS stated this behaviour is working as intended, so the report recommends restricting the phished user's permissions (for example with the AWSDenyAll policy) or removing the user entirely, and preventing phishing through hardware MFA, phishing exercises, and monitoring login IPs.

How it was found

  1. Set up a reverse-proxy phishing tool such as Modlishka to intercept traffic between the target and AWS.
  2. Phish the target user to capture their username, password, MFA code, and authentication cookies.
  3. Load the stolen cookies into a browser and visit the AWS web console to gain access.
  4. Change the victim's password, log out, and replace the MFA device to test whether the session is invalidated.
  5. Observe that the stolen cookies still allow a multi-factor authenticated session to the AWS web console.
  6. Test from different IP addresses, user agents, and regions to confirm the cookies work regardless of location.

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 into a website, the site gives your browser a small file called a cookie so it remembers you are logged in. This report shows that if an attacker tricks someone into logging in through a fake page, the attacker can steal that cookie and keep using it to access the person's AWS account for about 12 hours. Even if the person later changes their password or logs out, the stolen cookie still works, which is unusual because most sites cancel sessions when you log out.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.