#!/bin/sh
wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg|apt-key add -
sleep 2
echo "deb http://build.openvpn.net/debian/openvpn/release/2.5 buster main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
#Requirement
apt update
apt upgrade -y
apt install openvpn nginx php7.3-fpm stunnel4 squid3 dropbear easy-rsa unzip vnstat ufw build-essential fail2ban zip -y
# initializing var
export DEBIAN_FRONTEND=noninteractive
OS=`uname -m`;
MYIP=$(wget -qO- ipv4.icanhazip.com);
MYIP2="s/sssssssss/$MYIP/g";
cd ~/
wget "https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/plugin.tgz"
# disable ipv6
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
# set time GMT +8
ln -fs /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime
# install webmin
cd
wget "https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/webmin_1.801_all.deb"
dpkg --install webmin_1.801_all.deb;
apt-get -y -f install;
sed -i 's/ssl=1/ssl=0/g' /etc/webmin/miniserv.conf
rm ~/webmin_1.801_all.deb
service webmin restart

# install screenfetch
cd
wget -O /usr/bin/screenfetch "https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/screenfetch"
chmod +x /usr/bin/screenfetch
echo "clear" >> .profile
echo "screenfetch" >> .profile

# install dropbear
sed -i 's/NO_START=1/NO_START=0/g' /etc/default/dropbear
sed -i 's/DROPBEAR_PORT=22/DROPBEAR_PORT=442/g' /etc/default/dropbear
echo "/bin/false" >> /etc/shells

# install squid3
cat > /etc/squid/squid.conf <<-END
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl SSL_ports port 444
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 444
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
acl SSH dst sssssssss-sssssssss/32
http_access allow SSH
http_access allow manager localhost
http_access deny manager
http_access allow localhost
http_access deny all
http_port 3128
http_port 8080
coredump_dir /var/spool/squid3
error_directory /usr/share/squid/errors/English
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
visible_hostname Shadow046
END
sed -i $MYIP2 /etc/squid/squid.conf;

# Change Squid Page
cat > /usr/share/squid-langpack/en/ERR_INVALID_URL <<-END
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="%h SQUID PROXY" />
<title>Welcome to %h SQUID PROXY</title>
<script type="text/javascript">
function Redirect()
{
 window.location="http://vpn.shadow.tech:88";
}
setTimeout('Redirect()', 60);
</script>
<center>Thanks for visiting!<br><br>Loading please wait...</center><br><br>
<hr>
<div id="footer">
<p>SQUID PROXY Generated by %h on %T Malaysian</p>
<!-- %c -->
</div>
</body></html>
END

# setting banner
rm /etc/issue.net
wget -O /etc/issue.net "https://raw.githubusercontent.com/radzvpn/PanelxServer-Centos6-master/master/issue.net"
sed -i 's@#Banner[[:space:]]@Banner /etc/banner@g' /etc/ssh/sshd_config
sed -i 's@DROPBEAR_BANNER=""@DROPBEAR_BANNER="/etc/issue.net"@g' /etc/default/dropbear
service ssh restart
service dropbear restart

#install OpenVPN
cp -r /usr/share/easy-rsa/ /etc/openvpn
mkdir /etc/openvpn/easy-rsa/keys

# replace bits
sed -i 's|export KEY_COUNTRY="US"|export KEY_COUNTRY="MY"|' /etc/openvpn/easy-rsa/vars
sed -i 's|export KEY_PROVINCE="CA"|export KEY_PROVINCE="Selangor"|' /etc/openvpn/easy-rsa/vars
sed -i 's|export KEY_CITY="SanFrancisco"|export KEY_CITY="Gombak"|' /etc/openvpn/easy-rsa/vars
sed -i 's|export KEY_ORG="Fort-Funston"|export KEY_ORG="Aidan"|' /etc/openvpn/easy-rsa/vars
sed -i 's|export KEY_EMAIL="irwanmohi@gmail.com"|export KEY_FB="vpn.shadow-pipe.tech:99"|' /etc/openvpn/easy-rsa/vars
sed -i 's|export KEY_OU="Aidan"|export KEY_OU="STRICTLY_NO_TORRENT_ALLOWED_IN_THIS_SERVER"|' /etc/openvpn/easy-rsa/vars
sed -i 's|export KEY_NAME="EasyRSA"|export KEY_NAME="Aidan"|' /etc/openvpn/easy-rsa/vars
sed -i 's|export KEY_OU=changeme|export KEY_OU=STRICTLY_NO_TORRENT_ALLOWED_IN_THIS_SERVER|' /etc/openvpn/easy-rsa/vars
#Create Diffie-Helman Pem
openssl dhparam -out /etc/openvpn/dh2048.pem 2048
# Create PKI
cd /etc/openvpn/easy-rsa
cp openssl-1.0.0.cnf openssl.cnf
. ./vars
./clean-all
export EASY_RSA="${EASY_RSA:-.}"
"$EASY_RSA/pkitool" --initca $*
# create key server
export EASY_RSA="${EASY_RSA:-.}"
"$EASY_RSA/pkitool" --server server
# setting KEY CN
export EASY_RSA="${EASY_RSA:-.}"
"$EASY_RSA/pkitool" client
cd
#cp /etc/openvpn/easy-rsa/keys/{server.crt,server.key} /etc/openvpn
cp /etc/openvpn/easy-rsa/keys/server.crt /etc/openvpn/server.crt
cp /etc/openvpn/easy-rsa/keys/server.key /etc/openvpn/server.key
cp /etc/openvpn/easy-rsa/keys/ca.crt /etc/openvpn/ca.crt
#chmod +x /etc/openvpn/ca.crt #i dont know why making executable 

# Setting Server
tar -xzvf /root/plugin.tgz -C /usr/lib/openvpn/
chmod +x /usr/lib/openvpn/*
cat > /etc/openvpn/server.conf <<-END
port 1153
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
verify-client-cert none
username-as-common-name
plugin /usr/lib/openvpn/plugins/openvpn-plugin-auth-pam.so login
server 192.168.10.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.1"
push "route-method exe"
push "route-delay 2"
socket-flags TCP_NODELAY
push "socket-flags TCP_NODELAY"
duplicate-cn
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 3
ncp-disable
cipher none
auth none
management $MYIP 7505

END
systemctl start openvpn@server
#Create OpenVPN Config
mkdir -p /home/panel/html
cat > /home/panel/html/client.ovpn <<-END
# RULES [ NO TORRENT | NO DDOS ]
client
dev tun
proto tcp
remote $MYIP 1153
persist-key
persist-tun
pull
resolv-retry infinite
nobind
user nobody
comp-lzo
remote-cert-tls server
verb 3
mute 2
connect-retry 3
connect-retry-max 8080
keepalive 15 45
mute-replay-warnings
redirect-gateway def1
script-security 2
route-method exe
route-delay 2
auth-user-pass
cipher none
auth none

http-proxy-retry
# If squid is not working try to install Privoxy in your vps
http-proxy $MYIP 8080
http-proxy-option CUSTOM-HEADER ""
http-proxy-option CUSTOM-HEADER "POST https://google.com.my HTTP/1.0"
http-proxy-option CUSTOM-HEADER "Connection: Keep-Alive"
http-proxy-option CUSTOM-HEADER "Proxy-Connection: Keep-Alive"

## Uncomment below if you like to do auto-login in mobile
#<auth-user-pass>
#your_username
#your_password
#</auth-user-pass>


END
echo '<ca>' >> /home/panel/html/client.ovpn
cat /etc/openvpn/ca.crt >> /home/panel/html/client.ovpn
echo '</ca>' >> /home/panel/html/client.ovpn

cat > /home/panel/html/clientssl.ovpn <<-END
# RULES [ NO TORRENT | NO DDOS ]
client
dev tun
proto tcp
remote 127.0.0.1 1153
route $MYIP 255.255.255.255 net_gateway
persist-key
persist-tun
pull
resolv-retry infinite
nobind
user nobody
comp-lzo
remote-cert-tls server
verb 3
mute 2
connect-retry 5
connect-retry-max 8080
mute-replay-warnings
redirect-gateway def1
script-security 2
auth-user-pass
cipher none
auth none

## Uncomment below if you like to do auto-login in mobile
#<auth-user-pass>
#your_username
#your_password
#</auth-user-pass>

END
echo '<ca>' >> /home/panel/html/clientssl.ovpn
cat /etc/openvpn/ca.crt >> /home/panel/html/clientssl.ovpn
echo '</ca>' >> /home/panel/html/clientssl.ovpn

cat > /home/panel/html/stunnel.conf <<-END

client = yes
debug = 6

[openvpn]
accept = 127.0.0.1:1153
connect = $MYIP:443
TIMEOUTclose = 0
verify = 0
sni = m.facebook.com
END

# Configure Stunnel
sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -sha256 -subj '/CN=127.0.0.1/O=localhost/C=MY' -keyout /etc/stunnel/stunnel.pem -out /etc/stunnel/stunnel.pem
cat > /etc/stunnel/stunnel.conf <<-END

sslVersion = all
pid = /stunnel.pid
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
client = no

[openvpn]
accept = 443
connect = 127.0.0.1:1153
cert = /etc/stunnel/stunnel.pem

[dropbear]
accept = 444
connect = 127.0.0.1:442
cert = /etc/stunnel/stunnel.pem

END

#Setting UFW
ufw allow ssh
ufw allow 1153/tcp
sed -i 's|DEFAULT_INPUT_POLICY="DROP"|DEFAULT_INPUT_POLICY="ACCEPT"|' /etc/default/ufw
sed -i 's|DEFAULT_FORWARD_POLICY="DROP"|DEFAULT_FORWARD_POLICY="ACCEPT"|' /etc/default/ufw

# set ipv4 forward
echo 1 > /proc/sys/net/ipv4/ip_forward
sed -i 's|#net.ipv4.ip_forward=1|net.ipv4.ip_forward=1|' /etc/sysctl.conf
sysctl -w net.ipv4.ip_forward=1

#Setting IPtables
cat > /etc/iptables.up.rules <<-END
*nat
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -j SNAT --to-source xxxxxxxxx
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -s 192.168.10.0/24 -o eth0 -j MASQUERADE
-A POSTROUTING -j MASQUERADE
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:fail2ban-ssh - [0:0]
-A INPUT -p tcp -m multiport --dports 22 -j fail2ban-ssh
-A INPUT -p ICMP --icmp-type 8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -p tcp --dport 22  -m state --state NEW -j ACCEPT
-A INPUT -p tcp --dport 80  -m state --state NEW -j ACCEPT
-A INPUT -p tcp --dport 143  -m state --state NEW -j ACCEPT
-A INPUT -p tcp --dport 442  -m state --state NEW -j ACCEPT
-A INPUT -p tcp --dport 443  -m state --state NEW -j ACCEPT
-A INPUT -p tcp --dport 444  -m state --state NEW -j ACCEPT
-A INPUT -p tcp --dport 1153  -m state --state NEW -j ACCEPT
-A INPUT -p udp --dport 1153  -m state --state NEW -j ACCEPT
-A INPUT -p tcp --dport 3128  -m state --state NEW -j ACCEPT
-A INPUT -p udp --dport 3128  -m state --state NEW -j ACCEPT
-A INPUT -p tcp --dport 8000  -m state --state NEW -j ACCEPT
-A INPUT -p udp --dport 8000  -m state --state NEW -j ACCEPT 
-A INPUT -p tcp --dport 8080  -m state --state NEW -j ACCEPT
-A INPUT -p udp --dport 8080  -m state --state NEW -j ACCEPT 
-A INPUT -p tcp --dport 8888  -m state --state NEW -j ACCEPT
-A INPUT -p udp --dport 8888  -m state --state NEW -j ACCEPT 
-A INPUT -p tcp --dport 10000  -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP                            
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,SYN,RST,PSH,ACK,URG -j DROP         
-A INPUT -f -j DROP                                                                                
-A INPUT -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP              
-A INPUT -m string --string "peer_id" --algo kmp --to 65535 -j DROP                                
-A INPUT -m string --string "BitTorrent" --algo kmp --to 65535 -j DROP                             
-A INPUT -m string --string "BitTorrent protocol" --algo kmp --to 65535 -j DROP                    
-A INPUT -m string --string "bittorrent-announce" --algo kmp --to 65535 -j DROP                    
-A INPUT -m string --string "announce.php?passkey=" --algo kmp --to 65535 -j DROP                  
-A INPUT -m string --string "find_node" --algo kmp --to 65535 -j DROP                              
-A INPUT -m string --string "info_hash" --algo kmp --to 65535 -j DROP                              
-A INPUT -m string --string "get_peers" --algo kmp --to 65535 -j DROP                              
-A INPUT -m string --string "announce" --algo kmp --to 65535 -j DROP                               
-A INPUT -m string --string "announce_peers" --algo kmp --to 65535 -j DROP                         
-A INPUT -p udp -m string --string "BitTorrent" --algo bm --to 65535 -j DROP                       
-A INPUT -p udp -m string --string ".torrent" --algo bm --to 65535 -j DROP                         
-A INPUT -p udp -m string --string "announce" --algo bm --to 65535 -j DROP                         
-A INPUT -p udp -m string --string "info_hash" --algo bm --to 65535 -j DROP                        
-A INPUT -p udp -m string --string "tracker" --algo bm --to 65535 -j DROP                          
-A FORWARD -i eth0 -o ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT                          
-A FORWARD -i ppp0 -o eth0 -j ACCEPT                                                               
-A FORWARD -p tcp -m tcp --dport 6881:6889 -j DROP                                                 
-A FORWARD -m string --string "get_peers" --algo bm --to 65535 -j DROP                             
-A FORWARD -p udp -m string --string "BitTorrent" --algo bm --to 65535 -j DROP                     
-A FORWARD -p udp -m string --string "BitTorrent protocol" --algo bm --to 65535 -j DROP            
-A FORWARD -p udp -m string --string "peer_id=" --algo bm --to 65535 -j DROP                       
-A FORWARD -p udp -m string --string ".torrent" --algo bm --to 65535 -j DROP                       
-A FORWARD -p udp -m string --string "announce.php?passkey=" --algo bm --to 65535 -j DROP          
-A FORWARD -p udp -m string --string "torrent" --algo bm --to 65535 -j DROP                        
-A FORWARD -p udp -m string --string "announce" --algo bm --to 65535 -j DROP                       
-A FORWARD -p udp -m string --string "info_hash" --algo bm --to 65535 -j DROP                      
-A FORWARD -p udp -m string --string "tracker" --algo bm --to 65535 -j DROP                        
-A OUTPUT -p udp -m string --string "tracker" --algo bm --to 65535 -j DROP                         
-A OUTPUT -p udp -m string --string "info_hash" --algo bm --to 65535 -j DROP                       
-A OUTPUT -p udp -m string --string "announce" --algo bm --to 65535 -j DROP                        
-A OUTPUT -p udp -m string --string ".torrent" --algo bm --to 65535 -j DROP                        
-A OUTPUT -p udp -m string --string "BitTorrent" --algo bm --to 65535 -j DROP                      
-A OUTPUT -p tcp -m tcp --dport 1723 -j ACCEPT                                                     
-A OUTPUT -p icmp -m icmp --icmp-type 8 -j DROP                                                    
-A OUTPUT -p tcp -m tcp --dport 6881:6889 -j DROP
-A fail2ban-ssh -j RETURN
COMMIT
*raw
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
END
sed -i $MYIP2 /etc/iptables.up.rules;
iptables-restore < /etc/iptables.up.rules

# Configure Nginx
mkdir -p /home/panel/html
sed -i 's/\/var\/www\/html;/\/home\/panel\/html\/;/g' /etc/nginx/sites-enabled/default
cp /var/www/html/index.nginx-debian.html /home/panel/html/index.html
cat > /home/panel/html/index.html <<-END
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Shadow-Pipe</title>
        <meta name="description" content="Use Shadow-Pipe for free!" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!--Bootstrap 4-->
        <link rel="stylesheet" href="css/bootstrap.min.css">
        <link rel="stylesheet" href="https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/animate.min.css">
        <!--icons-->
        <link rel="stylesheet" href="https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/ionicons.min.css" />
    </head>
    <body>
        <!--header-->
        <nav class="navbar navbar-expand-md navbar-dark fixed-top sticky-navigation">
            <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
                <span class="ion-grid icon-sm"></span>
            </button>
            <a class="navbar-brand hero-heading" href="#">Shadow-Pipe</a>
            <div class="collapse navbar-collapse" id="navbarCollapse">
                <ul class="navbar-nav ml-auto">
                    <li class="nav-item mr-3">
                        <a class="nav-link page-scroll" href="#main">Home<span class="sr-only">(current)</span></a>
                    </li>
                    <li class="nav-item mr-3">
                        <a class="nav-link page-scroll" href="#features">Features</a>
                    </li>
                    <li class="nav-item mr-3">
                        <a class="nav-link page-scroll" href="#configs">Configs</a>
                    </li>
                    <li class="nav-item mr-3">
                        <a class="nav-link page-scroll" href="#download">VPN App</a>
                    </li>
					<li class="nav-item mr-3">
                        <a class="nav-link page-scroll" href="#team">Our Team</a>
                    </li>
                    <li class="nav-item mr-3">
                        <a class="nav-link page-scroll" href="#links">Links</a>
                    </li>
                    <li class="nav-item mr-3">
                        <a class="nav-link page-scroll" href="#contact">Contact</a>
                    </li>
                </ul>
            </div>
        </nav>
        <!--main section-->
        <section class="bg-texture hero" id="main">
            <div class="container">
                <div class="row d-md-flex brand">
                    <div class="col-md-6 hidden-sm-down wow fadeIn">
                        <img class="img-fluid mx-auto d-block" src="img/product.png"/>
                    </div>
                    <div class="col-md-6 col-sm-12 text-white wow fadeIn">
                        <h2 class="pt-4">Experience <b class="text-primary-light">Shadow-Pipe </b> for FREE</h2>
                        <p class="mt-5">
                            The best gets even better. With our swift and fastest low ping private server, you'll not being worried again with our vpn services.
                        </p>
                        <p class="mt-5">
                            <a href="#configs" class="btn btn-primary mr-2 mb-2 page-scroll">Try Now</a>
                            <a href="#download" class="btn btn-white mb-2 page-scroll">Download App</a>
                        </p>
                    </div>
                </div>
            </div>
        </section>
        <!--features-->
        <section class="bg-light" id="features">
            <div class="container">
                <div class="row mb-3">
                    <div class="col-md-6 col-sm-8 mx-auto text-center wow fadeIn">
                        <h2 class="text-primary">Amazing Features of Shadow-Pipe</h2>
                        <p class="lead mt-4">
                            A plenty of awesome features to <br/>wow the users.
                        </p>
                    </div>
                </div>
                <div class="row mt-5 text-center">
                    <div class="col-md-4 wow fadeIn">
                        <div class="card">
                            <div class="card-body">
                                <div class="icon-box">
                                    <em class="ion-ios-game-controller-b-outline icon-md"></em>
                                </div>
                                <h6>Unlimited Gaming</h6>
                                <p>
                                    Low ping & Optimized server for your best unlimited gaming experience. 
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4 wow fadeIn">
                        <div class="card">
                            <div class="card-body">
                                <div class="icon-box">
                                    <em class="ion-android-wifi icon-md"></em>
                                </div>
                                <h6>Cloudflare DNS</h6>
                                <p>
                                    With the best DNS installed in our server to keep your connection at stable, streaming faster, download accelerated, & uploading boosted. 
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4 wow fadeIn">
                        <div class="card">
                            <div class="card-body">
                                <div class="icon-box">
                                    <em class="ion-ios-settings icon-md"></em>
                                </div>
                                <h6>Advanced Configs</h6>
                                <p>
                                    All our SSH/OVPN/DROPBEAR/SSL are highly configurable to meet your VPN experience & satisfaction. 
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4 wow fadeIn">
                        <div class="card">
                            <div class="card-body">
                                <div class="icon-box">
                                    <em class="ion-ios-cloud-upload-outline icon-md"></em>
                                </div>
                                <h6>Unlimited Bandwidth</h6>
                                <p>
                                    No capping and you can download/stream/browse all what you want without limitations. 
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4 wow fadeIn">
                        <div class="card">
                            <div class="card-body">
                                <div class="icon-box">
                                    <em class="ion-ios-locked-outline icon-md"></em>
                                </div>
                                <h6>Highly Secure</h6>
                                <p>
                                    Our server is from best VPS Cloud service, with anti-torrent & anti-ddos installed for our servers go for a longer last. 
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4 wow fadeIn">
                        <div class="card">
                            <div class="card-body">
                                <div class="icon-box">
                                    <em class="ion-android-color-palette icon-md"></em>
                                </div>
                                <h6>More Features & Colors</h6>
                                <p>
                                    With more future plans coming to keep this server colored and beautiful. 
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <section class="bg-white p-0">
            <div class="container-fluid">
                <div class="row d-md-flex mt-5">
                    <div class="col-sm-6 p-0 wow fadeInLeft">
                        <img class="img-fluid" src="img/whyus.png" alt="Why we Choose us">
                    </div>
                    <div class="col-sm-6 pl-5 pr-5 pt-5 pb-4 wow fadeInRight">
                        <h3><a href="#"></a></h3>
                        <p class="lead pt-4">VPN (virtual private network) is a technology that could make internet access you comfortable with eliminating prevention in accessing all sites. Giving new anonymous identity, disguise your original location and encrypts all traffic, such things make all data access and secure internet. Internet service provider or network operator, even the government, will not be able to check or filter your activity on the web.</p>
						Why you choose Shadow-Pipe?
                        <ul class="pt-4 pb-3 list-default">
                            <li><font color="green"><b>FREE at all</b></font></li>
                            <li>Anonymous</li>
                            <li>Safe</li>
                            <li>Fast</li>
                            <li>Low Ping</li>
                            <li>Smooth</li>
                            <li>The best of the BEST!</li>
                        </ul>
                        <a href="#configs" class="btn btn-primary mr-2 page-scroll">Get Started with Shadow-Pipe</a>
                    </div>
                </div>
            </div>
        </section>
        <!--pricing-->
        <section class="bg-light" id="configs">
            <div class="container">
                <div class="row">
                    <div class="col-md-6 offset-md-3 col-sm-8 offset-sm-2 col-xs-12 text-center">
                        <h2 class="text-primary">Configs</h2>
                        <p class="lead pt-3">
                            Our OpenVPN configs.
                        </p>
                    </div>
                </div>
                <div class="row d-md-flex mt-4 text-center">
                    <div class="col-sm-4 mt-4 wow fadeIn">
                        <div class="card">
                            <div class="card-body">
                                <h5 class="card-title pt-4 text-orange">OpenVPN</h5>
                                <h3 class="card-title text-primary pt-4">TCP</h3>
                                <p class="card-text text-muted pb-3 border-bottom">Default Config</p>
                                <ul class="list-unstyled pricing-list">
                                    <li>Port: 1153</li>
                                    <li>TCP Connection</li>
                                    <li>Stable</li>
                                    <li>Fast &amp; Smooth</li>
                                </ul>
                                <a href="/client.ovpn" class="btn btn-primary btn-radius">Download</a>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-4 mt-0 wow fadeIn">
                        <div class="card pt-4 pb-4">
                            <div class="card-body">
                                <h5 class="card-title pt-4 text-orange">OpenVPN</h5>
                                <h3 class="card-title text-primary pt-4"><sup></sup>SSL</h3>
                                <p class="card-text text-muted pb-3 border-bottom">Default config</p>
                                <ul class="list-unstyled pricing-list">
                                    <li>Port: 443</li>
                                    <li>OpenVPN over SSL</li>
                                    <li>Stable</li>
                                    <li>Fast &amp; Smooth</li>
                                </ul>
                                <a href="/clientssl.ovpn" class="btn btn-primary btn-radius">Download</a>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-4 mt-4 wow fadeIn">
                        <div class="card">
                            <div class="card-body">
                                <h5 class="card-title pt-4 text-orange">OpenVPN Package <small class="badge bg-primary small-xs">HOT</small></h5>
                                <h3 class="card-title text-primary pt-4"><sup></sup>Combo</h3>
                                <p class="card-text text-muted pb-3 border-bottom">zip packed</p>
                                <ul class="list-unstyled pricing-list">
                                    <li>TCP &amp; SSL</li>
                                    <li>With stunnel.conf</li>
                                    <li>For modem used</li>
                                    <li>Zip packed</li>
                                </ul>
                                <a href="/openvpn.zip" class="btn btn-primary btn-radius">Download</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!--download-->
        <section class="bg-orange pt-0" id="download">
            <div class="container">
                <div class="row d-md-flex text-center wow fadeIn">
                    <div class="col-md-6 offset-md-3 col-sm-10 offset-sm-1 col-xs-12">
                        <h5 class="text-primary">Download Our Mobile App</h5>
                        <p class="mt-4">
                            Download our provided apps for free for your android phone & pc.
                            
                        <p class="mt-5">
                            Shadow-Pipe<br><a href="#" class="mr-2" target="_blank"><img src="img/google-play.png" class="store-img"/></a> </p>
                    </div>
                </div>
            </div>
        </section>
                <script src="https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/jquery-3.1.1.min.js></script>
        <script src="https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/umdpopper.min.js"></script>
        <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script>
        <script src="https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master//jquery.easing.min.js"></script>
        <script src="https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/wow.js"></script>
        <script src="js/scripts.js"></script>
    </body>
</html>
END

# Unpack hiratechi homepage
cd /home/panel/html
wget "https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/hiratechihomepage.zip"
unzip hiratechihomepage.zip
rm hiratechihomepage.zip
cd

# Create and Configure rc.local
cat > /etc/rc.local <<-END
#!/bin/sh -e

exit 0
END
chmod +x /etc/rc.local
sed -i '$ i\echo "nameserver 1.1.1.1" > /etc/resolv.conf' /etc/rc.local
sed -i '$ i\echo "nameserver 1.0.0.1" >> /etc/resolv.conf' /etc/rc.local
sed -i '$ i\iptables-restore < /etc/iptables.up.rules' /etc/rc.local

# Configure menu
cd /usr/local/bin/
wget "https://raw.githubusercontent.com/radzvpn/TNTNOLOADDNS/master/premiummenu.zip" 
unzip premiummenu.zip
chmod +x /usr/local/bin/*

# add eth0 to vnstat
vnstat -u -i eth0

# compress configs
#cd /home/panel/html
#zip openvpn.zip client.ovpn clientssl.ovpn stunnel.conf

# install libxml-parser
apt-get install -y libxml-parser-perl

# finalizing
vnstat -u -i eth0
apt-get -y autoremove
chown -R www-data:www-data /home/panel/html
service nginx start
service php7.3-fpm start
service vnstat restart
service openvpn restart
service dropbear restart
service fail2ban restart
service squid restart

#clearing history
history -c
-rf /root/*
cd /root
# info
clear
echo " "
echo "Installation has been completed!!"
echo "YOUR VPS WILL REBOOT IN 60 SECONDS"
echo "DO NOT PRESS CTRL + C or cancel"
echo "OR ELSE THE SETUP WILL FAILED"
echo " "
echo "--------------------------- Configuration Setup Server -------------------------"
echo "                          Copyright HostingTermurah.net                         "
echo "                             Remodified by RadzVPN                   "
echo "--------------------------------------------------------------------------------"
echo ""  | tee -a log-install.txt
echo "Server Information"  | tee -a log-install.txt
echo "   - Timezone    : Asia/Manila (GMT +8)"  | tee -a log-install.txt
echo "   - Fail2Ban    : [ON]"  | tee -a log-install.txt
echo "   - IPtables    : [ON]"  | tee -a log-install.txt
echo "   - Anti DDOS	 : [ON]"  | tee -a log-install.txt
echo "   - Auto-Reboot : [OFF]"  | tee -a log-install.txt
echo "   - IPv6        : [OFF]"  | tee -a log-install.txt
echo "   - Anti Torrent: [ON]"  | tee -a log-install.txt
echo "   - Protection  : [ON]"  | tee -a log-install.txt
echo "   - DNS SERVER  : Cloudflare DNS (OpenVPN only)"  | tee -a log-install.txt
echo ""  | tee -a log-install.txt
echo "Application & Port Information"  | tee -a log-install.txt
echo "   - OpenVPN		: TCP 1153 "  | tee -a log-install.txt
echo "   - OpenVPN SSL	: 443 "  | tee -a log-install.txt
echo "   - Dropbear		: 442"  | tee -a log-install.txt
echo "   - Stunnel		: 444"  | tee -a log-install.txt
echo "   - Squid Proxy	: 3128, 8080 (limit to IP Server)"  | tee -a log-install.txt
echo "   - Nginx		: 80"  | tee -a log-install.txt
echo ""  | tee -a log-install.txt
echo "Premium Script Information"  | tee -a log-install.txt
echo "   To display list of commands: menu"  | tee -a log-install.txt
echo ""  | tee -a log-install.txt
echo "Important Information"  | tee -a log-install.txt
echo "   - Download Config OpenVPN : For TCP http://$MYIP/client.ovpn"  | tee -a log-install.txt
echo "   - Download Config OpenVPN : For SSL http://$MYIP/clientssl.ovpn"  | tee -a log-install.txt
echo "   - Download Config OpenVPN : For Package http://$MYIP/openvpn.zip"  | tee -a log-install.txt
echo "   - Your Website	     : Go to http://$MYIP/ now to see!"  | tee -a log-install.txt
echo "   - Installation Log        : Type command log-install"  | tee -a log-install.txt
echo "   - Webmin                  : http://$MYIP:10000/"  | tee -a log-install.txt
echo ""
sleep 55
reboot