You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1010 B

# This script runs a scan for all available TLDs, and notes
# down the TLDs that resolve to `website/`
# It also puts some information about the IP Adress from where
# the scan was run (might be relevant for DNS lookups) into
# `website/_data/ip.json`. Structure is at
for domain in $(grep -v '^#' tlds.txt); do
RESULT=$(dig +time=1 +tries=1 +short "$domain." | head -c -1 | tr '\n' '@' | sed 's/@/`,`/g' | grep -v "connection timed out")
if [ ! -z "$RESULT" ]; then
echo $domain
# Very crude regex for punycode domains
if [[ $(echo "$domain" | grep -E "^XN--[[:upper:]]+$") ]]; then
DOMAIN_REAL=$(idn --idna-to-unicode "$domain")
echo "|$DOMAIN_REAL|$domain|[http](http://$domain)|[https](https://$domain)|\`$RESULT\`|" >>
curl '' > website/_data/ip.json
echo >>
echo "This scan was last run on $(date)" >>