iwantest 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848
  1. #!/bin/bash
  2. #########################################################
  3. ### Input your desire port and information...
  4. #########################################################
  5. MyScriptName='AidanVPN'
  6. # Stunnel Cert Info
  7. country='MY'
  8. state='Sel'
  9. locality='gombak'
  10. organization='aidan'
  11. organizationalunit='aidan'
  12. commonname='aidan'
  13. #Server Name for openvpn config and banner
  14. ServerName='Aidan-VPN'
  15. # OpenSSH Ports
  16. SSH_Port1='22'
  17. SSH_Port2='299'
  18. # Dropbear Ports
  19. Dropbear_Port1='790'
  20. Dropbear_Port2='2770'
  21. # Stunnel Ports
  22. Stunnel_Port1='446' # through Dropbear
  23. Stunnel_Port2='444' # through OpenSSH
  24. Stunnel_Port3='445' # through Openvpn
  25. # OpenVPN Ports
  26. OpenVPN_TCP_Port='1720'
  27. OpenVPN_UDP_Port='3900'
  28. # Privoxy Ports
  29. Privoxy_Port1='9880'
  30. Privoxy_Port2='3100'
  31. # Squid Ports
  32. Squid_Port1='3233'
  33. Squid_Port2='7003'
  34. Squid_Port3='9005'
  35. # Over-HTTP-Puncher
  36. OHP_Port1='5595'
  37. OHP_Port2='5596'
  38. OHP_Port3='5597'
  39. OHP_Port4='5598'
  40. OHP_Port5='5599'
  41. # Python Socks Proxy
  42. Simple_Port1='8033'
  43. Simple_Port2='22333'
  44. Direct_Port1='8044'
  45. Direct_Port2='22444'
  46. Open_Port1='8055'
  47. Open_Port2='22555'
  48. # WebServer Ports
  49. Php_Socket='9000'
  50. Fog_Openvpn_Monitoring='89'
  51. Tcp_Monitor_Port='450'
  52. Udp_Monitor_Port='451'
  53. Nginx_Port='85'
  54. # Server local time
  55. MyVPS_Time='Asia/Kuala_Lumpur'
  56. #########################################################
  57. ### Project Fog AutoScript Code Begins...
  58. #########################################################
  59. function InstUpdates(){
  60. export DEBIAN_FRONTEND=noninteractive
  61. apt-get update
  62. apt-get upgrade -y
  63. # Removing some firewall tools that may affect other services
  64. apt-get remove --purge ufw firewalld -y
  65. # Installing some important machine essentials
  66. apt-get install nano sudo wget curl zip unzip tar psmisc build-essential gzip iptables p7zip-full bc rc openssl cron net-tools dnsutils lsof dos2unix lrzsz git qrencode libcap2-bin dbus whois ngrep screen bzip2 ccrypt curl gcc automake autoconf libxml-parser-perl make libtool ruby -y
  67. # Now installing all our wanted services
  68. apt-get install dropbear stunnel4 squid privoxy ca-certificates nginx apt-transport-https lsb-release python python-pip python3-pip python-dev python-setuptools libssl-dev -y
  69. pip install shadowsocks
  70. pip3 install shadowsocks
  71. # Installing all required packages to install Webmin
  72. apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python dbus libxml-parser-perl shared-mime-info jq fail2ban -y
  73. # Installing a text colorizer and design
  74. gem install lolcat
  75. apt-get install figlet
  76. ###### Chokepoint for Debian and Ubuntu No. 1 vvvvvv
  77. # Installing all Web Panel Requirements
  78. sudo apt-get install lsb-release ca-certificates apt-transport-https software-properties-common -y
  79. sudo apt-get upgrade --fix-missing -y
  80. sudo apt-get install -y php8.0 -y
  81. sudo apt-get install php7.3-fpm -y
  82. sudo apt-get install php7.3-cli -y
  83. sudo apt-get install libssh2-1 -y
  84. sudo apt-get install php-ssh2 -y
  85. sudo apt-get install libgeoip-dev -y
  86. sudo apt-get install uwsgi -y
  87. sudo apt-get install geoipupdate -y
  88. sudo apt-get install uwsgi-plugin-python -y
  89. sudo apt-get install --reinstall python-virtualenv -y
  90. sudo apt-get install --reinstall geoip-database-extra -y
  91. sudo update-alternatives --set php /usr/bin/php7.3
  92. apt-get install php7.3-ssh2 php-ssh2-all-dev -y
  93. ###### Chokepoint for Debian and Ubuntu No.1 ^^^^^
  94. # Installing OpenVPN by pulling its repository inside sources.list file
  95. rm -rf /etc/apt/sources.list.d/openvpn*
  96. echo "deb http://build.openvpn.net/debian/openvpn/stable $(lsb_release -sc) main" > /etc/apt/sources.list.d/openvpn.list
  97. wget -qO - http://build.openvpn.net/debian/openvpn/stable/pubkey.gpg|apt-key add -
  98. apt-get update
  99. apt-get install openvpn -y
  100. # Certbot for Domain Self Sign Certification 2.3.4x
  101. sudo apt-get install certbot -y
  102. # Trying to remove obsolette packages after installation
  103. apt-get autoremove -y
  104. apt autoremove --fix-missing -y -f
  105. echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
  106. }
  107. function InstSSH(){
  108. # Removing some duplicated sshd server configs
  109. rm -f /etc/ssh/sshd_config
  110. sleep 1
  111. # Creating a SSH server config using cat eof tricks
  112. cat <<'MySSHConfig' > /etc/ssh/sshd_config
  113. # Project FOG OpenSSH Server config
  114. # -blackestsaint
  115. Port myPORT1
  116. Port myPORT2
  117. AddressFamily inet
  118. ListenAddress 0.0.0.0
  119. HostKey /etc/ssh/ssh_host_rsa_key
  120. HostKey /etc/ssh/ssh_host_ecdsa_key
  121. HostKey /etc/ssh/ssh_host_ed25519_key
  122. PermitRootLogin yes
  123. MaxSessions 1024
  124. PubkeyAuthentication yes
  125. PasswordAuthentication yes
  126. PermitEmptyPasswords no
  127. ChallengeResponseAuthentication no
  128. UsePAM yes
  129. X11Forwarding yes
  130. PrintMotd no
  131. ClientAliveInterval 300
  132. ClientAliveCountMax 2
  133. UseDNS no
  134. Banner /etc/zorro-luffy
  135. AcceptEnv LANG LC_*
  136. Subsystem sftp /usr/lib/openssh/sftp-server
  137. MySSHConfig
  138. sleep 2
  139. # Now we'll put our ssh ports inside of sshd_config
  140. sed -i "s|myPORT1|$SSH_Port1|g" /etc/ssh/sshd_config
  141. sed -i "s|myPORT2|$SSH_Port2|g" /etc/ssh/sshd_config
  142. # My workaround code to remove `BAD Password error` from passwd command, it will fix password-related error on their ssh accounts.
  143. sed -i '/password\s*requisite\s*pam_cracklib.s.*/d' /etc/pam.d/common-password
  144. sed -i 's/use_authtok //g' /etc/pam.d/common-password
  145. # 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.
  146. sed -i '/\/bin\/false/d' /etc/shells
  147. sed -i '/\/usr\/sbin\/nologin/d' /etc/shells
  148. echo '/bin/false' >> /etc/shells
  149. echo '/usr/sbin/nologin' >> /etc/shells
  150. # Restarting openssh service
  151. systemctl restart ssh
  152. # Removing some duplicate config file
  153. rm -rf /etc/default/dropbear*
  154. # creating dropbear config using cat eof tricks
  155. cat <<'MyDropbear' > /etc/default/dropbear
  156. # Project FOG Dropbear Config
  157. NO_START=0
  158. DROPBEAR_PORT=PORT01
  159. DROPBEAR_EXTRA_ARGS="-p PORT02"
  160. DROPBEAR_BANNER="/etc/zorro-luffy"
  161. DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key"
  162. DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key"
  163. DROPBEAR_ECDSAKEY="/etc/dropbear/dropbear_ecdsa_host_key"
  164. DROPBEAR_RECEIVE_WINDOW=65536
  165. MyDropbear
  166. # Now changing our desired dropbear ports
  167. sed -i "s|PORT01|$Dropbear_Port1|g" /etc/default/dropbear
  168. sed -i "s|PORT02|$Dropbear_Port2|g" /etc/default/dropbear
  169. # Restarting dropbear service
  170. systemctl restart dropbear
  171. }
  172. function InsStunnel(){
  173. StunnelDir=$(ls /etc/default | grep stunnel | head -n1)
  174. # Creating stunnel startup config using cat eof tricks
  175. cat <<'MyStunnelD' > /etc/default/$StunnelDir
  176. # Project FOG Stunnel Config
  177. ENABLED=1
  178. FILES="/etc/stunnel/*.conf"
  179. OPTIONS=""
  180. BANNER="/etc/zorro-luffy"
  181. PPP_RESTART=0
  182. # RLIMITS="-n 4096 -d unlimited"
  183. RLIMITS=""
  184. MyStunnelD
  185. # Removing all stunnel folder contents
  186. rm -rf /etc/stunnel/*
  187. # Creating stunnel certifcate using openssl
  188. openssl req -new -x509 -days 9999 -nodes -subj "/C=MY/ST=SEL/L=Gombak/O=$MyScriptName/OU=$MyScriptName/CN=$MyScriptName" -out /etc/stunnel/stunnel.pem -keyout /etc/stunnel/stunnel.pem
  189. # Creating stunnel server config
  190. cat <<'MyStunnelC' > /etc/stunnel/stunnel.conf
  191. # My Stunnel Config
  192. pid = /var/run/stunnel.pid
  193. cert = /etc/stunnel/stunnel.pem
  194. client = no
  195. socket = l:TCP_NODELAY=1
  196. socket = r:TCP_NODELAY=1
  197. TIMEOUTclose = 0
  198. [dropbear]
  199. accept = Stunnel_Port1
  200. connect = 127.0.0.1:dropbear_port_c
  201. [openssh]
  202. accept = Stunnel_Port2
  203. connect = 127.0.0.1:openssh_port_c
  204. [openvpn]
  205. accept = Stunnel_Port3
  206. connect = 127.0.0.1:openvpn_port_c
  207. MyStunnelC
  208. # setting stunnel ports
  209. sed -i "s|Stunnel_Port1|$Stunnel_Port1|g" /etc/stunnel/stunnel.conf
  210. sed -i "s|Stunnel_Port2|$Stunnel_Port2|g" /etc/stunnel/stunnel.conf
  211. sed -i "s|Stunnel_Port3|$Stunnel_Port3|g" /etc/stunnel/stunnel.conf
  212. sed -i "s|dropbear_port_c|$Dropbear_Port1|g" /etc/stunnel/stunnel.conf
  213. sed -i "s|openssh_port_c|$SSH_Port1|g" /etc/stunnel/stunnel.conf
  214. sed -i "s|openvpn_port_c|$OpenVPN_TCP_Port|g" /etc/stunnel/stunnel.conf
  215. # Restarting stunnel service
  216. systemctl restart $StunnelDir
  217. }
  218. function InsOHP(){
  219. cd
  220. wget https://github.com/korn-sudo/Project-Fog/raw/main/files/plugins/ohpserver
  221. chmod +x ohpserver
  222. sleep 3
  223. # Creating a SSH server config using cat eof tricks
  224. cat <<'MyOHPConfig' > /usr/local/sbin/ohp.sh
  225. #!/bin/bash
  226. # Credits to: ADM Manager,FordSenpai and Bon-Chan
  227. # ░▒▓█ Project Fog █▓▒░
  228. # Project Lead: blackestsaint
  229. screen -dm bash -c "./ohpserver -port OHP-Port1 -proxy IP-ADDRESS:Squid-Port1 -tunnel IP-ADDRESS:SSH-Port1"
  230. screen -dm bash -c "./ohpserver -port OHP-Port2 -proxy IP-ADDRESS:Squid-Port2 -tunnel IP-ADDRESS:SSH-Port2"
  231. screen -dm bash -c "./ohpserver -port OHP-Port3 -proxy IP-ADDRESS:Privoxy-Port1 -tunnel IP-ADDRESS:SSH-Port1"
  232. screen -dm bash -c "./ohpserver -port OHP-Port4 -proxy IP-ADDRESS:Privoxy-Port2 -tunnel IP-ADDRESS:SSH-Port2"
  233. screen -dm bash -c "./ohpserver -port OHP-Port5 -proxy IP-ADDRESS:OpenVPN-TCP-Port -tunnel IP-ADDRESS:SSH-Port1"
  234. MyOHPConfig
  235. # Now changing our desired ports for OHP
  236. sed -i "s|OHP-Port1|$OHP_Port1|g" /usr/local/sbin/ohp.sh
  237. sed -i "s|OHP-Port2|$OHP_Port2|g" /usr/local/sbin/ohp.sh
  238. sed -i "s|OHP-Port3|$OHP_Port3|g" /usr/local/sbin/ohp.sh
  239. sed -i "s|OHP-Port4|$OHP_Port4|g" /usr/local/sbin/ohp.sh
  240. sed -i "s|OHP-Port5|$OHP_Port5|g" /usr/local/sbin/ohp.sh
  241. sed -i "s|IP-ADDRESS|$IPADDR|g" /usr/local/sbin/ohp.sh
  242. sed -i "s|Squid-Port1|$Squid_Port1|g" /usr/local/sbin/ohp.sh
  243. sed -i "s|Squid-Port2|$Squid_Port2|g" /usr/local/sbin/ohp.sh
  244. sed -i "s|Privoxy-Port1|$Privoxy_Port1|g" /usr/local/sbin/ohp.sh
  245. sed -i "s|Privoxy-Port2|$Privoxy_Port2|g" /usr/local/sbin/ohp.sh
  246. sed -i "s|OpenVPN-TCP-Port|$OpenVPN_TCP_Port|g" /usr/local/sbin/ohp.sh
  247. sed -i "s|SSH-Port1|$SSH_Port1|g" /usr/local/sbin/ohp.sh
  248. sed -i "s|SSH-Port2|$SSH_Port2|g" /usr/local/sbin/ohp.sh
  249. chmod +x /usr/local/sbin/ohp.sh
  250. mkdir -p /etc/project-fog/ohp
  251. # For Activation of OHP after reboot
  252. echo "$OHP_Port1" > /etc/project-fog/ohp/ohp1
  253. echo "$OHP_Port2" > /etc/project-fog/ohp/ohp2
  254. echo "$OHP_Port3" > /etc/project-fog/ohp/ohp3
  255. echo "$OHP_Port4" > /etc/project-fog/ohp/ohp4
  256. echo "$OHP_Port5" > /etc/project-fog/ohp/ohp5
  257. # For Notification of status of OHP in menu
  258. echo "on" > /etc/project-fog/ohp/ohp1-status
  259. echo "on" > /etc/project-fog/ohp/ohp2-status
  260. echo "on" > /etc/project-fog/ohp/ohp3-status
  261. echo "on" > /etc/project-fog/ohp/ohp4-status
  262. echo "on" > /etc/project-fog/ohp/ohp5-status
  263. # OHP About
  264. mkdir -p /etc/korn
  265. cat <<'korn70' > /etc/korn/ohp-about
  266. Over-HTTP-Puncher
  267. 1.This is for advanced users only.
  268. 2. OHP enchance your HTTP Proxy software (squid/tinyproxy/privoxy)
  269. Example:
  270. Squid / Privoxy - some payload for promo needs back query,front and etc. to connect to internet ( status: 200 )
  271. Using OHP - any kind of request set-up, back or front query, etc.. will always responses 200 automatically. (using correct payload for a promo.) and connect to internet.
  272. Payload Set up:
  273. Payload for HTTP Injector,KTR same payload set-up
  274. Payload for OHP like SocksIP
  275. Software needed for OHP:
  276. Any http tunneling software.
  277. OHP is similar to Python Proxy.
  278. Explore and enjoy ^_^
  279. Credits to: lfasmpao
  280. korn70
  281. }
  282. function InsPython(){
  283. mkdir -p /etc/project-fog/py-socksproxy
  284. #For Notification in menu
  285. echo "$Simple_Port1" > /etc/project-fog/py-socksproxy/simple1-prox
  286. echo "on" > /etc/project-fog/py-socksproxy/simple1-status
  287. echo "$Simple_Port2" > /etc/project-fog/py-socksproxy/simple2-prox
  288. echo "on" > /etc/project-fog/py-socksproxy/simple2-status
  289. echo "$Direct_Port1" > /etc/project-fog/py-socksproxy/direct1-prox
  290. echo "on" > /etc/project-fog/py-socksproxy/direct1-status
  291. echo "$Direct_Port2" > /etc/project-fog/py-socksproxy/direct2-prox
  292. echo "on" > /etc/project-fog/py-socksproxy/direct2-status
  293. echo "$Open_Port1" > /etc/project-fog/py-socksproxy/open1-prox
  294. echo "on" > /etc/project-fog/py-socksproxy/open1-status
  295. echo "$Open_Port2" > /etc/project-fog/py-socksproxy/open2-prox
  296. echo "on" > /etc/project-fog/py-socksproxy/open2-status
  297. #For Activation after reboot
  298. echo "$Simple_Port1" > /etc/project-fog/py-socksproxy/simple1
  299. echo "$Simple_Port2" > /etc/project-fog/py-socksproxy/simple2
  300. echo "$Direct_Port1" > /etc/project-fog/py-socksproxy/direct1
  301. echo "$Direct_Port2" > /etc/project-fog/py-socksproxy/direct2
  302. echo "$Open_Port1" > /etc/project-fog/py-socksproxy/open1
  303. echo "$Open_Port2" > /etc/project-fog/py-socksproxy/open2
  304. # About Python Socks Proxy
  305. cat <<'PythonSP' > /etc/project-fog/py-socksproxy/about
  306. ░▒▓█ ☁️ Project Fog ☁️ █▓▒░
  307. What is a Socks Proxy?
  308. A SOCKS proxy is a proxy server at the TCP level. In other words,
  309. it acts as a tunnel, relaying all traffic going through it without
  310. modifying it. SOCKS proxies can be used to relay traffic using any
  311. network protocol that uses TCP.
  312. What is Python Socks Proxy?
  313. This Python module allows you to create TCP connections through
  314. a SOCKS proxy without any special effort.
  315. reference: google.com.my
  316. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  317. What is Simple Python Socks Proxy?
  318. Simple Socks Proxy acts or alternative for HTTP Proxy software
  319. like [ Squid, Privoxy, etc etc. . . ]
  320. Difference with other HTTP Proxy software like Squid, Privoxy?
  321. Squid, Privoxy : still need to configure
  322. Simple Socks Proxy : seamlessly installed
  323. reference: base on my experience | Please explore to know more . .
  324. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  325. What is Direct Python Socks Proxy?
  326. 1. Same function with OHP [Over-HTTP-Puncher]
  327. 2. Can act or alternative to Remote Proxy or SSH Port
  328. A. Difference with Squid or Privoxy?
  329. Squid, Privoxy : need right or proper Payload,
  330. in order to response Status: 200.
  331. Direct Socks Proxy :simple payload will do and response Status:200
  332. B. Payload Set Up?
  333. Squid, Privoxy : common set up
  334. Direct Socks Proxy : like SocksIP.
  335. 3. Difference between OHP and Direct Socks Proxy?
  336. OHP : upgrade your HTTP Proxy software
  337. [ simple payload will response Status: 200. ]
  338. its all in one.
  339. including Openvpn unlike Python Socks, needs other file for Openvpn.
  340. Direct Socks Proxy: can be use without any HTTP Proxy software
  341. and simple payload will response Status: 200.
  342. Need HTTP Proxy Software
  343. like Squid, Privoxy Need SSH Port Payload Set-up
  344. OHP : *Yes *Yes *like SocksIP
  345. Direct : *No *Yes *like SocksIP
  346. Socks Proxy
  347. reference: base on my experience | Please explore to know more . .
  348. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  349. What is Openvpn Python Socks Proxy?
  350. 1.Act or alternate for Remote Proxy exclusive for Openvpn TCP Protocol.
  351. [ simple payload will response Status: 200. ]
  352. 2. Payload Set-up?
  353. Basic or simple set-up can response Status: 200.
  354. 3. Same with OHP through Openvpn.
  355. reference: base on my experience | Please explore to know more . .
  356. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  357. Note: You can install many Python Socks Proxy but after restart,
  358. only last will save.
  359. Ex. Install 3 Simple Python Socks Proxy using Simple Socks Proxy Port 1
  360. Only last will be save after reboot.
  361. PythonSP
  362. }
  363. function InsShodowSocks(){
  364. # To prevent error in loading server of shadowsocks
  365. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python2.7/dist-packages/shadowsocks/crypto/openssl.py
  366. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.4/dist-packages/shadowsocks/crypto/openssl.py
  367. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.5/dist-packages/shadowsocks/crypto/openssl.py
  368. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.6/dist-packages/shadowsocks/crypto/openssl.py
  369. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.7/dist-packages/shadowsocks/crypto/openssl.py
  370. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.8/dist-packages/shadowsocks/crypto/openssl.py
  371. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.9/dist-packages/shadowsocks/crypto/openssl.py
  372. # Protection for scriptkiddies stealers
  373. mkdir -p /var/lib/mand-db
  374. echo "0" > /var/lib/mand-db/update0
  375. mkdir -p /etc/perl/net
  376. echo "17" > /etc/perl/net/dzip
  377. mkdir -p /usr/include/x86_64-linux-gnu/sys
  378. touch /usr/include/x86_64-linux-gnu/sys/zv.h
  379. # For SSR Menu Status
  380. mkdir -p /etc/project-fog/shadowsocksr
  381. echo "Not installed" > /etc/project-fog/shadowsocksr/server1-port
  382. echo " " > /etc/project-fog/shadowsocksr/server1-status
  383. echo "Not installed" > /etc/project-fog/shadowsocksr/server2-port
  384. echo " " > /etc/project-fog/shadowsocksr/server2-status
  385. echo "Not installed" > /etc/project-fog/shadowsocksr/server3-port
  386. echo " " > /etc/project-fog/shadowsocksr/server3-status
  387. cat <<'SSRabout' > /etc/project-fog/shadowsocksr/ssr-about
  388. ░▒▓█ ☁️ Project Fog ☁️ █▓▒░
  389. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  390. What is Shadowsocks?
  391. Shadowsocks is not a proxy on its own, but typically, the client
  392. software will help to connect to a third party socks5 proxy, speaking
  393. the shadowsocks language on the machine it is running on, which
  394. internet traffic can then be directed towards, similarly
  395. to a Secure tunnel(SSH tunnel).
  396. Unlike an SSH tunnel, shadowsocks can also proxy UDP traffic.
  397. How to use:
  398. 1. Download and install "Shadowsocks R" . Search in google for the link.
  399. 2. Copy the Config File [see Shadowsocks Menu for the Config File] in
  400. your Shadowsocks R apps.
  401. 3. Connect.
  402. End
  403. Tips:
  404. 1. Choose best payload and parameters for your server.
  405. You can use trial and error method.
  406. 2. You can easily stop, start and create SSR.
  407. 3. It always depends on your Network Provider, Register Promo,
  408. Payload and your set-up of SSR.
  409. For Pro Users:
  410. You can edit, add more server, etc. .
  411. Directory: /etc/project-fog/shadowsocksr
  412. Filename: Server*.json
  413. Credits to: clowwindy
  414. SSRabout
  415. }
  416. function InsOpenVPN(){
  417. #For notification and Restriction of being use by other services
  418. mkdir -p /etc/project-fog/openvpn
  419. #Restriction of being use by other services
  420. echo "$OpenVPN_UDP_Port" > /etc/project-fog/openvpn/udp-port
  421. # Checking if openvpn folder is accidentally deleted or purged
  422. if [[ ! -e /etc/openvpn ]]; then
  423. mkdir -p /etc/openvpn
  424. fi
  425. # Removing all existing openvpn server files
  426. rm -rf /etc/openvpn/*
  427. # Creating server.conf, ca.crt, server.crt and server.key
  428. cat <<'myOpenVPNconf' > /etc/openvpn/server_tcp.conf
  429. # OpenVPN TCP
  430. port OVPNTCP
  431. proto tcp
  432. dev tun
  433. sndbuf 0
  434. rcvbuf 0
  435. push "sndbuf 393216"
  436. push "rcvbuf 393216"
  437. ca /etc/openvpn/ca.crt
  438. cert /etc/openvpn/server.crt
  439. key /etc/openvpn/server.key
  440. dh /etc/openvpn/dh2048.pem
  441. verify-client-cert none
  442. username-as-common-name
  443. key-direction 0
  444. plugin /etc/openvpn/plugins/openvpn-plugin-auth-pam.so login
  445. server 10.200.0.0 255.255.0.0
  446. ifconfig-pool-persist ipp.txt
  447. push "route IP-ADDRESS 255.255.255.255 vpn_gateway"
  448. push "redirect-gateway def1 bypass-dhcp"
  449. push "dhcp-option DNS 1.1.1.1"
  450. push "dhcp-option DNS 1.0.0.1"
  451. push "route-method exe"
  452. push "route-delay 2"
  453. socket-flags TCP_NODELAY
  454. push "socket-flags TCP_NODELAY"
  455. keepalive 10 120
  456. comp-lzo
  457. user nobody
  458. group nogroup
  459. persist-key
  460. persist-tun
  461. status openvpn-status.log
  462. log tcp.log
  463. management 127.0.0.1 Tcp_Monitor_Port
  464. verb 3
  465. ncp-disable
  466. cipher none
  467. auth none
  468. duplicate-cn
  469. max-clients 50
  470. myOpenVPNconf
  471. cat <<'myOpenVPNconf2' > /etc/openvpn/server_udp.conf
  472. # OpenVPN UDP
  473. port OVPNUDP
  474. proto udp
  475. dev tun
  476. sndbuf 0
  477. rcvbuf 0
  478. push "sndbuf 393216"
  479. push "rcvbuf 393216"
  480. ca /etc/openvpn/ca.crt
  481. cert /etc/openvpn/server.crt
  482. key /etc/openvpn/server.key
  483. dh /etc/openvpn/dh2048.pem
  484. verify-client-cert none
  485. username-as-common-name
  486. key-direction 0
  487. plugin /etc/openvpn/plugins/openvpn-plugin-auth-pam.so login
  488. server 10.201.0.0 255.255.0.0
  489. ifconfig-pool-persist ipp.txt
  490. push "route IP-ADDRESS 255.255.255.255 vpn_gateway"
  491. push "redirect-gateway def1 bypass-dhcp"
  492. push "dhcp-option DNS 1.1.1.1"
  493. push "dhcp-option DNS 1.0.0.1"
  494. push "route-method exe"
  495. push "route-delay 2"
  496. socket-flags TCP_NODELAY
  497. push "socket-flags TCP_NODELAY"
  498. keepalive 10 120
  499. comp-lzo
  500. user nobody
  501. group nogroup
  502. persist-key
  503. persist-tun
  504. status openvpn-status.log
  505. log udp.log
  506. management 127.0.0.1 Udp_Monitor_Port
  507. verb 3
  508. ncp-disable
  509. cipher none
  510. auth none
  511. duplicate-cn
  512. max-clients 50
  513. myOpenVPNconf2
  514. cat <<'EOF7'> /etc/openvpn/ca.crt
  515. -----BEGIN CERTIFICATE-----
  516. MIIDqTCCAxKgAwIBAgIUBnJqBAnqOixnTtR+X8wEmXk9EDQwDQYJKoZIhvcNAQEL
  517. BQAwgYkxCzAJBgNVBAYTAm15MQwwCgYDVQQIDANzZWwxDzANBgNVBAcMBmdvbWJh
  518. azEOMAwGA1UECgwFYWlkYW4xFTATBgNVBAsMDHd3dy5haWRhbi5teTEVMBMGA1UE
  519. AwwMdnBuLmFpZGFuLm15MR0wGwYJKoZIhvcNAQkBFg5hZG1pbkBhaWRhbi5teTAe
  520. Fw0yMTEwMDcyMTE0NDdaFw00OTAyMjEyMTE0NDdaMIGJMQswCQYDVQQGEwJteTEM
  521. MAoGA1UECAwDc2VsMQ8wDQYDVQQHDAZnb21iYWsxDjAMBgNVBAoMBWFpZGFuMRUw
  522. EwYDVQQLDAx3d3cuYWlkYW4ubXkxFTATBgNVBAMMDHZwbi5haWRhbi5teTEdMBsG
  523. CSqGSIb3DQEJARYOYWRtaW5AYWlkYW4ubXkwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
  524. MIGJAoGBAJmt5wyo8p9tRHSDUNHHUqkt1H2livU3LT7PMzHFGsA3Uv4AchDnzep0
  525. Asl8Zv14kE3WUHCUn9TJKotNZrQcf0JIkdl9mlODMjIDt+Sgw7paal+E5kyztCw/
  526. tP3E9aBq84uJkUHNrx+s4pf4VmcG8jMvFBZ7u6QMz3H1hICRyjXjAgMBAAGjggEK
  527. MIIBBjAdBgNVHQ4EFgQUI9uCexq0CnJyzdDd/3EVIBBARQ0wgckGA1UdIwSBwTCB
  528. voAUI9uCexq0CnJyzdDd/3EVIBBARQ2hgY+kgYwwgYkxCzAJBgNVBAYTAm15MQww
  529. CgYDVQQIDANzZWwxDzANBgNVBAcMBmdvbWJhazEOMAwGA1UECgwFYWlkYW4xFTAT
  530. BgNVBAsMDHd3dy5haWRhbi5teTEVMBMGA1UEAwwMdnBuLmFpZGFuLm15MR0wGwYJ
  531. KoZIhvcNAQkBFg5hZG1pbkBhaWRhbi5teYIUBnJqBAnqOixnTtR+X8wEmXk9EDQw
  532. DAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQELBQADgYEADKe3
  533. qVstKktLiPaqapjkl3u9vhouVytAG/hn+udeyeDKVJLP8eni6nw8xVdiDwaKAZZW
  534. 9xTq2EcgQ5qA1UZdttCUSpYvrpsh1kRpCDb1wPM0vEULVs8kcMbV+7rF4vspCjLT
  535. 7VnTDziwIWuZR7z1Ykxt0qlc3Mw3b3m3UVztbRY=
  536. -----END CERTIFICATE-----
  537. EOF7
  538. cat <<'EOF9'> /etc/openvpn/server.crt
  539. Certificate:
  540. Data:
  541. Version: 3 (0x2)
  542. Serial Number:
  543. 0e:19:a0:34:ac:4c:44:ee:4e:e5:af:09:3e:6f:3a:d6
  544. Signature Algorithm: sha256WithRSAEncryption
  545. Issuer:
  546. countryName = my
  547. stateOrProvinceName = sel
  548. localityName = gombak
  549. organizationName = aidan
  550. organizationalUnitName = www.aidan.my
  551. commonName = vpn.aidan.my
  552. emailAddress = admin@aidan.my
  553. Validity
  554. Not Before: Oct 8 12:26:19 2021 GMT
  555. Not After : Jan 11 12:26:19 2024 GMT
  556. Subject:
  557. commonName = vpn.aidan.my
  558. X509v3 extensions:
  559. X509v3 Basic Constraints:
  560. CA:FALSE
  561. X509v3 Subject Key Identifier:
  562. E1:15:1A:9C:87:5A:B0:5F:EB:72:13:28:9F:1F:96:0C:D3:50:6F:1C
  563. X509v3 Authority Key Identifier:
  564. keyid:23:DB:82:7B:1A:B4:0A:72:72:CD:D0:DD:FF:71:15:20:10:40:45:0D
  565. DirName:/C=my/ST=sel/L=gombak/O=aidan/OU=www.aidan.my/CN=vpn.aidan.my/emailAddress=admin@aidan.my
  566. serial:06:72:6A:04:09:EA:3A:2C:67:4E:D4:7E:5F:CC:04:99:79:3D:10:34
  567. X509v3 Extended Key Usage:
  568. TLS Web Server Authentication
  569. X509v3 Key Usage:
  570. Digital Signature, Key Encipherment
  571. X509v3 Subject Alternative Name:
  572. DNS:vpn.aidan.my
  573. Signature Algorithm: sha256WithRSAEncryption
  574. 7b:bb:9d:d5:6e:fb:b3:c2:f8:ff:e3:de:a4:18:2c:64:39:50:
  575. 4e:a4:dd:85:36:d1:5a:67:7a:3e:17:0b:6d:69:fc:c7:c7:9b:
  576. 50:ed:13:20:43:64:e2:45:dc:02:1e:26:91:e9:f0:eb:89:eb:
  577. db:69:22:ef:a1:75:a2:ad:60:13:b1:a7:a5:6c:fa:02:c2:89:
  578. e8:72:f5:f2:5c:2f:78:25:70:5e:2e:c3:42:23:49:cf:68:0e:
  579. 0a:5a:5e:71:36:a6:64:db:e5:3d:fa:57:e5:cc:d9:b7:a1:41:
  580. df:70:05:d7:92:f7:35:52:e0:59:6d:02:82:64:4b:15:67:0e:
  581. 20:90
  582. -----BEGIN CERTIFICATE-----
  583. MIID4TCCA0qgAwIBAgIQDhmgNKxMRO5O5a8JPm861jANBgkqhkiG9w0BAQsFADCB
  584. iTELMAkGA1UEBhMCbXkxDDAKBgNVBAgMA3NlbDEPMA0GA1UEBwwGZ29tYmFrMQ4w
  585. DAYDVQQKDAVhaWRhbjEVMBMGA1UECwwMd3d3LmFpZGFuLm15MRUwEwYDVQQDDAx2
  586. cG4uYWlkYW4ubXkxHTAbBgkqhkiG9w0BCQEWDmFkbWluQGFpZGFuLm15MB4XDTIx
  587. MTAwODEyMjYxOVoXDTI0MDExMTEyMjYxOVowFzEVMBMGA1UEAwwMdnBuLmFpZGFu
  588. Lm15MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/AnQSYsLrklSCIrD
  589. wpfnShkVVAeKlcu6FCY6pq8aNe2jkdu86oAI1Vh18ef321I6m/260cny5q2BABvO
  590. g3wpsrAebuuIb/aP2s889N307zs0eOioyPJfklmkMYPgqXYRKSY1JHxpMpeHtifl
  591. ypUVFfTAyj5ikYJ5R+D3RVQb36P91ue29dwYY6CUIplRoMZZuIhFV53srVjlIBDH
  592. 2hL9H5iXiWHJNH0irnH8EKW9+IKJezWMtLit1LqWCgj0UfLgwDUHhpRUkecmZ9LQ
  593. hgA33jnIxIdoaq/njPyo/TyzhznNG6ECa4/zodR8to9Y7FYkHR63BBYmEXCd234Q
  594. VNIGOwIDAQABo4IBNTCCATEwCQYDVR0TBAIwADAdBgNVHQ4EFgQU4RUanIdasF/r
  595. chMonx+WDNNQbxwwgckGA1UdIwSBwTCBvoAUI9uCexq0CnJyzdDd/3EVIBBARQ2h
  596. gY+kgYwwgYkxCzAJBgNVBAYTAm15MQwwCgYDVQQIDANzZWwxDzANBgNVBAcMBmdv
  597. bWJhazEOMAwGA1UECgwFYWlkYW4xFTATBgNVBAsMDHd3dy5haWRhbi5teTEVMBMG
  598. A1UEAwwMdnBuLmFpZGFuLm15MR0wGwYJKoZIhvcNAQkBFg5hZG1pbkBhaWRhbi5t
  599. eYIUBnJqBAnqOixnTtR+X8wEmXk9EDQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCwYD
  600. VR0PBAQDAgWgMBcGA1UdEQQQMA6CDHZwbi5haWRhbi5teTANBgkqhkiG9w0BAQsF
  601. AAOBgQB7u53Vbvuzwvj/496kGCxkOVBOpN2FNtFaZ3o+FwttafzHx5tQ7RMgQ2Ti
  602. RdwCHiaR6fDrievbaSLvoXWirWATsaelbPoCwonocvXyXC94JXBeLsNCI0nPaA4K
  603. Wl5xNqZk2+U9+lflzNm3oUHfcAXXkvc1UuBZbQKCZEsVZw4gkA==
  604. -----END CERTIFICATE-----
  605. EOF9
  606. cat <<'EOF10'> /etc/openvpn/server.key
  607. -----BEGIN PRIVATE KEY-----
  608. MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC9i2bkRCrTukzc
  609. pXVcQ5ki3NNxZx6f4Ol7XSh2aiuYHD0z2jBJqzdggjdnSnk/h+V5dmqTLMrV2IqV
  610. JbLFgdhEShWY2f+p/npoyJ5DOHTOgjP0jfhq9l7tTLDuOXDL4PUq+ls9uVvWsGpC
  611. +1DEDoEq4rVbuaNUa3u7Za4oc1lLvLNpwd36YxN/v+nkN6g9yOIEKw70zwcsOEIR
  612. +JM2lpm0sIGLUuD8pJBGJwNwEnyVhqSAGFq6RE+vFiEqfApKAWBFDJab/TSTD8Qn
  613. 9zjP+WE/EZoY3bNAUQuPByIa4rVB0DpPBu91/JlmjTG2jp5vZawcegI62RLqQxCA
  614. bfSsHvcDAgMBAAECggEBALRK3yoNdTdEJExUzhde7VDt/+oEjmrBQxVm/U/1mVXs
  615. toKV7gyE4f3Ynt6PRlmZ6Drq2mD34FAc02UfILch1RbP6U8lPTzzpHf7LB8Amoq7
  616. 6rOaP0tu4ciShFF1LcegSVQCI7vIjoTd9ZWU+7Qhn9etIZkIMUXhnyYXh9tOLQgN
  617. 581Q84nvLzGniDnLd7Njfzs4VVnU/iBQ9k0lMF74PCNWe693XOTEDqiBzUhInv5l
  618. 3JbH+mjPiFs3qymJv3+zvWZcn5rq09O3kpmv7ALXlO7e2GAdouNHPpQwKWOUQKnP
  619. zOuySOElBR6y8ensdQA6htYj0nOFLbye4MBjqAZyekECgYEA7afTWNeSPrYwO1L9
  620. l9K1aV65v5SPLrrbQcu18QENdu7oW6FQgxZMgi72IZ98m117IvE4cVaGutRLM16s
  621. BQo+7QQfMMz0/qeuDX0xY3ts9296qNJS/I54po0etPiy82Iprhk46rsTD7kDP4DI
  622. VqOXV2NbGJNo2fCIba7GSLuR1BECgYEAzCzhz4MMQgdjTlW/V97QFCVAW0Sko54n
  623. cqkVrRMcfn38psXIykgk1t7OCTjHluzwaiOuQejBR+a5+7qo1KUjqpgnAX5VsRVt
  624. kGNSv/0vduapYmjfk9NWqo9WdAilCsZHH2kqbH/JAxiZS1Qx7aC4k+nW2ufbUZVV
  625. 4txppsGzXdMCgYEApTLn4vXWnukeFd7WkNbTa++Axv+JmD4jc1Ubn+/PYEEqG6fC
  626. w5yYilYCmdS3VXhhxCRRy9cNyIkRzR+eC9LXcwJOfCm8k9gTUSUZU8HUORuw8/Ff
  627. 5ldS3tNx6PKH0k8GEhNOUTzBP0ioTVhD6pXE+eYCyM6PMA/XhgbbpmtcL0ECgYEA
  628. zCToFqqp++8VHMLhkUMn+6yPX3IPx8SfHqbvFGDycYsYrcs+Cvr9UpXtngzWixIX
  629. A5jvZ9kIQBLyzD4DBrKjKbP99CFUHr4VEXQtzeahqZnRrKK9QTnjAqBUyanHEzHS
  630. 9RYao+dUnbLfuxDQ5w523vXErJV8lWLiP/Uv8drks58CgYBu1zfQ6u87ezgrFYfG
  631. lkMyDsKDfo7rDw/n87POzf4mXhBfH6SsdUxGQm+dhAPKsw5nlBzNyb/1qAr0/pCI
  632. RTEAOV616OGGDddmkkA1BkPvOR3J000TwTxkEJOKIvlss2dacHrmcKHdXd7sqzOI
  633. HTnch/a7v/QI8crkAJC1Ko62jA==
  634. -----END PRIVATE KEY-----
  635. EOF10
  636. cat <<'EOF13'> /etc/openvpn/dh2048.pem
  637. -----BEGIN DH PARAMETERS-----
  638. MIIBCAKCAQEAzC2KTpUqb7JqnThpVZ49nQ/vGU7+Fv2hCgBb+vmJK9D0Bn3+iwAL
  639. jlWOuohRU/wWPulruDVXEivK3s5hBE6umVQQsBjYOclMyVUW26Hl7F8iAqUeZd6j
  640. L6mb1rNAqcKI1s8J4Bqj2RxwwQ7MP1EzBIsIRD/fysgifRKi0D/qwC4ZTvPnef+h
  641. Nwm6cCjn6pjMgBDH8vjvA/gUyBWM92V0x38M/J6BmHqp/02sGCeLjZ7y64zid1QW
  642. wTxsx5M/cCZoezCXcuFIzHxbNjqWqCrt4HDd3P8aJpPqYhNV9XouZX2DfrzYnBXz
  643. EIzWaCi/0HjitKBuR9RhhU+mpXJwVU7xqwIBAg==
  644. -----END DH PARAMETERS-----
  645. EOF13
  646. # Creating a New update message in server.conf
  647. cat <<'NUovpn' > /etc/openvpn/server.conf
  648. # New Update are now released, OpenVPN Server
  649. # are now running both TCP and UDP Protocol. (Both are only running on IPv4)
  650. # But our native server.conf are now removed and divided
  651. # Into two different configs base on their Protocols:
  652. # * OpenVPN TCP (located at /etc/openvpn/server_tcp.conf
  653. # * OpenVPN UDP (located at /etc/openvpn/server_udp.conf
  654. #
  655. # Also other logging files like
  656. # status logs and server logs
  657. # are moved into new different file names:
  658. # * OpenVPN TCP Server logs (/etc/openvpn/tcp.log)
  659. # * OpenVPN UDP Server logs (/etc/openvpn/udp.log)
  660. # * OpenVPN TCP Status logs (/etc/openvpn/tcp_stats.log)
  661. # * OpenVPN UDP Status logs (/etc/openvpn/udp_stats.log)
  662. #
  663. # Server ports are configured base on env vars
  664. # executed/raised from this script (OpenVPN_TCP_Port/OpenVPN_UDP_Port)
  665. #
  666. NUovpn
  667. # setting openvpn server port
  668. sed -i "s|OVPNTCP|$OpenVPN_TCP_Port|g" /etc/openvpn/server_tcp.conf
  669. sed -i "s|OVPNUDP|$OpenVPN_UDP_Port|g" /etc/openvpn/server_udp.conf
  670. sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/openvpn/server_tcp.conf
  671. sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/openvpn/server_udp.conf
  672. sed -i "s|Tcp_Monitor_Port|$Tcp_Monitor_Port|g" /etc/openvpn/server_tcp.conf
  673. sed -i "s|Udp_Monitor_Port|$Udp_Monitor_Port|g" /etc/openvpn/server_udp.conf
  674. # Getting some OpenVPN plugins for unix authentication
  675. cd
  676. wget https://github.com/korn-sudo/Project-Fog/raw/main/files/plugins/plugin.tgz
  677. tar -xzvf /root/plugin.tgz -C /etc/openvpn/
  678. rm -f plugin.tgz
  679. # Some workaround for OpenVZ machines for "Startup error" openvpn service
  680. if [[ "$(hostnamectl | grep -i Virtualization | awk '{print $2}' | head -n1)" == 'openvz' ]]; then
  681. sed -i 's|LimitNPROC|#LimitNPROC|g' /lib/systemd/system/openvpn*
  682. systemctl daemon-reload
  683. fi
  684. # Allow IPv4 Forwarding
  685. sed -i '/net.ipv4.ip_forward.*/d' /etc/sysctl.conf
  686. sed -i '/net.ipv4.ip_forward.*/d' /etc/sysctl.d/*.conf
  687. echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/20-openvpn.conf
  688. sysctl --system &> /dev/null
  689. # Iptables Rule for OpenVPN server
  690. cat <<'EOFipt' > /etc/openvpn/openvpn.bash
  691. #!/bin/bash
  692. PUBLIC_INET="$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)"
  693. IPCIDR='10.200.0.0/16'
  694. IPCIDR2='10.201.0.0/16'
  695. iptables -I FORWARD -s $IPCIDR -j ACCEPT
  696. iptables -I FORWARD -s $IPCIDR2 -j ACCEPT
  697. iptables -t nat -A POSTROUTING -o $PUBLIC_INET -j MASQUERADE
  698. iptables -t nat -A POSTROUTING -s $IPCIDR -o $PUBLIC_INET -j MASQUERADE
  699. iptables -t nat -A POSTROUTING -s $IPCIDR2 -o $PUBLIC_INET -j MASQUERADE
  700. EOFipt
  701. chmod +x /etc/openvpn/openvpn.bash
  702. bash /etc/openvpn/openvpn.bash
  703. # Enabling IPv4 Forwarding
  704. echo 1 > /proc/sys/net/ipv4/ip_forward
  705. # Starting OpenVPN server
  706. systemctl start openvpn@server_tcp
  707. systemctl enable openvpn@server_tcp
  708. systemctl start openvpn@server_udp
  709. systemctl enable openvpn@server_udp
  710. }
  711. function InsProxy(){
  712. # Removing Duplicate privoxy config
  713. rm -rf /etc/privoxy/config*
  714. # Creating Privoxy server config using cat eof tricks
  715. cat <<'privoxy' > /etc/privoxy/config
  716. # My Privoxy Server Config
  717. user-manual /usr/share/doc/privoxy/user-manual
  718. confdir /etc/privoxy
  719. logdir /var/log/privoxy
  720. filterfile default.filter
  721. logfile logfile
  722. listen-address 0.0.0.0:Privoxy_Port1
  723. listen-address 0.0.0.0:Privoxy_Port2
  724. toggle 1
  725. enable-remote-toggle 0
  726. enable-remote-http-toggle 0
  727. enable-edit-actions 0
  728. enforce-blocks 0
  729. buffer-limit 4096
  730. enable-proxy-authentication-forwarding 1
  731. forwarded-connect-retries 1
  732. accept-intercepted-requests 1
  733. allow-cgi-request-crunching 1
  734. split-large-forms 0
  735. keep-alive-timeout 5
  736. tolerate-pipelining 1
  737. socket-timeout 300
  738. permit-access 0.0.0.0/0 IP-ADDRESS
  739. privoxy
  740. # Setting machine's IP Address inside of our privoxy config(security that only allows this machine to use this proxy server)
  741. sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/privoxy/config
  742. # Setting privoxy ports
  743. sed -i "s|Privoxy_Port1|$Privoxy_Port1|g" /etc/privoxy/config
  744. sed -i "s|Privoxy_Port2|$Privoxy_Port2|g" /etc/privoxy/config
  745. # Starting Proxy server
  746. echo -e "Restarting Privoxy Proxy server..."
  747. systemctl restart privoxy
  748. # Removing Duplicate Squid config
  749. rm -rf /etc/squid/squid.con*
  750. # Creating Squid server config using cat eof tricks
  751. cat <<'mySquid' > /etc/squid/squid.conf
  752. # My Squid Proxy Server Config
  753. acl VPN dst IP-ADDRESS/32
  754. http_access allow VPN
  755. http_access deny all
  756. http_port 0.0.0.0:Squid_Port1
  757. http_port 0.0.0.0:Squid_Port2
  758. http_port 0.0.0.0:Squid_Port3
  759. ### Allow Headers
  760. request_header_access Allow allow all
  761. request_header_access Authorization allow all
  762. request_header_access WWW-Authenticate allow all
  763. request_header_access Proxy-Authorization allow all
  764. request_header_access Proxy-Authenticate allow all
  765. request_header_access Cache-Control allow all
  766. request_header_access Content-Encoding allow all
  767. request_header_access Content-Length allow all
  768. request_header_access Content-Type allow all
  769. request_header_access Date allow all
  770. request_header_access Expires allow all
  771. request_header_access Host allow all
  772. request_header_access If-Modified-Since allow all
  773. request_header_access Last-Modified allow all
  774. request_header_access Location allow all
  775. request_header_access Pragma allow all
  776. request_header_access Accept allow all
  777. request_header_access Accept-Charset allow all
  778. request_header_access Accept-Encoding allow all
  779. request_header_access Accept-Language allow all
  780. request_header_access Content-Language allow all
  781. request_header_access Mime-Version allow all
  782. request_header_access Retry-After allow all
  783. request_header_access Title allow all
  784. request_header_access Connection allow all
  785. request_header_access Proxy-Connection allow all
  786. request_header_access User-Agent allow all
  787. request_header_access Cookie allow all
  788. request_header_access All deny all
  789. ### HTTP Anonymizer Paranoid
  790. reply_header_access Allow allow all
  791. reply_header_access Authorization allow all
  792. reply_header_access WWW-Authenticate allow all
  793. reply_header_access Proxy-Authorization allow all
  794. reply_header_access Proxy-Authenticate allow all
  795. reply_header_access Cache-Control allow all
  796. reply_header_access Content-Encoding allow all
  797. reply_header_access Content-Length allow all
  798. reply_header_access Content-Type allow all
  799. reply_header_access Date allow all
  800. reply_header_access Expires allow all
  801. reply_header_access Host allow all
  802. reply_header_access If-Modified-Since allow all
  803. reply_header_access Last-Modified allow all
  804. reply_header_access Location allow all
  805. reply_header_access Pragma allow all
  806. reply_header_access Accept allow all
  807. reply_header_access Accept-Charset allow all
  808. reply_header_access Accept-Encoding allow all
  809. reply_header_access Accept-Language allow all
  810. reply_header_access Content-Language allow all
  811. reply_header_access Mime-Version allow all
  812. reply_header_access Retry-After allow all
  813. reply_header_access Title allow all
  814. reply_header_access Connection allow all
  815. reply_header_access Proxy-Connection allow all
  816. reply_header_access User-Agent allow all
  817. reply_header_access Cookie allow all
  818. reply_header_access All deny all
  819. #Korn
  820. cache_mem 200 MB
  821. maximum_object_size_in_memory 32 KB
  822. maximum_object_size 1024 MB
  823. minimum_object_size 0 KB
  824. cache_swap_low 90
  825. cache_swap_high 95
  826. cache_dir ufs /var/spool/squid 100 16 256
  827. access_log /var/log/squid/access.log squid
  828. ### CoreDump
  829. coredump_dir /var/spool/squid
  830. dns_nameservers 1.1.1.1 1.0.0.1
  831. refresh_pattern ^ftp: 1440 20% 10080
  832. refresh_pattern ^gopher: 1440 0% 1440
  833. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
  834. refresh_pattern . 0 20% 4320
  835. visible_hostname blackestsaint
  836. mySquid
  837. # Setting machine's IP Address inside of our Squid config(security that only allows this machine to use this proxy server)
  838. sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/squid/squid.conf
  839. # Setting squid ports
  840. sed -i "s|Squid_Port1|$Squid_Port1|g" /etc/squid/squid.conf
  841. sed -i "s|Squid_Port2|$Squid_Port2|g" /etc/squid/squid.conf
  842. sed -i "s|Squid_Port3|$Squid_Port3|g" /etc/squid/squid.conf
  843. # Starting Proxy server
  844. echo -e "Restarting Squid Proxy server..."
  845. systemctl restart squid
  846. }
  847. function FogPanel(){
  848. rm /home/vps/public_html -rf
  849. rm /etc/nginx/sites-* -rf
  850. rm /etc/nginx/nginx.conf -rf
  851. sleep 1
  852. mkdir -p /home/vps/public_html
  853. # Creating nginx config for our webserver
  854. cat <<'myNginxC' > /etc/nginx/nginx.conf
  855. user www-data;
  856. worker_processes 1;
  857. pid /var/run/nginx.pid;
  858. events {
  859. multi_accept on;
  860. worker_connections 1024;
  861. }
  862. http {
  863. gzip on;
  864. gzip_vary on;
  865. gzip_comp_level 5;
  866. gzip_types text/plain application/x-javascript text/xml text/css;
  867. autoindex on;
  868. sendfile on;
  869. tcp_nopush on;
  870. tcp_nodelay on;
  871. keepalive_timeout 65;
  872. types_hash_max_size 2048;
  873. server_tokens off;
  874. include /etc/nginx/mime.types;
  875. default_type application/octet-stream;
  876. access_log /var/log/nginx/access.log;
  877. error_log /var/log/nginx/error.log;
  878. client_max_body_size 32M;
  879. client_header_buffer_size 8m;
  880. large_client_header_buffers 8 8m;
  881. fastcgi_buffer_size 8m;
  882. fastcgi_buffers 8 8m;
  883. fastcgi_read_timeout 600;
  884. include /etc/nginx/conf.d/*.conf;
  885. }
  886. myNginxC
  887. # Creating vps config for our OCS Panel
  888. cat <<'myvpsC' > /etc/nginx/conf.d/vps.conf
  889. server {
  890. listen Nginx_Port;
  891. server_name 127.0.0.1 localhost;
  892. access_log /var/log/nginx/vps-access.log;
  893. error_log /var/log/nginx/vps-error.log error;
  894. root /home/vps/public_html;
  895. location / {
  896. index index.html index.htm index.php;
  897. try_files $uri $uri/ /index.php?$args;
  898. }
  899. location ~ \.php$ {
  900. include /etc/nginx/fastcgi_params;
  901. fastcgi_pass 127.0.0.1:Php_Socket;
  902. fastcgi_index index.php;
  903. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  904. }
  905. }
  906. myvpsC
  907. # Creating monitoring config for our OpenVPN Monitoring Panel
  908. cat <<'myMonitoringC' > /etc/nginx/conf.d/monitoring.conf
  909. server {
  910. listen Fog_Openvpn_Monitoring;
  911. location / {
  912. uwsgi_pass unix:///run/uwsgi/app/openvpn-monitor/socket;
  913. include uwsgi_params;
  914. }
  915. }
  916. myMonitoringC
  917. #this is the home page of our webserver
  918. wget -O /home/vps/public_html/index.php "https://raw.githubusercontent.com/korn-sudo/Project-Fog/main/files/panel/index.php"
  919. # Setting up our WebServer Ports and IP Addresses
  920. cd
  921. sleep 1
  922. sed -i "s|/run/php/php7.3-fpm.sock|127.0.0.1:$Php_Socket|g" /etc/php/7.3/fpm/pool.d/www.conf
  923. sed -i "s|Php_Socket|$Php_Socket|g" /etc/nginx/conf.d/vps.conf
  924. sed -i "s|Nginx_Port|$Nginx_Port|g" /etc/nginx/conf.d/vps.conf
  925. sed -i "s|Fog_Openvpn_Monitoring|$Fog_Openvpn_Monitoring|g" /etc/nginx/conf.d/monitoring.conf
  926. sed -i "s|Fog_Openvpn_Monitoring|$Fog_Openvpn_Monitoring|g" /home/vps/public_html/index.php
  927. sed -i "s|fogserverip|$IPADDR|g" /home/vps/public_html/index.php
  928. sed -i "s|v2portas|65432|g" /home/vps/public_html/index.php
  929. sed -i "s|SSH_Port1|$SSH_Port1|g" /home/vps/public_html/index.php
  930. sed -i "s|SSH_Port2|$SSH_Port2|g" /home/vps/public_html/index.php
  931. sed -i "s|Dropbear_Port1|$Dropbear_Port1|g" /home/vps/public_html/index.php
  932. sed -i "s|Dropbear_Port2|$Dropbear_Port2|g" /home/vps/public_html/index.php
  933. sed -i "s|Stunnel_Port1|$Stunnel_Port1|g" /home/vps/public_html/index.php
  934. sed -i "s|Stunnel_Port2|$Stunnel_Port2|g" /home/vps/public_html/index.php
  935. sed -i "s|Stunnel_Port3|$Stunnel_Port3|g" /home/vps/public_html/index.php
  936. sed -i "s|Privoxy_Port1|$Privoxy_Port1|g" /home/vps/public_html/index.php
  937. sed -i "s|Privoxy_Port2|$Privoxy_Port1|g" /home/vps/public_html/index.php
  938. sed -i "s|Squid_Port1|$Squid_Port1|g" /home/vps/public_html/index.php
  939. sed -i "s|Squid_Port2|$Squid_Port2|g" /home/vps/public_html/index.php
  940. sed -i "s|Squid_Port3|$Squid_Port3|g" /home/vps/public_html/index.php
  941. sed -i "s|OHP_Port1|$OHP_Port1|g" /home/vps/public_html/index.php
  942. sed -i "s|OHP_Port2|$OHP_Port2|g" /home/vps/public_html/index.php
  943. sed -i "s|OHP_Port3|$OHP_Port3|g" /home/vps/public_html/index.php
  944. sed -i "s|OHP_Port4|$OHP_Port4|g" /home/vps/public_html/index.php
  945. sed -i "s|OHP_Port5|$OHP_Port5|g" /home/vps/public_html/index.php
  946. sed -i "s|Simple_Port1|$Simple_Port1|g" /home/vps/public_html/index.php
  947. sed -i "s|Simple_Port2|$Simple_Port2|g" /home/vps/public_html/index.php
  948. sed -i "s|Direct_Port1|$Direct_Port1|g" /home/vps/public_html/index.php
  949. sed -i "s|Direct_Port2|$Direct_Port2|g" /home/vps/public_html/index.php
  950. sed -i "s|Open_Port1|$Open_Port1|g" /home/vps/public_html/index.php
  951. sed -i "s|Open_Port2|$Open_Port2|g" /home/vps/public_html/index.php
  952. sed -i "s|NXPort|$Nginx_Port|g" /home/vps/public_html/index.php
  953. service nginx restart
  954. # Setting Up OpenVPN monitoring
  955. wget -O /srv/openvpn-monitor.zip "https://github.com/korn-sudo/Project-Fog/raw/main/files/panel/openvpn-monitor.zip"
  956. cd /srv
  957. unzip -qq openvpn-monitor.zip
  958. rm -f openvpn-monitor.zip
  959. cd openvpn-monitor
  960. virtualenv .
  961. . bin/activate
  962. pip install -r requirements.txt
  963. #updating ports for openvpn monitoring
  964. sed -i "s|Tcp_Monitor_Port|$Tcp_Monitor_Port|g" /srv/openvpn-monitor/openvpn-monitor.conf
  965. sed -i "s|Udp_Monitor_Port|$Udp_Monitor_Port|g" /srv/openvpn-monitor/openvpn-monitor.conf
  966. # Creating monitoring .ini for our OpenVPN Monitoring Panel
  967. cat <<'myMonitorINI' > /etc/uwsgi/apps-available/openvpn-monitor.ini
  968. [uwsgi]
  969. base = /srv
  970. project = openvpn-monitor
  971. logto = /var/log/uwsgi/app/%(project).log
  972. plugins = python
  973. chdir = %(base)/%(project)
  974. virtualenv = %(chdir)
  975. module = openvpn-monitor:application
  976. manage-script-name = true
  977. mount=/openvpn-monitor=openvpn-monitor.py
  978. myMonitorINI
  979. ln -s /etc/uwsgi/apps-available/openvpn-monitor.ini /etc/uwsgi/apps-enabled/
  980. # GeoIP For OpenVPN Monitor
  981. mkdir -p /var/lib/GeoIP
  982. wget -O /var/lib/GeoIP/GeoLite2-City.mmdb.gz "https://github.com/korn-sudo/Project-Fog/raw/main/files/panel/GeoLite2-City.mmdb.gz"
  983. gzip -d /var/lib/GeoIP/GeoLite2-City.mmdb.gz
  984. # Now creating all of our OpenVPN Configs
  985. # Smart Giga Games Promo TCP
  986. cat <<Config1> /home/vps/public_html/Smart.Giga.Games.ovpn
  987. # Created by blackestsaint
  988. client
  989. dev tun
  990. proto tcp
  991. setenv FRIENDLY_NAME "Server-Name"
  992. remote $IPADDR $OpenVPN_TCP_Port
  993. nobind
  994. persist-key
  995. persist-tun
  996. comp-lzo
  997. keepalive 10 120
  998. tls-client
  999. remote-cert-tls server
  1000. verb 2
  1001. auth-user-pass
  1002. cipher none
  1003. auth none
  1004. auth-nocache
  1005. auth-retry interact
  1006. connect-retry 0 1
  1007. nice -20
  1008. reneg-sec 0
  1009. redirect-gateway def1
  1010. setenv CLIENT_CERT 0
  1011. http-proxy $IPADDR $Squid_Port1
  1012. http-proxy-option VERSION 1.1
  1013. http-proxy-option CUSTOM-HEADER Host codm.garena.com
  1014. http-proxy-option CUSTOM-HEADER X-Forward-Host codm.garena.com
  1015. http-proxy-option CUSTOM-HEADER X-Forwarded-For codm.garena.com
  1016. http-proxy-option CUSTOM-HEADER Referrer codm.garena.com
  1017. <ca>
  1018. $(cat /etc/openvpn/ca.crt)
  1019. </ca>
  1020. Config1
  1021. # TNT Mobile Legends 10 Promo
  1022. cat <<Config2> /home/vps/public_html/ML10.ovpn
  1023. # Created by blackestsaint
  1024. client
  1025. dev tun
  1026. proto tcp
  1027. setenv FRIENDLY_NAME "Server-Name"
  1028. remote $IPADDR $OpenVPN_TCP_Port
  1029. nobind
  1030. persist-key
  1031. persist-tun
  1032. comp-lzo
  1033. keepalive 10 120
  1034. tls-client
  1035. remote-cert-tls server
  1036. verb 2
  1037. auth-user-pass
  1038. cipher none
  1039. auth none
  1040. auth-nocache
  1041. auth-retry interact
  1042. connect-retry 0 1
  1043. nice -20
  1044. reneg-sec 0
  1045. redirect-gateway def1
  1046. setenv CLIENT_CERT 0
  1047. http-proxy $IPADDR $Privoxy_Port1
  1048. http-proxy-option VERSION 1.1
  1049. http-proxy-option CUSTOM-HEADER ""
  1050. http-proxy-option CUSTOM-HEADER "GET https://web.mobilelegends.com HTTP/1.1"
  1051. http-proxy-option CUSTOM-HEADER Host web.mobilelegends.com
  1052. http-proxy-option CUSTOM-HEADER X-Forward-Host web.mobilelegends.com
  1053. http-proxy-option CUSTOM-HEADER X-Forwarded-For web.mobilelegends.com
  1054. http-proxy-option CUSTOM-HEADER Referrer web.mobilelegends.com
  1055. <ca>
  1056. $(cat /etc/openvpn/ca.crt)
  1057. </ca>
  1058. Config2
  1059. # Default TCP
  1060. cat <<Config3> /home/vps/public_html/Direct.TCP.ovpn
  1061. # Created by blackestsaint
  1062. client
  1063. dev tun
  1064. proto tcp
  1065. setenv FRIENDLY_NAME "Server-Name"
  1066. remote $IPADDR $OpenVPN_TCP_Port
  1067. nobind
  1068. persist-key
  1069. persist-tun
  1070. comp-lzo
  1071. keepalive 10 120
  1072. tls-client
  1073. remote-cert-tls server
  1074. verb 2
  1075. auth-user-pass
  1076. cipher none
  1077. auth none
  1078. auth-nocache
  1079. auth-retry interact
  1080. connect-retry 0 1
  1081. nice -20
  1082. reneg-sec 0
  1083. redirect-gateway def1
  1084. setenv CLIENT_CERT 0
  1085. <ca>
  1086. $(cat /etc/openvpn/ca.crt)
  1087. </ca>
  1088. Config3
  1089. # Default UDP
  1090. cat <<Config4> /home/vps/public_html/Direct.UDP.ovpn
  1091. # Created by blackestsaint
  1092. client
  1093. dev tun
  1094. proto udp
  1095. setenv FRIENDLY_NAME "Server-Name"
  1096. remote $IPADDR $OpenVPN_UDP_Port
  1097. nobind
  1098. persist-key
  1099. persist-tun
  1100. comp-lzo
  1101. keepalive 10 120
  1102. tls-client
  1103. remote-cert-tls server
  1104. verb 2
  1105. auth-user-pass
  1106. cipher none
  1107. auth none
  1108. auth-nocache
  1109. auth-retry interact
  1110. connect-retry 0 1
  1111. nice -20
  1112. reneg-sec 0
  1113. redirect-gateway def1
  1114. setenv CLIENT_CERT 0
  1115. <ca>
  1116. $(cat /etc/openvpn/ca.crt)
  1117. </ca>
  1118. Config4
  1119. # Smart Giga Stories Promo TCP
  1120. cat <<Config5> /home/vps/public_html/Smart.Giga.Stories.ovpn
  1121. # Created by blackestsaint
  1122. client
  1123. dev tun
  1124. proto tcp
  1125. setenv FRIENDLY_NAME "Server-Name"
  1126. remote $IPADDR $OpenVPN_TCP_Port
  1127. nobind
  1128. persist-key
  1129. persist-tun
  1130. comp-lzo
  1131. keepalive 10 120
  1132. tls-client
  1133. remote-cert-tls server
  1134. verb 2
  1135. auth-user-pass
  1136. cipher none
  1137. auth none
  1138. auth-nocache
  1139. auth-retry interact
  1140. connect-retry 0 1
  1141. nice -20
  1142. reneg-sec 0
  1143. redirect-gateway def1
  1144. setenv CLIENT_CERT 0
  1145. http-proxy $IPADDR $Squid_Port1
  1146. http-proxy-option VERSION 1.1
  1147. http-proxy-option CUSTOM-HEADER Host static.muscdn.com
  1148. http-proxy-option CUSTOM-HEADER X-Forward-Host static.muscdn.com
  1149. http-proxy-option CUSTOM-HEADER X-Forwarded-For static.muscdn.com
  1150. http-proxy-option CUSTOM-HEADER Referrer static.muscdn.com
  1151. <ca>
  1152. $(cat /etc/openvpn/ca.crt)
  1153. </ca>
  1154. Config5
  1155. # Renaming Server Name
  1156. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/Smart.Giga.Stories.ovpn
  1157. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/Direct.UDP.ovpn
  1158. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/Direct.TCP.ovpn
  1159. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/ML10.ovpn
  1160. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/Smart.Giga.Games.ovpn
  1161. # Creating OVPN download site index.html
  1162. cat <<'mySiteOvpn' > /home/vps/public_html/projectfog.html
  1163. <!DOCTYPE html>
  1164. <html lang="en">
  1165. <!-- Openvpn Config File Download site by Gwapong Lander -->
  1166. <head><meta charset="utf-8" /><title>VPN Config File Download</title><meta name="description" content="Project Fog Server -korn" /><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">Project Fog Config List</h5><br /><ul
  1167. class="list-group"><li class="list-group-item justify-content-between align-items-center" style="margin-bottom:1em;"><p> Giga Games Promo <span class="badge light-blue darken-4">Android/iOS/PC/Modem</span><br /><small> For Smart, TnT and Sun </small></p><a class="btn btn-outline-success waves-effect btn-sm"
  1168. href="http://IP-ADDRESS:NGINXPORT/Smart.Giga.Games.ovpn" style="float:right;"><i class="fa fa-download"></i> Download</a></li><li
  1169. class="list-group-item justify-content-between align-items-center" style="margin-bottom:1em;"><p> Giga Stories Promo <span class="badge light-blue darken-4">Android/iOS/PC/Modem</span><br /><small> For Smart, TnT and Sun </small></p><a class="btn btn-outline-success waves-effect btn-sm" href="http://IP-ADDRESS:NGINXPORT/Smart.Giga.Stories.ovpn" style="float:right;"><i class="fa fa-download"></i> Download</a></li><li
  1170. class="list-group-item justify-content-between align-items-center" style="margin-bottom:1em;"><p> Mobile Legends Promo (ML10) <span class="badge light-blue darken-4">Android/iOS/PC/Modem</span><br /><small> For any network with Mobile Legends Promo </small></p><a class="btn btn-outline-success waves-effect btn-sm" href="http://IP-ADDRESS:NGINXPORT/ML10.ovpn" style="float:right;"><i class="fa fa-download"></i> Download</a></li><li
  1171. class="list-group-item justify-content-between align-items-center" style="margin-bottom:1em;"><p> Openvpn Default TCP <span class="badge light-blue darken-4">Android/iOS/PC/Modem</span><br /><small> This default and cannot be use for bypassing promos.</small></p><a class="btn btn-outline-success waves-effect btn-sm" href="http://IP-ADDRESS:NGINXPORT/Direct.TCP.ovpn" style="float:right;"><i class="fa fa-download"></i> Download</a></li><li
  1172. class="list-group-item justify-content-between align-items-center" style="margin-bottom:1em;"><p> Openvpn Default UDP <span class="badge light-blue darken-4">Android/iOS/PC/Modem</span><br /><small> This default and cannot be use for bypassing promos.</small></p><a class="btn btn-outline-success waves-effect btn-sm" href="http://IP-ADDRESS:NGINXPORT/Direct.UDP.ovpn" style="float:right;"><i class="fa fa-download"></i> Download</a></li><li
  1173. class="list-group-item justify-content-between align-items-center" style="margin-bottom:1em;"><p> Reserved <span class="badge light-blue darken-4">Android/iOS/PC/Modem</span><br /><small> Reserve by Gwapong Lander.</small></p><a class="btn btn-outline-success waves-effect btn-sm" href="http://IP-ADDRESS:NGINXPORT/null" style="float:right;"><i class="fa fa-download"></i> Download</a></li>
  1174. </ul></div></div></div></div></body></html>
  1175. mySiteOvpn
  1176. # Setting template's correct name,IP address and nginx Port
  1177. sed -i "s|NGINXPORT|$Nginx_Port|g" /home/vps/public_html/projectfog.html
  1178. sed -i "s|IP-ADDRESS|$IPADDR|g" /home/vps/public_html/projectfog.html
  1179. # Restarting nginx service
  1180. systemctl restart nginx
  1181. # Creating all .ovpn config archives
  1182. cd /home/vps/public_html
  1183. zip -qq -r config.zip *.ovpn
  1184. cd
  1185. chown -R www-data:www-data /home/vps/public_html
  1186. }
  1187. function ip_address(){
  1188. 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 )"
  1189. [ -z "${IP}" ] && IP="$( wget -qO- -t1 -T2 ipv4.icanhazip.com )"
  1190. [ -z "${IP}" ] && IP="$( wget -qO- -t1 -T2 ipinfo.io/ip )"
  1191. [ ! -z "${IP}" ] && echo "${IP}" || echo
  1192. }
  1193. IPADDR="$(ip_address)"
  1194. function ConfStartup(){
  1195. # Creating startup 1 script using cat eof tricks
  1196. cat <<'kornz' > /etc/projectfogstartup
  1197. #!/bin/sh
  1198. # Deleting Expired SSH Accounts
  1199. /usr/local/sbin/korn-user-delete-expired &> /dev/null
  1200. # Firewall Protection ( Torrent, Brute Force, Port Scanning )
  1201. /usr/local/sbin/korn-turntable-fog-obs
  1202. # Setting server local time
  1203. ln -fs /usr/share/zoneinfo/Asia/Manila /etc/localtime
  1204. # Prevent DOS-like UI when installing using APT (Disabling APT interactive dialog)
  1205. export DEBIAN_FRONTEND=noninteractive
  1206. # Blacklisted
  1207. #/bin/bash /etc/vil/blacklist
  1208. # Allowing ALL TCP ports for our machine (Simple workaround for policy-based VPS)
  1209. iptables -A INPUT -s $(wget -4qO- http://ipinfo.io/ip) -p tcp -m multiport --dport 1:65535 -j ACCEPT
  1210. # Allowing OpenVPN to Forward traffic
  1211. /bin/bash /etc/openvpn/openvpn.bash
  1212. # SSR Server
  1213. /usr/local/sbin/korn-ssr-updater-fog-obs
  1214. ###### WARNING
  1215. ###### MAKE SURE YOU ONLY PUT [FULLY WORKING APPS]
  1216. ###### WHOLE SCRIPT WILL COLLAPSE
  1217. ###### IF YOU ADD NOT WORKING SCRIPT
  1218. ###### TEST IT BEFORE ADD YOUR COMMAND HERE
  1219. ###### by: blackestsaint
  1220. kornz
  1221. rm -rf /etc/sysctl.d/99*
  1222. # Setting our startup script to run every machine boots
  1223. cat <<'kornx' > /etc/systemd/system/projectfogstartup.service
  1224. [Unit]
  1225. Description=/etc/projectfogstartup
  1226. ConditionPathExists=/etc/projectfogstartup
  1227. [Service]
  1228. Type=forking
  1229. ExecStart=/etc/projectfogstartup start
  1230. TimeoutSec=0
  1231. StandardOutput=tty
  1232. RemainAfterExit=yes
  1233. SysVStartPriority=99
  1234. [Install]
  1235. WantedBy=multi-user.target
  1236. kornx
  1237. chmod +x /etc/projectfogstartup
  1238. systemctl enable projectfogstartup
  1239. systemctl start projectfogstartup
  1240. # Applying cron job
  1241. cd
  1242. echo "SHELL=/bin/sh
  1243. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" | crontab -
  1244. sleep 1
  1245. echo "#OHP Server
  1246. @reboot /usr/local/sbin/korn-ohp-updater-fog-obs
  1247. #Multi-login Limit ON dropbear,ssh,ssl (not included: openvpn)
  1248. @reboot /usr/local/sbin/limiter-fog-obs
  1249. @reboot /usr/local/sbin/fog-limiter-activator-obs
  1250. # Python Socks Server
  1251. @reboot /usr/local/sbin/korn-python-updater-fog-obs
  1252. # Timer for Auto-reconnect
  1253. @reboot /usr/local/sbin/disable-orasan
  1254. " >> /var/spool/cron/crontabs/root
  1255. }
  1256. function ports_info(){
  1257. # For Edit Port dependencies
  1258. mkdir -p /etc/project-fog/service-ports
  1259. mkdir -p /etc/project-fog/v2
  1260. echo "$SSH_Port1" > /etc/project-fog/service-ports/sshp1
  1261. echo "$SSH_Port2" > /etc/project-fog/service-ports/sshp2
  1262. echo "$OpenVPN_TCP_Port" > /etc/project-fog/service-ports/openvpn-tcp
  1263. echo "$OpenVPN_UDP_Port" > /etc/project-fog/service-ports/openvpn-udp
  1264. echo "$Squid_Port1" > /etc/project-fog/service-ports/squid1
  1265. echo "$Squid_Port2" > /etc/project-fog/service-ports/squid2
  1266. echo "$Squid_Port3" > /etc/project-fog/service-ports/squid3
  1267. echo "$Privoxy_Port1" > /etc/project-fog/service-ports/priv1
  1268. echo "$Privoxy_Port2" > /etc/project-fog/service-ports/priv2
  1269. echo "$Dropbear_Port1" > /etc/project-fog/service-ports/dropbear1
  1270. echo "$Dropbear_Port2" > /etc/project-fog/service-ports/dropbear2
  1271. echo "$Stunnel_Port2" > /etc/project-fog/service-ports/stunnel-ssh
  1272. echo "$Stunnel_Port1" > /etc/project-fog/service-ports/stunnel-drop
  1273. echo "$Stunnel_Port3" > /etc/project-fog/service-ports/stunnel-open
  1274. echo "65432" > /etc/project-fog/v2/panel_port
  1275. }
  1276. function InsV2ray(){
  1277. bash <(curl -Ls https://raw.githubusercontent.com/nullptrX/v2-ui/master/install.sh)
  1278. sleep 1
  1279. cat <<'v2about' > /etc/project-fog/v2/about
  1280. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1281. ░▒▓█ ☁️ Project Fog ☁️ █▓▒░
  1282. What is V2Ray?
  1283. Multiple inbound/outbound proxies: one V2Ray instance supports in
  1284. parallel multiple inbound and outbound protocols. Each protocol works
  1285. independently.
  1286. Current Supported Protocols:
  1287. 1. Vmess 5. Dokodemo-door
  1288. 2. Vless 6. Socks
  1289. 3. Trojan 7. HTTP
  1290. 4. Shadowsocks
  1291. How to Use V2Ray?
  1292. 1. Go to your browser and enter this link:
  1293. http://IP-ADDRESS:65432
  1294. 2. Login Username: admin
  1295. Login Password: admin
  1296. 3. Go to Accounts
  1297. 4. Tap or click the " + " button. its color blue.
  1298. 5. Add Account Tab will appear and
  1299. fill in and choose parameters for your V2Ray.
  1300. REMINDERS:
  1301. 1. Please use port ramdomly given V2Ray Panel.
  1302. 2. If you want preferred port, make sure it is not
  1303. currently use by other services or else
  1304. your all V2Ray connection will not work.
  1305. 3. iF you accidentally hit current use port in your V2Ray config,
  1306. A. Go to Panel > Accounts > : and delete all accounts.
  1307. B. Go to your VPS and restart V2ray using Menu.
  1308. or simply reboot your VPS.
  1309. Supported Platforms:
  1310. 1. Windows
  1311. 2. Andoid Phones
  1312. 3. iPhones
  1313. 4. Mac
  1314. Notes:
  1315. This V2Ray Panel is made by Sprov.
  1316. All credits to Sprov.
  1317. Check his work at:
  1318. https://github.com/sprov065
  1319. https://blog.sprov.xyz/
  1320. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1321. v2about
  1322. sleep 1
  1323. function InstBadVPN(){
  1324. # Pull BadVPN Binary 64bit or 32bit
  1325. if [ "$(getconf LONG_BIT)" == "64" ]; then
  1326. wget -O /usr/bin/badvpn-udpgw "https://github.com/korn-sudo/Project-Fog/raw/main/files/plugins/badvpn-udpgw64"
  1327. else
  1328. wget -O /usr/bin/badvpn-udpgw "https://github.com/korn-sudo/Project-Fog/raw/main/files/plugins/badvpn-udpgw"
  1329. fi
  1330. # Set BadVPN to Start on Boot via .profile
  1331. sed -i '$ i\screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300' /root/.profile
  1332. # Change Permission to make it Executable
  1333. chmod +x /usr/bin/badvpn-udpgw
  1334. # Start BadVPN via Screen
  1335. screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300
  1336. }
  1337. # Running screenfetch
  1338. wget -O /usr/bin/screenfetch "https://raw.githubusercontent.com/korn-sudo/Project-Fog/main/files/plugins/screenfetch"
  1339. chmod +x /usr/bin/screenfetch
  1340. echo "/bin/bash /etc/openvpn/openvpn.bash" >> .profile
  1341. echo "clear" >> .profile
  1342. echo "screenfetch" >> .profile
  1343. # Obash
  1344. cd
  1345. curl -skL "https://github.com/louigi600/obash/archive/8976fd2fa256c583769b979036f59a741730eb48.tar.gz" -o obash.tgz
  1346. tar xf obash.tgz && rm -f obash.tgz
  1347. sleep 1
  1348. cd obash-8976fd2fa256c583769b979036f59a741730eb48
  1349. make clean
  1350. make
  1351. mv -f obash /usr/local/bin/obash
  1352. cd .. && rm -rf obash-8976fd2fa256c583769b979036f59a741730eb48
  1353. cd
  1354. #alias menu
  1355. wget -O ./.bashrc "https://raw.githubusercontent.com/korn-sudo/Project-Fog/main/files/plugins/.bashrc"
  1356. #banner
  1357. cat <<'korn77' > /etc/zorro-luffy
  1358. <br><font>
  1359. <br><font>
  1360. <br><font color='green'> <b> ░▒▓█ ☁️ Project Fog ☁️ █▓▒░</b> </br></font>
  1361. <br><font>
  1362. <br><font color='#32CD32'>: : : ★ Happy Browsing!😊 </br></font>
  1363. <br><font color='#32CD32'>: : : ★ This is FREE and Not for Sale! </br></font>
  1364. <br><font color='#FDD017'>: : : ★ Project Lead: blackestsaint 🦊</br></font>
  1365. <br><font>
  1366. <br><font color='#32CD32'>: : : ★ STRICTLY NO ACCOUNT SHARING</br></font>
  1367. <br><font color='#32CD32'>: : : ★ STRICTLY NO MULTI-LOGIN</br></font>
  1368. <br><font color='#32CD32'>: : : ★ STRICTLY NO TORRENT</br></font>
  1369. <br><font>
  1370. <br><font color='#FF00FF'>░▒▓█ VIOLATORS WILL BE BAN!!!</br></font>
  1371. <br><font>
  1372. <br><font>
  1373. korn77
  1374. #block-by-keyword
  1375. mkdir -p /etc/vil
  1376. echo "#!/bin/bash " >> /etc/vil
  1377. # Timer Notification in menu section checker
  1378. echo " " > /etc/korn/timer-proxy
  1379. echo " " > /etc/korn/timer-seconds
  1380. #Tweak for IPV4 TCP/UDP speed and maximize capability function Status: OFF
  1381. cd
  1382. mkdir -p /etc/project-fog/others
  1383. echo "#Project Fog TCP Tweak OFF" > /etc/sysctl.conf
  1384. echo "off" > /etc/project-fog/others/tcptweaks
  1385. #for blocking by keywords notes
  1386. mkdir -p /etc/korn
  1387. echo "
  1388. Keyword below has been blocked:
  1389. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1390. Ports block [ torrent related issues ]
  1391. 24 25 26 50 57
  1392. 105 106 109 110 143
  1393. 158 209 218 220 465
  1394. 587 993 995 1109 24554
  1395. 60177 60179
  1396. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::" >> /etc/korn/block-by-keyword
  1397. echo "
  1398. THIS PORT ARE BLOCK IN SERVER DUE TO TORRENT ISSUE:
  1399. WARNING! DO NOT USE THIS PORT:
  1400. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1401. 24 25 26 50 57
  1402. 105 106 109 110 143
  1403. 158 209 218 220 465
  1404. 587 993 995 1109 24554
  1405. 60177 60179
  1406. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::" >> /etc/korn/warning
  1407. # Dependencies of all Editing Port scenario
  1408. mkdir -p /etc/project-fog/others
  1409. echo "24 25 26 50 57
  1410. 105 106 109 110 143
  1411. 158 209 218 220 465
  1412. 587 993 995 1109 24554
  1413. 60177 60179 450 $Php_Socket " >> /etc/project-fog/others/banned-port
  1414. # Setting server local time
  1415. ln -fs /usr/share/zoneinfo/$MyVPS_Time /etc/localtime
  1416. #version of Project Fog autoscript
  1417. echo "$ver" > /etc/korn/version
  1418. # Start-up Application Verification (protection for modders)
  1419. mkdir -p /usr/lib/kshell
  1420. echo "75" > /usr/lib/kshell/libs
  1421. }
  1422. function Complete-reboot(){
  1423. clear
  1424. echo ""
  1425. echo ""
  1426. figlet Project Fog -c | lolcat
  1427. echo ""
  1428. echo " Installation Complete! System need to reboot to apply all changes! "
  1429. read -p " Press Enter to reboot..."
  1430. reboot
  1431. }
  1432. #########################################################
  1433. ### Installation Begins...
  1434. #########################################################
  1435. # Filtering Machine did not meet Requirements
  1436. echo "Checking if your Server meet the requirements . . . "
  1437. CheckRequirements
  1438. ScriptMessage
  1439. sleep 2
  1440. #System Upgrade and Updates
  1441. echo " Installing Operating System Updates"
  1442. InstUpdates
  1443. # Configure OpenSSH and Dropbear
  1444. echo " Configuring ssh..."
  1445. InstSSH
  1446. # Configure Stunnel
  1447. echo " Configuring stunnel..."
  1448. InsStunnel
  1449. # Configure BadVPN UDPGW
  1450. echo " Configuring BadVPN UDPGW..."
  1451. InstBadVPN
  1452. # Configure Webmin
  1453. echo " Configuring webmin..."
  1454. InstWebmin
  1455. # Configure Squid and Privoxy
  1456. echo " Configuring proxy..."
  1457. InsProxy
  1458. # Configure Over-HTTP-Puncher
  1459. echo " Configuring Over-HTTP-Puncher..."
  1460. InsOHP
  1461. # Configure Python Socks Proxy
  1462. echo " Configuring Python Socks Proxy..."
  1463. InsPython
  1464. # Configure Shadowsocks R
  1465. echo " Configuring Shadowsocks R..."
  1466. InsShodowSocks
  1467. # Configure OpenVPN
  1468. echo " Configuring OpenVPN..."
  1469. InsOpenVPN
  1470. # Configuring Nginx OVPN config download site
  1471. echo " Configuring OpenVPN Config File and Panel Services..."
  1472. FogPanel
  1473. # Some assistance and startup scripts
  1474. echo " Configuring Startup Application Automation..."
  1475. ConfStartup
  1476. # VPS Menu script v1.0
  1477. echo " Configuring Main Dish Menu..."
  1478. ConfMenu
  1479. # Saving all Ports Information
  1480. echo " Saving all Ports Information..."
  1481. ports_info
  1482. # Configure OpenVPN
  1483. echo " Configuring V2Ray..."
  1484. InsV2ray
  1485. # Others Services ( Screenfetch, Setting Local, TCP Tweak )
  1486. echo " Adding other services..."
  1487. InstOthers
  1488. #Server Information and Details
  1489. echo "READ ME!"
  1490. Installation-log
  1491. #Final Touch (Reboot Remark)
  1492. Complete-reboot
  1493. clear
  1494. cd ~
  1495. rm /root/fog-debian -rf
  1496. exit 1
  1497. reboot