Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- WORDS=$(cat /usr/share/dict/words)
- IFS=$'\n'
- LC_ALL=C
- echo "" > domains.txt
- for word in $WORDS; do
- if [[ $word =~ ^[A-Za-z]{4,12}$ ]]; then
- domain="$word.com"
- echo "checking $domain ..."
- host_result=$(timeout 3 host "$domain")
- host_retcode=$?
- whois_result=$(timeout 2 whois "$domain" | egrep -q '^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri')
- whois_retcode=$?
- # TimeOut'ed
- if [ $host_retcode -eq 0 ] && [ $whois_retcode -eq 124 ]; then
- echo "add $domain (timeout)"
- echo "$domain" >> domains.txt
- elif [ $host_retcode -eq 0 ] && [ $whois_retcode -eq 0 ]; then
- echo "add $domain"
- echo "$domain" >> domains.txt
- fi
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement