Skip to content

Instantly share code, notes, and snippets.

@fb11
Created September 18, 2019 20:07
Show Gist options
  • Select an option

  • Save fb11/e6304dfbb3bd40440b5d3353b276ca12 to your computer and use it in GitHub Desktop.

Select an option

Save fb11/e6304dfbb3bd40440b5d3353b276ca12 to your computer and use it in GitHub Desktop.
sub.sh
#!/bin/bash
#@cihanmehmet tweets, @cihanmehmets
if [[ $# -eq 0 ]] ;
then
echo "Usage: ./sub.sh findname2.com"
exit 1
else
curl 'https://crt.sh/?q=%.'$1'&output=json' | jq '.[] | {name_value}' | sed 's/\"//g' | sed 's/\*\.//g' | sort -u |grep "name_value"|cut -d ' ' -f4 > $1.txt
curl -s "http://web.archive.org/cdx/search/cdx?url=*."$1"/*&output=text&fl=original&collapse=urlkey" |sort| sed -e 's_https*://__' -e "s/\/.*//" -e 's/:.*//' -e 's/^www\.//' | uniq >>$1.txt
cat $1.txt|sort -u
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment