-
-
Save MohamedTarekq/9d9ccb2da95c42ac2e61b80bba2f8302 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