ohp.sh 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/bin/bash
  2. # Open Http Puncher
  3. # SL
  4. # ==========================================
  5. # Color
  6. RED='\033[0;31m'
  7. NC='\033[0m'
  8. GREEN='\033[0;32m'
  9. ORANGE='\033[0;33m'
  10. BLUE='\033[0;34m'
  11. PURPLE='\033[0;35m'
  12. CYAN='\033[0;36m'
  13. LIGHT='\033[0;37m'
  14. # ==========================================
  15. # Getting
  16. MYIP=$(wget -qO- ipinfo.io/ip);
  17. echo "Checking VPS"
  18. IZIN=$( curl ipinfo.io/ip | grep $MYIP )
  19. if [ $MYIP = $MYIP ]; then
  20. echo -e "${NC}${GREEN}Permission Accepted...${NC}"
  21. else
  22. echo -e "${NC}${RED}Permission Denied!${NC}";
  23. echo -e "${NC}${LIGHT}Fuck You!!"
  24. exit 0
  25. fi
  26. # Download File Ohp
  27. wget https://github.com/lfasmpao/open-http-puncher/releases/download/0.1/ohpserver-linux32.zip
  28. unzip ohpserver-linux32.zip
  29. chmod +x ohpserver
  30. cp ohpserver /usr/local/bin/ohpserver
  31. /bin/rm -rf ohpserver*
  32. # Installing Service
  33. # SSH OHP Port 8181
  34. cat > /etc/systemd/system/ssh-ohp.service << END
  35. [Unit]
  36. Description=SSH OHP Redirection Service
  37. Documentation=nekopoi.care
  38. After=network.target nss-lookup.target
  39. [Service]
  40. Type=simple
  41. User=root
  42. CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
  43. AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
  44. NoNewPrivileges=true
  45. ExecStart=/usr/local/bin/ohpserver -port 8181 -proxy 127.0.0.1:3128 -tunnel 127.0.0.1:22
  46. Restart=on-failure
  47. LimitNOFILE=infinity
  48. [Install]
  49. WantedBy=multi-user.target
  50. END
  51. # Dropbear OHP 8282
  52. cat > /etc/systemd/system/dropbear-ohp.service << END
  53. [Unit]]
  54. Description=Dropbear OHP Redirection Service
  55. Documentation=https://nekopoi.care
  56. After=network.target nss-lookup.target
  57. [Service]
  58. Type=simple
  59. User=root
  60. CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
  61. AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
  62. NoNewPrivileges=true
  63. ExecStart=/usr/local/bin/ohpserver -port 8282 -proxy 127.0.0.1:3128 -tunnel 127.0.0.1:109
  64. Restart=on-failure
  65. LimitNOFILE=infinity
  66. [Install]
  67. WantedBy=multi-user.target
  68. END
  69. # OpenVPN OHP 8383
  70. cat > /etc/systemd/system/openvpn-ohp.service << END
  71. [Unit]]
  72. Description=OpenVPN OHP Redirection Service
  73. Documentation=nekopoi.care
  74. After=network.target nss-lookup.target
  75. [Service]
  76. Type=simple
  77. User=root
  78. CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
  79. AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
  80. NoNewPrivileges=true
  81. ExecStart=/usr/local/bin/ohpserver -port 8383 -proxy 127.0.0.1:3128 -tunnel 127.0.0.1:1194
  82. Restart=on-failure
  83. LimitNOFILE=infinity
  84. [Install]
  85. WantedBy=multi-user.target
  86. END
  87. systemctl daemon-reload
  88. systemctl enable ssh-ohp
  89. systemctl restart ssh-ohp
  90. systemctl enable dropbear-ohp
  91. systemctl restart dropbear-ohp
  92. systemctl enable openvpn-ohp
  93. systemctl restart openvpn-ohp
  94. #------------------------------
  95. printf 'INSTALLATION COMPLETED !\n'
  96. sleep 0.5
  97. printf 'CHECKING LISTENING PORT\n'
  98. if [ -n "$(ss -tupln | grep ohpserver | grep -w 8181)" ]
  99. then
  100. echo 'SSH OHP Redirection Running'
  101. else
  102. echo 'SSH OHP Redirection Not Found, please check manually'
  103. fi
  104. sleep 0.5
  105. if [ -n "$(ss -tupln | grep ohpserver | grep -w 8282)" ]
  106. then
  107. echo 'Dropbear OHP Redirection Running'
  108. else
  109. echo 'Dropbear OHP Redirection Not Found, please check manually'
  110. fi
  111. sleep 0.5
  112. if [ -n "$(ss -tupln | grep ohpserver | grep -w 8383)" ]
  113. then
  114. echo 'OpenVPN OHP Redirection Running'
  115. else
  116. echo 'OpenVPN OHP Redirection Not Found, please check manually'
  117. fi
  118. sleep 0.5