Skip to content

OSWA · Module 5

Cross-Site Scripting: Exploitation

Turn XSS into session theft, credential capture, and admin takeover, and bypass filters and CSP to land working payloads.

~2.5 h 5 resources Last updated September 27, 2026

Once XSS is confirmed, exploitation turns script execution into real impact: stealing session cookies, hijacking authenticated sessions, capturing credentials, keylogging, or making authenticated requests on the victim's behalf. On the OSWA exam, emulated users visit pages at intervals, so a stored or reflected payload aimed at an admin can hand you an authenticated administrator session, the primary exam objective. This module also covers bypassing the filters and CSP that stand between a confirmed injection and a working payload.

XSS Exploitation Techniques

Each XSS type has its own exploitation path. Reflected XSS is delivered via a crafted URL to a target user. Stored XSS fires automatically when a victim (or emulated user) views the poisoned page, making it ideal for admin session theft. DOM-based exploitation abuses client-side sinks, postMessage, and client-side routing, and can chain through prototype pollution or mutation XSS to defeat sanitizers like DOMPurify.

Payloads and Filter Bypass

The JavaScript you run determines the impact: cookie and localStorage theft, page content exfiltration, authenticated requests, or loading an external payload. When input is filtered, you need tag and event-handler alternatives, context escapes, encoding chains, polyglots, and WAF-specific tricks. Content Security Policy often blocks the obvious payload, so JSONP abuse and other CSP bypasses become necessary to land execution.

Read

The core material for this module. Where a guide goes deeper than needed, the relevant sections are highlighted.

Practice

Apply the module hands-on.

All OSWA practice machines