Skip to content

Instantly share code, notes, and snippets.

@noobsdt
Created September 5, 2020 17:27
Show Gist options
  • Save noobsdt/f2c5827ad37a463b3ca57773b95cbd4a to your computer and use it in GitHub Desktop.
Save noobsdt/f2c5827ad37a463b3ca57773b95cbd4a to your computer and use it in GitHub Desktop.
Js file collection via some tools ;)
#!/bin/bash
# Take domain name as user input e.g jsfinder.sh domain
# Must have httpx.txt, resolved.txt in same directory
d=js
if [ ! -d "$d" ]
then
echo "Directory Created ..."
mkdir js
fi
if [ -d "$d" ]
then
cd $d
rm *
cd ..
fi
echo ""
echo "getJS Running ..."
getJS -verbose -input=httpx.txt -complete -resolve -output=js/jsfile.txt
echo ""
echo "gau Running ..."
cat resolved.txt | gau | grep -iE '*\.js' | grep -iEv '\.json' | tee -a js/gaujs.txt
echo ""
echo "Gospider Running ..."
gospider -S httpx.txt -a -w -r -c 10 -t 20 --sitemap --robots | grep -iE '\.js' | grep -iEv '\.json' | grep -iEo '(http|https)://[^/\"].*\.js+' | sed "s#\] \- #\n#g" | anew | tee -a js/gospider.txt
echo ""
echo "Github Running ..."
python ~/tools/github-search/github-endpoints.py -d $1 | grep -iE '\.js' | grep -iEv '\.json' | tee -a js/github.txt
echo "Gathering all js files ..."
cd js
cat * | anew | tee -a jslinks.txt
rm jsfile.txt gaujs.txt gospider.txt github.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment