-
Notifications
You must be signed in to change notification settings - Fork 122
/
tunnels.sh
178 lines (114 loc) · 4.31 KB
/
tunnels.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#!/bin/bash
#
# Copyright (c) 2022 Barchampas Gerasimos <[email protected]>.
# mip22 is a advanced phishing tool.
#
# mip22 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# mip22 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# Terminal Colors
RED="$(printf '\033[31m')"
GREEN="$(printf '\033[32m')"
ORANGE="$(printf '\033[33m')"
BLUE="$(printf '\033[34m')"
MAGENTA="$(printf '\033[35m')"
CYAN="$(printf '\033[36m')"
WHITE="$(printf '\033[37m')"
BLACK="$(printf '\033[30m')"
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${CYAN} Installing required tunnels."
# Ngrok Download
get_ngrok() {
url="$1"
file=`basename $url`
if [[ -e "$file" ]]; then
rm -rf "$file"
fi
wget --no-check-certificate "$url" > /dev/null 2>&1
if [[ -e "$file" ]]; then
unzip "$file" > /dev/null 2>&1
mv -f ngrok .host/ngrok > /dev/null 2>&1
rm -rf "$file" > /dev/null 2>&1
chmod +x .host/ngrok > /dev/null 2>&1
else
echo -e "\n${RED}[${WHITE}!${RED}]${RED} Error, Install Ngrok manually."
{ clear; exit 1; }
fi
}
# Cloudflared Download
get_cloudflared() {
url="$1"
file=`basename $url`
if [[ -e "$file" ]]; then
rm -rf "$file"
fi
wget --no-check-certificate "$url" > /dev/null 2>&1
if [[ -e "$file" ]]; then
mv -f "$file" .host/cloudflared > /dev/null 2>&1
chmod +x .host/cloudflared > /dev/null 2>&1
else
echo -e "\n${RED}[${WHITE}!${RED}]${RED} Error, Install Cloudflared manually."
{ clear; exit 1; }
fi
}
# Download and install Ngrok
ngrok_download_and_install() {
if [[ -e ".host/ngrok" ]]; then
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${GREEN} Ngrok already installed. Setup your api from menu."
sleep 1
else
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${MAGENTA} Downloading and Installing ngrok..."${WHITE}
architecture=$(uname -m)
if [[ ("$architecture" == *'arm'*) || ("$architecture" == *'Android'*) ]]; then
get_ngrok 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip'
elif [[ "$architecture" == *'aarch64'* ]]; then
get_ngrok 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.zip'
elif [[ "$architecture" == *'x86_64'* ]]; then
get_ngrok 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip'
else
get_ngrok 'https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-386.zip'
fi
fi
}
# Download and install Cloudflared
cloudflared_download_and_install() {
if [[ -e ".host/cloudflared" ]]; then
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${GREEN} Cloudflared already installed."
sleep 1
else
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${MAGENTA} Downloading and Installing Cloudflared..."${WHITE}
architecture=$(uname -m)
if [[ ("$architecture" == *'arm'*) || ("$architecture" == *'Android'*) ]]; then
get_cloudflared 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm'
elif [[ "$architecture" == *'aarch64'* ]]; then
get_cloudflared 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64'
elif [[ "$architecture" == *'x86_64'* ]]; then
get_cloudflared 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64'
else
get_cloudflared 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-386'
fi
fi
}
# Download and install Localhostrun
localhostrun_download_and_install() {
if [[ `command -v ssh -R 80:localhost:8080 [email protected]` ]]; then
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${GREEN} LocalhostRun already installed."
sleep 1
else
echo -e "\n${GREEN}[${WHITE}+${GREEN}]${MAGENTA} Downloading and Installing LocalhostRun..."${WHITE}
ssh -R 80:localhost:8080 [email protected]
fi
}
ngrok_download_and_install
cloudflared_download_and_install
localhostrun_download_and_install