real-world-onion-sites/get-ct-log.sh

18 lines
460 B
Bash
Raw Normal View History

#!/bin/sh
log=ct-log.md
tf=/tmp/ctget$$.txt
2021-06-01 16:38:34 -04:00
curl "https://crt.sh/?q=\.onion" |
perl -nle 'next unless m!TD.*\.onion\b!; s!\s+!\n!go; s!</?TD>!\n!goi; s!<BR>!\n!goi; print' |
egrep '[2-7a-z]{56}\.onion$' |
sort -u |
2021-06-01 16:38:34 -04:00
awk -F. '{print $(NF-1), $0}' |
sort |
awk 'BEGIN {print "# Onion Certificate Transparency Log"} $2~/^\*/{print "* wildcard `" $2 "`"; next} {print "* `https://" $2 "`"}' >$tf
test -s $tf && cp $tf $log
rm $tf
exit 0