├── src
├── logo.jpg
└── Thumbs.db
├── README.md
└── mux.sh
/src/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmteam/waterwall/HEAD/src/logo.jpg
--------------------------------------------------------------------------------
/src/Thumbs.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahmteam/waterwall/HEAD/src/Thumbs.db
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
WaterWall Tunnel
8 | تانل واتر وال
9 |
10 |
11 | ## پیش نیاز
12 |
13 | اوبنتو 20 و بالاتر
14 |
15 |
16 | ## نصب
17 |
18 | - اسکریپت روی هر دو سرور اجرا شود (خارج و ایران )
19 |
20 |
21 |
22 | ### mux (http2 , mux , grpc)
23 |
24 |
25 | ```
26 | bash <(curl https://raw.githubusercontent.com/ahmteam/waterwall/main/mux.sh)
27 |
28 |
29 | ```
30 |
31 |
32 |
33 |
34 | ---
35 |
36 | [لینک اصلی پروژه](https://github.com/radkesvat/WaterWall)
37 | ---
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | # تلگرام
52 |
53 | [@sixtininelearn](https://t.me/sixtininelearn)
54 |
55 | [@sixti9learn](https://t.me/sixti9learn)
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/mux.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "
4 |
5 | ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄
6 | ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░▌ ▐░▌
7 | ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌░▌ ▐░▌
8 | ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌
9 | ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░▌
10 | ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌
11 | ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀ ▐░▌ ▐░▌ ▐░▌
12 | ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌
13 | ▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▐░▌
14 | ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░░▌
15 | ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀ ▀▀ "
16 |
17 | # Coler Code
18 | Purple='\033[0;35m'
19 | Cyan='\033[0;36m'
20 | cyan='\033[0;36m'
21 | CYAN='\033[0;36m'
22 | YELLOW='\033[0;33m'
23 | White='\033[0;96m'
24 | RED='\033[0;31m'
25 | BLUE='\033[0;34m'
26 | MAGENTA='\033[0;35m'
27 | NC='\033[0m' # No Color
28 |
29 | # Determine the architecture and set the ASSET_NAME accordingly
30 | ARCH=$(uname -m)
31 | if [ "$ARCH" == "aarch64" ]; then
32 | ASSET_NAME="Waterwall-linux-arm64.zip"
33 | elif [ "$ARCH" == "x86_64" ]; then
34 | ASSET_NAME="Waterwall-linux-64.zip"
35 | else
36 | echo "Unsupported architecture: $ARCH"
37 | exit 1
38 | fi
39 |
40 | # Function to download and unzip the release
41 | download_and_unzip() {
42 | local url="$1"
43 | local dest="$2"
44 |
45 | echo "Downloading $dest from $url..."
46 | wget -q -O "$dest" "$url"
47 | if [ $? -ne 0 ]; then
48 | echo "Error: Unable to download file."
49 | return 1
50 | fi
51 |
52 | echo "Unzipping $dest..."
53 | unzip -o "$dest"
54 | if [ $? -ne 0 ]; then
55 | echo "Error: Unable to unzip file."
56 | return 1
57 | fi
58 |
59 | sleep 0.5
60 | chmod +x Waterwall
61 | rm "$dest"
62 |
63 | echo "Download and unzip completed successfully."
64 | }
65 |
66 | # Function to get download URL for the latest release
67 | get_latest_release_url() {
68 | local api_url="https://api.github.com/repos/radkesvat/WaterWall/releases/latest"
69 |
70 | echo "Fetching latest release data..." >&2
71 | local response=$(curl -s "$api_url")
72 | if [ $? -ne 0 ]; then
73 | echo "Error: Unable to fetch release data." >&2
74 | return 1
75 | fi
76 |
77 | local asset_url=$(echo "$response" | jq -r ".assets[] | select(.name == \"$ASSET_NAME\") | .browser_download_url")
78 | if [ -z "$asset_url" ]; then
79 | echo "Error: Asset not found." >&2
80 | return 1
81 | fi
82 |
83 | echo "$asset_url"
84 | }
85 |
86 | # Function to get download URL for a specific release version
87 | get_specific_release_url() {
88 | local version=$1
89 | local api_url="https://api.github.com/repos/radkesvat/WaterWall/releases/tags/$version"
90 |
91 | echo "Fetching release data for version $version..." >&2
92 | response=$(curl -s $api_url)
93 | if [ $? -ne 0 ]; then
94 | echo "Error: Unable to fetch release data for version $version." >&2
95 | exit 1
96 | fi
97 |
98 | local asset_url=$(echo $response | jq -r ".assets[] | select(.name == \"$ASSET_NAME\") | .browser_download_url")
99 | if [ -z "$asset_url" ]; then
100 | echo "Error: Asset not found for version $version." >&2
101 | exit 1
102 | fi
103 |
104 | echo $asset_url
105 | }
106 |
107 | setup_waterwall_service() {
108 | cat > /etc/systemd/system/waterwall.service << EOF
109 | [Unit]
110 | Description=Waterwall Service
111 | After=network.target
112 |
113 | [Service]
114 | ExecStart=/root/RRT/Waterwall
115 | WorkingDirectory=/root/RRT
116 | Restart=always
117 | RestartSec=5
118 | User=root
119 | StandardOutput=null
120 | StandardError=null
121 |
122 | [Install]
123 | WantedBy=multi-user.target
124 | EOF
125 | systemctl daemon-reload
126 | systemctl enable waterwall
127 | systemctl start waterwall
128 | }
129 |
130 | while true; do
131 | echo -e "${Purple}Select an option:${NC}"
132 | echo -e "${White}1. IRAN ${NC}"
133 | echo -e "${Cyan}2. KHAREJ ${NC}"
134 | echo -e "${White}3. Uninstall${NC}"
135 | echo -e "${Cyan}0. Exit ${NC}"
136 |
137 | read -p "Enter your choice: " choice
138 | if [[ "$choice" -eq 1 || "$choice" -eq 2 ]]; then
139 | SSHD_CONFIG_FILE="/etc/ssh/sshd_config"
140 | CURRENT_PORT=$(grep -E '^(#Port |Port )' "$SSHD_CONFIG_FILE")
141 |
142 | if [[ "$CURRENT_PORT" != "Port 22" && "$CURRENT_PORT" != "#Port 22" ]]; then
143 | sudo sed -i -E 's/^(#Port |Port )[0-9]+/Port 22/' "$SSHD_CONFIG_FILE"
144 | echo "SSH Port has been updated to Port 22."
145 | sudo systemctl restart sshd
146 | sudo service ssh restart
147 | fi
148 | sleep 0.5
149 | mkdir /root/RRT
150 | cd /root/RRT
151 | apt install unzip -y
152 | apt install jq -y
153 |
154 | read -p "Do you want to install the latest version? (y/n): " answer
155 | if [[ "$answer" == [Yy]* ]]; then
156 | # Get the latest release URL
157 | url=$(get_latest_release_url)
158 |
159 | if [ $? -ne 0 ] || [ -z "$url" ]; then
160 | echo "Failed to retrieve the latest release URL."
161 | exit 1
162 | fi
163 | echo "Latest Release URL: $url"
164 | download_and_unzip "$url" "$ASSET_NAME"
165 | if [ $? -ne 0 ]; then
166 | echo "Failed to download or unzip the file."
167 | exit 1
168 | fi
169 | elif [[ "$answer" == [Nn]* ]]; then
170 | read -p "Enter the version you want to install (e.g., v1.18): " version
171 | # Get the specific release URL
172 | url=$(get_specific_release_url "$version")
173 |
174 | if [ $? -ne 0 ] || [ -z "$url" ]; then
175 | echo "Failed to retrieve the latest release URL."
176 | exit 1
177 | fi
178 | echo "Specific Version URL: $url"
179 | download_and_unzip "$url" "$ASSET_NAME"
180 | else
181 | echo "Please answer yes (y) or no (n)."
182 | break
183 | fi
184 |
185 | cat > core.json << EOF
186 | {
187 | "log": {
188 | "path": "log/",
189 | "core": {
190 | "loglevel": "DEBUG",
191 | "file": "core.log",
192 | "console": true
193 | },
194 | "network": {
195 | "loglevel": "DEBUG",
196 | "file": "network.log",
197 | "console": true
198 | },
199 | "dns": {
200 | "loglevel": "SILENT",
201 | "file": "dns.log",
202 | "console": false
203 | }
204 | },
205 | "dns": {},
206 | "misc": {
207 | "workers": 0,
208 | "ram-profile": "server",
209 | "libs-path": "libs/"
210 | },
211 | "configs": [
212 | "config.json"
213 | ]
214 | }
215 | EOF
216 | fi
217 |
218 | if [ "$choice" -eq 1 ]; then
219 | public_ip=$(wget -qO- https://api.ipify.org)
220 | echo -e "${Cyan}You chose Iran.${NC}"
221 | read -p "enter Kharej Ipv4: " ip_remote
222 | read -p "Enter the SNI (default: zula.ir): " input_sni
223 | HOSTNAME=${input_sni:-zula.ir}
224 | cat > config.json << EOF
225 | {
226 | "name": "reverse_reality_grpc_hd_multiport_server",
227 | "nodes": [
228 | {
229 | "name": "users_inbound",
230 | "type": "TcpListener",
231 | "settings": {
232 | "address": "0.0.0.0",
233 | "port": [23,65535],
234 | "nodelay": true
235 | },
236 | "next": "header"
237 | },
238 | {
239 | "name": "header",
240 | "type": "HeaderClient",
241 | "settings": {
242 | "data": "src_context->port"
243 | },
244 | "next": "bridge2"
245 | },
246 | {
247 | "name": "bridge2",
248 | "type": "Bridge",
249 | "settings": {
250 | "pair": "bridge1"
251 | }
252 | },
253 | {
254 | "name": "bridge1",
255 | "type": "Bridge",
256 | "settings": {
257 | "pair": "bridge2"
258 | }
259 | },
260 | {
261 | "name": "reverse_server",
262 | "type": "ReverseServer",
263 | "settings": {},
264 | "next": "bridge1"
265 | },
266 | {
267 | "name": "pbserver",
268 | "type": "ProtoBufServer",
269 | "settings": {},
270 | "next": "reverse_server"
271 | },
272 | {
273 | "name": "h2server",
274 | "type": "Http2Server",
275 | "settings": {},
276 | "next": "pbserver"
277 | },
278 | {
279 | "name": "halfs",
280 | "type": "HalfDuplexServer",
281 | "settings": {},
282 | "next": "h2server"
283 | },
284 | {
285 | "name": "reality_server",
286 | "type": "RealityServer",
287 | "settings": {
288 | "destination": "reality_dest",
289 | "password": "2249A0222"
290 | },
291 | "next": "halfs"
292 | },
293 | {
294 | "name": "kharej_inbound",
295 | "type": "TcpListener",
296 | "settings": {
297 | "address": "0.0.0.0",
298 | "port": 443,
299 | "nodelay": true,
300 | "whitelist": [
301 | "$ip_remote/32"
302 | ]
303 | },
304 | "next": "reality_server"
305 | },
306 | {
307 | "name": "reality_dest",
308 | "type": "TcpConnector",
309 | "settings": {
310 | "nodelay": true,
311 | "address": "$HOSTNAME",
312 | "port": 443
313 | }
314 | }
315 | ]
316 | }
317 | EOF
318 | sleep 0.5
319 | setup_waterwall_service
320 | sleep 0.5
321 | echo -e "${Cyan}Iran IPv4 is: $public_ip${NC}"
322 | echo -e "${Purple}Kharej IPv4 is: $ip_remote${NC}"
323 | echo -e "${Cyan}SNI $HOSTNAME${NC}"
324 | echo -e "${Purple}Iran Setup Successfully Created ${NC}"
325 | read -p "Press Enter to continue"
326 | elif [ "$choice" -eq 2 ]; then
327 | public_ip=$(wget -qO- https://api.ipify.org)
328 | echo -e "${Purple}You chose Kharej.${NC}"
329 | read -p "enter Iran Ip: " ip_remote
330 | read -p "Enter the SNI (default: zula.ir): " input_sni
331 | HOSTNAME=${input_sni:-zula.ir}
332 | cat > config.json << EOF
333 | {
334 | "name": "reverse_reality_grpc_client_hd_multiport_client",
335 | "nodes": [
336 | {
337 | "name": "outbound_to_core",
338 | "type": "TcpConnector",
339 | "settings": {
340 | "nodelay": true,
341 | "address": "127.0.0.1",
342 | "port": "dest_context->port"
343 | }
344 | },
345 | {
346 | "name": "header",
347 | "type": "HeaderServer",
348 | "settings": {
349 | "override": "dest_context->port"
350 | },
351 | "next": "outbound_to_core"
352 | },
353 | {
354 | "name": "bridge1",
355 | "type": "Bridge",
356 | "settings": {
357 | "pair": "bridge2"
358 | },
359 | "next": "header"
360 | },
361 | {
362 | "name": "bridge2",
363 | "type": "Bridge",
364 | "settings": {
365 | "pair": "bridge1"
366 | },
367 | "next": "reverse_client"
368 | },
369 | {
370 | "name": "reverse_client",
371 | "type": "ReverseClient",
372 | "settings": {
373 | "minimum-unused": 16
374 | },
375 | "next": "pbclient"
376 | },
377 | {
378 | "name": "pbclient",
379 | "type": "ProtoBufClient",
380 | "settings": {},
381 | "next": "h2client"
382 | },
383 | {
384 | "name": "h2client",
385 | "type": "Http2Client",
386 | "settings": {
387 | "host": "$HOSTNAME",
388 | "port": 443,
389 | "path": "/",
390 | "contenttype": "application/grpc",
391 | "concurrency": 64
392 | },
393 | "next": "halfc"
394 | },
395 | {
396 | "name": "halfc",
397 | "type": "HalfDuplexClient",
398 | "next": "reality_client"
399 | },
400 |
401 | {
402 | "name": "reality_client",
403 | "type": "RealityClient",
404 | "settings": {
405 | "sni": "$HOSTNAME",
406 | "password": "2249A0222"
407 | },
408 | "next": "outbound_to_iran"
409 | },
410 | {
411 | "name": "outbound_to_iran",
412 | "type": "TcpConnector",
413 | "settings": {
414 | "nodelay": true,
415 | "address": "$ip_remote",
416 | "port": 443
417 | }
418 | }
419 | ]
420 | }
421 | EOF
422 | sleep 0.5
423 | setup_waterwall_service
424 | sleep 0.5
425 | echo -e "${Purple}Kharej IPv4 is: $public_ip${NC}"
426 | echo -e "${Cyan}Iran IPv4 is: $ip_remote${NC}"
427 | echo -e "${Purple}SNI $HOSTNAME${NC}"
428 | echo -e "${Cyan}Kharej Setup Successfully Created ${NC}"
429 | read -p "Press Enter to continue"
430 | elif [ "$choice" -eq 3 ]; then
431 | sudo systemctl stop waterwall
432 | sudo systemctl disable waterwall
433 | rm -rf /etc/systemd/system/waterwall.service
434 | pkill -f Waterwall
435 | rm -rf /root/RRT
436 | echo "Removed"
437 | read -p "Press Enter to continue"
438 | elif [ "$choice" -eq 0 ]; then
439 | echo "Exit.."
440 | break
441 | else
442 | echo "Invalid choice. Please try again."
443 | fi
444 | done
445 |
--------------------------------------------------------------------------------