Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. WORDS=$(cat /usr/share/dict/words)
  4.  
  5. IFS=$'\n'
  6. LC_ALL=C
  7.  
  8. echo "" > domains.txt
  9. for word in $WORDS; do
  10. if [[ $word =~ ^[A-Za-z]{4,12}$ ]]; then
  11. domain="$word.com"
  12. echo "checking $domain ..."
  13. host_result=$(timeout 3 host "$domain")
  14. host_retcode=$?
  15. whois_result=$(timeout 2 whois "$domain" | egrep -q '^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri')
  16. whois_retcode=$?
  17.  
  18. # TimeOut'ed
  19. if [ $host_retcode -eq 0 ] && [ $whois_retcode -eq 124 ]; then
  20. echo "add $domain (timeout)"
  21. echo "$domain" >> domains.txt
  22. elif [ $host_retcode -eq 0 ] && [ $whois_retcode -eq 0 ]; then
  23. echo "add $domain"
  24. echo "$domain" >> domains.txt
  25. fi
  26. fi
  27. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement