Created
June 21, 2016 12:46
-
-
Save vmule/9314969f605232fcc0197feea337662d to your computer and use it in GitHub Desktop.
DNS interrogator script
This file contains hidden or 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/bash | |
| COMMON_SUBDOMAINS=(www mail smtp pop imap blog en ftp ssh login) | |
| if [[ "$2" == "x" ]]; then | |
| dig +nocmd "$1" +noall +answer "${3:-any}" | |
| wild_ips="$(dig +short "*.$1" "${3:-any}" | tr '\n' '|')" | |
| wild_ips="${wild_ips%|}" | |
| for sub in "${COMMON_SUBDOMAINS[@]}"; do | |
| dig +nocmd "$sub.$1" +noall +answer "${3:-any}" | |
| done | grep -vE "${wild_ips}" | |
| dig +nocmd "*.$1" +noall +answer "${3:-any}" | |
| else | |
| dig +nocmd "$1" +noall +answer "${2:-any}" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Vito,
your script make exactly what I want to do.
I would like to ask if I can (and how) read a domain list from a file.
I've a file domini.txt with 2.500 domain name...
Thank you very much!
Luca