tunnels.sh 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2022 Barchampas Gerasimos <makindosxx@gmail.com>.
  4. # mip22 is a advanced phishing tool.
  5. #
  6. # mip22 is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU Affero General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # mip22 is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU Affero General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Affero General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. #
  20. # Terminal Colors
  21. RED="$(printf '\033[31m')"
  22. GREEN="$(printf '\033[32m')"
  23. ORANGE="$(printf '\033[33m')"
  24. BLUE="$(printf '\033[34m')"
  25. MAGENTA="$(printf '\033[35m')"
  26. CYAN="$(printf '\033[36m')"
  27. WHITE="$(printf '\033[37m')"
  28. BLACK="$(printf '\033[30m')"
  29. echo -e "\n${GREEN}[${WHITE}+${GREEN}]${CYAN} Installing required tunnels."
  30. # Ngrok Download
  31. get_ngrok() {
  32. url="$1"
  33. file=`basename $url`
  34. if [[ -e "$file" ]]; then
  35. rm -rf "$file"
  36. fi
  37. wget --no-check-certificate "$url" > /dev/null 2>&1
  38. if [[ -e "$file" ]]; then
  39. unzip "$file" > /dev/null 2>&1
  40. mv -f ngrok .host/ngrok > /dev/null 2>&1
  41. rm -rf "$file" > /dev/null 2>&1
  42. chmod +x .host/ngrok > /dev/null 2>&1
  43. else
  44. echo -e "\n${RED}[${WHITE}!${RED}]${RED} Error, Install Ngrok manually."
  45. { clear; exit 1; }
  46. fi
  47. }
  48. # Cloudflared Download
  49. get_cloudflared() {
  50. url="$1"
  51. file=`basename $url`
  52. if [[ -e "$file" ]]; then
  53. rm -rf "$file"
  54. fi
  55. wget --no-check-certificate "$url" > /dev/null 2>&1
  56. if [[ -e "$file" ]]; then
  57. mv -f "$file" .host/cloudflared > /dev/null 2>&1
  58. chmod +x .host/cloudflared > /dev/null 2>&1
  59. else
  60. echo -e "\n${RED}[${WHITE}!${RED}]${RED} Error, Install Cloudflared manually."
  61. { clear; exit 1; }
  62. fi
  63. }
  64. # Download and install Ngrok
  65. ngrok_download_and_install() {
  66. if [[ -e ".host/ngrok" ]]; then
  67. echo -e "\n${GREEN}[${WHITE}+${GREEN}]${GREEN} Ngrok already installed. Setup your api from menu."
  68. sleep 1
  69. else
  70. echo -e "\n${GREEN}[${WHITE}+${GREEN}]${MAGENTA} Downloading and Installing ngrok..."${WHITE}
  71. architecture=$(uname -m)
  72. if [[ ("$architecture" == *'arm'*) || ("$architecture" == *'Android'*) ]]; then
  73. get_ngrok 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip'
  74. elif [[ "$architecture" == *'aarch64'* ]]; then
  75. get_ngrok 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.zip'
  76. elif [[ "$architecture" == *'x86_64'* ]]; then
  77. get_ngrok 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip'
  78. else
  79. get_ngrok 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-386.zip'
  80. fi
  81. fi
  82. }
  83. # Download and install Cloudflared
  84. cloudflared_download_and_install() {
  85. if [[ -e ".host/cloudflared" ]]; then
  86. echo -e "\n${GREEN}[${WHITE}+${GREEN}]${GREEN} Cloudflared already installed."
  87. sleep 1
  88. else
  89. echo -e "\n${GREEN}[${WHITE}+${GREEN}]${MAGENTA} Downloading and Installing Cloudflared..."${WHITE}
  90. architecture=$(uname -m)
  91. if [[ ("$architecture" == *'arm'*) || ("$architecture" == *'Android'*) ]]; then
  92. get_cloudflared 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm'
  93. elif [[ "$architecture" == *'aarch64'* ]]; then
  94. get_cloudflared 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64'
  95. elif [[ "$architecture" == *'x86_64'* ]]; then
  96. get_cloudflared 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64'
  97. else
  98. get_cloudflared 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-386'
  99. fi
  100. fi
  101. }
  102. # Download and install Localhostrun
  103. localhostrun_download_and_install() {
  104. if [[ `command -v ssh -R 80:localhost:8080 nokey@localhost.run` ]]; then
  105. echo -e "\n${GREEN}[${WHITE}+${GREEN}]${GREEN} LocalhostRun already installed."
  106. sleep 1
  107. else
  108. echo -e "\n${GREEN}[${WHITE}+${GREEN}]${MAGENTA} Downloading and Installing LocalhostRun..."${WHITE}
  109. ssh -R 80:localhost:8080 nokey@localhost.run
  110. fi
  111. }
  112. ngrok_download_and_install
  113. cloudflared_download_and_install
  114. localhostrun_download_and_install