Advertisement
Guest User

Huthos Artifact #1

a guest
Apr 12th, 2015
3,710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.46 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # initialisasi var
  4. export DEBIAN_FRONTEND=noninteractive
  5. OS=`uname -m`;
  6. MYIP=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0'`;
  7. MYIP2="s/xxxxxxxxx/$MYIP/g";
  8.  
  9. # go to root
  10. cd
  11.  
  12. # disable ipv6
  13. echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
  14. sed -i '$ i\echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6' /etc/rc.local
  15.  
  16. # install wget and curl
  17. apt-get update;apt-get -y install wget curl;
  18.  
  19. # set time GMT +7
  20. ln -fs /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
  21.  
  22. # set locale
  23. sed -i 's/AcceptEnv/#AcceptEnv/g' /etc/ssh/sshd_config
  24. service ssh restart
  25.  
  26. # set repo
  27. wget -O /etc/apt/sources.list "http://huthos.com/script/conf/sources.list.debian7"
  28. wget "http://www.dotdeb.org/dotdeb.gpg"
  29. cat dotdeb.gpg | apt-key add -;rm dotdeb.gpg
  30.  
  31. # remove unused
  32. apt-get -y --purge remove samba*;
  33. apt-get -y --purge remove apache2*;
  34. apt-get -y --purge remove sendmail*;
  35. apt-get -y --purge remove bind9*;
  36.  
  37. # update
  38. apt-get update; apt-get -y upgrade;
  39.  
  40. # install essential package
  41. apt-get -y install bmon iftop htop nmap axel nano iptables traceroute sysv-rc-conf dnsutils bc nethogs openvpn vnstat less screen psmisc apt-file whois sslh ptunnel ngrep mtr git zsh mrtg snmp snmpd snmp-mibs-downloader unzip unrar rsyslog debsums rkhunter
  42. apt-get -y install build-essential
  43.  
  44. # disable exim
  45. service exim4 stop
  46. sysv-rc-conf exim4 off
  47.  
  48. # update apt-file
  49. apt-file update
  50.  
  51. # install screenfetch
  52. cd
  53. wget https://github.com/KittyKatt/screenFetch/raw/master/screenfetch-dev
  54. mv screenfetch-dev /usr/bin/screenfetch
  55. chmod +x /usr/bin/screenfetch
  56. echo "clear" >> .bashrc
  57. echo "screenfetch" >> .bashrc
  58.  
  59. # install badvpn
  60. wget -O /usr/bin/badvpn-udpgw "http://huthos.com/script/conf/badvpn-udpgw"
  61. sed -i '$ i\screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300' /etc/rc.local
  62. chmod +x /usr/bin/badvpn-udpgw
  63. screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300
  64.  
  65. # setting port ssh
  66. sed -i '/Port 22/a Port 143' /etc/ssh/sshd_config
  67. sed -i 's/Port 22/Port  22/g' /etc/ssh/sshd_config
  68. service ssh restart
  69.  
  70. # install dropbear
  71. apt-get -y install dropbear
  72. sed -i 's/NO_START=1/NO_START=0/g' /etc/default/dropbear
  73. sed -i 's/DROPBEAR_PORT=22/DROPBEAR_PORT=443/g' /etc/default/dropbear
  74. sed -i 's/DROPBEAR_EXTRA_ARGS=/DROPBEAR_EXTRA_ARGS="-p 109 -p 110"/g' /etc/default/dropbear
  75. echo "/bin/false" >> /etc/shells
  76. service ssh restart
  77. service dropbear restart
  78.  
  79. # install fail2ban
  80. apt-get -y install fail2ban;service fail2ban restart
  81.  
  82. # install webmin
  83. cd
  84. wget "http://prdownloads.sourceforge.net/webadmin/webmin_1.680_all.deb"
  85. dpkg --install webmin_1.680_all.deb;
  86. apt-get -y -f install;
  87. rm /root/webmin_1.680_all.deb
  88. service webmin restart
  89. service vnstat restart
  90.  
  91. # downlaod script
  92. cd
  93. wget http://huthos.com/script/user-logindeb.sh
  94. chmod +x user-logindeb.sh
  95.  
  96. # finalisasi
  97. service ssh restart
  98. service dropbear restart
  99. service fail2ban restart
  100. service squid restart
  101. service webmin restart
  102.  
  103. # info
  104. cd
  105. clear
  106. echo "byth.com | @khejes | byth | 45eerds67"
  107. echo "==============================================="
  108. echo ""
  109. echo "Service"
  110. echo "-------"
  111. echo "OpenSSH  : 22, 143, 80"
  112. echo "Dropbear : 109, 110, 443"
  113. echo "badvpn   : badvpn-udpgw port 7300"
  114. echo "./user-logindeb.sh"
  115. echo "Webmin   : https://$MYIP:10000/"
  116. echo "Timezone : Asia/Jakarta"
  117. echo "Fail2Ban : [on]"
  118. echo "IPv6     : [off]"
  119. echo ""
  120. echo "REBOOT VPS!"
  121. echo ""
  122. echo "==============================================="
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement