123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- #auto installer SSH + Dropbear +Stunnel + SSLH Multi Port
- # initializing var
- export DEBIAN_FRONTEND=noninteractive
- OS=`uname -m`;
- MYIP=$(wget -qO- ipv4.icanhazip.com);
- MYIP2="s/xxxxxxxxx/$MYIP/g";
- # Delete Acount SSH Expired
- echo "================ Auto deleted Account Expired ======================"
- wget -O /usr/local/bin/userdelexpired "https://raw.githubusercontent.com/4hidessh/sshtunnel/master/userdelexpired" && chmod +x /usr/local/bin/userdelexpired
- #tambahan installer
- apt-get -y install gcc
- apt-get -y install make
- apt-get install cmake -y
- apt-get -y install git
- apt-get -y install wget
- apt-get install screen -y
- apt-get -y install unzip
- apt-get -y install curl
- apt-get -y install unrar
- apt-get -y install dnsutils net-tools tcpdump grepcidr
- apt-get install dsniff -y
- # nano /etc/rc.local
- cat > /etc/rc.local <<-END
- #!/bin/sh -e
- # rc.local
- # By default this script does nothing.
- exit 0
- END
- # Ubah izin akses
- chmod +x /etc/rc.local
- # enable rc local
- systemctl enable rc-local
- # detail nama perusahaan
- country=ID
- state=Semarang
- locality=JawaTengah
- organization=hidessh
- organizationalunit=HideSSH
- commonname=hidessh.com
- email=admin@hidessh.com
- cd
- # set time GMT +7 jakarta
- ln -fs /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
- # set locale SSH
- echo "================= Setting Port SSH ======================"
- cd
- sed -i 's/#Port 22/Port 22/g' /etc/ssh/sshd_config
- sed -i '/Port 22/a Port 80' /etc/ssh/sshd_config
- sed -i 's/AcceptEnv/#AcceptEnv/g' /etc/ssh/sshd_config
- /etc/init.d/ssh restart
- echo "================ install Dropbear ======================"
- echo "========================================================="
- # install dropbear
- apt-get -y install dropbear
- sed -i 's/NO_START=1/NO_START=0/g' /etc/default/dropbear
- sed -i 's/DROPBEAR_PORT=22/DROPBEAR_PORT=44/g' /etc/default/dropbear
- sed -i 's/DROPBEAR_EXTRA_ARGS=/DROPBEAR_EXTRA_ARGS="-p 77 "/g' /etc/default/dropbear
- echo "/bin/false" >> /etc/shells
- echo "/usr/sbin/nologin" >> /etc/shells
- /etc/init.d/ssh restart
- /etc/init.d/dropbear restart
- # install squid3
- echo "================ konfigurasi Squid3 ======================"
- cd
- apt-get -y install squid3
- wget -O /etc/squid/squid.conf "https://raw.githubusercontent.com/idtunnel/sshtunnel/master/debian9/squid3.conf"
- sed -i $MYIP2 /etc/squid/squid.conf;
- /etc/init.d/squid restart
- echo "================= install stunnel ====================="
- echo "========================================================="
- # install stunnel
- apt-get install stunnel4 -y
- cat > /etc/stunnel/stunnel.conf <<-END
- cert = /etc/stunnel/stunnel.pem
- client = no
- socket = a:SO_REUSEADDR=1
- socket = l:TCP_NODELAY=1
- socket = r:TCP_NODELAY=1
- [dropbear]
- accept = 222
- connect = 127.0.0.1:22
- [dropbear]
- accept = 444
- connect = 127.0.0.1:44
- [dropbear]
- accept = 777
- connect = 127.0.0.1:77
- END
- echo "================= membuat Sertifikat OpenSSL ======================"
- echo "========================================================="
- #membuat sertifikat
- openssl genrsa -out key.pem 2048
- openssl req -new -x509 -key key.pem -out cert.pem -days 1095 \
- -subj "/C=$country/ST=$state/L=$locality/O=$organization/OU=$organizationalunit/CN=$commonname/emailAddress=$email"
- cat key.pem cert.pem >> /etc/stunnel/stunnel.pem
- # konfigurasi stunnel
- sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
- /etc/init.d/stunnel4 restart
- #install Dns Server
- echo "================= DNS Server ======================"
- apt-get install resolvconf -y
- wget -O /etc/resolvconf/resolv.conf.d/head "https://raw.githubusercontent.com/4hidessh/sshtunnel/master/dns" && chmod +x /etc/resolvconf/resolv.conf.d/head
- #install sslh
- echo "================= Install Multi Port ======================"
- apt-get install sslh -y
- #konfigurasi
- wget -O /etc/default/sslh "https://raw.githubusercontent.com/idtunnel/sslh/master/sslh-conf"
- service sslh restart
- cd
- # common password debian
- wget -O /etc/pam.d/common-password "https://raw.githubusercontent.com/idtunnel/sshtunnel/master/debian9/common-password-deb9"
- chmod +x /etc/pam.d/common-password
- # Custom Banner SSH
- echo "================ Banner ======================"
- wget -O /etc/issue.net "https://github.com/idtunnel/sshtunnel/raw/master/debian9/banner-custom.conf"
- chmod +x /etc/issue.net
- echo "Banner /etc/issue.net" >> /etc/ssh/sshd_config
- echo "DROPBEAR_BANNER="/etc/issue.net"" >> /etc/default/dropbear
- # Instal DDOS Flate
- wget https://github.com/jgmdev/ddos-deflate/archive/master.zip -O ddos.zip
- unzip ddos.zip
- cd ddos-deflate-master
- ./install.sh
- echo "================= Auto Installer Disable badVPN V 3 ======================"
- # buat directory badvpn
- cd /usr/bin
- mkdir build
- cd build
- wget https://github.com/ambrop72/badvpn/archive/1.999.130.tar.gz
- tar xvzf 1.999.130.tar.gz
- cd badvpn-1.999.130
- cmake -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_TUN2SOCKS=1 -DBUILD_UDPGW=1
- make install
- make -i install
- cd
- # auto start badvpn single port
- sed -i '$ i\screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 100' /etc/rc.local
- screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 500 --max-connections-for-client 20
- cd
- # permition
- chmod +x /usr/local/bin/badvpn-udpgw
- chmod +x /usr/local/share/man/man7/badvpn.7
- chmod +x /usr/local/bin/badvpn-tun2socks
- chmod +x /usr/local/share/man/man8/badvpn-tun2socks.8
- chmod +x /usr/bin/build
- chmod +x /etc/rc.local
- # autoreboot 12 jam
- echo "================ Auto Reboot ======================"
- echo "0 0 * * * root /sbin/reboot" > /etc/cron.d/reboot
|