Created
January 4, 2024 19:47
-
-
Save AlexAtkinson/ba5162a4f945321943f756d398fe6084 to your computer and use it in GitHub Desktop.
Flyover subdomain detection.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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