HackPath Academy

Web Application Hacking (Hands-On)

Cross-Site Scripting (XSS) — Concept + Live Lab

Inject JavaScript that runs in a victim's browser. Pop it live in the lab.

Intermediate · 18 min · Hands-on lab

Open the interactive lesson & lab →

XSS happens when an app reflects or stores user input into a page without escaping it, so your input is parsed as HTML/JavaScript and executes in other users' browsers.

The three types

Payloads to try in the lab

<script>alert('XSS')</script>
<img src=x onerror=alert('XSS')>
<svg onload=alert(document.domain)>

Real impact goes far beyond alert(): stealing session cookies, keylogging, or performing actions as the victim. alert() is just proof the code executed.

Take the quiz and try the live lab →