# Reflected XSS

Attacker Date in HTTP Request -> included in response.\
\
Sample Use:\
Attacker can craft malicious link and send them to victims.\
On visiting them, victim also passes xss payload (like GET parameter) to server that gets returned with the response and executed.\
This way simple phishing link can execute JS of victim.

Lab #1: Between HTML Tags\
[Reflected XSS into HTML context with nothing encoded](https://portswigger.net/web-security/cross-site-scripting/reflected/lab-html-context-nothing-encoded)\
Find a feature that allows for user input to be inserted into response:\
\
\
<https://portswigger.net/web-security/cross-site-scripting/cheat-sheet#event-handlers-that-do-require-user-interaction><br>

![](https://3058986782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Meelc6eytaOzLNlksNf%2Fuploads%2FuQLB5qPqY6IVLF0wXH9N%2Fimage.png?alt=media\&token=126f6b2e-1aae-4f05-b213-8fbf175ab5c3)

![](https://3058986782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Meelc6eytaOzLNlksNf%2Fuploads%2F5lpJr7iMbmr5Dum9WVoQ%2Fimage.png?alt=media\&token=f7669273-40f8-4d2c-ba2a-8546016d0242)

![](https://3058986782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Meelc6eytaOzLNlksNf%2Fuploads%2FrfYp4r2P1pXBZvzLb7uj%2Fimage.png?alt=media\&token=e989f46e-ee76-4c21-b428-9964f28b640b)

To solve the lab need to trigger alert staight awaty:

![](https://3058986782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Meelc6eytaOzLNlksNf%2Fuploads%2FgIslvXu9h2j62GUjcqnh%2Fimage.png?alt=media\&token=8d760e1e-844b-4ef7-8491-b32bebf09c45)

![](https://3058986782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Meelc6eytaOzLNlksNf%2Fuploads%2FtRgw506Qbl7hxuF34fl9%2Fimage.png?alt=media\&token=fdd1cb61-5070-4049-ad13-7f0b3603accb)
