Advertisement
indexnotfound

Get Real IP Address Cloudflare

Mar 4th, 2020
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.03 KB | None | 0 0
  1. checkDependencies() {
  2.    echo -e '\033[94m[\033[93m!\033[94m]\033[97m Checking Dependencies....'
  3.    sleep 1
  4.    checkOS=$(uname -o)
  5.    dpkg-query -W -f='${Status} ${Version}\n' dnsutils > /dev/null 2>&1
  6.    if [[ $? -eq 0 ]]; then
  7.         printf '\033[94m[\033[92m+\033[94m]\033[93m dnsutils \033[97m...........\033[94m(\033[92m✔\033[94m)\033[97m\n'
  8.    else
  9.         printf '\033[94m[\033[91m-\033[94m]\033[93m dnsutils \033[97m...........\033[94m(\033[91m✘\033[94m)\033[97m\n'
  10.         sleep 1
  11.         if [[ $checkOS == 'GNU/Linux' ]]; then
  12.                 sudo apt install dnsutils > /dev/null 2>&1
  13.         else
  14.                 apt install dnsutils > /dev/null 2>&1
  15.         fi
  16.    fi
  17.    sleep 1
  18.  
  19.    dpkg-query -W -f='${Status} ${Version}\n' curl > /dev/null 2>&1
  20.    if [[ $? -eq 0 ]]; then
  21.         printf '\033[94m[\033[92m+\033[94m]\033[93m cURL \033[97m...........\033[94m(\033[92m✔\033[94m)\033[97m'
  22.    else
  23.         printf '\033[94m[\033[91m-\033[94m]\033[93m cURL \033[97m...........\033[94m(\033[91m✘\033[94m)\033[97m'
  24.         if [[ $checkOS == 'GNU/Linux' ]]; then
  25.                 sudo apt install curl > /dev/null 2>&1
  26.         else
  27.                 apt install curl > /dev/null 2>&1
  28.         fi
  29.    fi
  30.    clear
  31. }
  32. banner() {
  33.    printf "
  34. \t \033[97;1m                ..            \033[0m   \033[91m _____\033[97m        \033[91m _____\033[97m _           _
  35. \t \033[97;1m            -/+ooooo+:.       \033[0m   \033[91m|  _  \033[91m|\033[97m___ ___\033[91m|     \033[97m| |___ _ _ _| |
  36. \t \033[97;1m          -oooooooooooo+.     \033[0m   \033[91m|   __\033[97m|  _| . \033[91m|  |--\033[97m| | . | | | . |
  37. \t \033[97;1m     -/oo+ooooooooooooooo-    \033[0m   \033[91m|__|  \033[97m|_| |___\033[91m|_____\033[97m|_|___|___|___|\033[97;1m
  38. \t \033[97;1m   ':ooooooooooooooooooooo'   \033[0m   \033[93;2mGet Real IP Cloudflare Web\033[0m\033[97;1m
  39. \t \033[97;1m :+ooooooooooooooooooooooo/-' \033[0m   \033[97;1mVer \033[92;1m1.0\033[0m\033[97;1m
  40. \t \033[97;1m/oooooooooooooooooooooooooooo-\033[0m
  41. \t \033[97;1moooooooooooooooooooooooooooooo\033[0m
  42. \t \033[97;1m-oooooooooooooooooooooooooooo/\033[0m
  43. \t \033[97;1m ./+ooooooooooooooooooooooo+- \033[0m
  44. \t \033[97;1m     ''''''''''''''''''''''   \033[0m
  45.   \n"
  46. }
  47.  
  48. main() {
  49.   printf "\033[94m[\033[93m!\033[94m]\033[97m Checking Host...\n";
  50.   if [[ $(host $host | grep "not found") ]]; then
  51.     printf "\033[94m[\033[91m-\033[94m] \033[97;1m$host \033[0m\033[97mhost not valid \033[94m(\033[91m✘\033[94m)\033[0m\n"
  52.     exit
  53.   else
  54.     printf "\033[94m[\033[92m+\033[94m]\033[97;1m $host \033[0m\033[97mhost valid \033[94m(\033[92m✔\033[94m)\033[97m\n"
  55.     sleep 1
  56.     printf "\033[94m[\033[93m!\033[94m]\033[97m Checking server...\n";
  57.     if [[ $(curl -i --silent $(host $host | grep -Po '([0-9]{1,3}[\.]){3}[0-9]{1,3}') | grep "cloudflare") ]]; then
  58.       printf "\033[94m[\033[92m+\033[94m] \033[97mIP HOST : \033[97;1m$(host $host | grep -Po '([0-9]{1,3}[\.]){3}[0-9]{1,3}' | head -n1)\033[0m\n"
  59.       printf "\033[94m[\033[92m+\033[94m]\033[97m Server  : \033[92mCloudFlare\n"
  60.       sleep 1
  61.       if [[ $(host server.$host | grep -Po '([0-9]{1,3}[\.]){3}[0-9]{1,3}') ]]; then
  62.         printf "\033[94m[\033[92m+\033[94m]\033[97m Real IP : \033[97;1m$(host server.$host | grep -Po '([0-9]{1,3}[\.]){3}[0-9]{1,3}' | head -n1)\033[0m\n"
  63.       else
  64.         printf "\033[94m[\033[91m-\033[94m]\033[97m Can't Get Real IP Cloudflare \033[94m(\033[91m✘\033[94m)\033[0m"
  65.       fi
  66.     else
  67.       printf "\033[94m[\033[92m+\033[94m] \033[97mIP HOST : \033[97;1m$(host $host | grep -Po '([0-9]{1,3}[\.]){3}[0-9]{1,3}' | head -n1)\033[0m\n"
  68.       printf "\033[94m[\033[91m-\033[94m]\033[97m Server  : \033[92m$(curl -i --silent $(host google.com | grep -Po '([0-9]{1,3}[\.]){3}[0-9]{1,3}') | grep -Po '(?<=Server: )[^,]*')\n"
  69.       printf "\033[94m[\033[91m-\033[94m]\033[97;1m $host\033[0m\033[97m tidak menggunakan server CloudFlare \033[94m(\033[91m✘\033[94m)\033[0m\n"
  70.     fi
  71.   fi
  72.  
  73. }
  74.  
  75. clear
  76. checkDependencies
  77. banner
  78. printf "\033[94m[\033[93m?\033[94m] \033[97mHost : ";
  79. read host;
  80. main host
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement