Web App - XSS
Last updated
Was this helpful?
Last updated
Was this helpful?
➡️ Cross-site scripting (XSS) allows an attacker to compromise the interactions of the users with a vulnerable application. It lets the attacker execute (malicious) JavaScript in a victim's browser, compromising the user's interaction with the application.
Reflected XSS
when an application unsafely includes user-supplied data (injected script) from an HTTP request in its immediate response
payload (malicious script) come from the current HTTP request
Stored XSS
when an application receives and stores data from an untrusted source and unsafely includes it within its later HTTP responses
payload (malicious script) come from the application's database
DOM-based XSS
when client-side Javascript (code) unsafely processes data from an untrusted source and writes it back to the DOM
everything happens locally in the browser
The request happens entirelly locally
no request seen in the browser Dev Tools / Network tab
Try some basic payloads
The lab can be used for testing other payloads
To check if XSS is stored for more users, use
incognito sessions
to create 2 different environments with separate/difference accounts
First try some HTML injection, once found out if it works, XSS follows
every user that visits the page is impacted by the stored XSS payload
Open http://localhost/labs/x0x03.php
first Firefox container
Open http://localhost/labs/x0x03_admin.php
in the second container
Goal - exfiltrate the admin cookie
use Collaborator (with BurpSuite Pro)
or
Use netcat
or (not for private traffic)