Skip to content
XSS Write-up Intermediate

How I Used Keylogger XSS to Capture Credentials Leading to ATO

A reflected cross-site scripting flaw existed on the main login page, and the author bypassed a web application firewall that stripped script tags and blocked external script sources. By loading a keylogger script, an attacker could capture the victim's username and password as they typed them, leading to account takeover.

yyaminn Follow

Published on medium.com

As a bug bounty hunter, I always strive to demonstrate the real and practical impact of my findings, showcasing how they affect the business and its users. To maximize the value of my discoveries, I thoroughly exploit and document them, providing detailed evidence of their severity and potential consequences.

yyaminn, on medium.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 the login page reflected user-supplied input into the HTML response without proper output encoding, and the WAF's filter was bypassable by splitting script tags.

Impact

An attacker could capture usernames and passwords entered on the login page, leading to unauthorised access to victim accounts; the WAF was bypassed, so it did not prevent the attack.

What the attacker needed

Victim clicks a crafted link; attacker-controlled server

How it was found

  1. Start an HTTP server on a public host to serve the keylogger script and receive keystrokes.
  2. Open the vulnerable URL with the crafted payload.
  3. Enter a username and password into the login fields.
  4. Observe that all keystrokes, including the credentials, are sent to the attacker's server in real time.

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.

Cross-site scripting (XSS) is when a website lets an attacker slip their own JavaScript code into a page that other people view. Here the login page reflected the attacker's code back to the victim, so the attacker's code ran in the victim's browser. That code recorded every key the victim pressed on the login form and sent it to the attacker's server, giving the attacker the victim's password.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.