Skip to content

Instantly share code, notes, and snippets.

@KathanP19
Last active March 20, 2024 15:08
Show Gist options
  • Save KathanP19/9c1a8a322ada7b40462caf6897687cce to your computer and use it in GitHub Desktop.
Save KathanP19/9c1a8a322ada7b40462caf6897687cce to your computer and use it in GitHub Desktop.
Find DomXSS using pattern in jsfile.
#!/bin/bash
#This code is taken from https://github.com/dwisiswant0/findom-xss Do check it out.
PATTERN="(document|location|window)\.(URL|documentURI|search|hash|referrer|(location\.)?href|name)"
BODY=$(curl -sL ${1})
SCAN=($(echo ${BODY} | grep -Eoin ${PATTERN}))
if [[ ! -z "${SCAN}" ]]; then
echo -en "---\n\033[0;32m[!] ${1}\033[0m\n${SCAN}\n"
echo -e "---\n${1}\n${SCAN}" >> domxss_scan.txt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment