Created
November 8, 2021 00:21
-
-
Save aufzayed/6cabed910c081cc2f2186cd27b80f687 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the required tools | |
# subjs -> https://github.com/lc/subjs | |
# js-beautify -> https://github.com/beautify-web/js-beautify | |
# haklistgen -> https://github.com/hakluke/haklistgen | |
haklist() { | |
# declare TMPDIR variable | |
TMPDIR="/tmp/haklist" | |
# create a temp work dir | |
mkdir $TMPDIR | |
# extract javascript files links from the website | |
echo $1 | subjs > "$TMPDIR/jslinks.txt" | |
# donload javascript files | |
cat "$TMPDIR/jslinks.txt" | xargs wget -P $TMPDIR | |
# list javascript files in the temp directory then pass them to js-beautify then pass them to haklistgen tool | |
for i in $(ls $TMPDIR | grep '\.js'); do cat "$TMPDIR/$i" | js-beautify | haklistgen | sort -u >> haklist.txt; done | |
# remove the temp work directory | |
rm -rf $TMPDIR | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment