JavaScript Files

JavaScript files can contain useful information such as subdomains, directories, endpoints, files and API routes, as well as sensitive data like usernames, passwords or API Keys, hence they are worth exploring.

Manual extraction of endpoints from JS files

curl -s $url/file.js | grep -oh "\"\/[a-zA-Z0-9_/?=&]*\"" \
    | sed -e 's/^"//' -e 's/"$//' | sort -u

Collecting JS files from Web Archives

echo $domain | gau --threads 10 | grep "\.js" | sort -u | httpx -silent -mc 200 \
    | anew alive_js_files.txt

Collecting JS files from Crawler/Spider

echo $domain | katana -silent | grep -E "\.js($|\?)"

Sensitive Data from JS files

python3 SecretFinder.py -i $domain/file.js -o cli

Last updated

Was this helpful?