Skip to content

Instantly share code, notes, and snippets.

@AlexAtkinson
Created January 4, 2024 19:47
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 AlexAtkinson/ba5162a4f945321943f756d398fe6084 to your computer and use it in GitHub Desktop.
Save AlexAtkinson/ba5162a4f945321943f756d398fe6084 to your computer and use it in GitHub Desktop.
Flyover subdomain detection.
#!/bin/env bash
# Checks if subdomain.$1 is registered.
# Iterates the 1000 most popular subdomains.
# NOTE: Can be changed to 10000, or even 100000.
#
# Usage:
# ./dnsSUBflyover.sh nike.com
#
# NOTE:
# For more subdomains:
# https://github.com/YashGoti/Subdomain
# https://github.com/aboul3la/Sublist3r
# ----------------------------------
if [ "$#" == "0" ]; then
echo "You need to supply at least one argument! EG: nike.com"
exit 1
fi
# https://github.com/bitquark/dnspop/blob/master/results/bitquark_20160227_subdomains_popular_1000
SUBS=($(printf ' '; while read sub; do printf "${sub,,} "; done <<< $(curl -sS "https://raw.githubusercontent.com/bitquark/dnspop/master/results/bitquark_20160227_subdomains_popular_1000")))
ELEMENTS=${#SUBS[@]}
while (( "$#" )); do
for (( i=0;i<$ELEMENTS;i++)); do
dig ${SUBS[${i}]}.$1 +short | grep -v -e '^$' > /dev/null && echo "${SUBS[${i}]}.$1 : registered"
done
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment