-
Notifications
You must be signed in to change notification settings - Fork 11
/
Firewall-VPN
76 lines (69 loc) · 2.99 KB
/
Firewall-VPN
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
#!/bin/sh
#!/bin/bash
#!/usr/bin/sh
#!/usr/bin/bash
#!/usr/bin/env sh
#!/usr/bin/env bash
#!/data/data/com.termux/files/usr/bin/sh
#!/data/data/com.termux/files/usr/bin/bash
###############################################################
# Firewall-VPN #
#-Info--------------------------------------------------------#
# Deleting and Adding IpTables Rules #
#-About-------------------------------------------------------#
#--╼▰[ Skils ]-╼▰[ MultiMan ] #
#--╼▰[ Part of ]-╼▰[ HacKingPro ] #
#--╼▰[ Script Name ]-╼▰[ HacKingPro-Firewall-VPN ] #
#--╼▰[ Author ]-╼▰[ AnLoMinus ]-╼▰[ Leon Yaakobov ] #
###############################################################
# CREDIT: To All World Creators free Scripts & Tools #
# BIG THANX TO ALL COMUNITY THAT SHARE ALL THAT FREE #
# GREAT SCRIPTS #
# Location: Made With LOVE IN ISRAEL ! #
###############################################################
#-Metadata----------------------------------------------------#
#--╼▰[ Version ]-╼▰[ 1.0.0 ] #
#--╼▰[ Source ]-╼▰[ https://github.com/AnLoMinus/HacKingPro ] #
#--╼▰[ Created ]-╼▰[ 24-11-2022 ] #
#--╼▰[ Update ]-╼▰[ 24-11-2022 ] #
###############################################################
#--╼▰[ Main Menu ]--╼▰ [ FireWall Rules ]
####### Table of contents
# 1 - IPv4 flush
# 2 - IPv6 flush
# 3 - Ping machine
# 4 - Allow VPN connection only from machine
# IPv4 flush
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X
iptables -Z
# IPv6 flush
ip6tables -P INPUT DROP
ip6tables -P FORWARD DROP
ip6tables -P OUTPUT DROP
ip6tables -t nat -F
ip6tables -t mangle -F
ip6tables -F
ip6tables -X
ip6tables -Z
# Ping machine
iptables -A INPUT -p icmp -i tun0 -s $1 --icmp-type echo-request -j ACCEPT
iptables -A INPUT -p icmp -i tun0 -s $1 --icmp-type echo-reply -j ACCEPT
iptables -A INPUT -p icmp -i tun0 --icmp-type echo-request -j DROP
iptables -A INPUT -p icmp -i tun0 --icmp-type echo-reply -j DROP
iptables -A OUTPUT -p icmp -o tun0 -d $1 --icmp-type echo-reply -j ACCEPT
iptables -A OUTPUT -p icmp -o tun0 -d $1 --icmp-type echo-request -j ACCEPT
iptables -A OUTPUT -p icmp -o tun0 --icmp-type echo-request -j DROP
iptables -A OUTPUT -p icmp -o tun0 --icmp-type echo-reply -j DROP
# Allow VPN connection only from machine
iptables -A INPUT -i tun0 -p tcp -s $1 -j ACCEPT
iptables -A OUTPUT -o tun0 -p tcp -d $1 -j ACCEPT
iptables -A INPUT -i tun0 -p udp -s $1 -j ACCEPT
iptables -A OUTPUT -o tun0 -p udp -d $1 -j ACCEPT
iptables -A INPUT -i tun0 -j DROP
iptables -A OUTPUT -o tun0 -j DROP