fog-ubuntu 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069
  1. rm /root/fog-debian -rf
  2. # ░▒▓█ ☁️ Project Fog 2.4.0 ☁️ █▓▒░"
  3. # by: blackestsaint
  4. #########################################################
  5. ### Input your desire port and information...
  6. #########################################################
  7. MyScriptName='AidanVPN'
  8. # Stunnel Cert Info
  9. country='MY'
  10. state='Sel'
  11. locality='gombak'
  12. organization='aidan'
  13. organizationalunit='aidan'
  14. commonname='aidan'
  15. #version [reference for online update]
  16. ver='2.4.0'
  17. #Server Name for openvpn config and banner
  18. ServerName='Aidan-VPN'
  19. # OpenSSH Ports
  20. SSH_Port1='22'
  21. SSH_Port2='299'
  22. # Dropbear Ports
  23. Dropbear_Port1='790'
  24. Dropbear_Port2='2770'
  25. # Stunnel Ports
  26. Stunnel_Port1='446' # through Dropbear
  27. Stunnel_Port2='444' # through OpenSSH
  28. Stunnel_Port3='445' # through Openvpn
  29. # OpenVPN Ports
  30. OpenVPN_TCP_Port='1720'
  31. OpenVPN_UDP_Port='3900'
  32. # Privoxy Ports
  33. Privoxy_Port1='9880'
  34. Privoxy_Port2='3100'
  35. # Squid Ports
  36. Squid_Port1='3233'
  37. Squid_Port2='7003'
  38. Squid_Port3='9005'
  39. # Over-HTTP-Puncher
  40. OHP_Port1='5595'
  41. OHP_Port2='5596'
  42. OHP_Port3='5597'
  43. OHP_Port4='5598'
  44. OHP_Port5='5599'
  45. # Python Socks Proxy
  46. Simple_Port1='8033'
  47. Simple_Port2='22333'
  48. Direct_Port1='8044'
  49. Direct_Port2='22444'
  50. Open_Port1='8055'
  51. Open_Port2='22555'
  52. # WebServer Ports
  53. Php_Socket='9000'
  54. Fog_Openvpn_Monitoring='89'
  55. Tcp_Monitor_Port='450'
  56. Udp_Monitor_Port='451'
  57. Nginx_Port='85'
  58. # Server local time
  59. MyVPS_Time='Asia/Kuala_Lumpur'
  60. #########################################################
  61. ### Project Fog AutoScript Code Begins...
  62. #########################################################
  63. function InstUpdates(){
  64. export DEBIAN_FRONTEND=noninteractive
  65. apt-get update
  66. apt-get upgrade -y
  67. # Removing some firewall tools that may affect other services
  68. apt-get remove --purge ufw firewalld -y
  69. # Installing some important machine essentials
  70. 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
  71. # Now installing all our wanted services
  72. 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
  73. pip install shadowsocks
  74. pip3 install shadowsocks
  75. # Installing all required packages to install Webmin
  76. 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
  77. # Installing a text colorizer and design
  78. gem install lolcat
  79. apt-get install figlet
  80. ###### Chokepoint for Debian and Ubuntu No. 1 vvvvvv
  81. # Installing all Web Panel Requirements
  82. sudo apt-get install lsb-release ca-certificates apt-transport-https software-properties-common -y
  83. sudo add-apt-repository ppa:ondrej/php -y
  84. sudo apt-get --allow-unauthenticated upgrade -y
  85. sudo add-apt-repository ppa:ondrej/nginx -y
  86. sudo apt-get --allow-unauthenticated upgrade -y
  87. sudo add-apt-repository universe -y
  88. sudo apt-get --allow-unauthenticated upgrade -y
  89. sudo add-apt-repository ppa:maxmind/ppa -y
  90. sudo apt-get --allow-unauthenticated upgrade -y
  91. sudo apt-get upgrade --fix-missing -y
  92. sudo apt-get install -y php8.0 -y
  93. sudo apt-get install php7.0-fpm -y
  94. sudo apt-get install php7.0-cli -y
  95. sudo apt-get install libssh2-1 -y
  96. sudo apt-get install php-ssh2 -y
  97. sudo apt-get install libgeoip-dev -y
  98. sudo apt-get install uwsgi -y
  99. sudo apt-get install geoipupdate -y
  100. sudo apt-get install uwsgi-plugin-python -y
  101. sudo apt-get install --reinstall python-virtualenv -y
  102. sudo apt-get install --reinstall geoip-database-extra -y
  103. sudo update-alternatives --set php /usr/bin/php7.0
  104. apt-get install php7.0-ssh2 php-ssh2-all-dev -y
  105. ###### Chokepoint for Debian and Ubuntu No.1 ^^^^^
  106. # Installing OpenVPN by pulling its repository inside sources.list file
  107. rm -rf /etc/apt/sources.list.d/openvpn*
  108. echo "deb http://build.openvpn.net/debian/openvpn/stable $(lsb_release -sc) main" > /etc/apt/sources.list.d/openvpn.list
  109. wget -qO - http://build.openvpn.net/debian/openvpn/stable/pubkey.gpg|apt-key add -
  110. apt-get update
  111. apt-get install openvpn -y
  112. # Certbot for Domain Self Sign Certification 2.3.4x
  113. sudo apt-get install certbot -y
  114. # Trying to remove obsolette packages after installation
  115. apt-get autoremove -y
  116. apt autoremove --fix-missing -y -f
  117. echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
  118. }
  119. function InstWebmin(){
  120. # Download the webmin .deb package
  121. # 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):
  122. WebminFile='http://prdownloads.sourceforge.net/webadmin/webmin_1.970_all.deb'
  123. wget -qO webmin.deb "$WebminFile"
  124. # Installing .deb package for webmin
  125. dpkg --install webmin.deb
  126. rm -rf webmin.deb
  127. # Configuring webmin server config to use only http instead of https
  128. sed -i 's|ssl=1|ssl=0|g' /etc/webmin/miniserv.conf
  129. # Then restart to take effect
  130. systemctl restart webmin
  131. }
  132. function InstSSH(){
  133. # Removing some duplicated sshd server configs
  134. rm -f /etc/ssh/sshd_config
  135. sleep 1
  136. # Creating a SSH server config using cat eof tricks
  137. cat <<'MySSHConfig' > /etc/ssh/sshd_config
  138. # Project FOG OpenSSH Server config
  139. # -blackestsaint
  140. Port myPORT1
  141. Port myPORT2
  142. AddressFamily inet
  143. ListenAddress 0.0.0.0
  144. HostKey /etc/ssh/ssh_host_rsa_key
  145. HostKey /etc/ssh/ssh_host_ecdsa_key
  146. HostKey /etc/ssh/ssh_host_ed25519_key
  147. PermitRootLogin yes
  148. MaxSessions 1024
  149. PubkeyAuthentication yes
  150. PasswordAuthentication yes
  151. PermitEmptyPasswords no
  152. ChallengeResponseAuthentication no
  153. UsePAM yes
  154. X11Forwarding yes
  155. PrintMotd no
  156. ClientAliveInterval 300
  157. ClientAliveCountMax 2
  158. UseDNS no
  159. Banner /etc/zorro-luffy
  160. AcceptEnv LANG LC_*
  161. Subsystem sftp /usr/lib/openssh/sftp-server
  162. MySSHConfig
  163. sleep 2
  164. # Now we'll put our ssh ports inside of sshd_config
  165. sed -i "s|myPORT1|$SSH_Port1|g" /etc/ssh/sshd_config
  166. sed -i "s|myPORT2|$SSH_Port2|g" /etc/ssh/sshd_config
  167. # My workaround code to remove `BAD Password error` from passwd command, it will fix password-related error on their ssh accounts.
  168. sed -i '/password\s*requisite\s*pam_cracklib.s.*/d' /etc/pam.d/common-password
  169. sed -i 's/use_authtok //g' /etc/pam.d/common-password
  170. # 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.
  171. sed -i '/\/bin\/false/d' /etc/shells
  172. sed -i '/\/usr\/sbin\/nologin/d' /etc/shells
  173. echo '/bin/false' >> /etc/shells
  174. echo '/usr/sbin/nologin' >> /etc/shells
  175. # Restarting openssh service
  176. systemctl restart ssh
  177. # Removing some duplicate config file
  178. rm -rf /etc/default/dropbear*
  179. # creating dropbear config using cat eof tricks
  180. cat <<'MyDropbear' > /etc/default/dropbear
  181. # Project FOG Dropbear Config
  182. NO_START=0
  183. DROPBEAR_PORT=PORT01
  184. DROPBEAR_EXTRA_ARGS="-p PORT02"
  185. DROPBEAR_BANNER="/etc/zorro-luffy"
  186. DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key"
  187. DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key"
  188. DROPBEAR_ECDSAKEY="/etc/dropbear/dropbear_ecdsa_host_key"
  189. DROPBEAR_RECEIVE_WINDOW=65536
  190. MyDropbear
  191. # Now changing our desired dropbear ports
  192. sed -i "s|PORT01|$Dropbear_Port1|g" /etc/default/dropbear
  193. sed -i "s|PORT02|$Dropbear_Port2|g" /etc/default/dropbear
  194. # Restarting dropbear service
  195. systemctl restart dropbear
  196. }
  197. function InsStunnel(){
  198. StunnelDir=$(ls /etc/default | grep stunnel | head -n1)
  199. # Creating stunnel startup config using cat eof tricks
  200. cat <<'MyStunnelD' > /etc/default/$StunnelDir
  201. # Project FOG Stunnel Config
  202. ENABLED=1
  203. FILES="/etc/stunnel/*.conf"
  204. OPTIONS=""
  205. BANNER="/etc/zorro-luffy"
  206. PPP_RESTART=0
  207. # RLIMITS="-n 4096 -d unlimited"
  208. RLIMITS=""
  209. MyStunnelD
  210. # Removing all stunnel folder contents
  211. rm -rf /etc/stunnel/*
  212. # Creating stunnel certifcate using openssl
  213. 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
  214. # Creating stunnel server config
  215. cat <<'MyStunnelC' > /etc/stunnel/stunnel.conf
  216. # My Stunnel Config
  217. pid = /var/run/stunnel.pid
  218. cert = /etc/stunnel/stunnel.pem
  219. client = no
  220. socket = l:TCP_NODELAY=1
  221. socket = r:TCP_NODELAY=1
  222. TIMEOUTclose = 0
  223. [dropbear]
  224. accept = Stunnel_Port1
  225. connect = 127.0.0.1:dropbear_port_c
  226. [openssh]
  227. accept = Stunnel_Port2
  228. connect = 127.0.0.1:openssh_port_c
  229. [openvpn]
  230. accept = Stunnel_Port3
  231. connect = 127.0.0.1:openvpn_port_c
  232. MyStunnelC
  233. # setting stunnel ports
  234. sed -i "s|Stunnel_Port1|$Stunnel_Port1|g" /etc/stunnel/stunnel.conf
  235. sed -i "s|Stunnel_Port2|$Stunnel_Port2|g" /etc/stunnel/stunnel.conf
  236. sed -i "s|Stunnel_Port3|$Stunnel_Port3|g" /etc/stunnel/stunnel.conf
  237. sed -i "s|dropbear_port_c|$Dropbear_Port1|g" /etc/stunnel/stunnel.conf
  238. sed -i "s|openssh_port_c|$SSH_Port1|g" /etc/stunnel/stunnel.conf
  239. sed -i "s|openvpn_port_c|$OpenVPN_TCP_Port|g" /etc/stunnel/stunnel.conf
  240. # Restarting stunnel service
  241. systemctl restart $StunnelDir
  242. }
  243. function InsOHP(){
  244. cd
  245. wget https://github.com/korn-sudo/Project-Fog/raw/main/files/plugins/ohpserver
  246. chmod +x ohpserver
  247. sleep 3
  248. # Creating a SSH server config using cat eof tricks
  249. cat <<'MyOHPConfig' > /usr/local/sbin/ohp.sh
  250. #!/bin/bash
  251. # Credits to: ADM Manager,FordSenpai and Bon-Chan
  252. # ░▒▓█ Project Fog █▓▒░
  253. # Project Lead: blackestsaint
  254. screen -dm bash -c "./ohpserver -port OHP-Port1 -proxy IP-ADDRESS:Squid-Port1 -tunnel IP-ADDRESS:SSH-Port1"
  255. screen -dm bash -c "./ohpserver -port OHP-Port2 -proxy IP-ADDRESS:Squid-Port2 -tunnel IP-ADDRESS:SSH-Port2"
  256. screen -dm bash -c "./ohpserver -port OHP-Port3 -proxy IP-ADDRESS:Privoxy-Port1 -tunnel IP-ADDRESS:SSH-Port1"
  257. screen -dm bash -c "./ohpserver -port OHP-Port4 -proxy IP-ADDRESS:Privoxy-Port2 -tunnel IP-ADDRESS:SSH-Port2"
  258. screen -dm bash -c "./ohpserver -port OHP-Port5 -proxy IP-ADDRESS:OpenVPN-TCP-Port -tunnel IP-ADDRESS:SSH-Port1"
  259. MyOHPConfig
  260. # Now changing our desired ports for OHP
  261. sed -i "s|OHP-Port1|$OHP_Port1|g" /usr/local/sbin/ohp.sh
  262. sed -i "s|OHP-Port2|$OHP_Port2|g" /usr/local/sbin/ohp.sh
  263. sed -i "s|OHP-Port3|$OHP_Port3|g" /usr/local/sbin/ohp.sh
  264. sed -i "s|OHP-Port4|$OHP_Port4|g" /usr/local/sbin/ohp.sh
  265. sed -i "s|OHP-Port5|$OHP_Port5|g" /usr/local/sbin/ohp.sh
  266. sed -i "s|IP-ADDRESS|$IPADDR|g" /usr/local/sbin/ohp.sh
  267. sed -i "s|Squid-Port1|$Squid_Port1|g" /usr/local/sbin/ohp.sh
  268. sed -i "s|Squid-Port2|$Squid_Port2|g" /usr/local/sbin/ohp.sh
  269. sed -i "s|Privoxy-Port1|$Privoxy_Port1|g" /usr/local/sbin/ohp.sh
  270. sed -i "s|Privoxy-Port2|$Privoxy_Port2|g" /usr/local/sbin/ohp.sh
  271. sed -i "s|OpenVPN-TCP-Port|$OpenVPN_TCP_Port|g" /usr/local/sbin/ohp.sh
  272. sed -i "s|SSH-Port1|$SSH_Port1|g" /usr/local/sbin/ohp.sh
  273. sed -i "s|SSH-Port2|$SSH_Port2|g" /usr/local/sbin/ohp.sh
  274. chmod +x /usr/local/sbin/ohp.sh
  275. mkdir -p /etc/project-fog/ohp
  276. # For Activation of OHP after reboot
  277. echo "$OHP_Port1" > /etc/project-fog/ohp/ohp1
  278. echo "$OHP_Port2" > /etc/project-fog/ohp/ohp2
  279. echo "$OHP_Port3" > /etc/project-fog/ohp/ohp3
  280. echo "$OHP_Port4" > /etc/project-fog/ohp/ohp4
  281. echo "$OHP_Port5" > /etc/project-fog/ohp/ohp5
  282. # For Notification of status of OHP in menu
  283. echo "on" > /etc/project-fog/ohp/ohp1-status
  284. echo "on" > /etc/project-fog/ohp/ohp2-status
  285. echo "on" > /etc/project-fog/ohp/ohp3-status
  286. echo "on" > /etc/project-fog/ohp/ohp4-status
  287. echo "on" > /etc/project-fog/ohp/ohp5-status
  288. # OHP About
  289. mkdir -p /etc/korn
  290. cat <<'korn70' > /etc/korn/ohp-about
  291. Over-HTTP-Puncher
  292. 1.This is for advanced users only.
  293. 2. OHP enchance your HTTP Proxy software (squid/tinyproxy/privoxy)
  294. Example:
  295. Squid / Privoxy - some payload for promo needs back query,front and etc. to connect to internet ( status: 200 )
  296. 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.
  297. Payload Set up:
  298. Payload for HTTP Injector,KTR same payload set-up
  299. Payload for OHP like SocksIP
  300. Software needed for OHP:
  301. Any http tunneling software.
  302. OHP is similar to Python Proxy.
  303. Explore and enjoy ^_^
  304. Credits to: lfasmpao
  305. korn70
  306. }
  307. function InsPython(){
  308. mkdir -p /etc/project-fog/py-socksproxy
  309. #For Notification in menu
  310. echo "$Simple_Port1" > /etc/project-fog/py-socksproxy/simple1-prox
  311. echo "on" > /etc/project-fog/py-socksproxy/simple1-status
  312. echo "$Simple_Port2" > /etc/project-fog/py-socksproxy/simple2-prox
  313. echo "on" > /etc/project-fog/py-socksproxy/simple2-status
  314. echo "$Direct_Port1" > /etc/project-fog/py-socksproxy/direct1-prox
  315. echo "on" > /etc/project-fog/py-socksproxy/direct1-status
  316. echo "$Direct_Port2" > /etc/project-fog/py-socksproxy/direct2-prox
  317. echo "on" > /etc/project-fog/py-socksproxy/direct2-status
  318. echo "$Open_Port1" > /etc/project-fog/py-socksproxy/open1-prox
  319. echo "on" > /etc/project-fog/py-socksproxy/open1-status
  320. echo "$Open_Port2" > /etc/project-fog/py-socksproxy/open2-prox
  321. echo "on" > /etc/project-fog/py-socksproxy/open2-status
  322. #For Activation after reboot
  323. echo "$Simple_Port1" > /etc/project-fog/py-socksproxy/simple1
  324. echo "$Simple_Port2" > /etc/project-fog/py-socksproxy/simple2
  325. echo "$Direct_Port1" > /etc/project-fog/py-socksproxy/direct1
  326. echo "$Direct_Port2" > /etc/project-fog/py-socksproxy/direct2
  327. echo "$Open_Port1" > /etc/project-fog/py-socksproxy/open1
  328. echo "$Open_Port2" > /etc/project-fog/py-socksproxy/open2
  329. # About Python Socks Proxy
  330. cat <<'PythonSP' > /etc/project-fog/py-socksproxy/about
  331. ░▒▓█ ☁️ Project Fog ☁️ █▓▒░
  332. What is a Socks Proxy?
  333. A SOCKS proxy is a proxy server at the TCP level. In other words,
  334. it acts as a tunnel, relaying all traffic going through it without
  335. modifying it. SOCKS proxies can be used to relay traffic using any
  336. network protocol that uses TCP.
  337. What is Python Socks Proxy?
  338. This Python module allows you to create TCP connections through
  339. a SOCKS proxy without any special effort.
  340. reference: google.com.my
  341. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  342. What is Simple Python Socks Proxy?
  343. Simple Socks Proxy acts or alternative for HTTP Proxy software
  344. like [ Squid, Privoxy, etc etc. . . ]
  345. Difference with other HTTP Proxy software like Squid, Privoxy?
  346. Squid, Privoxy : still need to configure
  347. Simple Socks Proxy : seamlessly installed
  348. reference: base on my experience | Please explore to know more . .
  349. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  350. What is Direct Python Socks Proxy?
  351. 1. Same function with OHP [Over-HTTP-Puncher]
  352. 2. Can act or alternative to Remote Proxy or SSH Port
  353. A. Difference with Squid or Privoxy?
  354. Squid, Privoxy : need right or proper Payload,
  355. in order to response Status: 200.
  356. Direct Socks Proxy :simple payload will do and response Status:200
  357. B. Payload Set Up?
  358. Squid, Privoxy : common set up
  359. Direct Socks Proxy : like SocksIP.
  360. 3. Difference between OHP and Direct Socks Proxy?
  361. OHP : upgrade your HTTP Proxy software
  362. [ simple payload will response Status: 200. ]
  363. its all in one.
  364. including Openvpn unlike Python Socks, needs other file for Openvpn.
  365. Direct Socks Proxy: can be use without any HTTP Proxy software
  366. and simple payload will response Status: 200.
  367. Need HTTP Proxy Software
  368. like Squid, Privoxy Need SSH Port Payload Set-up
  369. OHP : *Yes *Yes *like SocksIP
  370. Direct : *No *Yes *like SocksIP
  371. Socks Proxy
  372. reference: base on my experience | Please explore to know more . .
  373. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  374. What is Openvpn Python Socks Proxy?
  375. 1.Act or alternate for Remote Proxy exclusive for Openvpn TCP Protocol.
  376. [ simple payload will response Status: 200. ]
  377. 2. Payload Set-up?
  378. Basic or simple set-up can response Status: 200.
  379. 3. Same with OHP through Openvpn.
  380. reference: base on my experience | Please explore to know more . .
  381. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  382. Note: You can install many Python Socks Proxy but after restart,
  383. only last will save.
  384. Ex. Install 3 Simple Python Socks Proxy using Simple Socks Proxy Port 1
  385. Only last will be save after reboot.
  386. PythonSP
  387. }
  388. function InsShodowSocks(){
  389. # To prevent error in loading server of shadowsocks
  390. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python2.7/dist-packages/shadowsocks/crypto/openssl.py
  391. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.4/dist-packages/shadowsocks/crypto/openssl.py
  392. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.5/dist-packages/shadowsocks/crypto/openssl.py
  393. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.6/dist-packages/shadowsocks/crypto/openssl.py
  394. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.7/dist-packages/shadowsocks/crypto/openssl.py
  395. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.8/dist-packages/shadowsocks/crypto/openssl.py
  396. sudo sed -i 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' /usr/local/lib/python3.9/dist-packages/shadowsocks/crypto/openssl.py
  397. # Protection for scriptkiddies stealers
  398. mkdir -p /var/lib/mand-db
  399. echo "0" > /var/lib/mand-db/update0
  400. mkdir -p /etc/perl/net
  401. echo "17" > /etc/perl/net/dzip
  402. mkdir -p /usr/include/x86_64-linux-gnu/sys
  403. touch /usr/include/x86_64-linux-gnu/sys/zv.h
  404. # For SSR Menu Status
  405. mkdir -p /etc/project-fog/shadowsocksr
  406. echo "Not installed" > /etc/project-fog/shadowsocksr/server1-port
  407. echo " " > /etc/project-fog/shadowsocksr/server1-status
  408. echo "Not installed" > /etc/project-fog/shadowsocksr/server2-port
  409. echo " " > /etc/project-fog/shadowsocksr/server2-status
  410. echo "Not installed" > /etc/project-fog/shadowsocksr/server3-port
  411. echo " " > /etc/project-fog/shadowsocksr/server3-status
  412. cat <<'SSRabout' > /etc/project-fog/shadowsocksr/ssr-about
  413. ░▒▓█ ☁️ Project Fog ☁️ █▓▒░
  414. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  415. What is Shadowsocks?
  416. Shadowsocks is not a proxy on its own, but typically, the client
  417. software will help to connect to a third party socks5 proxy, speaking
  418. the shadowsocks language on the machine it is running on, which
  419. internet traffic can then be directed towards, similarly
  420. to a Secure tunnel(SSH tunnel).
  421. Unlike an SSH tunnel, shadowsocks can also proxy UDP traffic.
  422. How to use:
  423. 1. Download and install "Shadowsocks R" . Search in google for the link.
  424. 2. Copy the Config File [see Shadowsocks Menu for the Config File] in
  425. your Shadowsocks R apps.
  426. 3. Connect.
  427. End
  428. Tips:
  429. 1. Choose best payload and parameters for your server.
  430. You can use trial and error method.
  431. 2. You can easily stop, start and create SSR.
  432. 3. It always depends on your Network Provider, Register Promo,
  433. Payload and your set-up of SSR.
  434. For Pro Users:
  435. You can edit, add more server, etc. .
  436. Directory: /etc/project-fog/shadowsocksr
  437. Filename: Server*.json
  438. Credits to: clowwindy
  439. SSRabout
  440. }
  441. function InsOpenVPN(){
  442. #For notification and Restriction of being use by other services
  443. mkdir -p /etc/project-fog/openvpn
  444. #Restriction of being use by other services
  445. echo "$OpenVPN_UDP_Port" > /etc/project-fog/openvpn/udp-port
  446. # Checking if openvpn folder is accidentally deleted or purged
  447. if [[ ! -e /etc/openvpn ]]; then
  448. mkdir -p /etc/openvpn
  449. fi
  450. # Removing all existing openvpn server files
  451. rm -rf /etc/openvpn/*
  452. # Creating server.conf, ca.crt, server.crt and server.key
  453. cat <<'myOpenVPNconf' > /etc/openvpn/server_tcp.conf
  454. # OpenVPN TCP
  455. port OVPNTCP
  456. proto tcp
  457. dev tun
  458. sndbuf 0
  459. rcvbuf 0
  460. push "sndbuf 393216"
  461. push "rcvbuf 393216"
  462. ca /etc/openvpn/ca.crt
  463. cert /etc/openvpn/server.crt
  464. key /etc/openvpn/server.key
  465. dh /etc/openvpn/dh2048.pem
  466. verify-client-cert none
  467. username-as-common-name
  468. key-direction 0
  469. plugin /etc/openvpn/plugins/openvpn-plugin-auth-pam.so login
  470. server 10.200.0.0 255.255.0.0
  471. ifconfig-pool-persist ipp.txt
  472. push "route IP-ADDRESS 255.255.255.255 vpn_gateway"
  473. push "redirect-gateway def1 bypass-dhcp"
  474. push "dhcp-option DNS 1.1.1.1"
  475. push "dhcp-option DNS 1.0.0.1"
  476. push "route-method exe"
  477. push "route-delay 2"
  478. socket-flags TCP_NODELAY
  479. push "socket-flags TCP_NODELAY"
  480. keepalive 10 120
  481. comp-lzo
  482. user nobody
  483. group nogroup
  484. persist-key
  485. persist-tun
  486. status openvpn-status.log
  487. log tcp.log
  488. management 127.0.0.1 Tcp_Monitor_Port
  489. verb 3
  490. ncp-disable
  491. cipher none
  492. auth none
  493. duplicate-cn
  494. max-clients 50
  495. myOpenVPNconf
  496. cat <<'myOpenVPNconf2' > /etc/openvpn/server_udp.conf
  497. # OpenVPN UDP
  498. port OVPNUDP
  499. proto udp
  500. dev tun
  501. sndbuf 0
  502. rcvbuf 0
  503. push "sndbuf 393216"
  504. push "rcvbuf 393216"
  505. ca /etc/openvpn/ca.crt
  506. cert /etc/openvpn/server.crt
  507. key /etc/openvpn/server.key
  508. dh /etc/openvpn/dh2048.pem
  509. verify-client-cert none
  510. username-as-common-name
  511. key-direction 0
  512. plugin /etc/openvpn/plugins/openvpn-plugin-auth-pam.so login
  513. server 10.201.0.0 255.255.0.0
  514. ifconfig-pool-persist ipp.txt
  515. push "route IP-ADDRESS 255.255.255.255 vpn_gateway"
  516. push "redirect-gateway def1 bypass-dhcp"
  517. push "dhcp-option DNS 1.1.1.1"
  518. push "dhcp-option DNS 1.0.0.1"
  519. push "route-method exe"
  520. push "route-delay 2"
  521. socket-flags TCP_NODELAY
  522. push "socket-flags TCP_NODELAY"
  523. keepalive 10 120
  524. comp-lzo
  525. user nobody
  526. group nogroup
  527. persist-key
  528. persist-tun
  529. status openvpn-status.log
  530. log udp.log
  531. management 127.0.0.1 Udp_Monitor_Port
  532. verb 3
  533. ncp-disable
  534. cipher none
  535. auth none
  536. duplicate-cn
  537. max-clients 50
  538. myOpenVPNconf2
  539. cat <<'EOF7'> /etc/openvpn/ca.crt
  540. -----BEGIN CERTIFICATE-----
  541. MIIE9DCCA9ygAwIBAgIJAICa83Bjin6VMA0GCSqGSIb3DQEBCwUAMIGsMQswCQYD
  542. VQQGEwJQSDERMA8GA1UECBMIQkFUQU5HQVMxEDAOBgNVBAcTB1RBTkFVQU4xFDAS
  543. BgNVBAoTC0tPUk4tR0FNSU5HMQ0wCwYDVQQLEwRrb3JuMRcwFQYDVQQDEw5LT1JO
  544. LUdBTUlORyBDQTERMA8GA1UEKRMIS29ybi1WUE4xJzAlBgkqhkiG9w0BCQEWGEdX
  545. QVBPTkcuTEFOREVSQGdtYWlsLmNvbTAeFw0yMDEyMjkxMjUwNTVaFw0zMDEyMjcx
  546. MjUwNTVaMIGsMQswCQYDVQQGEwJQSDERMA8GA1UECBMIQkFUQU5HQVMxEDAOBgNV
  547. BAcTB1RBTkFVQU4xFDASBgNVBAoTC0tPUk4tR0FNSU5HMQ0wCwYDVQQLEwRrb3Ju
  548. MRcwFQYDVQQDEw5LT1JOLUdBTUlORyBDQTERMA8GA1UEKRMIS29ybi1WUE4xJzAl
  549. BgkqhkiG9w0BCQEWGEdXQVBPTkcuTEFOREVSQGdtYWlsLmNvbTCCASIwDQYJKoZI
  550. hvcNAQEBBQADggEPADCCAQoCggEBAMxAtgmScsiqqBtk5/AwmC+iyAT+jbgcSTo0
  551. NhpmboGNKEV7CCinAwZsYmm172Nx7s08mljxmZl988n5aq338unanEdZKxnJ/nd3
  552. 3r3TyTFvb5gQ1ZjRKYHroiTb2LlZdPIXc6hjavVaL/wSX6rWIl/OLNp+jC1xyzgz
  553. PsUw8PmL3DcJGuaeqZmigT7ihIufo8328Lnhpjyak2JzYbeq+Ecp6KTLyX8Vcwei
  554. r+sfcG2aZsRHaELT1lDL89VCvsvTKX51V5vcYgyA7WWXIFIxEA7Xb09iDfHEIacD
  555. UOR5C63AlFd7P236Ya1MkD0dm1BE8A2/ncNAK6imtuDPEc5MFVECAwEAAaOCARUw
  556. ggERMB0GA1UdDgQWBBRxLGapu/LRv3i2e/tnO4MitQvIdDCB4QYDVR0jBIHZMIHW
  557. gBRxLGapu/LRv3i2e/tnO4MitQvIdKGBsqSBrzCBrDELMAkGA1UEBhMCUEgxETAP
  558. BgNVBAgTCEJBVEFOR0FTMRAwDgYDVQQHEwdUQU5BVUFOMRQwEgYDVQQKEwtLT1JO
  559. LUdBTUlORzENMAsGA1UECxMEa29ybjEXMBUGA1UEAxMOS09STi1HQU1JTkcgQ0Ex
  560. ETAPBgNVBCkTCEtvcm4tVlBOMScwJQYJKoZIhvcNAQkBFhhHV0FQT05HLkxBTkRF
  561. UkBnbWFpbC5jb22CCQCAmvNwY4p+lTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEB
  562. CwUAA4IBAQBx/i8n74O0XRn2qTHPcDMQgVewNkBoMau50VH/E1cY8R5Zzy7L/ty7
  563. 2uu5BOT5GnVTwKpMSz+AalEptTpZ1dFDuYMz1E3190kHD4xNQjRTKP+BhgBi+rGL
  564. CB5FK7YseZGLcHqmYuYx9caEDAqKg/zzDSLYs4Gfy55IG1V1XtAs0BLsKm+t8mvy
  565. Cq5rWD5VoC8UbPbjo2Zl3l+ceJTTgkU4+7YHCBkyBsu1SOTqXJn3mTafIkCb+Kk9
  566. +GtTpmAIms8xnHkzl0kCG/WA4t8vWWA21Ja/Bac0ZjqjR5xEm7bBLhAOdPg8r3iO
  567. aUkO7wClIE6dNtSc2jKJhYRO3UhOFxqd
  568. -----END CERTIFICATE-----
  569. EOF7
  570. cat <<'EOF9'> /etc/openvpn/server.crt
  571. Certificate:
  572. Data:
  573. Version: 3 (0x2)
  574. Serial Number: 1 (0x1)
  575. Signature Algorithm: sha256WithRSAEncryption
  576. Issuer: C=PH, ST=BATANGAS, L=TANAUAN, O=KORN-GAMING, OU=korn, CN=KORN-GAMING CA/name=Korn-VPN/emailAddress=GWAPONG.LANDER@gmail.com
  577. Validity
  578. Not Before: Dec 29 12:50:55 2020 GMT
  579. Not After : Dec 27 12:50:55 2030 GMT
  580. Subject: C=PH, ST=BATANGAS, L=TANAUAN, O=KORN-GAMING, OU=korn, CN=server/name=Korn-VPN/emailAddress=GWAPONG.LANDER@gmail.com
  581. Subject Public Key Info:
  582. Public Key Algorithm: rsaEncryption
  583. Public-Key: (2048 bit)
  584. Modulus:
  585. 00:a5:7d:4f:e2:14:14:23:9b:a6:6e:09:9f:c2:6e:
  586. ee:83:67:1a:4f:b1:ee:32:16:09:d2:0e:9c:fb:29:
  587. cc:b9:45:e1:fd:21:e2:e4:2f:7d:70:83:42:dc:75:
  588. b5:6a:a7:94:da:36:e4:26:e9:d3:86:08:b8:2f:24:
  589. 9a:ca:61:31:d9:36:03:ec:e3:01:30:24:30:c2:7d:
  590. 94:e0:07:ac:ea:c8:81:c6:14:3d:6d:b5:0c:90:e4:
  591. 1f:e7:f4:bd:04:ca:84:a8:f2:43:78:93:f7:d2:80:
  592. 69:9f:00:82:b0:35:21:51:d2:57:7e:10:e6:85:50:
  593. aa:80:a1:ed:bc:0b:99:f9:70:e3:f7:c2:5b:2b:4c:
  594. 6e:f5:a1:61:b3:aa:77:3d:33:fa:f0:d3:00:02:bb:
  595. 13:b5:eb:a2:60:f8:96:1c:22:cb:a4:94:01:ef:66:
  596. 60:a2:15:98:35:d4:66:b2:c8:02:2c:fa:2c:f2:e9:
  597. 6a:4d:7d:47:69:ab:2d:41:63:6a:d1:ac:e2:0e:93:
  598. 7f:29:a6:5c:b2:af:d8:11:e3:ab:a7:45:b8:8e:a8:
  599. fb:e2:04:de:86:79:2c:cc:2c:1f:58:4f:8c:29:24:
  600. 55:f1:6e:1a:df:5b:fb:3a:11:b4:24:63:d8:c7:bb:
  601. 95:ca:3e:ef:6c:84:67:30:98:58:9f:95:da:52:09:
  602. 2e:47
  603. Exponent: 65537 (0x10001)
  604. X509v3 extensions:
  605. X509v3 Basic Constraints:
  606. CA:FALSE
  607. Netscape Cert Type:
  608. SSL Server
  609. Netscape Comment:
  610. Easy-RSA Generated Server Certificate
  611. X509v3 Subject Key Identifier:
  612. 20:89:52:D3:B8:CC:BE:ED:89:04:FA:64:EB:3C:4C:29:27:36:09:C4
  613. X509v3 Authority Key Identifier:
  614. keyid:71:2C:66:A9:BB:F2:D1:BF:78:B6:7B:FB:67:3B:83:22:B5:0B:C8:74
  615. DirName:/C=PH/ST=BATANGAS/L=TANAUAN/O=KORN-GAMING/OU=korn/CN=KORN-GAMING CA/name=Korn-VPN/emailAddress=GWAPONG.LANDER@gmail.com
  616. serial:80:9A:F3:70:63:8A:7E:95
  617. X509v3 Extended Key Usage:
  618. TLS Web Server Authentication
  619. X509v3 Key Usage:
  620. Digital Signature, Key Encipherment
  621. X509v3 Subject Alternative Name:
  622. DNS:server
  623. Signature Algorithm: sha256WithRSAEncryption
  624. 12:18:dd:33:b6:52:49:e9:2d:69:75:3b:ac:4d:e2:bf:85:48:
  625. 07:4f:14:bd:fb:e2:37:fb:86:3b:78:69:01:43:29:4d:62:a3:
  626. 5f:85:98:9a:82:fc:21:72:50:5e:dd:a6:a5:3e:94:b7:f9:a3:
  627. eb:ee:76:94:b3:27:5a:fa:f0:0d:b8:8c:9b:0e:ed:21:c2:79:
  628. 3e:4f:bf:e7:50:7b:42:06:2b:d9:79:ab:0e:d9:79:12:2a:8e:
  629. d6:55:f8:a4:fc:1c:48:13:d7:b3:81:0b:ab:ad:90:3d:9a:7e:
  630. 07:be:e8:64:8d:cf:7a:29:01:df:da:31:0e:4b:22:2d:c0:3a:
  631. f9:ff:0e:e8:f0:07:dd:13:8b:94:95:6d:70:52:af:49:52:58:
  632. 11:61:35:d2:83:a0:04:49:d0:17:0c:68:dd:70:24:d5:33:a9:
  633. 6e:28:7f:16:48:e6:d7:1c:3d:88:2a:32:5e:0d:61:2b:56:bc:
  634. cf:23:e2:7e:20:f7:2a:72:2e:f4:5c:a8:cd:d7:7d:07:72:cd:
  635. 68:57:bf:0b:d0:bf:c0:36:5b:66:e8:2a:5b:76:5b:5a:af:cd:
  636. 04:16:d2:e3:19:6f:34:9c:93:36:c9:fb:b4:45:6b:1a:20:02:
  637. 93:81:a4:b5:12:c2:f3:29:33:e8:8d:dd:69:6b:7f:db:35:ca:
  638. f6:07:d5:60
  639. -----BEGIN CERTIFICATE-----
  640. MIIFXzCCBEegAwIBAgIBATANBgkqhkiG9w0BAQsFADCBrDELMAkGA1UEBhMCUEgx
  641. ETAPBgNVBAgTCEJBVEFOR0FTMRAwDgYDVQQHEwdUQU5BVUFOMRQwEgYDVQQKEwtL
  642. T1JOLUdBTUlORzENMAsGA1UECxMEa29ybjEXMBUGA1UEAxMOS09STi1HQU1JTkcg
  643. Q0ExETAPBgNVBCkTCEtvcm4tVlBOMScwJQYJKoZIhvcNAQkBFhhHV0FQT05HLkxB
  644. TkRFUkBnbWFpbC5jb20wHhcNMjAxMjI5MTI1MDU1WhcNMzAxMjI3MTI1MDU1WjCB
  645. pDELMAkGA1UEBhMCUEgxETAPBgNVBAgTCEJBVEFOR0FTMRAwDgYDVQQHEwdUQU5B
  646. VUFOMRQwEgYDVQQKEwtLT1JOLUdBTUlORzENMAsGA1UECxMEa29ybjEPMA0GA1UE
  647. AxMGc2VydmVyMREwDwYDVQQpEwhLb3JuLVZQTjEnMCUGCSqGSIb3DQEJARYYR1dB
  648. UE9ORy5MQU5ERVJAZ21haWwuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
  649. CgKCAQEApX1P4hQUI5umbgmfwm7ug2caT7HuMhYJ0g6c+ynMuUXh/SHi5C99cINC
  650. 3HW1aqeU2jbkJunThgi4LySaymEx2TYD7OMBMCQwwn2U4Aes6siBxhQ9bbUMkOQf
  651. 5/S9BMqEqPJDeJP30oBpnwCCsDUhUdJXfhDmhVCqgKHtvAuZ+XDj98JbK0xu9aFh
  652. s6p3PTP68NMAArsTteuiYPiWHCLLpJQB72ZgohWYNdRmssgCLPos8ulqTX1Haast
  653. QWNq0aziDpN/KaZcsq/YEeOrp0W4jqj74gTehnkszCwfWE+MKSRV8W4a31v7OhG0
  654. JGPYx7uVyj7vbIRnMJhYn5XaUgkuRwIDAQABo4IBkDCCAYwwCQYDVR0TBAIwADAR
  655. BglghkgBhvhCAQEEBAMCBkAwNAYJYIZIAYb4QgENBCcWJUVhc3ktUlNBIEdlbmVy
  656. YXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCCJUtO4zL7tiQT6ZOs8
  657. TCknNgnEMIHhBgNVHSMEgdkwgdaAFHEsZqm78tG/eLZ7+2c7gyK1C8h0oYGypIGv
  658. MIGsMQswCQYDVQQGEwJQSDERMA8GA1UECBMIQkFUQU5HQVMxEDAOBgNVBAcTB1RB
  659. TkFVQU4xFDASBgNVBAoTC0tPUk4tR0FNSU5HMQ0wCwYDVQQLEwRrb3JuMRcwFQYD
  660. VQQDEw5LT1JOLUdBTUlORyBDQTERMA8GA1UEKRMIS29ybi1WUE4xJzAlBgkqhkiG
  661. 9w0BCQEWGEdXQVBPTkcuTEFOREVSQGdtYWlsLmNvbYIJAICa83Bjin6VMBMGA1Ud
  662. JQQMMAoGCCsGAQUFBwMBMAsGA1UdDwQEAwIFoDARBgNVHREECjAIggZzZXJ2ZXIw
  663. DQYJKoZIhvcNAQELBQADggEBABIY3TO2UknpLWl1O6xN4r+FSAdPFL374jf7hjt4
  664. aQFDKU1io1+FmJqC/CFyUF7dpqU+lLf5o+vudpSzJ1r68A24jJsO7SHCeT5Pv+dQ
  665. e0IGK9l5qw7ZeRIqjtZV+KT8HEgT17OBC6utkD2afge+6GSNz3opAd/aMQ5LIi3A
  666. Ovn/DujwB90Ti5SVbXBSr0lSWBFhNdKDoARJ0BcMaN1wJNUzqW4ofxZI5tccPYgq
  667. Ml4NYStWvM8j4n4g9ypyLvRcqM3XfQdyzWhXvwvQv8A2W2boKlt2W1qvzQQW0uMZ
  668. bzSckzbJ+7RFaxogApOBpLUSwvMpM+iN3Wlrf9s1yvYH1WA=
  669. -----END CERTIFICATE-----
  670. EOF9
  671. cat <<'EOF10'> /etc/openvpn/server.key
  672. -----BEGIN PRIVATE KEY-----
  673. MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQClfU/iFBQjm6Zu
  674. CZ/Cbu6DZxpPse4yFgnSDpz7Kcy5ReH9IeLkL31wg0LcdbVqp5TaNuQm6dOGCLgv
  675. JJrKYTHZNgPs4wEwJDDCfZTgB6zqyIHGFD1ttQyQ5B/n9L0EyoSo8kN4k/fSgGmf
  676. AIKwNSFR0ld+EOaFUKqAoe28C5n5cOP3wlsrTG71oWGzqnc9M/rw0wACuxO166Jg
  677. +JYcIsuklAHvZmCiFZg11GayyAIs+izy6WpNfUdpqy1BY2rRrOIOk38pplyyr9gR
  678. 46unRbiOqPviBN6GeSzMLB9YT4wpJFXxbhrfW/s6EbQkY9jHu5XKPu9shGcwmFif
  679. ldpSCS5HAgMBAAECggEBAKLueZPQyPM17+out4gqx9G/1PvZ5vaRFCIoGQ5/3Pwc
  680. fZ9HmaenygzYbx+3FGJpk/g0SvS1CnjQZOalV3EhuH5u2/aCmUzYlNkn40eexvRx
  681. bLOkgcZdln2g3Hj3UJJDAdGElEFHDZvGqjbNvd3WsXNpcJLB+PQQs43p37Jgibw3
  682. gBWIS1/kJfVzeTnzk5qgrMogNIW4RAXUzI3tEbhYEVXCi/ZP/iBzalb2eAl/DOC9
  683. iKyZ+rEwPCfWL+JFq5Qe6T0R/USOZAdC1irr6XQ0rNQwWbce/RWAmb45d3QYHbb6
  684. Qjhx0ScuheRdutqaJUkqDHk26V13Z4KjLbKzUQZIg0ECgYEA0l+vajfWtTMnW1CR
  685. Qp+gpxvgQnN+V3tX30KiXOtM2BtGLXFIDdvbQxaMRzd+hW0naVVhu0KIQo07OEOz
  686. 4OH/xNHqVZ47gQgKHkUZub72JXaJAk1F40NdRbLvn5jfMz3I+MtTIXT7f1mBHvM7
  687. xLnBpwhs+JUKAAFTrw+TzOTd2skCgYEAyWGTHsBUEuEt9wj8LEp2fm6M9Iqp3eWS
  688. 6V7TiOqWduK3aCDhyw1BkvVZjWHFiL927y+imik9z0SBAKdUnKPSxLrMkzKH0ZER
  689. v2UmKhZHKMsKERIh8kcaAFYuNZSvxdbWRdMzM5dam5L6P67LvysZutE7gXsorynE
  690. OX8eRUBAOI8CgYEAznUjVM26BBhQrpgSBt1br8R2wSBRRI+C/FOLvj8aKhgSNjSv
  691. bxJuS5fMUXQP0ef+vqwRftJboVyzWpNu6+s/tKwCGsZwRUBblbtg9N6I+NksurqV
  692. NOT+m5FxAyLnIYWoPypjyjjhPOjdBD/XT0ix2Tg2oXq61qh2tR5HgdS2OakCgYEA
  693. s8FANGvS4ANWJzNC/Tn+aT6+3S3FEMfyihNV2NolMruOoQjw43HSvZ35sMS8MSNO
  694. w5QOnXMAtDleuTmjwipNYcOoBiBNsde/MsvT9C9sl1Idiz1XRc8Hu5Mxriwpdfwd
  695. ybgK9Rs+Cq54aE3bmqmbTvGjHyHTH/+1IumAGKqQaKsCgYAMacI1eSUDTNa0I4Us
  696. 29bKpvZrbDn/oDBaLGxBLrLMf450HJvpz0PGvNh0mY2G3a3dd6JRf5ZZ8me1rHXZ
  697. cwB6fMAtJdp6x/2QTDZ2va5avhRB/4lRNyJifl6lhad0XPKhEOByd7wg+VeCBJ6P
  698. xXEZw5bUG9re12VX9nWNBLhJCw==
  699. -----END PRIVATE KEY-----
  700. EOF10
  701. cat <<'EOF13'> /etc/openvpn/dh2048.pem
  702. -----BEGIN DH PARAMETERS-----
  703. MIIBCAKCAQEA6LG2I1lCezcnn9QXIT4pVFqB1mlww4YUywZ0lZV9OL6FyT+hlhix
  704. LKulx5Wt6JhbSMjq7bJOhXiXaKh4Ve3UYTF0M+9t+7PeWyzgYu7ouyUWJDdubb/f
  705. KqObXujveTPUs8BxtmOYNZQwVmh/hXPVeC62PyrL3uX8t2oziZcn52RN+nUxzAWS
  706. wbZ7VXkKCfAC/QzJu+SEooS18I8R02waN5Pem0lj7Dg8IvT1Y4u8ZpLdr7uBg6mX
  707. dN49yNN5IfrmebxWqTH71JkyvIr9eX4HUSBH16bKfjjBr2XD0L0/jd0xxkQ4at38
  708. Baz0CzH2Sn+GXV44+gfR6/9WBSSmsnZ4cwIBAg==
  709. -----END DH PARAMETERS-----
  710. EOF13
  711. # Creating a New update message in server.conf
  712. cat <<'NUovpn' > /etc/openvpn/server.conf
  713. # New Update are now released, OpenVPN Server
  714. # are now running both TCP and UDP Protocol. (Both are only running on IPv4)
  715. # But our native server.conf are now removed and divided
  716. # Into two different configs base on their Protocols:
  717. # * OpenVPN TCP (located at /etc/openvpn/server_tcp.conf
  718. # * OpenVPN UDP (located at /etc/openvpn/server_udp.conf
  719. #
  720. # Also other logging files like
  721. # status logs and server logs
  722. # are moved into new different file names:
  723. # * OpenVPN TCP Server logs (/etc/openvpn/tcp.log)
  724. # * OpenVPN UDP Server logs (/etc/openvpn/udp.log)
  725. # * OpenVPN TCP Status logs (/etc/openvpn/tcp_stats.log)
  726. # * OpenVPN UDP Status logs (/etc/openvpn/udp_stats.log)
  727. #
  728. # Server ports are configured base on env vars
  729. # executed/raised from this script (OpenVPN_TCP_Port/OpenVPN_UDP_Port)
  730. #
  731. NUovpn
  732. # setting openvpn server port
  733. sed -i "s|OVPNTCP|$OpenVPN_TCP_Port|g" /etc/openvpn/server_tcp.conf
  734. sed -i "s|OVPNUDP|$OpenVPN_UDP_Port|g" /etc/openvpn/server_udp.conf
  735. sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/openvpn/server_tcp.conf
  736. sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/openvpn/server_udp.conf
  737. sed -i "s|Tcp_Monitor_Port|$Tcp_Monitor_Port|g" /etc/openvpn/server_tcp.conf
  738. sed -i "s|Udp_Monitor_Port|$Udp_Monitor_Port|g" /etc/openvpn/server_udp.conf
  739. # Getting some OpenVPN plugins for unix authentication
  740. cd
  741. wget https://github.com/korn-sudo/Project-Fog/raw/main/files/plugins/plugin.tgz
  742. tar -xzvf /root/plugin.tgz -C /etc/openvpn/
  743. rm -f plugin.tgz
  744. # Some workaround for OpenVZ machines for "Startup error" openvpn service
  745. if [[ "$(hostnamectl | grep -i Virtualization | awk '{print $2}' | head -n1)" == 'openvz' ]]; then
  746. sed -i 's|LimitNPROC|#LimitNPROC|g' /lib/systemd/system/openvpn*
  747. systemctl daemon-reload
  748. fi
  749. # Allow IPv4 Forwarding
  750. sed -i '/net.ipv4.ip_forward.*/d' /etc/sysctl.conf
  751. sed -i '/net.ipv4.ip_forward.*/d' /etc/sysctl.d/*.conf
  752. echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/20-openvpn.conf
  753. sysctl --system &> /dev/null
  754. # Iptables Rule for OpenVPN server
  755. cat <<'EOFipt' > /etc/openvpn/openvpn.bash
  756. #!/bin/bash
  757. PUBLIC_INET="$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)"
  758. IPCIDR='10.200.0.0/16'
  759. IPCIDR2='10.201.0.0/16'
  760. iptables -I FORWARD -s $IPCIDR -j ACCEPT
  761. iptables -I FORWARD -s $IPCIDR2 -j ACCEPT
  762. iptables -t nat -A POSTROUTING -o $PUBLIC_INET -j MASQUERADE
  763. iptables -t nat -A POSTROUTING -s $IPCIDR -o $PUBLIC_INET -j MASQUERADE
  764. iptables -t nat -A POSTROUTING -s $IPCIDR2 -o $PUBLIC_INET -j MASQUERADE
  765. EOFipt
  766. chmod +x /etc/openvpn/openvpn.bash
  767. bash /etc/openvpn/openvpn.bash
  768. # Enabling IPv4 Forwarding
  769. echo 1 > /proc/sys/net/ipv4/ip_forward
  770. # Starting OpenVPN server
  771. systemctl start openvpn@server_tcp
  772. systemctl enable openvpn@server_tcp
  773. systemctl start openvpn@server_udp
  774. systemctl enable openvpn@server_udp
  775. }
  776. function InsProxy(){
  777. # Removing Duplicate privoxy config
  778. rm -rf /etc/privoxy/config*
  779. # Creating Privoxy server config using cat eof tricks
  780. cat <<'privoxy' > /etc/privoxy/config
  781. # My Privoxy Server Config
  782. user-manual /usr/share/doc/privoxy/user-manual
  783. confdir /etc/privoxy
  784. logdir /var/log/privoxy
  785. filterfile default.filter
  786. logfile logfile
  787. listen-address 0.0.0.0:Privoxy_Port1
  788. listen-address 0.0.0.0:Privoxy_Port2
  789. toggle 1
  790. enable-remote-toggle 0
  791. enable-remote-http-toggle 0
  792. enable-edit-actions 0
  793. enforce-blocks 0
  794. buffer-limit 4096
  795. enable-proxy-authentication-forwarding 1
  796. forwarded-connect-retries 1
  797. accept-intercepted-requests 1
  798. allow-cgi-request-crunching 1
  799. split-large-forms 0
  800. keep-alive-timeout 5
  801. tolerate-pipelining 1
  802. socket-timeout 300
  803. permit-access 0.0.0.0/0 IP-ADDRESS
  804. privoxy
  805. # Setting machine's IP Address inside of our privoxy config(security that only allows this machine to use this proxy server)
  806. sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/privoxy/config
  807. # Setting privoxy ports
  808. sed -i "s|Privoxy_Port1|$Privoxy_Port1|g" /etc/privoxy/config
  809. sed -i "s|Privoxy_Port2|$Privoxy_Port2|g" /etc/privoxy/config
  810. # Starting Proxy server
  811. echo -e "Restarting Privoxy Proxy server..."
  812. systemctl restart privoxy
  813. # Removing Duplicate Squid config
  814. rm -rf /etc/squid/squid.con*
  815. # Creating Squid server config using cat eof tricks
  816. cat <<'mySquid' > /etc/squid/squid.conf
  817. # My Squid Proxy Server Config
  818. acl VPN dst IP-ADDRESS/32
  819. http_access allow VPN
  820. http_access deny all
  821. http_port 0.0.0.0:Squid_Port1
  822. http_port 0.0.0.0:Squid_Port2
  823. http_port 0.0.0.0:Squid_Port3
  824. ### Allow Headers
  825. request_header_access Allow allow all
  826. request_header_access Authorization allow all
  827. request_header_access WWW-Authenticate allow all
  828. request_header_access Proxy-Authorization allow all
  829. request_header_access Proxy-Authenticate allow all
  830. request_header_access Cache-Control allow all
  831. request_header_access Content-Encoding allow all
  832. request_header_access Content-Length allow all
  833. request_header_access Content-Type allow all
  834. request_header_access Date allow all
  835. request_header_access Expires allow all
  836. request_header_access Host allow all
  837. request_header_access If-Modified-Since allow all
  838. request_header_access Last-Modified allow all
  839. request_header_access Location allow all
  840. request_header_access Pragma allow all
  841. request_header_access Accept allow all
  842. request_header_access Accept-Charset allow all
  843. request_header_access Accept-Encoding allow all
  844. request_header_access Accept-Language allow all
  845. request_header_access Content-Language allow all
  846. request_header_access Mime-Version allow all
  847. request_header_access Retry-After allow all
  848. request_header_access Title allow all
  849. request_header_access Connection allow all
  850. request_header_access Proxy-Connection allow all
  851. request_header_access User-Agent allow all
  852. request_header_access Cookie allow all
  853. request_header_access All deny all
  854. ### HTTP Anonymizer Paranoid
  855. reply_header_access Allow allow all
  856. reply_header_access Authorization allow all
  857. reply_header_access WWW-Authenticate allow all
  858. reply_header_access Proxy-Authorization allow all
  859. reply_header_access Proxy-Authenticate allow all
  860. reply_header_access Cache-Control allow all
  861. reply_header_access Content-Encoding allow all
  862. reply_header_access Content-Length allow all
  863. reply_header_access Content-Type allow all
  864. reply_header_access Date allow all
  865. reply_header_access Expires allow all
  866. reply_header_access Host allow all
  867. reply_header_access If-Modified-Since allow all
  868. reply_header_access Last-Modified allow all
  869. reply_header_access Location allow all
  870. reply_header_access Pragma allow all
  871. reply_header_access Accept allow all
  872. reply_header_access Accept-Charset allow all
  873. reply_header_access Accept-Encoding allow all
  874. reply_header_access Accept-Language allow all
  875. reply_header_access Content-Language allow all
  876. reply_header_access Mime-Version allow all
  877. reply_header_access Retry-After allow all
  878. reply_header_access Title allow all
  879. reply_header_access Connection allow all
  880. reply_header_access Proxy-Connection allow all
  881. reply_header_access User-Agent allow all
  882. reply_header_access Cookie allow all
  883. reply_header_access All deny all
  884. #Korn
  885. cache_mem 200 MB
  886. maximum_object_size_in_memory 32 KB
  887. maximum_object_size 1024 MB
  888. minimum_object_size 0 KB
  889. cache_swap_low 90
  890. cache_swap_high 95
  891. cache_dir ufs /var/spool/squid 100 16 256
  892. access_log /var/log/squid/access.log squid
  893. ### CoreDump
  894. coredump_dir /var/spool/squid
  895. dns_nameservers 1.1.1.1 1.0.0.1
  896. refresh_pattern ^ftp: 1440 20% 10080
  897. refresh_pattern ^gopher: 1440 0% 1440
  898. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
  899. refresh_pattern . 0 20% 4320
  900. visible_hostname blackestsaint
  901. mySquid
  902. # Setting machine's IP Address inside of our Squid config(security that only allows this machine to use this proxy server)
  903. sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/squid/squid.conf
  904. # Setting squid ports
  905. sed -i "s|Squid_Port1|$Squid_Port1|g" /etc/squid/squid.conf
  906. sed -i "s|Squid_Port2|$Squid_Port2|g" /etc/squid/squid.conf
  907. sed -i "s|Squid_Port3|$Squid_Port3|g" /etc/squid/squid.conf
  908. # Starting Proxy server
  909. echo -e "Restarting Squid Proxy server..."
  910. systemctl restart squid
  911. }
  912. function FogPanel(){
  913. rm /home/vps/public_html -rf
  914. rm /etc/nginx/sites-* -rf
  915. rm /etc/nginx/nginx.conf -rf
  916. sleep 1
  917. mkdir -p /home/vps/public_html
  918. # Creating nginx config for our webserver
  919. cat <<'myNginxC' > /etc/nginx/nginx.conf
  920. user www-data;
  921. worker_processes 1;
  922. pid /var/run/nginx.pid;
  923. events {
  924. multi_accept on;
  925. worker_connections 1024;
  926. }
  927. http {
  928. gzip on;
  929. gzip_vary on;
  930. gzip_comp_level 5;
  931. gzip_types text/plain application/x-javascript text/xml text/css;
  932. autoindex on;
  933. sendfile on;
  934. tcp_nopush on;
  935. tcp_nodelay on;
  936. keepalive_timeout 65;
  937. types_hash_max_size 2048;
  938. server_tokens off;
  939. include /etc/nginx/mime.types;
  940. default_type application/octet-stream;
  941. access_log /var/log/nginx/access.log;
  942. error_log /var/log/nginx/error.log;
  943. client_max_body_size 32M;
  944. client_header_buffer_size 8m;
  945. large_client_header_buffers 8 8m;
  946. fastcgi_buffer_size 8m;
  947. fastcgi_buffers 8 8m;
  948. fastcgi_read_timeout 600;
  949. include /etc/nginx/conf.d/*.conf;
  950. }
  951. myNginxC
  952. # Creating vps config for our OCS Panel
  953. cat <<'myvpsC' > /etc/nginx/conf.d/vps.conf
  954. server {
  955. listen Nginx_Port;
  956. server_name 127.0.0.1 localhost;
  957. access_log /var/log/nginx/vps-access.log;
  958. error_log /var/log/nginx/vps-error.log error;
  959. root /home/vps/public_html;
  960. location / {
  961. index index.html index.htm index.php;
  962. try_files $uri $uri/ /index.php?$args;
  963. }
  964. location ~ \.php$ {
  965. include /etc/nginx/fastcgi_params;
  966. fastcgi_pass 127.0.0.1:Php_Socket;
  967. fastcgi_index index.php;
  968. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  969. }
  970. }
  971. myvpsC
  972. # Creating monitoring config for our OpenVPN Monitoring Panel
  973. cat <<'myMonitoringC' > /etc/nginx/conf.d/monitoring.conf
  974. server {
  975. listen Fog_Openvpn_Monitoring;
  976. location / {
  977. uwsgi_pass unix:///run/uwsgi/app/openvpn-monitor/socket;
  978. include uwsgi_params;
  979. }
  980. }
  981. myMonitoringC
  982. #this is the home page of our webserver
  983. wget -O /home/vps/public_html/index.php "https://raw.githubusercontent.com/korn-sudo/Project-Fog/main/files/panel/index.php"
  984. # Setting up our WebServer Ports and IP Addresses
  985. cd
  986. sleep 1
  987. sed -i "s|/run/php/php7.0-fpm.sock|127.0.0.1:$Php_Socket|g" /etc/php/7.0/fpm/pool.d/www.conf
  988. sed -i "s|Php_Socket|$Php_Socket|g" /etc/nginx/conf.d/vps.conf
  989. sed -i "s|Nginx_Port|$Nginx_Port|g" /etc/nginx/conf.d/vps.conf
  990. sed -i "s|Fog_Openvpn_Monitoring|$Fog_Openvpn_Monitoring|g" /etc/nginx/conf.d/monitoring.conf
  991. sed -i "s|Fog_Openvpn_Monitoring|$Fog_Openvpn_Monitoring|g" /home/vps/public_html/index.php
  992. sed -i "s|fogserverip|$IPADDR|g" /home/vps/public_html/index.php
  993. sed -i "s|v2portas|65432|g" /home/vps/public_html/index.php
  994. sed -i "s|SSH_Port1|$SSH_Port1|g" /home/vps/public_html/index.php
  995. sed -i "s|SSH_Port2|$SSH_Port2|g" /home/vps/public_html/index.php
  996. sed -i "s|Dropbear_Port1|$Dropbear_Port1|g" /home/vps/public_html/index.php
  997. sed -i "s|Dropbear_Port2|$Dropbear_Port2|g" /home/vps/public_html/index.php
  998. sed -i "s|Stunnel_Port1|$Stunnel_Port1|g" /home/vps/public_html/index.php
  999. sed -i "s|Stunnel_Port2|$Stunnel_Port2|g" /home/vps/public_html/index.php
  1000. sed -i "s|Stunnel_Port3|$Stunnel_Port3|g" /home/vps/public_html/index.php
  1001. sed -i "s|Privoxy_Port1|$Privoxy_Port1|g" /home/vps/public_html/index.php
  1002. sed -i "s|Privoxy_Port2|$Privoxy_Port1|g" /home/vps/public_html/index.php
  1003. sed -i "s|Squid_Port1|$Squid_Port1|g" /home/vps/public_html/index.php
  1004. sed -i "s|Squid_Port2|$Squid_Port2|g" /home/vps/public_html/index.php
  1005. sed -i "s|Squid_Port3|$Squid_Port3|g" /home/vps/public_html/index.php
  1006. sed -i "s|OHP_Port1|$OHP_Port1|g" /home/vps/public_html/index.php
  1007. sed -i "s|OHP_Port2|$OHP_Port2|g" /home/vps/public_html/index.php
  1008. sed -i "s|OHP_Port3|$OHP_Port3|g" /home/vps/public_html/index.php
  1009. sed -i "s|OHP_Port4|$OHP_Port4|g" /home/vps/public_html/index.php
  1010. sed -i "s|OHP_Port5|$OHP_Port5|g" /home/vps/public_html/index.php
  1011. sed -i "s|Simple_Port1|$Simple_Port1|g" /home/vps/public_html/index.php
  1012. sed -i "s|Simple_Port2|$Simple_Port2|g" /home/vps/public_html/index.php
  1013. sed -i "s|Direct_Port1|$Direct_Port1|g" /home/vps/public_html/index.php
  1014. sed -i "s|Direct_Port2|$Direct_Port2|g" /home/vps/public_html/index.php
  1015. sed -i "s|Open_Port1|$Open_Port1|g" /home/vps/public_html/index.php
  1016. sed -i "s|Open_Port2|$Open_Port2|g" /home/vps/public_html/index.php
  1017. sed -i "s|NXPort|$Nginx_Port|g" /home/vps/public_html/index.php
  1018. service nginx restart
  1019. # Setting Up OpenVPN monitoring
  1020. wget -O /srv/openvpn-monitor.zip "https://github.com/korn-sudo/Project-Fog/raw/main/files/panel/openvpn-monitor.zip"
  1021. cd /srv
  1022. unzip -qq openvpn-monitor.zip
  1023. rm -f openvpn-monitor.zip
  1024. cd openvpn-monitor
  1025. virtualenv .
  1026. . bin/activate
  1027. pip install -r requirements.txt
  1028. #updating ports for openvpn monitoring
  1029. sed -i "s|Tcp_Monitor_Port|$Tcp_Monitor_Port|g" /srv/openvpn-monitor/openvpn-monitor.conf
  1030. sed -i "s|Udp_Monitor_Port|$Udp_Monitor_Port|g" /srv/openvpn-monitor/openvpn-monitor.conf
  1031. # Creating monitoring .ini for our OpenVPN Monitoring Panel
  1032. cat <<'myMonitorINI' > /etc/uwsgi/apps-available/openvpn-monitor.ini
  1033. [uwsgi]
  1034. base = /srv
  1035. project = openvpn-monitor
  1036. logto = /var/log/uwsgi/app/%(project).log
  1037. plugins = python
  1038. chdir = %(base)/%(project)
  1039. virtualenv = %(chdir)
  1040. module = openvpn-monitor:application
  1041. manage-script-name = true
  1042. mount=/openvpn-monitor=openvpn-monitor.py
  1043. myMonitorINI
  1044. ln -s /etc/uwsgi/apps-available/openvpn-monitor.ini /etc/uwsgi/apps-enabled/
  1045. # GeoIP For OpenVPN Monitor
  1046. mkdir -p /var/lib/GeoIP
  1047. wget -O /var/lib/GeoIP/GeoLite2-City.mmdb.gz "https://github.com/korn-sudo/Project-Fog/raw/main/files/panel/GeoLite2-City.mmdb.gz"
  1048. gzip -d /var/lib/GeoIP/GeoLite2-City.mmdb.gz
  1049. # Now creating all of our OpenVPN Configs
  1050. # Smart Giga Games Promo TCP
  1051. cat <<Config1> /home/vps/public_html/Smart.Giga.Games.ovpn
  1052. # Created by blackestsaint
  1053. client
  1054. dev tun
  1055. proto tcp
  1056. setenv FRIENDLY_NAME "Server-Name"
  1057. remote $IPADDR $OpenVPN_TCP_Port
  1058. nobind
  1059. persist-key
  1060. persist-tun
  1061. comp-lzo
  1062. keepalive 10 120
  1063. tls-client
  1064. remote-cert-tls server
  1065. verb 2
  1066. auth-user-pass
  1067. cipher none
  1068. auth none
  1069. auth-nocache
  1070. auth-retry interact
  1071. connect-retry 0 1
  1072. nice -20
  1073. reneg-sec 0
  1074. redirect-gateway def1
  1075. setenv CLIENT_CERT 0
  1076. http-proxy $IPADDR $Squid_Port1
  1077. http-proxy-option VERSION 1.1
  1078. http-proxy-option CUSTOM-HEADER Host codm.garena.com
  1079. http-proxy-option CUSTOM-HEADER X-Forward-Host codm.garena.com
  1080. http-proxy-option CUSTOM-HEADER X-Forwarded-For codm.garena.com
  1081. http-proxy-option CUSTOM-HEADER Referrer codm.garena.com
  1082. <ca>
  1083. $(cat /etc/openvpn/ca.crt)
  1084. </ca>
  1085. Config1
  1086. # TNT Mobile Legends 10 Promo
  1087. cat <<Config2> /home/vps/public_html/ML10.ovpn
  1088. # Created by blackestsaint
  1089. client
  1090. dev tun
  1091. proto tcp
  1092. setenv FRIENDLY_NAME "Server-Name"
  1093. remote $IPADDR $OpenVPN_TCP_Port
  1094. nobind
  1095. persist-key
  1096. persist-tun
  1097. comp-lzo
  1098. keepalive 10 120
  1099. tls-client
  1100. remote-cert-tls server
  1101. verb 2
  1102. auth-user-pass
  1103. cipher none
  1104. auth none
  1105. auth-nocache
  1106. auth-retry interact
  1107. connect-retry 0 1
  1108. nice -20
  1109. reneg-sec 0
  1110. redirect-gateway def1
  1111. setenv CLIENT_CERT 0
  1112. http-proxy $IPADDR $Privoxy_Port1
  1113. http-proxy-option VERSION 1.1
  1114. http-proxy-option CUSTOM-HEADER ""
  1115. http-proxy-option CUSTOM-HEADER "GET https://web.mobilelegends.com HTTP/1.1"
  1116. http-proxy-option CUSTOM-HEADER Host web.mobilelegends.com
  1117. http-proxy-option CUSTOM-HEADER X-Forward-Host web.mobilelegends.com
  1118. http-proxy-option CUSTOM-HEADER X-Forwarded-For web.mobilelegends.com
  1119. http-proxy-option CUSTOM-HEADER Referrer web.mobilelegends.com
  1120. <ca>
  1121. $(cat /etc/openvpn/ca.crt)
  1122. </ca>
  1123. Config2
  1124. # Default TCP
  1125. cat <<Config3> /home/vps/public_html/Direct.TCP.ovpn
  1126. # Created by blackestsaint
  1127. client
  1128. dev tun
  1129. proto tcp
  1130. setenv FRIENDLY_NAME "Server-Name"
  1131. remote $IPADDR $OpenVPN_TCP_Port
  1132. nobind
  1133. persist-key
  1134. persist-tun
  1135. comp-lzo
  1136. keepalive 10 120
  1137. tls-client
  1138. remote-cert-tls server
  1139. verb 2
  1140. auth-user-pass
  1141. cipher none
  1142. auth none
  1143. auth-nocache
  1144. auth-retry interact
  1145. connect-retry 0 1
  1146. nice -20
  1147. reneg-sec 0
  1148. redirect-gateway def1
  1149. setenv CLIENT_CERT 0
  1150. <ca>
  1151. $(cat /etc/openvpn/ca.crt)
  1152. </ca>
  1153. Config3
  1154. # Default UDP
  1155. cat <<Config4> /home/vps/public_html/Direct.UDP.ovpn
  1156. # Created by blackestsaint
  1157. client
  1158. dev tun
  1159. proto udp
  1160. setenv FRIENDLY_NAME "Server-Name"
  1161. remote $IPADDR $OpenVPN_UDP_Port
  1162. nobind
  1163. persist-key
  1164. persist-tun
  1165. comp-lzo
  1166. keepalive 10 120
  1167. tls-client
  1168. remote-cert-tls server
  1169. verb 2
  1170. auth-user-pass
  1171. cipher none
  1172. auth none
  1173. auth-nocache
  1174. auth-retry interact
  1175. connect-retry 0 1
  1176. nice -20
  1177. reneg-sec 0
  1178. redirect-gateway def1
  1179. setenv CLIENT_CERT 0
  1180. <ca>
  1181. $(cat /etc/openvpn/ca.crt)
  1182. </ca>
  1183. Config4
  1184. # Smart Giga Stories Promo TCP
  1185. cat <<Config5> /home/vps/public_html/Smart.Giga.Stories.ovpn
  1186. # Created by blackestsaint
  1187. client
  1188. dev tun
  1189. proto tcp
  1190. setenv FRIENDLY_NAME "Server-Name"
  1191. remote $IPADDR $OpenVPN_TCP_Port
  1192. nobind
  1193. persist-key
  1194. persist-tun
  1195. comp-lzo
  1196. keepalive 10 120
  1197. tls-client
  1198. remote-cert-tls server
  1199. verb 2
  1200. auth-user-pass
  1201. cipher none
  1202. auth none
  1203. auth-nocache
  1204. auth-retry interact
  1205. connect-retry 0 1
  1206. nice -20
  1207. reneg-sec 0
  1208. redirect-gateway def1
  1209. setenv CLIENT_CERT 0
  1210. http-proxy $IPADDR $Squid_Port1
  1211. http-proxy-option VERSION 1.1
  1212. http-proxy-option CUSTOM-HEADER Host static.muscdn.com
  1213. http-proxy-option CUSTOM-HEADER X-Forward-Host static.muscdn.com
  1214. http-proxy-option CUSTOM-HEADER X-Forwarded-For static.muscdn.com
  1215. http-proxy-option CUSTOM-HEADER Referrer static.muscdn.com
  1216. <ca>
  1217. $(cat /etc/openvpn/ca.crt)
  1218. </ca>
  1219. Config5
  1220. # Renaming Server Name
  1221. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/Smart.Giga.Stories.ovpn
  1222. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/Direct.UDP.ovpn
  1223. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/Direct.TCP.ovpn
  1224. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/ML10.ovpn
  1225. sed -i "s|Server-Name|$ServerName|g" /home/vps/public_html/Smart.Giga.Games.ovpn
  1226. # Creating OVPN download site index.html
  1227. cat <<'mySiteOvpn' > /home/vps/public_html/projectfog.html
  1228. <!DOCTYPE html>
  1229. <html lang="en">
  1230. <!-- Openvpn Config File Download site by Gwapong Lander -->
  1231. <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
  1232. 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"
  1233. href="http://IP-ADDRESS:NGINXPORT/Smart.Giga.Games.ovpn" style="float:right;"><i class="fa fa-download"></i> Download</a></li><li
  1234. 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
  1235. 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
  1236. 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
  1237. 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
  1238. 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>
  1239. </ul></div></div></div></div></body></html>
  1240. mySiteOvpn
  1241. # Setting template's correct name,IP address and nginx Port
  1242. sed -i "s|NGINXPORT|$Nginx_Port|g" /home/vps/public_html/projectfog.html
  1243. sed -i "s|IP-ADDRESS|$IPADDR|g" /home/vps/public_html/projectfog.html
  1244. # Restarting nginx service
  1245. systemctl restart nginx
  1246. # Creating all .ovpn config archives
  1247. cd /home/vps/public_html
  1248. zip -qq -r config.zip *.ovpn
  1249. cd
  1250. chown -R www-data:www-data /home/vps/public_html
  1251. }
  1252. function ip_address(){
  1253. 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 )"
  1254. [ -z "${IP}" ] && IP="$( wget -qO- -t1 -T2 ipv4.icanhazip.com )"
  1255. [ -z "${IP}" ] && IP="$( wget -qO- -t1 -T2 ipinfo.io/ip )"
  1256. [ ! -z "${IP}" ] && echo "${IP}" || echo
  1257. }
  1258. IPADDR="$(ip_address)"
  1259. function ConfStartup(){
  1260. # Creating startup 1 script using cat eof tricks
  1261. cat <<'kornz' > /etc/projectfogstartup
  1262. #!/bin/sh
  1263. # Deleting Expired SSH Accounts
  1264. /usr/local/sbin/korn-user-delete-expired &> /dev/null
  1265. # Firewall Protection ( Torrent, Brute Force, Port Scanning )
  1266. /usr/local/sbin/korn-turntable-fog-obs
  1267. # Setting server local time
  1268. ln -fs /usr/share/zoneinfo/Asia/Manila /etc/localtime
  1269. # Prevent DOS-like UI when installing using APT (Disabling APT interactive dialog)
  1270. export DEBIAN_FRONTEND=noninteractive
  1271. # Blacklisted
  1272. #/bin/bash /etc/vil/blacklist
  1273. # Allowing ALL TCP ports for our machine (Simple workaround for policy-based VPS)
  1274. iptables -A INPUT -s $(wget -4qO- http://ipinfo.io/ip) -p tcp -m multiport --dport 1:65535 -j ACCEPT
  1275. # Allowing OpenVPN to Forward traffic
  1276. /bin/bash /etc/openvpn/openvpn.bash
  1277. # SSR Server
  1278. /usr/local/sbin/korn-ssr-updater-fog-obs
  1279. ###### WARNING
  1280. ###### MAKE SURE YOU ONLY PUT [FULLY WORKING APPS]
  1281. ###### WHOLE SCRIPT WILL COLLAPSE
  1282. ###### IF YOU ADD NOT WORKING SCRIPT
  1283. ###### TEST IT BEFORE ADD YOUR COMMAND HERE
  1284. ###### by: blackestsaint
  1285. kornz
  1286. rm -rf /etc/sysctl.d/99*
  1287. # Setting our startup script to run every machine boots
  1288. cat <<'kornx' > /etc/systemd/system/projectfogstartup.service
  1289. [Unit]
  1290. Description=/etc/projectfogstartup
  1291. ConditionPathExists=/etc/projectfogstartup
  1292. [Service]
  1293. Type=forking
  1294. ExecStart=/etc/projectfogstartup start
  1295. TimeoutSec=0
  1296. StandardOutput=tty
  1297. RemainAfterExit=yes
  1298. SysVStartPriority=99
  1299. [Install]
  1300. WantedBy=multi-user.target
  1301. kornx
  1302. chmod +x /etc/projectfogstartup
  1303. systemctl enable projectfogstartup
  1304. systemctl start projectfogstartup
  1305. # Applying cron job
  1306. cd
  1307. echo "SHELL=/bin/sh
  1308. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" | crontab -
  1309. sleep 1
  1310. echo "#OHP Server
  1311. @reboot /usr/local/sbin/korn-ohp-updater-fog-obs
  1312. #Multi-login Limit ON dropbear,ssh,ssl (not included: openvpn)
  1313. @reboot /usr/local/sbin/limiter-fog-obs
  1314. @reboot /usr/local/sbin/fog-limiter-activator-obs
  1315. # Python Socks Server
  1316. @reboot /usr/local/sbin/korn-python-updater-fog-obs
  1317. # Timer for Auto-reconnect
  1318. @reboot /usr/local/sbin/disable-orasan
  1319. " >> /var/spool/cron/crontabs/root
  1320. }
  1321. ###### Chokepoint for Debian and Ubuntu No.2 vvvvvv
  1322. function ConfMenu(){
  1323. echo -e " Creating Menu scripts.."
  1324. cd /usr/local/sbin/
  1325. wget -q 'https://github.com/korn-sudo/Project-Fog/raw/main/files/menu/korn2021-ubuntu.zip'
  1326. unzip -qq korn2021-ubuntu.zip
  1327. rm -f korn2021-ubuntu.zip
  1328. chmod +x ./*
  1329. dos2unix ./* &> /dev/null
  1330. sed -i 's|/etc/squid/squid.conf|/etc/privoxy/config|g' ./*
  1331. sed -i 's|http_port|listen-address|g' ./*
  1332. cd ~
  1333. wget -O /usr/bin/uninstaller-fog-obs "https://github.com/korn-sudo/Project-Fog/raw/main/files/plugins/ubuntu_unins-fog-obs"
  1334. chmod +x /usr/bin/uninstaller-fog-obs
  1335. }
  1336. ###### Chokepoint for Debian and Ubuntu No.2 ^^^^^
  1337. function ports_info(){
  1338. # For Edit Port dependencies
  1339. mkdir -p /etc/project-fog/service-ports
  1340. mkdir -p /etc/project-fog/v2
  1341. echo "$SSH_Port1" > /etc/project-fog/service-ports/sshp1
  1342. echo "$SSH_Port2" > /etc/project-fog/service-ports/sshp2
  1343. echo "$OpenVPN_TCP_Port" > /etc/project-fog/service-ports/openvpn-tcp
  1344. echo "$OpenVPN_UDP_Port" > /etc/project-fog/service-ports/openvpn-udp
  1345. echo "$Squid_Port1" > /etc/project-fog/service-ports/squid1
  1346. echo "$Squid_Port2" > /etc/project-fog/service-ports/squid2
  1347. echo "$Squid_Port3" > /etc/project-fog/service-ports/squid3
  1348. echo "$Privoxy_Port1" > /etc/project-fog/service-ports/priv1
  1349. echo "$Privoxy_Port2" > /etc/project-fog/service-ports/priv2
  1350. echo "$Dropbear_Port1" > /etc/project-fog/service-ports/dropbear1
  1351. echo "$Dropbear_Port2" > /etc/project-fog/service-ports/dropbear2
  1352. echo "$Stunnel_Port2" > /etc/project-fog/service-ports/stunnel-ssh
  1353. echo "$Stunnel_Port1" > /etc/project-fog/service-ports/stunnel-drop
  1354. echo "$Stunnel_Port3" > /etc/project-fog/service-ports/stunnel-open
  1355. echo "65432" > /etc/project-fog/v2/panel_port
  1356. }
  1357. function InsV2ray(){
  1358. bash <(curl -Ls https://raw.githubusercontent.com/nullptrX/v2-ui/master/install.sh)
  1359. sleep 1
  1360. cat <<'v2about' > /etc/project-fog/v2/about
  1361. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1362. ░▒▓█ ☁️ Project Fog ☁️ █▓▒░
  1363. What is V2Ray?
  1364. Multiple inbound/outbound proxies: one V2Ray instance supports in
  1365. parallel multiple inbound and outbound protocols. Each protocol works
  1366. independently.
  1367. Current Supported Protocols:
  1368. 1. Vmess 5. Dokodemo-door
  1369. 2. Vless 6. Socks
  1370. 3. Trojan 7. HTTP
  1371. 4. Shadowsocks
  1372. How to Use V2Ray?
  1373. 1. Go to your browser and enter this link:
  1374. http://IP-ADDRESS:65432
  1375. 2. Login Username: admin
  1376. Login Password: admin
  1377. 3. Go to Accounts
  1378. 4. Tap or click the " + " button. its color blue.
  1379. 5. Add Account Tab will appear and
  1380. fill in and choose parameters for your V2Ray.
  1381. REMINDERS:
  1382. 1. Please use port ramdomly given V2Ray Panel.
  1383. 2. If you want preferred port, make sure it is not
  1384. currently use by other services or else
  1385. your all V2Ray connection will not work.
  1386. 3. iF you accidentally hit current use port in your V2Ray config,
  1387. A. Go to Panel > Accounts > : and delete all accounts.
  1388. B. Go to your VPS and restart V2ray using Menu.
  1389. or simply reboot your VPS.
  1390. Supported Platforms:
  1391. 1. Windows
  1392. 2. Andoid Phones
  1393. 3. iPhones
  1394. 4. Mac
  1395. Notes:
  1396. This V2Ray Panel is made by Sprov.
  1397. All credits to Sprov.
  1398. Check his work at:
  1399. https://github.com/sprov065
  1400. https://blog.sprov.xyz/
  1401. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  1402. v2about
  1403. sleep 1
  1404. sed -i "s|IP-ADDRESS|$IPADDR|g" /etc/project-fog/v2/about
  1405. }
  1406. function ScriptMessage(){
  1407. clear
  1408. echo ""
  1409. echo ""
  1410. echo ""
  1411. echo -e " ░▒▓█ ☁️ Project Fog ☁️ █▓▒░"
  1412. echo " "
  1413. echo -e " This Script is FREE always and forever . . ."
  1414. echo -e " by: blackestsaint 🦊 "
  1415. echo ""
  1416. echo ""
  1417. echo -e " Credits to:"
  1418. echo -e " PHC-Ford [FordSenpai] 🐱"
  1419. echo -e " Bon-chan 🦢"
  1420. echo -e " lfasmpao 🐯"
  1421. echo -e " ADM-Manager 🐬"
  1422. echo -e " Sprov 🌤️"
  1423. echo -e " WaGo-G 🔥"
  1424. echo -e " PHC_JAYVEE ☣️"
  1425. echo ""
  1426. echo ""
  1427. }
  1428. function InstBadVPN(){
  1429. # Pull BadVPN Binary 64bit or 32bit
  1430. if [ "$(getconf LONG_BIT)" == "64" ]; then
  1431. wget -O /usr/bin/badvpn-udpgw "https://github.com/korn-sudo/Project-Fog/raw/main/files/plugins/badvpn-udpgw64"
  1432. else
  1433. wget -O /usr/bin/badvpn-udpgw "https://github.com/korn-sudo/Project-Fog/raw/main/files/plugins/badvpn-udpgw"
  1434. fi
  1435. # Set BadVPN to Start on Boot via .profile
  1436. sed -i '$ i\screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300' /root/.profile
  1437. # Change Permission to make it Executable
  1438. chmod +x /usr/bin/badvpn-udpgw
  1439. # Start BadVPN via Screen
  1440. screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300
  1441. }
  1442. function CheckRequirements(){
  1443. ###### Chokepoint for Debian and Ubuntu No.3 vvvvvv
  1444. # Not Debian OS will be force exit
  1445. source /etc/os-release
  1446. if [[ "$ID" != 'ubuntu' ]]; then
  1447. ScriptMessage
  1448. echo -e "[\e[1;31mError\e[0m] This script is for Ubuntu only, exiting..."
  1449. exit 1
  1450. fi
  1451. # Non-rooted machine will be force exit
  1452. # If you're on sudo user, run `sudo su -` first before running this script
  1453. if [[ $EUID -ne 0 ]];then
  1454. ScriptMessage
  1455. echo -e "[\e[1;31mError\e[0m] This script must be run as root, exiting..."
  1456. exit 1
  1457. fi
  1458. # (For OpenVPN) Checking it this machine have TUN Module, this is the tunneling interface of OpenVPN server
  1459. if [[ ! -e /dev/net/tun ]]; then
  1460. echo -e "[\e[1;31mError\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"
  1461. echo -e "[\e[1;31m-\e[0m] Script is now exiting..."
  1462. exit 1
  1463. fi
  1464. ###### Chokepoint for Debian and Ubuntu No.3 ^^^^^
  1465. }
  1466. function InstOthers(){
  1467. # Running screenfetch
  1468. wget -O /usr/bin/screenfetch "https://raw.githubusercontent.com/korn-sudo/Project-Fog/main/files/plugins/screenfetch"
  1469. chmod +x /usr/bin/screenfetch
  1470. echo "/bin/bash /etc/openvpn/openvpn.bash" >> .profile
  1471. echo "clear" >> .profile
  1472. echo "screenfetch" >> .profile
  1473. # Obash
  1474. cd
  1475. curl -skL "https://github.com/louigi600/obash/archive/8976fd2fa256c583769b979036f59a741730eb48.tar.gz" -o obash.tgz
  1476. tar xf obash.tgz && rm -f obash.tgz
  1477. sleep 1
  1478. cd obash-8976fd2fa256c583769b979036f59a741730eb48
  1479. make clean
  1480. make
  1481. mv -f obash /usr/local/bin/obash
  1482. cd .. && rm -rf obash-8976fd2fa256c583769b979036f59a741730eb48
  1483. cd
  1484. #alias menu
  1485. wget -O ./.bashrc "https://raw.githubusercontent.com/korn-sudo/Project-Fog/main/files/plugins/.bashrc"
  1486. #banner
  1487. cat <<'korn77' > /etc/zorro-luffy
  1488. <br><font>
  1489. <br><font>
  1490. <br><font color='green'> <b> ░▒▓█ ☁️ Project Fog ☁️ █▓▒░</b> </br></font>
  1491. <br><font>
  1492. <br><font color='#32CD32'>: : : ★ Happy Browsing!😊 </br></font>
  1493. <br><font color='#32CD32'>: : : ★ This is FREE and Not for Sale! </br></font>
  1494. <br><font color='#FDD017'>: : : ★ Project Lead: blackestsaint 🦊</br></font>
  1495. <br><font>
  1496. <br><font color='#32CD32'>: : : ★ STRICTLY NO ACCOUNT SHARING</br></font>
  1497. <br><font color='#32CD32'>: : : ★ STRICTLY NO MULTI-LOGIN</br></font>
  1498. <br><font color='#32CD32'>: : : ★ STRICTLY NO TORRENT</br></font>
  1499. <br><font>
  1500. <br><font color='#FF00FF'>░▒▓█ VIOLATORS WILL BE BAN!!!</br></font>
  1501. <br><font>
  1502. <br><font>
  1503. korn77
  1504. #block-by-keyword
  1505. mkdir -p /etc/vil
  1506. echo "#!/bin/bash " >> /etc/vil
  1507. # Timer Notification in menu section checker
  1508. echo " " > /etc/korn/timer-proxy
  1509. echo " " > /etc/korn/timer-seconds
  1510. #Tweak for IPV4 TCP/UDP speed and maximize capability function Status: OFF
  1511. cd
  1512. mkdir -p /etc/project-fog/others
  1513. echo "#Project Fog TCP Tweak OFF" > /etc/sysctl.conf
  1514. echo "off" > /etc/project-fog/others/tcptweaks
  1515. #for blocking by keywords notes
  1516. mkdir -p /etc/korn
  1517. echo "
  1518. Keyword below has been blocked:
  1519. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1520. Ports block [ torrent related issues ]
  1521. 24 25 26 50 57
  1522. 105 106 109 110 143
  1523. 158 209 218 220 465
  1524. 587 993 995 1109 24554
  1525. 60177 60179
  1526. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::" >> /etc/korn/block-by-keyword
  1527. echo "
  1528. THIS PORT ARE BLOCK IN SERVER DUE TO TORRENT ISSUE:
  1529. WARNING! DO NOT USE THIS PORT:
  1530. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  1531. 24 25 26 50 57
  1532. 105 106 109 110 143
  1533. 158 209 218 220 465
  1534. 587 993 995 1109 24554
  1535. 60177 60179
  1536. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::" >> /etc/korn/warning
  1537. # Dependencies of all Editing Port scenario
  1538. mkdir -p /etc/project-fog/others
  1539. echo "24 25 26 50 57
  1540. 105 106 109 110 143
  1541. 158 209 218 220 465
  1542. 587 993 995 1109 24554
  1543. 60177 60179 450 $Php_Socket " >> /etc/project-fog/others/banned-port
  1544. # Setting server local time
  1545. ln -fs /usr/share/zoneinfo/$MyVPS_Time /etc/localtime
  1546. #version of Project Fog autoscript
  1547. echo "$ver" > /etc/korn/version
  1548. # Start-up Application Verification (protection for modders)
  1549. mkdir -p /usr/lib/kshell
  1550. echo "75" > /usr/lib/kshell/libs
  1551. }
  1552. function Installation-log(){
  1553. clear
  1554. echo ""
  1555. echo " INSTALLATION FINISH! "
  1556. echo ""
  1557. echo ""
  1558. echo "Server Information: " | tee -a log-install.txt | lolcat
  1559. echo " • Timezone : $MyVPS_Time " tee -a log-install.txt | lolcat
  1560. echo " • Fail2Ban : [ON]" | tee -a log-install.txt | lolcat
  1561. echo " • IPtables : [ON]" | tee -a log-install.txt | lolcat
  1562. echo " • Auto-Reboot : [OFF] See menu to [ON] " | tee -a log-install.txt
  1563. echo " • TCP Speed Tweak: [OFF] See menu to [ON]" | tee -a log-install.txt | lolcat
  1564. echo " • Squid Cache : [ON]" | tee -a log-install.txt | lolcat
  1565. echo " • IPv6 : [OFF]" | tee -a log-install.txt | lolcat
  1566. echo " "| tee -a log-install.txt | lolcat
  1567. echo "Automated Features:"| tee -a log-install.txt | lolcat
  1568. echo " • Auto delete expired user account"| tee -a log-install.txt | lolcat
  1569. echo " • Auto restart server "| tee -a log-install.txt | lolcat
  1570. echo " • Auto disconnect multilogin users [Openvpn not included]."| tee -a log-install.txt | lolcat
  1571. echo " • Auto configure firewall every reboot[Protection for torrent and etc..]"| tee -a log-install.txt | lolcat
  1572. echo " • Auto updated firewall[if port change,removed or add,firewall will adapt your new port]"| tee -a log-install.txt | lolcat
  1573. echo " • Auto updated OHP[Over-HTTP-Puncher]working even theres changes in ports"| tee -a log-install.txt | lolcat
  1574. echo " " | tee -a log-install.txt | lolcat
  1575. echo "Services & Port Information:" | tee -a log-install.txt | lolcat
  1576. echo " • OpenVPN : [ON] : TCP: $OpenVPN_TCP_Port | UDP: $OpenVPN_UDP_Port" | tee -a log-install.txt | lolcat
  1577. echo " • Dropbear : [ON] : $Dropbear_Port1 | $Dropbear_Port2 " | tee -a log-install.txt | lolcat
  1578. echo " • Squid Proxy : [ON] : $Squid_Port1 | $Squid_Port2 |$Squid_Port3 | limit to IP Server" | tee -a log-install.txt | lolcat
  1579. echo " • Privoxy : [ON] : $Privoxy_Port1 | $Privoxy_Port2 | limit to IP Server" | tee -a log-install.txt | lolcat
  1580. echo " • SSL through Dropbear : [ON] : $Stunnel_Port1 " | tee -a log-install.txt | lolcat
  1581. echo " • SSL through OpenSSH : [ON] : $Stunnel_Port2" | tee -a log-install.txt | lolcat
  1582. echo " • SSL through Openvpn : [ON] : $Stunnel_Port3 " | tee -a log-install.txt | lolcat
  1583. echo " • OHP [through Squid] : [ON] : $OHP_Port1 | $OHP_Port2 " | tee -a log-install.txt | lolcat
  1584. echo " • OHP [through Privoxy]: [ON] : $OHP_Port3 | $OHP_Port4 " | tee -a log-install.txt | lolcat
  1585. echo " • OHP [through Openvpn]: [ON] : $OHP_Port5 " | tee -a log-install.txt | lolcat
  1586. echo " • Simple Socks Proxy : [ON] : $Simple_Port1 | $Simple_Port2 " | tee -a log-install.txt | lolcat
  1587. echo " • Direct Socks Proxy : [ON] : $Direct_Port1 | $Direct_Port2 " | tee -a log-install.txt | lolcat
  1588. echo " • Openvpn Socks Proxy : [ON] : $Open_Port1 | $Open_Port2 " | tee -a log-install.txt | lolcat
  1589. echo " • ShadowsocksR Server : [OFF] : Configure through menu " | tee -a log-install.txt | lolcat
  1590. echo " • BADVPN : [ON] : 7300 " | tee -a log-install.txt | lolcat
  1591. echo " • Additional SSHD Port : [ON] : $SSH_Port2" | tee -a log-install.txt | lolcat
  1592. echo " • OCS Panel : [ON] : http://$IPADDR:$Nginx_Port" | tee -a log-install.txt | lolcat
  1593. echo " • Openvpn Monitoring : [ON] : http://$IPADDR:$Fog_Openvpn_Monitoring" | tee -a log-install.txt | lolcat
  1594. echo " • V2ray Panel : [ON] : http://$IPADDR:65432 " | tee -a log-install.txt | lolcat
  1595. echo "" | tee -a log-install.txt | lolcat
  1596. echo "Notes:" | tee -a log-install.txt | lolcat
  1597. echo " ★ Edit/Change/Off/On your OHP Port and Python Socks [see in menu option] " | tee -a log-install.txt | lolcat
  1598. echo " ★ Torrent Protection [ add newest torrent port] " | tee -a log-install.txt | lolcat
  1599. echo " ★ Port Scanner Basic Protection " | tee -a log-install.txt | lolcat
  1600. echo " ★ Brute Force Attack Basic Protection " | tee -a log-install.txt | lolcat
  1601. echo " ★ All ports can be edited in Edit Menu. OHP and Socks Proxy adapt new port. " | tee -a log-install.txt | lolcat
  1602. echo " ★ Multi-login Limit customize per user [see menu]. " | tee -a log-install.txt | lolcat
  1603. echo " ★ To display list of commands: " [ menu ] or [ menu fog ] "" | tee -a log-install.txt | lolcat
  1604. echo "" | tee -a log-install.txt | lolcat
  1605. echo " ★ Other concern and questions of these auto-scripts?" | tee -a log-install.txt | lolcat
  1606. echo " Direct Messege : www.facebook.com/kornips" | tee -a log-install.txt | lolcat
  1607. echo ""
  1608. read -p " Press enter.."
  1609. }
  1610. function Complete-reboot(){
  1611. clear
  1612. echo ""
  1613. echo ""
  1614. figlet Project Fog -c | lolcat
  1615. echo ""
  1616. echo " Installation Complete! System need to reboot to apply all changes! "
  1617. read -p " Press Enter to reboot..."
  1618. reboot
  1619. }
  1620. #########################################################
  1621. ### Installation Begins...
  1622. #########################################################
  1623. # Filtering Machine did not meet Requirements
  1624. echo "Checking if your Server meet the requirements . . . "
  1625. CheckRequirements
  1626. ScriptMessage
  1627. sleep 2
  1628. #System Upgrade and Updates
  1629. echo " Installing Operating System Updates"
  1630. InstUpdates
  1631. # Configure OpenSSH and Dropbear
  1632. echo " Configuring ssh..."
  1633. InstSSH
  1634. # Configure Stunnel
  1635. echo " Configuring stunnel..."
  1636. InsStunnel
  1637. # Configure BadVPN UDPGW
  1638. echo " Configuring BadVPN UDPGW..."
  1639. InstBadVPN
  1640. # Configure Webmin
  1641. echo " Configuring webmin..."
  1642. InstWebmin
  1643. # Configure Squid and Privoxy
  1644. echo " Configuring proxy..."
  1645. InsProxy
  1646. # Configure Over-HTTP-Puncher
  1647. echo " Configuring Over-HTTP-Puncher..."
  1648. InsOHP
  1649. # Configure Python Socks Proxy
  1650. echo " Configuring Python Socks Proxy..."
  1651. InsPython
  1652. # Configure Shadowsocks R
  1653. echo " Configuring Shadowsocks R..."
  1654. InsShodowSocks
  1655. # Configure OpenVPN
  1656. echo " Configuring OpenVPN..."
  1657. InsOpenVPN
  1658. # Configuring Nginx OVPN config download site
  1659. echo " Configuring OpenVPN Config File and Panel Services..."
  1660. FogPanel
  1661. # Some assistance and startup scripts
  1662. echo " Configuring Startup Application Automation..."
  1663. ConfStartup
  1664. # VPS Menu script v1.0
  1665. echo " Configuring Main Dish Menu..."
  1666. ConfMenu
  1667. # Saving all Ports Information
  1668. echo " Saving all Ports Information..."
  1669. ports_info
  1670. # Configure OpenVPN
  1671. echo " Configuring V2Ray..."
  1672. InsV2ray
  1673. # Others Services ( Screenfetch, Setting Local, TCP Tweak )
  1674. echo " Adding other services..."
  1675. InstOthers
  1676. #Server Information and Details
  1677. echo "READ ME!"
  1678. Installation-log
  1679. #Final Touch (Reboot Remark)
  1680. Complete-reboot
  1681. clear
  1682. cd ~
  1683. rm /root/fog-debian -rf
  1684. exit 1