Advertisement
KingSkrupellos

Simple Tools for Website Information Gathering

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