AgusSR

Simple Tools for Website Information Gathering

Aug 15th, 2017
2,134
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # Simple Tools for Website Information Gathering
  4. # Coded by L0c4lh34rtz - IndoXploit
  5. # contact me: agussetyar@indoxploit
  6.  
  7. merah="\e[0;31m"
  8. ijo="\e[0;32m"
  9. off="\e[0m"
  10.  
  11. function check {
  12.     if [[ $(host google.com) ]];
  13.         then
  14.         echo -e "[!] $ijo HOST OK $off"
  15.     else
  16.         echo -e "[!] $merah HOST BELUM DI ADA $off (install dulu gan)"
  17.         exit
  18.     fi
  19.  
  20.     if [[ $(ping -q -w 1 -c 1 google.com) ]];
  21.         then
  22.         echo -e "[!] $ijo KONEKSI OK $off"
  23.     else
  24.         echo -e "[!] $merah KONEKSI MATI $off (koneksimu harus nyala mas)"
  25.         exit
  26.     fi
  27.  
  28.     echo ""
  29.     echo ""
  30. }
  31.  
  32. function _host_dom2ip {
  33.     echo $(host -W 1 $1 | grep "has address" | cut -d " " -f 4 | sort -u | uniq)
  34. }
  35.  
  36. function _host_ip2hostname {
  37.     ip=$(_host_dom2ip $1)
  38.     echo $(host -W 1 $ip | grep -v "not found" | cut -d " " -f 5 | sort -u | uniq)
  39. }
  40.  
  41. function _host_ip {
  42.     echo $(host -W 1 $1 | grep -v "not found" | cut -d " " -f 5 | sort -u | uniq)
  43. }
  44.  
  45. function _host_t {
  46.     if [ $1 = "ns" ];
  47.         then
  48.         cmd=$(host -W 1 -t $1 $2 | cut -d " " -f 4 | sort -u | uniq)
  49.     elif [ $1 = "mx" ];
  50.         then
  51.         cmd=$(host -W 1 -t $1 $2 | cut -d " " -f 7 | sort -u | uniq)
  52.     fi
  53.     echo $cmd
  54. }
  55.  
  56. check
  57.  
  58. echo -n "[#] Target: "
  59. read target
  60.  
  61. echo ""
  62. echo "[:::::::::IP Address::::::::]"
  63. for ip in $(_host_dom2ip $target);
  64. do
  65.     echo -e "[*] $ijo $ip $off"
  66. done
  67. echo "[:::::::::::::::::::::::::::]"
  68.  
  69. echo ""
  70. echo "[::::::::::HOSTNAME:::::::::]"
  71. for hostname in $(_host_ip2hostname $target);
  72. do
  73.     if [ "$hostname" = "" ];
  74.         then
  75.         pesan="$merah Unknown Hostname/Not Found $off"
  76.     elif [ "$hostname" = "no" ];
  77.         then
  78.         pesan="$merah no servers could be reached $off"
  79.     else
  80.         pesan="$ijo $hostname $off"
  81.     fi
  82.  
  83.     echo -e "[*] $pesan"
  84. done
  85. echo "[:::::::::::::::::::::::::::]"
  86.  
  87. echo ""
  88. echo "[::::::NameServer (NS)::::::]"
  89. for ns in $(_host_t ns $target);
  90. do
  91.     echo -e "[*] $ijo $ns $off"
  92. done
  93. echo "[:::::::::::::::::::::::::::]"
  94.  
  95. echo ""
  96. echo "[::::::MailServer (MX)::::::]"
  97. for mx in $(_host_t mx $target);
  98. do
  99.     echo -e "[*] $ijo $mx $off"
  100. done
  101. echo "[:::::::::::::::::::::::::::]"
  102.  
  103. echo ""
  104. echo "[::::Scan IP RANGE 1-255::::]"
  105. _ip_=$(_host_dom2ip $target | cut -d "." -f 1-3)
  106. for range in {1..255};
  107. do
  108.     _ip1_="$_ip_.$range"
  109.     _ip2_=$(_host_ip $_ip1_)
  110.  
  111.     if [ "$_ip2_" = "" ];
  112.         then
  113.         pesan="$merah Unknown Hostname/Not Found $off"
  114.     elif [ "$_ip2_" = "no" ];
  115.         then
  116.         pesan="$merah no servers could be reached $off"
  117.     else
  118.         pesan="$ijo $_ip2_ $off"
  119.     fi
  120.  
  121.     echo -e "[*] $ijo $_ip1_ $off -> $pesan"
  122. done
  123. echo "[:::::::::::::::::::::::::::]"
RAW Paste Data