SHARE
TWEET

Untitled

a guest Dec 8th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. if [ -z $1 ]
  4. then
  5.         echo "Error : You need to specify a website url as a parameter..."
  6.         exit
  7. else
  8.         set -- `echo $1 | sed 's/^http\(\|s\):\/\///g'`
  9.         printf "We are trying to perform a zone transfer for the domain $1\n\n"
  10. fi
  11.  
  12. dns_servers=`whois $1 | grep -i "name server:" | cut -d':' -f2 | sort -uf | sed -e 's/ //g'`
  13.  
  14. echo "${@:2}"
  15.  
  16. if [ -z "`echo $dns_servers | sed -e 's/ //g'`" ]
  17. then
  18.         echo -e "\e[91mwe have not found any DNS server for this domain..."
  19.         exit
  20. fi
  21.  
  22. while read line;
  23.  
  24.         do echo -e "\e[39m > Test with ${line}";
  25.  
  26.         result=`dig axfr $1 @$line +noall +answer`
  27.  
  28.         dig=`echo "$result" | grep 'Transfer failed'`
  29.  
  30.         if [ -n "$dig" ]
  31.         then
  32.                 echo -e "\e[91mTransfer failed with this server...\n"
  33.  
  34.         else
  35.                 echo -e "\e[92m\n[SUCCES] : A server vulnerable to zone transfer attacks has been found !\n"
  36.                 echo "$result"
  37.         fi
  38. done <<< "$dns_servers"
  39.  
  40. exit
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top