Skip to content

Instantly share code, notes, and snippets.

@sasqwatch
Forked from gwen001/wordgrab.sh
Created August 18, 2020 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasqwatch/e33cfa79d4c8058e51830a6e2bf62f6f to your computer and use it in GitHub Desktop.
Save sasqwatch/e33cfa79d4c8058e51830a6e2bf62f6f to your computer and use it in GitHub Desktop.
create a wordlist from the target itself
#using cewl
wordgrab() {
url=$1
cewl.rb -u "Mozilla/5.0 (X11; Linux; rv:74.0) Gecko/20100101 Firefox/74.0" -d 0 -m 3 https://www.$1 | tr '[:upper:]' '[:lower:]' |sort -fu | grep -v "robin wood"
}
# added min length 3
wordgrab() {
url=$1
tmpfile="$(date "+%s")"
curl -sLk -m 3 -A "Mozilla/5.0 (X11; Linux; rv:74.0) Gecko/20100101 Firefox/74.0" https://$url | html2text | egrep -io "[0-9a-zA-Z\-]+" | tr '[:upper:]' '[:lower:]' | sed -r "s/^[^a-z]+//g" | sed -r "s/[^a-z0-9]+$//g" | sort -fu | tee -a $tmpfile | tr '-' '.' | tee -a $tmpfile | tr "." "\n" >> $tmpfile
cat $tmpfile | sort -fu | sed -r '/.{3,}/!d'
rm $tmpfile
}
# with user-agent
# credits @fo0_
wordgrab() {
url=$1
tmpfile="$(date "+%s")"
curl -sLk -m 3 -A "Mozilla/5.0 (X11; Linux; rv:74.0) Gecko/20100101 Firefox/74.0" https://$url | html2text | egrep -io "[0-9a-zA-Z\-]+" | tr '[:upper:]' '[:lower:]' | sed -r "s/^[^a-z]+//g" | sed -r "s/[^a-z0-9]+$//g" | sort -fu | tee -a $tmpfile | tr '-' '.' | tee -a $tmpfile | tr "." "\n" >> $tmpfile
cat $tmpfile | sort -fu
rm $tmpfile
}
wordgrab() {
url=$1
tmpfile="$(date "+%s")"
curl -sLk -m 3 https://$url | html2text | egrep -io "[0-9a-zA-Z\-]+" | tr '[:upper:]' '[:lower:]' | sed -r "s/^[^a-z]+//g" | sed -r "s/[^a-z0-9]+$//g" | sort -fu | tee -a $tmpfile | tr '-' '.' | tee -a $tmpfile | tr "." "\n" >> $tmpfile
cat $tmpfile | sort -fu
rm $tmpfile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment