iwan.sh 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. #!/bin/bash
  2. # Initializing IP
  3. export DEBIAN_FRONTEND=noninteractive
  4. OS=`uname -m`;
  5. MYIP=$(wget -qO- ifconfig.co);
  6. MYIP2="s/xxxxxxxxx/$MYIP/g";
  7. NET=$(ip -o $ANU -4 route show to default | awk '{print $5}');
  8. source /etc/os-release
  9. ver=$VERSION_ID
  10. # Stunnel Cert Info
  11. country=ID
  12. state=MY
  13. locality=SELANGIR
  14. organization=aidan
  15. organizationalunit=aidan
  16. commonname=aidan
  17. # Password Setup
  18. wget -O /etc/pam.d/common-password "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/password"
  19. chmod +x /etc/pam.d/common-password
  20. # Goto Root
  21. cd
  22. # System Setup
  23. cat > /etc/systemd/system/rc-local.service <<-END
  24. [Unit]
  25. Description=/etc/rc.local
  26. ConditionPathExists=/etc/rc.local
  27. [Service]
  28. Type=forking
  29. ExecStart=/etc/rc.local start
  30. TimeoutSec=0
  31. StandardOutput=tty
  32. RemainAfterExit=yes
  33. SysVStartPriority=99
  34. [Install]
  35. WantedBy=multi-user.target
  36. END
  37. # Reboot Settings
  38. cat > /etc/rc.local <<-END
  39. #!/bin/sh -e
  40. # rc.local
  41. # By default this script does nothing.
  42. exit 0
  43. END
  44. # Set Permissions
  45. chmod +x /etc/rc.local
  46. # Enable On Reboot
  47. systemctl enable rc-local
  48. systemctl start rc-local.service
  49. # Disable IPV6
  50. echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
  51. sed -i '$ i\echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6' /etc/rc.local
  52. # Set Repo
  53. sh -c 'echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list'
  54. apt install gnupg gnupg1 gnupg2 -y
  55. wget http://www.webmin.com/jcameron-key.asc
  56. apt-key add jcameron-key.asc
  57. # Update
  58. apt update -y
  59. apt upgrade -y
  60. apt dist-upgrade -y
  61. # Install Wget And Curl
  62. apt -y install wget curl
  63. # Install Components
  64. apt-get -y install libio-pty-perl libauthen-pam-perl apt-show-versions libnet-ssleay-perl
  65. # Set System Time
  66. ln -fs /usr/share/zoneinfo/Asia/Kuala_Lumpur/etc/localtime
  67. # Set Sshd
  68. sed -i 's/AcceptEnv/#AcceptEnv/g' /etc/ssh/sshd_config
  69. # NeoFetch
  70. apt-get --reinstall --fix-missing install -y bzip2 gzip coreutils wget screen rsyslog iftop htop net-tools zip unzip wget net-tools curl nano sed screen gnupg gnupg1 bc apt-transport-https build-essential dirmngr libxml-parser-perl neofetch git
  71. rm .profile
  72. wget "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/.profile"
  73. # Install Webserver
  74. if [ $(cat /etc/debian_version) == '10.9' ]; then
  75. VERSION=10.9
  76. apt -y --purge remove apache2*;
  77. apt -y install nginx
  78. apt -y install php-fpm php-cli libssh2-1 php-ssh2 php
  79. sed -i 's/listen = \/run\/php\/php7.3-fpm.sock/listen = 127.0.0.1:9000/g' /etc/php/7.3/fpm/pool.d/www.conf
  80. rm /etc/nginx/sites-enabled/default
  81. rm /etc/nginx/sites-available/default
  82. wget -O /etc/nginx/nginx.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/nginx.conf"
  83. wget -O /etc/nginx/conf.d/vps.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/vps.conf"
  84. wget -O /etc/nginx/conf.d/monitoring.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/monitoring.conf"
  85. mkdir -p /home/vps/public_html
  86. wget -O /home/vps/public_html/index.php "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/index.php"
  87. service php7.3-fpm restart
  88. service nginx restart
  89. elif [ $(cat /etc/debian_version) == '9.13' ]; then
  90. VERSION=9.13
  91. apt -y --purge remove apache2*;
  92. apt -y install nginx
  93. apt -y install php7.0-fpm php7.0-cli libssh2-1 php-ssh2 php7.0
  94. sed -i 's/listen = \/run\/php\/php7.0-fpm.sock/listen = 127.0.0.1:9000/g' /etc/php/7.0/fpm/pool.d/www.conf
  95. rm /etc/nginx/sites-enabled/default
  96. rm /etc/nginx/sites-available/default
  97. wget -O /etc/nginx/nginx.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/nginx.conf"
  98. wget -O /etc/nginx/conf.d/vps.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/vps.conf"
  99. wget -O /etc/nginx/conf.d/monitoring.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/monitoring.conf"
  100. mkdir -p /home/vps/public_html
  101. wget -O /home/vps/public_html/index.php "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/index.php"
  102. service php7.0-fpm restart
  103. service nginx restart
  104. fi
  105. # Install Badvpn
  106. cd
  107. wget -O /usr/bin/badvpn-udpgw "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/badvpn-udpgw64"
  108. chmod +x /usr/bin/badvpn-udpgw
  109. sed -i '$ i\screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7100 --max-clients 500' /etc/rc.local
  110. sed -i '$ i\screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 --max-clients 500' /etc/rc.local
  111. sed -i '$ i\screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 500' /etc/rc.local
  112. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7100 --max-clients 500
  113. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 --max-clients 500
  114. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 500
  115. # Setup SSH
  116. sed -i 's/#Port 22/Port 22/g' /etc/ssh/sshd_config
  117. /etc/init.d/ssh restart
  118. # Install Dropbear
  119. apt -y install dropbear
  120. sed -i 's/NO_START=1/NO_START=0/g' /etc/default/dropbear
  121. sed -i 's/DROPBEAR_PORT=22/DROPBEAR_PORT=143/g' /etc/default/dropbear
  122. sed -i 's/DROPBEAR_EXTRA_ARGS=/DROPBEAR_EXTRA_ARGS="-p 109"/g' /etc/default/dropbear
  123. echo "/bin/false" >> /etc/shells
  124. echo "/usr/sbin/nologin" >> /etc/shells
  125. /etc/init.d/dropbear restart
  126. # Install Squid Proxy
  127. cd
  128. apt -y install squid
  129. cat > /etc/squid/squid.conf <<-END
  130. acl manager proto cache_object
  131. acl localhost src 127.0.0.1/32 ::1
  132. acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
  133. acl SSL_ports port 442
  134. acl Safe_ports port 80
  135. acl Safe_ports port 21
  136. acl Safe_ports port 443
  137. acl Safe_ports port 70
  138. acl Safe_ports port 210
  139. acl Safe_ports port 1025-65535
  140. acl Safe_ports port 280
  141. acl Safe_ports port 488
  142. acl Safe_ports port 591
  143. acl Safe_ports port 777
  144. acl CONNECT method CONNECT
  145. acl SSH dst xxxxxxxxx
  146. http_access allow SSH
  147. http_access allow manager localhost
  148. http_access deny manager
  149. http_access allow localhost
  150. http_access deny all
  151. http_port 8080
  152. http_port 8000
  153. http_port 3128
  154. coredump_dir /var/spool/squid
  155. refresh_pattern ^ftp: 1440 20% 10080
  156. refresh_pattern ^gopher: 1440 0% 1440
  157. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
  158. refresh_pattern . 0 20% 4320
  159. visible_hostname aidan
  160. END
  161. sed -i $MYIP2 /etc/squid/squid.conf
  162. # OpenVPN Monitoring
  163. apt-get install -y gcc libgeoip-dev python-virtualenv python-dev geoip-database-extra uwsgi uwsgi-plugin-python
  164. wget -O /srv/openvpn-monitor.tar "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/openvpn-monitor.tar"
  165. cd /srv
  166. tar xf openvpn-monitor.tar
  167. cd openvpn-monitor
  168. virtualenv .
  169. . bin/activate
  170. pip install -r requirements.txt
  171. wget -O /etc/uwsgi/apps-available/openvpn-monitor.ini "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/openvpn-monitor.ini"
  172. ln -s /etc/uwsgi/apps-available/openvpn-monitor.ini /etc/uwsgi/apps-enabled/
  173. # GeoIP For OpenVPN Monitor
  174. mkdir -p /var/lib/GeoIP
  175. wget -O /var/lib/GeoIP/GeoLite2-City.mmdb.gz "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/GeoLite2-City.mmdb.gz"
  176. gzip -d /var/lib/GeoIP/GeoLite2-City.mmdb.gz
  177. # Install Webserver
  178. if [ $(cat /etc/debian_version) == '10.9' ]; then
  179. VERSION=10.9
  180. apt -y --purge remove apache2*;
  181. apt -y install nginx
  182. apt -y install php-fpm php-cli libssh2-1 php-ssh2 php
  183. sed -i 's/listen = \/run\/php\/php7.3-fpm.sock/listen = 127.0.0.1:9000/g' /etc/php/7.3/fpm/pool.d/www.conf
  184. rm /etc/nginx/sites-enabled/default
  185. rm /etc/nginx/sites-available/default
  186. wget -O /etc/nginx/nginx.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/nginx.conf"
  187. wget -O /etc/nginx/conf.d/vps.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/vps.conf"
  188. wget -O /etc/nginx/conf.d/monitoring.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/monitoring.conf"
  189. mkdir -p /home/vps/public_html
  190. wget -O /home/vps/public_html/index.php "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/index.php"
  191. service php7.3-fpm restart
  192. service nginx restart
  193. elif [ $(cat /etc/debian_version) == '9.13' ]; then
  194. VERSION=9.13
  195. apt -y --purge remove apache2*;
  196. apt -y install nginx
  197. apt -y install php7.0-fpm php7.0-cli libssh2-1 php-ssh2 php7.0
  198. sed -i 's/listen = \/run\/php\/php7.0-fpm.sock/listen = 127.0.0.1:9000/g' /etc/php/7.0/fpm/pool.d/www.conf
  199. rm /etc/nginx/sites-enabled/default
  200. rm /etc/nginx/sites-available/default
  201. wget -O /etc/nginx/nginx.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/nginx.conf"
  202. wget -O /etc/nginx/conf.d/vps.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/vps.conf"
  203. wget -O /etc/nginx/conf.d/monitoring.conf "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/monitoring.conf"
  204. mkdir -p /home/vps/public_html
  205. wget -O /home/vps/public_html/index.php "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/index.php"
  206. service php7.0-fpm restart
  207. service nginx restart
  208. fi
  209. # Install Badvpn
  210. cd
  211. wget -O /usr/bin/badvpn-udpgw "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/badvpn-udpgw64"
  212. chmod +x /usr/bin/badvpn-udpgw
  213. sed -i '$ i\screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7100 --max-clients 500' /etc/rc.local
  214. sed -i '$ i\screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 --max-clients 500' /etc/rc.local
  215. sed -i '$ i\screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 500' /etc/rc.local
  216. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7100 --max-clients 500
  217. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 --max-clients 500
  218. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 500
  219. # Setup SSH
  220. sed -i 's/#Port 22/Port 22/g' /etc/ssh/sshd_config
  221. /etc/init.d/ssh restart
  222. # Install Dropbear
  223. apt -y install dropbear
  224. sed -i 's/NO_START=1/NO_START=0/g' /etc/default/dropbear
  225. sed -i 's/DROPBEAR_PORT=22/DROPBEAR_PORT=143/g' /etc/default/dropbear
  226. sed -i 's/DROPBEAR_EXTRA_ARGS=/DROPBEAR_EXTRA_ARGS="-p 109"/g' /etc/default/dropbear
  227. echo "/bin/false" >> /etc/shells
  228. echo "/usr/sbin/nologin" >> /etc/shells
  229. /etc/init.d/dropbear restart
  230. # Install Squid Proxy
  231. cd
  232. apt -y install squid
  233. cat > /etc/squid/squid.conf <<-END
  234. acl manager proto cache_object
  235. acl localhost src 127.0.0.1/32 ::1
  236. acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
  237. acl SSL_ports port 442
  238. acl Safe_ports port 80
  239. acl Safe_ports port 21
  240. acl Safe_ports port 443
  241. acl Safe_ports port 70
  242. acl Safe_ports port 210
  243. acl Safe_ports port 1025-65535
  244. acl Safe_ports port 280
  245. acl Safe_ports port 488
  246. acl Safe_ports port 591
  247. acl Safe_ports port 777
  248. acl CONNECT method CONNECT
  249. acl SSH dst xxxxxxxxx
  250. http_access allow SSH
  251. http_access allow manager localhost
  252. http_access deny manager
  253. http_access allow localhost
  254. http_access deny all
  255. http_port 8080
  256. http_port 8000
  257. http_port 3128
  258. coredump_dir /var/spool/squid
  259. refresh_pattern ^ftp: 1440 20% 10080
  260. refresh_pattern ^gopher: 1440 0% 1440
  261. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
  262. refresh_pattern . 0 20% 4320
  263. visible_hostname aidan
  264. END
  265. sed -i $MYIP2 /etc/squid/squid.conf
  266. # Install Stunnel
  267. apt -y install stunnel4
  268. cat > /etc/stunnel/stunnel.conf <<-END
  269. cert = /etc/stunnel/stunnel.pem
  270. client = no
  271. socket = a:SO_REUSEADDR=1
  272. socket = l:TCP_NODELAY=1
  273. socket = r:TCP_NODELAY=1
  274. [dropbear]
  275. accept = 442
  276. connect = 127.0.0.1:109
  277. END
  278. # Make Stunnel Certificate
  279. openssl genrsa -out key.pem 2048
  280. openssl req -new -x509 -key key.pem -out cert.pem -days 1095 \
  281. -subj "/C=$country/ST=$state/L=$locality/O=$organization/OU=$organizationalunit/CN=$commonname/emailAddress=$email"
  282. cat key.pem cert.pem >> /etc/stunnel/stunnel.pem
  283. # Configuration Stunnel
  284. sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
  285. /etc/init.d/stunnel4 restart
  286. # Install OpenVPN
  287. apt -y install openvpn iptables iptables-persistent -y
  288. wget -O /etc/openvpn/openvpn.zip "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/openvpn.zip"
  289. cd /etc/openvpn/
  290. unzip openvpn.zip
  291. rm -f openvpn.zip
  292. cd
  293. mkdir -p /usr/lib/openvpn/
  294. cp /usr/lib/x86_64-linux-gnu/openvpn/plugins/openvpn-plugin-auth-pam.so /usr/lib/openvpn/openvpn-plugin-auth-pam.so
  295. # Autostart All Openvpn Config
  296. sed -i 's/#AUTOSTART="all"/AUTOSTART="all"/g' /etc/default/openvpn
  297. # OpenVPN IPV4 Fowarding
  298. echo 1 > /proc/sys/net/ipv4/ip_forward
  299. sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
  300. # Resolve ANU
  301. ANU=$(ip -o $ANU -4 route show to default | awk '{print $5}');
  302. # TCP & UDP
  303. iptables -t nat -I POSTROUTING -s 10.6.0.0/24 -o $ANU -j MASQUERADE
  304. iptables -t nat -I POSTROUTING -s 10.7.0.0/24 -o $ANU -j MASQUERADE
  305. iptables-save > /etc/iptables.up.rules
  306. chmod +x /etc/iptables.up.rules
  307. iptables-restore -t < /etc/iptables.up.rules
  308. netfilter-persistent save
  309. netfilter-persistent reload
  310. # Restore Iptables
  311. cat > /etc/network/if-up.d/iptables <<-END
  312. iptables-restore < /etc/iptables.up.rules
  313. iptables -t nat -A POSTROUTING -s 10.6.0.0/24 -o $ANU -j SNAT --to xxxxxxxxx
  314. iptables -t nat -A POSTROUTING -s 10.7.0.0/24 -o $ANU -j SNAT --to xxxxxxxxx
  315. END
  316. sed -i $MYIP2 /etc/network/if-up.d/iptables
  317. chmod +x /etc/network/if-up.d/iptables
  318. # Enable Openvpn
  319. systemctl enable openvpn
  320. systemctl start openvpn
  321. /etc/init.d/openvpn restart
  322. /etc/init.d/openvpn status
  323. # Openvpn Config
  324. cat > /home/vps/public_html/aidan.ovpn <<-END
  325. # OpenVPN Configuration By aidan
  326. client
  327. dev tun
  328. proto tcp
  329. remote $MYIP 1194
  330. http-proxy $MYIP 8080
  331. remote-cert-tls server
  332. resolv-retry infinite
  333. nobind
  334. tun-mtu 1500
  335. mssfix 1500
  336. persist-key
  337. persist-tun
  338. ping-restart 0
  339. ping-timer-rem
  340. reneg-sec 0
  341. comp-lzo
  342. auth SHA512
  343. auth-user-pass
  344. auth-nocache
  345. cipher AES-256-CBC
  346. verb 3
  347. pull
  348. END
  349. echo '<ca>' >> /home/vps/public_html/aidan.ovpn
  350. cat /etc/openvpn/keys/ca.crt >> /home/vps/public_html/aidan.ovpn
  351. echo '</ca>' >> /home/vps/public_html/aidan.ovpn
  352. # Install Fail2ban
  353. apt -y install fail2ban
  354. # SSH/Dropbear Banner
  355. wget -O /etc/banner "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Other/banner"
  356. sed -i 's@#Banner none@Banner /etc/banner@g' /etc/ssh/sshd_config
  357. sed -i 's@DROPBEAR_BANNER=""@DROPBEAR_BANNER="/etc/banner"@g' /etc/default/dropbear
  358. # OpenVPN Monitoring
  359. apt-get install -y gcc libgeoip-dev python-virtualenv python-dev geoip-database-extra uwsgi uwsgi-plugin-python
  360. wget -O /srv/openvpn-monitor.tar "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/openvpn-monitor.tar"
  361. cd /srv
  362. tar xf openvpn-monitor.tar
  363. cd openvpn-monitor
  364. virtualenv .
  365. . bin/activate
  366. pip install -r requirements.txt
  367. wget -O /etc/uwsgi/apps-available/openvpn-monitor.ini "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/openvpn-monitor.ini"
  368. ln -s /etc/uwsgi/apps-available/openvpn-monitor.ini /etc/uwsgi/apps-enabled/
  369. # GeoIP For OpenVPN Monitor
  370. mkdir -p /var/lib/GeoIP
  371. wget -O /var/lib/GeoIP/GeoLite2-City.mmdb.gz "https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Panel/GeoLite2-City.mmdb.gz"
  372. gzip -d /var/lib/GeoIP/GeoLite2-City.mmdb.gz
  373. # Block Torrents
  374. iptables -A FORWARD -m string --string "get_peers" --algo bm -j DROP
  375. iptables -A FORWARD -m string --string "announce_peer" --algo bm -j DROP
  376. iptables -A FORWARD -m string --string "find_node" --algo bm -j DROP
  377. iptables -A FORWARD -m string --algo bm --string "BitTorrent" -j DROP
  378. iptables -A FORWARD -m string --algo bm --string "BitTorrent protocol" -j DROP
  379. iptables -A FORWARD -m string --algo bm --string "peer_id=" -j DROP
  380. iptables -A FORWARD -m string --algo bm --string ".torrent" -j DROP
  381. iptables -A FORWARD -m string --algo bm --string "announce.php?passkey=" -j DROP
  382. iptables -A FORWARD -m string --algo bm --string "torrent" -j DROP
  383. iptables -A FORWARD -m string --algo bm --string "announce" -j DROP
  384. iptables -A FORWARD -m string --algo bm --string "info_hash" -j DROP
  385. iptables-save > /etc/iptables.up.rules
  386. iptables-restore -t < /etc/iptables.up.rules
  387. netfilter-persistent save
  388. netfilter-persistent reload
  389. # Purge Unnecessary Files
  390. apt -y autoclean
  391. apt -y remove --purge unscd
  392. apt-get -y --purge remove samba*;
  393. apt-get -y --purge remove apache2*;
  394. apt-get -y --purge remove bind9*;
  395. apt-get -y remove sendmail*
  396. # Stop Nginx Port 80
  397. service nginx stop
  398. # Install V2ray
  399. wget https://raw.githubusercontent.com/irwanmohi/AutoScriptDebian10-1/main/Resources/Services/ins-vt.sh && chmod +x ins-vt.sh && sed -i -e 's/\r$//' ins-vt.sh && screen -S v2ray ./ins-vt.sh