3. XSS Discovery

In web app vulns, detecting them can become as difficult as exploiting them. XSS vulns are widespread, many tools

Automated discovery of XSS

All web application vulnerability scanners have various capabilities for detecting all 3 types of XSS

These scanners do two types: Active and Passive

Paid tools have a higher level of accuracy. Open source tools are still plenty capable

Tools usually work by identifying input fields and sending various payloads

Common OSS tools for XSS discovery https://github.com/s0md3v/XSStrike https://github.com/rajeshmajumdar/BruteXSS https://github.com/epsylon/xsser

xsstrike example usage

git clone https://github.com/s0md3v/XSStrike.git
cd XSStrike
pip install -r requirements.txt
python xsstrike.py
python xsstrike.py -u "http://SERVER_IP:PORT/index.php?task=test" 

![](/img/Pasted image 20241002212011.png)

Manual discovery of XSS

depends on level of security of application basic XSS vulns usually found through testing various XSS payloads identifying advanced XSS vulns requires advanced code review skills

XSS Payloads

most basic method: manually testing various payloads in an input field of a given webpage

https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/XSS%20Injection/README.md

https://github.com/payloadbox/xss-payload-list

xss can be injected into any input on an html page which is not exclusive to html input fields
may also be http headers like the cookie or user agent 
	(relevant when their values are displayed on the page)

majority of above payloads do not work with our example webpages even though we are dealing with the most basic type of XSS vulns.

The above explanation is why its not very efficient to resort to manually copy/pasting xss payloads - even if there's a vulnerability it may take a while to identify the vulnerability especially if we have many input fields to test.

Code Review

Most reliable method of detecting XSS vuln would be manual code review - covering both back-end and front-end code.

Understanding exactly how input is handled all the way until it reaches web browser we can write a custom payload that would work with higher confidence

We are unlikely to find XSS vulns through payload lists or XSS tools for more common web applications.