In the name of Allah
Hi guys, in this write-up, I’m gonna explain my own approach towards Swagger XSS and why I don’t use the Nuclei template ( swagger-api.yaml) ;d
1. Find as many subdomains as possible
2. cat all_subs.txt | dnsx | tee -a resolved_ones.txt
3. cat resolved_ones.txt | httpx | tee -a alive_ones.txt
4. ffuf -w /root/wordlist/api/swagger_xss.txt:FUZZ -w alive_ones.txt:URL -u URLFUZZ -mc 200 -o ffuf-result.txt
5. cat ffuf-result.txt | jq -r .results[].url | tee -a feed_me_to_httpx.txt
6. cat feed_me_to_httpx.txt | httpx -silent -title | tee -a title.txt
7. cat title.txt | grep "Swagger UI"
Find as many subdomains as possible you can get help from Chaos.
Now it’s time to resolve subdomains. If you get false positive, use ShuffleDNS with -d and -l options.
After resolving them, we need to find alive subdomains. You can add
User-Agent, Time Delay and etc
Now we are ready to fuzz for Swagger UI endpoints.
ffuf -w /root/wordlist/api/swagger_xss.txt:FUZZ -w alive_ones.txt:URL -u URLFUZZ -mc 200 -o ffuf-result.txt
Extracting found URLs from ffuf result.
cat ffuf-result.txt | jq -r .results[].url | tee -a feed_me_to_httpx.txt
Now, we use httpx with -title to get the title of fuzzed and possible endpoints for Swagger UI.
cat feed_me_to_httpx.txt | httpx -silent -title | tee -a title.txt
cat title.txt | grep "Swagger UI"
I think the best approach would be fixing above-mentioned problems and code your own private nuclei template. Even though, my methodology worked fine so far, I was able to find multiple VDP bugs, and you can use it if you’re not into coding templates, but it takes lots of time and energy, also you have to send lots of requests. Therefore, I tried to explain my previous methodology and the reason why I don’t use default Nuclei template in this regard so you guys can think and get the idea or maybe you can come up with a better methodology.