forked from syapik96/aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebsocket.sh
112 lines (95 loc) · 3.08 KB
/
websocket.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
#!/bin/bash
# Proxy For Connection Over WebSocket-Python
# ====================================
# UPDATED 22-1-28
cd
# Installing Service ws ws-ovpn
wget -O /usr/local/bin/ws-ovpn "https://raw.githubusercontent.com/alkhanet26/aws/main/lain2/ovpn.py"
chmod +x /usr/local/bin/ws-ovpn
# Create system Service ws ws-ovpn
cat > /etc/systemd/system/ws-ovpn.service <<END
[Unit]
Description=OpenVpn Over Websocket Python
Documentation=https://github.com/alkhanet26/aws
After=network.target nss-lookup.target
[Service]
Type=simple
User=root
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ExecStart=/usr/bin/python -O /usr/local/bin/ws-ovpn 2099
Restart=on-failure
[Install]
WantedBy=multi-user.target
END
# Installing Service ws-dropbear
wget -O /usr/local/bin/ws-dropbear "https://raw.githubusercontent.com/alkhanet26/aws/main/websocket-python/dropbear-ws.py"
chmod +x /usr/local/bin/ws-dropbear
# Create system Service ws-dropbear
cat > /etc/systemd/system/ws-dropbear.service <<END
[Unit]
Description=Dropbear Over Websocket Python
Documentation=https://github.com/alkhanet26/aws
After=network.target nss-lookup.target
[Service]
Type=simple
User=root
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ExecStart=/usr/bin/python -O /usr/local/bin/ws-dropbear
Restart=on-failure
[Install]
WantedBy=multi-user.target
END
# Installing Service ws-stunnel
wget -O /usr/local/bin/ws-stunnel "https://raw.githubusercontent.com/alkhanet26/aws/main/websocket-python/ws-stunnel.py"
chmod +x /usr/local/bin/ws-stunnel
# Create system Service ws-stunnel
cat > /etc/systemd/system/ws-stunnel.service <<END
[Unit]
Description=Ssl/tls Proxy Over Websocket Python
Documentation=https://github.com/alkhanet26/aws
After=network.target nss-lookup.target
[Service]
Type=simple
User=root
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ExecStart=/usr/bin/python -O /usr/local/bin/ws-stunnel
Restart=on-failure
[Install]
WantedBy=multi-user.target
END
# Installing Service ws-openssh
wget -O /usr/local/bin/ws-openssh "https://raw.githubusercontent.com/alkhanet26/aws/main/lain2/edu-openssh.py"
chmod +x /usr/local/bin/ws-openssh
# Create system Service ws-openssh
cat > /etc/systemd/system/ws-openssh.service <<END
[Unit]
Description=OpenSSH Over Websocket Python
Documentation=https://github.com/alkhanet26/aws
After=network.target nss-lookup.target
[Service]
Type=simple
User=root
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ExecStart=/usr/bin/python -O /usr/local/bin/ws-openssh
Restart=on-failure
[Install]
WantedBy=multi-user.target
END
# ENABLE & START/RESTART SERVICE
systemctl daemon-reload
systemctl enable ws-ovpn
systemctl restart ws-ovpn
systemctl enable ws-dropbear
systemctl restart ws-dropbear
systemctl enable ws-stunnel
systemctl restart ws-stunnel
systemctl enable ws-openssh
systemctl restart ws-openssh