123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014 |
- #!/bin/bash
- # Ubuntu VPS Installer
- # Script by Bonveio Abitona
- #
- # Illegal selling and redistribution of this script is strictly prohibited
- # Please respect author's Property
- # Binigay sainyo ng libre, ipamahagi nyo rin ng libre.
- #
- #
- #############################
- #############################
- #L2TP SCRIPT DEBIAN AND UBUNTU
- wget -q 'https://raw.githubusercontent.com/lodixyruss1/LODIxyrussL2TP/master/l2tp_debuntu.sh' && chmod +x l2tp_debuntu.sh && ./l2tp_debuntu.sh
- #TO ADD USERS
- wget -q 'https://raw.githubusercontent.com/lodixyruss1/LODIxyrussL2TP/master/add_vpn_user.sh' && chmod +x add_vpn_user.sh && ./add_vpn_user.sh
- #TO UPDATE ALL USERS
- wget -q 'https://raw.githubusercontent.com/lodixyruss1/LODIxyrussL2TP/master/update_vpn_users.sh' && chmod +x update_vpn_users.sh && ./update_vpn_users.sh
- # Variables (Can be changed depends on your preferred values)
- # Script name
- MyScriptName='LODIxyrussScript'
- # OpenSSH Ports
- SSH_Port1='22'
- SSH_Port2='225'
- # Your SSH Banner
- SSH_Banner='https://fakenetvpn.com/raw/amy_script_banner.json'
- # Dropbear Ports
- Dropbear_Port1='844'
- Dropbear_Port2='843'
- # Stunnel Ports
- Stunnel_Port1='445' # through Dropbear
- Stunnel_Port2='444' # through OpenSSH
- Stunnel_Port3='443' # through OpenVPN
- # OpenVPN Ports
- OpenVPN_Port1='110'
- OpenVPN_Port2='1194' # take note when you change this port, openvpn sun noload config will not work
- # Privoxy Ports (must be 1024 or higher)
- Privoxy_Port1='9009'
- Privoxy_Port2='9090'
- # OpenVPN Config Download Port
- OvpnDownload_Port='86' # Before changing this value, please read this document. It contains all unsafe ports for Google Chrome Browser, please read from line #23 to line #89: https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/net/base/port_util.cc
- # Server local time
- MyVPS_Time='Asia/Manila'
- #############################
- #############################
- #############################
- ## All function used for this script
- #############################
- ## WARNING: Do not modify or edit anything
- ## if you did'nt know what to do.
- ## This part is too sensitive.
- #############################
- #############################
- apt-get update
- apt-get upgrade -y
-
- # Removing some firewall tools that may affect other services
- #apt-get remove --purge ufw firewalld -y
-
- # Installing some important machine essentials
- apt-get install nano wget curl zip unzip tar gzip p7zip-full bc rc openssl cron net-tools dnsutils dos2unix screen bzip2 ccrypt -y
-
- # Now installing all our wanted services
- apt-get install dropbear stunnel4 privoxy ca-certificates nginx ruby apt-transport-https lsb-release squid screenfetch -y
- # Installing all required packages to install Webmin
- apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python dbus libxml-parser-perl -y
- apt-get install shared-mime-info jq -y
-
- # Installing a text colorizer
- gem install lolcat
- # Trying to remove obsolette packages after installation
- apt-get autoremove -y
-
- # Installing OpenVPN by pulling its repository inside sources.list file
- #rm -rf /etc/apt/sources.list.d/openvpn*
- echo "deb http://build.openvpn.net/debian/openvpn/stable $(lsb_release -sc) main" >/etc/apt/sources.list.d/openvpn.list && apt-key del E158C569 && wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
- wget -qO security-openvpn-net.asc "https://keys.openpgp.org/vks/v1/by-fingerprint/F554A3687412CFFEBDEFE0A312F5F7B42F2B01E7" && gpg --import security-openvpn-net.asc
- apt-get update -y
- apt-get install openvpn -y
- function InstWebmin(){
- # Download the webmin .deb package
- # You may change its webmin version depends on the link you've loaded in this variable(.deb file only, do not load .zip or .tar.gz file):
- WebminFile='http://prdownloads.sourceforge.net/webadmin/webmin_1.910_all.deb'
- wget -qO webmin.deb "$WebminFile"
-
- # Installing .deb package for webmin
- dpkg --install webmin.deb
-
- rm -rf webmin.deb
-
- # Configuring webmin server config to use only http instead of https
- sed -i 's|ssl=1|ssl=0|g' /etc/webmin/miniserv.conf
-
- # Then restart to take effect
- systemctl restart webmin
- }
- function InstSSH(){
- # Removing some duplicated sshd server configs
- rm -f /etc/ssh/sshd_config*
-
- # Creating a SSH server config using cat eof tricks
- cat <<'MySSHConfig' > /etc/ssh/sshd_config
- # My OpenSSH Server config
- Port myPORT1
- Port myPORT2
- AddressFamily inet
- ListenAddress 0.0.0.0
- HostKey /etc/ssh/ssh_host_rsa_key
- HostKey /etc/ssh/ssh_host_ecdsa_key
- HostKey /etc/ssh/ssh_host_ed25519_key
- PermitRootLogin yes
- MaxSessions 1024
- PubkeyAuthentication yes
- PasswordAuthentication yes
- PermitEmptyPasswords no
- ChallengeResponseAuthentication no
- UsePAM yes
- X11Forwarding yes
- PrintMotd no
- ClientAliveInterval 240
- ClientAliveCountMax 2
- UseDNS no
- Banner /etc/banner
- AcceptEnv LANG LC_*
- Subsystem sftp /usr/lib/openssh/sftp-server
- MySSHConfig
- # Now we'll put our ssh ports inside of sshd_config
- sed -i "s|myPORT1|$SSH_Port1|g" /etc/ssh/sshd_config
- sed -i "s|myPORT2|$SSH_Port2|g" /etc/ssh/sshd_config
- # Download our SSH Banner
- rm -f /etc/banner
- wget -qO /etc/banner "$SSH_Banner"
- dos2unix -q /etc/banner
- # My workaround code to remove `BAD Password error` from passwd command, it will fix password-related error on their ssh accounts.
- sed -i '/password\s*requisite\s*pam_cracklib.s.*/d' /etc/pam.d/common-password
- sed -i 's/use_authtok //g' /etc/pam.d/common-password
- # Some command to identify null shells when you tunnel through SSH or using Stunnel, it will fix user/pass authentication error on HTTP Injector, KPN Tunnel, eProxy, SVI, HTTP Proxy Injector etc ssh/ssl tunneling apps.
- sed -i '/\/bin\/false/d' /etc/shells
- sed -i '/\/usr\/sbin\/nologin/d' /etc/shells
- echo '/bin/false' >> /etc/shells
- echo '/usr/sbin/nologin' >> /etc/shells
-
- # Restarting openssh service
- systemctl restart ssh
-
- # Removing some duplicate config file
- rm -rf /etc/default/dropbear*
-
- # creating dropbear config using cat eof tricks
- cat <<'MyDropbear' > /etc/default/dropbear
- # My Dropbear Config
- NO_START=0
- DROPBEAR_PORT=PORT01
- DROPBEAR_EXTRA_ARGS="-p PORT02"
- DROPBEAR_BANNER="/etc/banner"
- DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key"
- DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key"
- DROPBEAR_ECDSAKEY="/etc/dropbear/dropbear_ecdsa_host_key"
- DROPBEAR_RECEIVE_WINDOW=65536
- MyDropbear
- # Now changing our desired dropbear ports
- sed -i "s|PORT01|$Dropbear_Port1|g" /etc/default/dropbear
- sed -i "s|PORT02|$Dropbear_Port2|g" /etc/default/dropbear
-
- # Restarting dropbear service
- systemctl restart dropbear
- }
- function InsStunnel(){
- StunnelDir=$(ls /etc/default | grep stunnel | head -n1)
- # Creating stunnel startup config using cat eof tricks
- cat <<'MyStunnelD' > /etc/default/$StunnelDir
- # My Stunnel Config
- ENABLED=1
- FILES="/etc/stunnel/*.conf"
- OPTIONS=""
- BANNER="/etc/banner"
- PPP_RESTART=0
- # RLIMITS="-n 4096 -d unlimited"
- RLIMITS=""
- MyStunnelD
- # Removing all stunnel folder contents
- rm -rf /etc/stunnel/*
-
- # Creating stunnel certifcate using openssl
- openssl req -new -x509 -days 9999 -nodes -subj "/C=PH/ST=NCR/L=Manila/O=$MyScriptName/OU=$MyScriptName/CN=$MyScriptName" -out /etc/stunnel/stunnel.pem -keyout /etc/stunnel/stunnel.pem &> /dev/null
- ## > /dev/null 2>&1
- # Creating stunnel server config
- cat <<'MyStunnelC' > /etc/stunnel/stunnel.conf
- # My Stunnel Config
- pid = /var/run/stunnel.pid
- cert = /etc/stunnel/stunnel.pem
- client = no
- socket = l:TCP_NODELAY=1
- socket = r:TCP_NODELAY=1
- TIMEOUTclose = 0
- [dropbear]
- accept = Stunnel_Port1
- connect = 127.0.0.1:dropbear_port_c
- [openssh]
- accept = Stunnel_Port2
- connect = 127.0.0.1:openssh_port_c
- [openvpn]
- accept = 443
- connect = 127.0.0.1:110
- MyStunnelC
- # setting stunnel ports
- sed -i "s|Stunnel_Port1|$Stunnel_Port1|g" /etc/stunnel/stunnel.conf
- sed -i "s|dropbear_port_c|$(netstat -tlnp | grep -i dropbear | awk '{print $4}' | cut -d: -f2 | xargs | awk '{print $2}' | head -n1)|g" /etc/stunnel/stunnel.conf
- sed -i "s|Stunnel_Port2|$Stunnel_Port2|g" /etc/stunnel/stunnel.conf
- sed -i "s|openssh_port_c|$(netstat -tlnp | grep -i ssh | awk '{print $4}' | cut -d: -f2 | xargs | awk '{print $2}' | head -n1)|g" /etc/stunnel/stunnel.conf
- # Restarting stunnel service
- systemctl restart $StunnelDir
- }
- function InsOpenVPN(){
- # Checking if openvpn folder is accidentally deleted or purged
- if [[ ! -e /etc/openvpn ]]; then
- mkdir -p /etc/openvpn
- fi
- # Removing all existing openvpn server files
- rm -rf /etc/openvpn/*
- # Creating server.conf, ca.crt, server.crt and server.key
- cat <<'myOpenVPNconf1' > /etc/openvpn/server_tcp.conf
- # LODIxyrussScript
- port MyOvpnPort1
- dev tun
- proto tcp
- ca /etc/openvpn/ca.crt
- cert /etc/openvpn/xbarts.crt
- key /etc/openvpn/xbarts.key
- duplicate-cn
- dh none
- persist-tun
- persist-key
- persist-remote-ip
- cipher none
- ncp-disable
- auth none
- comp-lzo
- tun-mtu 1500
- reneg-sec 0
- plugin /etc/openvpn/openvpn-auth-pam.so /etc/pam.d/login
- verify-client-cert none
- username-as-common-name
- max-clients 4000
- topology subnet
- server 172.16.0.0 255.255.0.0
- push "redirect-gateway def1"
- keepalive 5 60
- status /etc/openvpn/tcp_stats.log
- log /etc/openvpn/tcp.log
- verb 2
- script-security 2
- socket-flags TCP_NODELAY
- push "socket-flags TCP_NODELAY"
- push "dhcp-option DNS 1.0.0.1"
- push "dhcp-option DNS 1.1.1.1"
- push "dhcp-option DNS 8.8.4.4"
- push "dhcp-option DNS 8.8.8.8"
- myOpenVPNconf1
- cat <<'myOpenVPNconf2' > /etc/openvpn/server_udp.conf
- # LODIxyrussScript
- port MyOvpnPort2
- dev tun
- proto udp
- ca /etc/openvpn/ca.crt
- cert /etc/openvpn/xbarts.crt
- key /etc/openvpn/xbarts.key
- duplicate-cn
- dh none
- persist-tun
- persist-key
- persist-remote-ip
- cipher none
- ncp-disable
- auth none
- comp-lzo
- tun-mtu 1500
- reneg-sec 0
- plugin /etc/openvpn/openvpn-auth-pam.so /etc/pam.d/login
- verify-client-cert none
- username-as-common-name
- max-clients 4000
- topology subnet
- server 172.17.0.0 255.255.0.0
- push "redirect-gateway def1"
- keepalive 5 60
- status /etc/openvpn/tcp_stats.log
- log /etc/openvpn/tcp.log
- verb 2
- script-security 2
- socket-flags TCP_NODELAY
- push "socket-flags TCP_NODELAY"
- push "dhcp-option DNS 1.0.0.1"
- push "dhcp-option DNS 1.1.1.1"
- push "dhcp-option DNS 8.8.4.4"
- push "dhcp-option DNS 8.8.8.8"
- myOpenVPNconf2
- cat <<'EOF7'> /etc/openvpn/ca.crt
- -----BEGIN CERTIFICATE-----
- MIIDszCCApsCFGFXyH7a/TIZZvJeOnvSq0AHHa25MA0GCSqGSIb3DQEBCwUAMIGV
- MQswCQYDVQQGEwJNWTERMA8GA1UECAwIU2VsYW5nb3IxDzANBgNVBAcMBkdvbWJh
- azEOMAwGA1UECgwFYWlkYW4xHDAaBgNVBAsME1Byb2R1Y3QgRGV2ZWxvcG1lbnQx
- FTATBgNVBAMMDHd3dy5haWRhbi5teTEdMBsGCSqGSIb3DQEJARYOaXJ3YW5AYWlk
- YW4ubXkwHhcNMjExMDAzMDAxNjE2WhcNMjMxMDAzMDAxNjE2WjCBlTELMAkGA1UE
- BhMCTVkxETAPBgNVBAgMCFNlbGFuZ29yMQ8wDQYDVQQHDAZHb21iYWsxDjAMBgNV
- BAoMBWFpZGFuMRwwGgYDVQQLDBNQcm9kdWN0IERldmVsb3BtZW50MRUwEwYDVQQD
- DAx3d3cuYWlkYW4ubXkxHTAbBgkqhkiG9w0BCQEWDmlyd2FuQGFpZGFuLm15MIIB
- IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwo9wsA/rKRiVawe1Rava+FcO
- m0/4Uz9H0kS78cyF4TQiU0xmNsi/zC0mBlSZMyej30DkXlFEH5CcaUb8DcjB9OyN
- bcKnC4Y1VBC17a/snZxwlex8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QQHDAZHb21iYWsxDjAMBgNV
- BAoMBWFpZGFuMRwwGgYDVQQLDBNQcm9kdWN0IERldmVsb3BtZW50MRUwEwYDVQQD
- DAx3d3cuYWlkYW4ubXkxHTAbBgkqhkiG9w0BCQEWDmlyd2FuQGFpZGFuLm15MIIB
- IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwo9wsA/rKRiVawe1Rava+FcO
- m0/4Uz9H0kS78cyF4TQiU0xmNsi/zC0mBlSZMyej30DkXlFEH5CcaUb8DcjB9OyN
- bcKnC4Y1VBC17a/snZxwlex8GfddlkOd3+nv1oAwWZKS5/LMszXGw9XtuGrNyyU+
- XnfhZIJ72Dg/v8DjdqqgrNeaBnh4oszpONxYX4wHRYU2qHJi0YvmpE+I/GWmzzCb
- hknC38Z50Eid4h7B70LkfBverGEXe7c4aGVkouZoY1wnGjcEhjiWohwe240y3OwH
- W9Dpqi0qxJx1TkwtHArrIWLybzozV1xf9AGD725oJ6l4mEbJtuSshwL8974ItwID
- AQABMA0GCSqGSIb3DQEBCwUAA4IBAQAtqpt6N5Jn/uPPRfhDyBuTNEjma3GPs7yJ
- xTTDv1ipRXEwHlIV1/qNrHtoZNLHj8T5+iLXVK/Pd4Gj5nKHEJC741ivV7P4SVGa
- RFgAWLXVYZCElGx9YyV2sFvb/Eg4YzuE9B4dEv5Jodc9A6dYi9D4Oq88tu3cCThR
- 7k1xoRlcM9A1yjAyUr8k54siYmPXSKVGMhvzPsZuHktFcrruD8SgcZ/TriBPfx/G
- tSabU2TGdgVyNWfnfa/ztbhFboINhU2OXh7Zp9FeVQaPhiMHkFzHkU+QgPAtiqso
- pslo1GqSLA9GOxvkdQY2oBcpFNsjOcGN+zJfvPGZ0jh5bTNcN40l
- -----END CERTIFICATE-----
- Certificate:
- Data:
- Version: 1 (0x0)
- Serial Number:
- 61:57:c8:7e:da:fd:32:19:66:f2:5e:3a:7b:d2:ab:40:07:1d:ad:b9
- Signature Algorithm: sha256WithRSAEncryption
- Issuer: C = MY, ST = Selangor, L = Gombak, O = aidan, OU = Product Development, CN = www.aidan.my, emailAddress = irwan@aidan.my
- Validity
- Not Before: Oct 3 00:16:16 2021 GMT
- Not After : Oct 3 00:16:16 2023 GMT
- Subject: C = MY, ST = Selangor, L = Gombak, O = aidan, OU = Product Development, CN = www.aidan.my, emailAddress = irwan@aidan.my
- Subject Public Key Info:
- Public Key Algorithm: rsaEncryption
- RSA Public-Key: (2048 bit)
- Modulus:
- 00:c2:8f:70:b0:0f:eb:29:18:95:6b:07:b5:45:ab:
- da:f8:57:0e:9b:4f:f8:53:3f:47:d2:44:bb:f1:cc:
- 85:e1:34:22:53:4c:66:36:c8:bf:cc:2d:26:06:54:
- 99:33:27:a3:df:40:e4:5e:51:44:1f:90:9c:69:46:
- fc:0d:c8:c1:f4:ec:8d:6d:c2:a7:0b:86:35:54:10:
- b5:ed:af:ec:9d:9c:70:95:ec:7c:19:f7:5d:96:43:
- 9d:df:e9:ef:d6:80:30:59:92:92:e7:f2:cc:b3:35:
- c6:c3:d5:ed:b8:6a:cd:cb:25:3e:5e:77:e1:64:82:
- 7b:d8:38:3f:bf:c0:e3:76:aa:a0:ac:d7:9a:06:78:
- 78:a2:cc:e9:38:dc:58:5f:8c:07:45:85:36:a8:72:
- 62:d1:8b:e6:a4:4f:88:fc:65:a6:cf:30:9b:86:49:
- c2:df:c6:79:d0:48:9d:e2:1e:c1:ef:42:e4:7c:1b:
- de:ac:61:17:7b:b7:38:68:65:64:a2:e6:68:63:5c:
- 27:1a:37:04:86:38:96:a2:1c:1e:db:8d:32:dc:ec:
- 07:5b:d0:e9:aa:2d:2a:c4:9c:75:4e:4c:2d:1c:0a:
- eb:21:62:f2:6f:3a:33:57:5c:5f:f4:01:83:ef:6e:
- 68:27:a9:78:98:46:c9:b6:e4:ac:87:02:fc:f7:be:
- 08:b7
- Exponent: 65537 (0x10001)
- Signature Algorithm: sha256WithRSAEncryption
- 2d:aa:9b:7a:37:92:67:fe:e3:cf:45:f8:43:c8:1b:93:34:48:
- e6:6b:71:8f:b3:bc:89:c5:34:c3:bf:58:a9:45:71:30:1e:52:
- 15:d7:fa:8d:ac:7b:68:64:d2:c7:8f:c4:f9:fa:22:d7:54:af:
- cf:77:81:a3:e6:72:87:10:90:bb:e3:58:af:57:b3:f8:49:51:
- 9a:44:58:00:58:b5:d5:61:90:84:94:6c:7d:63:25:76:b0:5b:
- db:fc:48:38:63:3b:84:f4:1e:1d:12:fe:49:a1:d7:3d:03:a7:
- 58:8b:d0:f8:3a:af:3c:b6:ed:dc:09:38:51:ee:4d:71:a1:19:
- 5c:33:d0:35:ca:30:32:52:bf:24:e7:8b:22:62:63:d7:48:a5:
- 46:32:1b:f3:3e:c6:6e:1e:4b:45:72:ba:ee:0f:c4:a0:71:9f:
- d3:ae:20:4f:7f:1f:c6:b5:26:9b:53:64:c6:76:05:72:35:67:
- e7:7d:af:f3:b5:b8:45:6e:82:0d:85:4d:8e:5e:1e:d9:a7:d1:
- 5e:55:06:8f:86:23:07:90:5c:c7:91:4f:90:80:f0:2d:8a:ab:
- 28:a6:c9:68:d4:6a:92:2c:0f:46:3b:1b:e4:75:06:36:a0:17:
- 29:14:db:23:39:c1:8d:fb:32:5f:bc:f1:99:d2:38:79:6d:33:
- 5c:37:8d:25
- SHA1 Fingerprint=89:DB:7A:29:92:B7:30:21:1B:D1:3F:C1:FF:41:91:F8:2C:BA:62:25
- -----BEGIN CERTIFICATE-----
- MIIDszCCApsCFGFXyH7a/TIZZvJeOnvSq0AHHa25MA0GCSqGSIb3DQEBCwUAMIGV
- MQswCQYDVQQGEwJNWTERMA8GA1UECAwIU2VsYW5nb3IxDzANBgNVBAcMBkdvbWJh
- azEOMAwGA1UECgwFYWlkYW4xHDAaBgNVBAsME1Byb2R1Y3QgRGV2ZWxvcG1lbnQx
- FTATBgNVBAMMDHd3dy5haWRhbi5teTEdMBsGCSqGSIb3DQEJARYOaXJ3YW5AYWlk
- YW4ubXkwHhcNMjExMDAzMDAxNjE2Wh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ZVLNbVc8BrGd3YdAUukIz+Hte0dFlS/TTGKlPKat7tmPExm/lXNTVdxmXwmhD
- UsPTbIOPGUMCgYEA09gpquGJ/QANr1o424+aBZq8QCkgxHSuQMG8WC2mDmj7U8gx
- W8rUKbU+G+SQhbZjIZvEbsqZ6oRKHRg9Xmwez8XIbs2mmoMyURSx99Z9CVFou84e
- 64+Qbesk3ptJnqlQnU2D8pjGHk/BZc1kfx2xs5IeMDP+pHvMf9IUBudAE4ECgYA8
- t//0CYQDzR3IoaNLiMbN6BP6HL0qeewsixrr5lKn1fRyY5nA6hl/I5BhTavF9Qqy
- 03oQT7FqXZ02cnuT+eTieBR/VAIiJzdvrg4a749x9Vw6MAKzZS14tlVdgBT4mhiK
- 6Ma16ECv39DstI9mYD3RF0TU4+pIf0C63S+Oe/ekNwKBgQCS15lZ3hO56wq1mvF2
- KE9WtjuJ0odReUu2BEkeyUI7vgRFrhahY57fchmgxszA8GzVQtaRElO5I1DBLfDQ
- wnxITvjSRsizBykQEom4G4nQ06VtRp+tyw9xHtg6AVTsjdGfbL2rOoKB5Y7moQjI
- Xow5b6i2ObHdZZ3TLNtYvktUxQ==
- -----END PRIVATE KEY-----
- EOF10
- # Getting all dns inside resolv.conf then use as Default DNS for our openvpn server
- #grep -v '#' /etc/resolv.conf | grep 'nameserver' | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | while read -r line; do
- #echo "push \"dhcp-option DNS $line\"" >> /etc/openvpn/server_tcp.conf
- #done
- #grep -v '#' /etc/resolv.conf | grep 'nameserver' | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | while read -r line; do
- #echo "push \"dhcp-option DNS $line\"" >> /etc/openvpn/server_udp.conf
- #done
- # setting openvpn server port
- sed -i "s|MyOvpnPort1|$OpenVPN_Port1|g" /etc/openvpn/server_tcp.conf
- sed -i "s|MyOvpnPort2|$OpenVPN_Port2|g" /etc/openvpn/server_udp.conf
-
- # Generating openvpn dh.pem file using openssl
- #openssl dhparam -out /etc/openvpn/dh.pem 1024
-
- # Getting some OpenVPN plugins for unix authentication
- wget -qO /etc/openvpn/b.zip 'https://raw.githubusercontent.com/Bonveio/BonvScripts/master/openvpn_plugin64'
- unzip -qq /etc/openvpn/b.zip -d /etc/openvpn
- rm -f /etc/openvpn/b.zip
-
- # Some workaround for OpenVZ machines for "Startup error" openvpn service
- if [[ "$(hostnamectl | grep -i Virtualization | awk '{print $2}' | head -n1)" == 'openvz' ]]; then
- sed -i 's|LimitNPROC|#LimitNPROC|g' /lib/systemd/system/openvpn*
- systemctl daemon-reload
- fi
- # Allow IPv4 Forwarding
- echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/20-openvpn.conf && sysctl --system &> /dev/null && echo 1 > /proc/sys/net/ipv4/ip_forward
- # Iptables Rule for OpenVPN server
- #PUBLIC_INET="$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)"
- #IPCIDR='10.200.0.0/16'
- #iptables -I FORWARD -s $IPCIDR -j ACCEPT
- #iptables -t nat -A POSTROUTING -o $PUBLIC_INET -j MASQUERADE
- #iptables -t nat -A POSTROUTING -s $IPCIDR -o $PUBLIC_INET -j MASQUERADE
-
- # Installing Firewalld
- apt install firewalld -y
- systemctl start firewalld
- systemctl enable firewalld
- firewall-cmd --quiet --set-default-zone=public
- firewall-cmd --quiet --zone=public --permanent --add-port=1-65534/tcp
- firewall-cmd --quiet --zone=public --permanent --add-port=1-65534/udp
- firewall-cmd --quiet --reload
- firewall-cmd --quiet --add-masquerade
- firewall-cmd --quiet --permanent --add-masquerade
- firewall-cmd --quiet --permanent --add-service=ssh
- firewall-cmd --quiet --permanent --add-service=openvpn
- firewall-cmd --quiet --permanent --add-service=http
- firewall-cmd --quiet --permanent --add-service=https
- firewall-cmd --quiet --permanent --add-service=privoxy
- firewall-cmd --quiet --permanent --add-service=squid
- firewall-cmd --quiet --reload
-
- # Enabling IPv4 Forwarding
- echo 1 > /proc/sys/net/ipv4/ip_forward
-
- # Starting OpenVPN server
- systemctl start openvpn@server_tcp
- systemctl start openvpn@server_udp
- systemctl enable openvpn@server_tcp
- systemctl enable openvpn@server_udp
- systemctl restart openvpn@server_tcp
- systemctl restart openvpn@server_udp
-
- # Pulling OpenVPN no internet fixer script
- #wget -qO /etc/openvpn/openvpn.bash "https://raw.githubusercontent.com/Bonveio/BonvScripts/master/openvpn.bash"
- #0chmod +x /etc/openvpn/openvpn.bash
- }
- function InsProxy(){
- # Removing Duplicate privoxy config
- rm -rf /etc/privoxy/config*
-
- # Creating Privoxy server config using cat eof tricks
- cat <<'myPrivoxy' > /etc/privoxy/config
- # My Privoxy Server Config
- user-manual /usr/share/doc/privoxy/user-manual
- confdir /etc/privoxy
- logdir /var/log/privoxy
- filterfile default.filter
- logfile logfile
- listen-address 0.0.0.0:Privoxy_Port1
- listen-address 0.0.0.0:Privoxy_Port2
- toggle 1
- enable-remote-toggle 0
- enable-remote-http-toggle 0
- enable-edit-actions 0
- enforce-blocks 0
- buffer-limit 4096
- enable-proxy-authentication-forwarding 1
- forwarded-connect-retries 1
- accept-intercepted-requests 1
- allow-cgi-request-crunching 1
- split-large-forms 0
- keep-alive-timeout 5
- tolerate-pipelining 1
- socket-timeout 300
- permit-access 0.0.0.0/0 IP-ADDRESS
- myPrivoxy
- # Setting machine's IP Address inside of our privoxy config(security that only allows this machine to use this proxy server)
- sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/privoxy/config
-
- # Setting privoxy ports
- sed -i "s|Privoxy_Port1|$Privoxy_Port1|g" /etc/privoxy/config
- sed -i "s|Privoxy_Port2|$Privoxy_Port2|g" /etc/privoxy/config
- # I'm setting Some Squid workarounds to prevent Privoxy's overflowing file descriptors that causing 50X error when clients trying to connect to your proxy server(thanks for this trick @homer_simpsons)
- apt remove --purge squid -y
- rm -rf /etc/squid/sq*
- apt install squid -y
-
- # Squid Ports (must be 1024 or higher)
- Proxy_Port1='8080'
- Proxy_Port2='8000'
- cat <<mySquid > /etc/squid/squid.conf
- acl VPN dst $(wget -4qO- http://ipinfo.io/ip)/32
- http_access allow VPN
- http_access deny all
- http_port 0.0.0.0:$Proxy_Port1
- http_port 0.0.0.0:$Proxy_Port2
- coredump_dir /var/spool/squid
- dns_nameservers 1.1.1.1 1.0.0.1
- 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 localhost
- mySquid
- sed -i "s|SquidCacheHelper|$Privoxy_Port1|g" /etc/squid/squid.conf
- # Starting Proxy server
- echo -e "Restarting proxy server.."
- systemctl restart privoxy
- systemctl restart squid
- }
- function OvpnConfigs(){
- # Creating nginx config for our ovpn config downloads webserver
- cat <<'myNginxC' > /etc/nginx/conf.d/bonveio-ovpn-config.conf
- # My OpenVPN Config Download Directory
- server {
- listen 0.0.0.0:myNginx;
- server_name localhost;
- root /var/www/openvpn;
- index index.html;
- }
- myNginxC
- # Setting our nginx config port for .ovpn download site
- sed -i "s|myNginx|$OvpnDownload_Port|g" /etc/nginx/conf.d/bonveio-ovpn-config.conf
- # Removing Default nginx page(port 80)
- rm -rf /etc/nginx/sites-*
- # Creating our root directory for all of our .ovpn configs
- rm -rf /var/www/openvpn
- mkdir -p /var/www/openvpn
- # Now creating all of our OpenVPN Configs
- cat <<EOF152> /var/www/openvpn/GTMConfig.ovpn
- # Credits to LODIxyruss
- client
- dev tun
- proto tcp
- remote $IPADDR $OpenVPN_Port1
- remote-cert-tls server
- resolv-retry infinite
- nobind
- tun-mtu 1500
- tun-mtu-extra 32
- mssfix 1450
- persist-key
- persist-tun
- auth-user-pass
- auth none
- auth-nocache
- cipher none
- keysize 0
- comp-lzo
- setenv CLIENT_CERT 0
- reneg-sec 0
- verb 1
- http-proxy $(curl -s http://ipinfo.io/ip || wget -q http://ipinfo.io/ip) $Proxy_Port2
- http-proxy-option CUSTOM-HEADER Host redirect.googlevideo.com
- http-proxy-option CUSTOM-HEADER X-Forwarded-For redirect.googlevideo.com
- <ca>
- $(cat /etc/openvpn/ca.crt)
- </ca>
- EOF152
- cat <<EOF16> /var/www/openvpn/SunConfig.ovpn
- # Credits to LODIxyruss
- client
- dev tun
- proto udp
- remote $IPADDR $OpenVPN_Port2
- remote-cert-tls server
- resolv-retry infinite
- nobind
- tun-mtu 1500
- tun-mtu-extra 32
- mssfix 1450
- persist-key
- persist-tun
- auth-user-pass
- auth none
- auth-nocache
- cipher none
- keysize 0
- comp-lzo
- setenv CLIENT_CERT 0
- reneg-sec 0
- verb 1
- <ca>
- $(cat /etc/openvpn/ca.crt)
- </ca>
- EOF16
- cat <<EOF160> /var/www/openvpn/GStories.ovpn
- # Credits to LODIxyruss
- client
- dev tun
- proto tcp
- remote $IPADDR $OpenVPN_Port1
- remote-cert-tls server
- resolv-retry infinite
- nobind
- tun-mtu 1500
- tun-mtu-extra 32
- mssfix 1450
- persist-key
- persist-tun
- auth-user-pass
- auth none
- auth-nocache
- cipher none
- keysize 0
- comp-lzo
- setenv CLIENT_CERT 0
- reneg-sec 0
- verb 1
- http-proxy $(curl -s http://ipinfo.io/ip || wget -q http://ipinfo.io/ip) $Proxy_Port2
- http-proxy-option CUSTOM-HEADER Host tweetdeck.twitter.com
- http-proxy-option CUSTOM-HEADER X-Forwarded-For tweetdeck.twitter.com
- <ca>
- $(cat /etc/openvpn/ca.crt)
- </ca>
- EOF160
- cat <<EOF17> /var/www/openvpn/SunNoloadConfig.ovpn
- # Credits to LODIxyruss
- client
- dev tun
- proto tcp-client
- remote $IPADDR $OpenVPN_Port1
- remote-cert-tls server
- bind
- float
- tun-mtu 1500
- tun-mtu-extra 32
- mssfix 1450
- mute-replay-warnings
- connect-retry-max 9999
- redirect-gateway def1
- connect-retry 0 1
- resolv-retry infinite
- setenv CLIENT_CERT 0
- persist-tun
- persist-key
- auth-user-pass
- auth none
- auth-nocache
- auth-retry interact
- cipher none
- keysize 0
- comp-lzo
- reneg-sec 0
- verb 0
- nice -20
- log /dev/null
- <ca>
- $(cat /etc/openvpn/ca.crt)
- </ca>
- EOF17
- # Creating OVPN download site index.html
- cat <<'mySiteOvpn' > /var/www/openvpn/index.html
- <!DOCTYPE html>
- <html lang="en">
- <!-- OVPN Download site by LODIxyruss -->
- <head><meta charset="utf-8" /><title>MyScriptName OVPN Config Download</title><meta name="description" content="MyScriptName Server" /><meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" /><meta name="theme-color" content="#000000" /><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"><link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"><link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.8.3/css/mdb.min.css" rel="stylesheet"></head><body><div class="container justify-content-center" style="margin-top:9em;margin-bottom:5em;"><div class="col-md"><div class="view"><img src="https://openvpn.net/wp-content/uploads/openvpn.jpg" class="card-img-top"><div class="mask rgba-white-slight"></div></div><div class="card"><div class="card-body"><h5 class="card-title">Config List</h5><br /><ul class="list-group"><li class="list-group-item justify-content-between align-items-center" style="margin-bottom:1em;"><p>For Globe/TM <span class="badge light-blue darken-4">Android/iOS</span><br /><small> For EZ/GS Promo with WNP freebies</small></p><a class="btn btn-outline-success waves-effect btn-sm" href="http://IP-ADDRESS:NGINXPORT/GTMConfig.ovpn" style="float:right;"><i class="fa fa-download"></i> Download</a></li><li class="list-group-item justify-content-between align-items-center" style="margin-bottom:1em;"><p>For Sun <span class="badge light-blue darken-4">Android/iOS/PC/Modem</span><br /><small> For TU/CTC UDP Promos</small></p><a class="btn btn-outline-success waves-effect btn-sm" href="http://IP-ADDRESS:NGINXPORT/SunConfig.ovpn" style="float:right;"><i class="fa fa-download"></i> Download</a></li><li class="list-group-item justify-content-between align-items-center" style="margin-bottom:1em;"><p>For Sun <span class="badge light-blue darken-4">Android/iOS/PC/MODEM</span><br /><small> TNT GIGASTORIES</small></p><a class="btn btn-outline-success waves-effect btn-sm" href="http://IP-ADDRESS:NGINXPORT/GStories.ovpn" style="float:right;"><i class="fa fa-download"></i> Download</a></li></ul></div></div></div></div></body></html>
- mySiteOvpn
-
- # Setting template's correct name,IP address and nginx Port
- sed -i "s|MyScriptName|$MyScriptName|g" /var/www/openvpn/index.html
- sed -i "s|NGINXPORT|$OvpnDownload_Port|g" /var/www/openvpn/index.html
- sed -i "s|IP-ADDRESS|$IPADDR|g" /var/www/openvpn/index.html
- # Restarting nginx service
- systemctl restart nginx
-
- # Creating all .ovpn config archives
- cd /var/www/openvpn
- zip -qq -r Configs.zip *.ovpn
- cd
- }
- function ip_address(){
- local IP="$( ip addr | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | egrep -v "^192\.168|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-2]\.|^10\.|^127\.|^255\.|^0\." | head -n 1 )"
- [ -z "${IP}" ] && IP="$( wget -qO- -t1 -T2 ipv4.icanhazip.com )"
- [ -z "${IP}" ] && IP="$( wget -qO- -t1 -T2 ipinfo.io/ip )"
- [ ! -z "${IP}" ] && echo "${IP}" || echo
- }
- IPADDR="$(ip_address)"
- function ConfStartup(){
- # Daily reboot time of our machine
- # For cron commands, visit https://crontab.guru
- echo -e "0 4\t* * *\troot\treboot" > /etc/cron.d/b_reboot_job
- # Creating directory for startup script
- rm -rf /etc/barts
- mkdir -p /etc/barts
- chmod -R 755 /etc/barts
-
- # Creating startup script using cat eof tricks
- cat <<'EOFSH' > /etc/barts/startup.sh
- #!/bin/bash
- # Setting server local time
- ln -fs /usr/share/zoneinfo/MyVPS_Time /etc/localtime
- # Prevent DOS-like UI when installing using APT (Disabling APT interactive dialog)
- export DEBIAN_FRONTEND=noninteractive
- # Allowing ALL TCP ports for our machine (Simple workaround for policy-based VPS)
- iptables -A INPUT -s $(wget -4qO- http://ipinfo.io/ip) -p tcp -m multiport --dport 1:65535 -j ACCEPT
- # Allowing OpenVPN to Forward traffic
- /bin/bash /etc/openvpn/openvpn.bash
- # Deleting Expired SSH Accounts
- /usr/local/sbin/delete_expired &> /dev/null
- EOFSH
- chmod +x /etc/barts/startup.sh
-
- # Setting server local time every time this machine reboots
- sed -i "s|MyVPS_Time|$MyVPS_Time|g" /etc/barts/startup.sh
- #
- rm -rf /etc/sysctl.d/99*
- # Setting our startup script to run every machine boots
- echo "[Unit]
- Description=Barts Startup Script
- Before=network-online.target
- Wants=network-online.target
- [Service]
- Type=oneshot
- ExecStart=/bin/bash /etc/barts/startup.sh
- RemainAfterExit=yes
- [Install]
- WantedBy=multi-user.target" > /etc/systemd/system/barts.service
- chmod +x /etc/systemd/system/barts.service
- systemctl daemon-reload
- systemctl start barts
- systemctl enable barts &> /dev/null
- # Rebooting cron service
- systemctl restart cron
- systemctl enable cron
-
- }
- function ConfMenu(){
- echo -e " Creating Menu scripts.."
- cd /usr/local/sbin/
- rm -rf {accounts,base-ports,base-ports-wc,base-script,bench-network,clearcache,connections,create,create_random,create_trial,delete_expired,diagnose,edit_dropbear,edit_openssh,edit_openvpn,edit_ports,edit_squid3,edit_stunnel4,locked_list,menu,options,ram,reboot_sys,reboot_sys_auto,restart_services,server,set_multilogin_autokill,set_multilogin_autokill_lib,show_ports,speedtest,user_delete,user_details,user_details_lib,user_extend,user_list,user_lock,user_unlock}
- wget -q 'https://raw.githubusercontent.com/Barts-23/menu1/master/menu.zip'
- unzip -qq menu.zip
- rm -f menu.zip
- chmod +x ./*
- dos2unix ./* &> /dev/null
- sed -i 's|/etc/squid/squid.conf|/etc/privoxy/config|g' ./*
- sed -i 's|http_port|listen-address|g' ./*
- cd ~
- echo 'clear' > /etc/profile.d/barts.sh
- echo 'echo '' > /var/log/syslog' >> /etc/profile.d/barts.sh
- echo 'screenfetch -p -A Android' >> /etc/profile.d/barts.sh
- chmod +x /etc/profile.d/barts.sh
- }
- function ScriptMessage(){
- echo -e " (。◕‿◕。) $MyScriptName Ubuntu VPS Installer"
- echo -e " Open release version"
- echo -e ""
- echo -e " Script created by Bonveio"
- echo -e " Edited by LODIxyruss"
- }
- #############################
- #############################
- ## Installation Process
- #############################
- ## WARNING: Do not modify or edit anything
- ## if you did'nt know what to do.
- ## This part is too sensitive.
- #############################
- #############################
- # First thing to do is check if this machine is Debian
- source /etc/os-release
- if [[ "$ID" != 'ubuntu' ]]; then
- ScriptMessage
- echo -e "[\e[1;31mError\e[0m] This script is for Ubuntu only, exting..."
- exit 1
- fi
- # Now check if our machine is in root user, if not, this script exits
- # If you're on sudo user, run `sudo su -` first before running this script
- if [[ $EUID -ne 0 ]];then
- ScriptMessage
- echo -e "[\e[1;31mError\e[0m] This script must be run as root, exiting..."
- exit 1
- fi
- # (For OpenVPN) Checking it this machine have TUN Module, this is the tunneling interface of OpenVPN server
- if [[ ! -e /dev/net/tun ]]; then
- echo -e "[\e[1;31m×\e[0m] You cant use this script without TUN Module installed/embedded in your machine, file a support ticket to your machine admin about this matter"
- echo -e "[\e[1;31m-\e[0m] Script is now exiting..."
- exit 1
- fi
- # Begin Installation by Updating and Upgrading machine and then Installing all our wanted packages/services to be install.
- ScriptMessage
- sleep 2
-
- # Configure OpenSSH and Dropbear
- echo -e "Configuring ssh..."
- InstSSH
-
- # Configure Stunnel
- echo -e "Configuring stunnel..."
- InsStunnel
-
- # Configure Webmin
- echo -e "Configuring webmin..."
- InstWebmin
-
- # Configure Privoxy and Squid
- echo -e "Configuring proxy..."
- InsProxy
-
- # Configure OpenVPN
- echo -e "Configuring OpenVPN..."
- InsOpenVPN
-
- # Configuring Nginx OVPN config download site
- OvpnConfigs
- # Some assistance and startup scripts
- ConfStartup
- # VPS Menu script v1.0
- ConfMenu
-
- # Setting server local time
- ln -fs /usr/share/zoneinfo/$MyVPS_Time /etc/localtime
-
- clear
- cd ~
- # Running sysinfo
- bash /etc/profile.d/barts.sh
-
- # Showing script's banner message
- ScriptMessage
-
- # Showing additional information from installating this script
- echo -e ""
- echo -e " Success Installation"
- echo -e ""
- echo -e " Service Ports: "
- echo -e " OpenSSH: $SSH_Port1, $SSH_Port2"
- echo -e " Stunnel: $Stunnel_Port1, $Stunnel_Port2"
- echo -e " DropbearSSH: $Dropbear_Port1, $Dropbear_Port2"
- echo -e " Privoxy: $Privoxy_Port1, $Privoxy_Port2"
- echo -e " Squid: $Proxy_Port1, $Proxy_Port2"
- echo -e " OpenVPN: $OpenVPN_Port1, $OpenVPN_Port2"
- echo -e " OpenVPN SSL: $Stunnel_Port3"
- echo -e " NGiNX: $OvpnDownload_Port"
- echo -e " Webmin: 10000"
- echo -e " L2tp IPSec Key: fakenetvpn101"
- echo -e ""
- echo -e ""
- echo -e " OpenVPN Configs Download site"
- echo -e " http://$IPADDR:$OvpnDownload_Port"
- echo -e ""
- echo -e " All OpenVPN Configs Archive"
- echo -e " http://$IPADDR:$OvpnDownload_Port/Configs.zip"
- echo -e ""
- echo -e ""
- echo -e " [Note] DO NOT RESELL THIS SCRIPT"
- # Clearing all logs from installation
- rm -rf /root/.bash_history && history -c && echo '' > /var/log/syslog
- rm -f Ubuntu-VPS-Installer*
- exit 1
|