hackXpert labs
All labs › Reflected XSS

🬷 Reflected XSS

Your input comes straight back out in the response. Every lab here is the same contact form with a different filter in front of it, so the only thing that changes between them is what you have to get past.

44 labs and targetsfree accountlesson included
How cross-site scripting actually works — taught by The XSS Rat

What it is

XSS happens when input you control ends up in the page without being neutralised for the context it lands in. Context is the whole game: inside HTML, inside an attribute, inside a script block and inside a URL all need different escaping, and a filter built for one of them is useless in the others.

How I attack it

  1. Find where your input is reflected, then view source and look at exactly what surrounds it.
  2. Break out of that context first - close the attribute, close the tag, close the string - before you even think about a payload.
  3. If the output is encoded, check whether it is encoded for the right context. HTML-encoding inside a script block stops nothing.
  4. Stored beats reflected on impact. Ask who else loads that page, and what their session can do.

Learn it from The XSS Rat

Free reference reading

GET parameters 33

Numbered low to high, and they get progressively harder. 00 is the one that is supposed to be safe - if you break that one, mail info@thexssrat.com.

Regex filters 1

POST bodies 7

Same idea, except the sink is a POST parameter, so you cannot just share a URL.

DOM sinks 1

Nothing reaches the server. The bug is in the JavaScript that reads your input.

DOM XSS

Client-side sink, no server round trip. Find it in the source, not the response.

Applications 2

Application

RatterChatter

A chat app riddled with reflected XSS. Find where the message is echoed back.

Application

Game Room

XSS games with a score. Email change, money transfer, overview pages.

Also here 6

Nothing matches thatClear the filter to see everything again.