Skip to content

Instantly share code, notes, and snippets.

@minkione
Forked from seqrity/wordlist_from_js.sh
Created November 16, 2021 10:47
Show Gist options
  • Save minkione/07167a6ac1e37655c6e644cdcae08301 to your computer and use it in GitHub Desktop.
Save minkione/07167a6ac1e37655c6e644cdcae08301 to your computer and use it in GitHub Desktop.
Make wordlist from js files
#! /bin/bash
## This script fetch js files from a domain name and make a wordlist by words in js files
## Credit: https://gist.github.com/aufzayed/6cabed910c081cc2f2186cd27b80f687
##### Install requirements #####
##### Before running this script you should install Go #####
## Install subjs (https://github.com/lc/subjs)
GO111MODULE=on go get -u -v github.com/lc/subjs
## Install js-beautify (https://github.com/beautify-web/js-beautify)
apt install npm -y && npm install js-beautify
## Install haklistgen (https://github.com/hakluke/haklistgen)
go install github.com/hakluke/haklistgen@latest
## Usage: ./wordlist_from_js.sh example.com
##Get address (https://www.example.com) and fetch js files by subjs then save in jslinks.tmp file
echo "https://"$1 | subjs > jslinks.tmp
## Make jsfiles directory for storing js files
mkdir jsfiles && wget --compression=gzip -i jslinks.tmp -P jsfiles
## Read all js files and create wordlist by haklistgen
cat jsfiles/*.js | js-beautify -i | haklistgen | sort -u > $1"_js_wordlist.txt"
rm -rf jslinks.tmp jsfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment