menu 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801
  1. #!/bin/bash
  2. #
  3. ll="/usr/local/include/snaps" && [[ ! -d ${ll} ]] && exit
  4. clear
  5. [[ "$(whoami)" != "root" ]] && {
  6. 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"
  7. exit 0
  8. }
  9. declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
  10. sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 > /dev/null 2>&1
  11. sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 > /dev/null 2>&1
  12. sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 > /dev/null 2>&1
  13. # [[ ! -d /usr/local/lib/rm ]] && exit
  14. _hora=$(printf '%(%D-%H:%M:%S)T')
  15. #COLORES
  16. red=$(tput setaf 1)
  17. gren=$(tput setaf 2)
  18. yellow=$(tput setaf 3)
  19. SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
  20. DIR="/etc/VPS-MX"
  21. SCPusr="${SCPdir}/controlador"
  22. SCPfrm="${SCPdir}/herramientas"
  23. SCPinst="${SCPdir}/protocolos"
  24. SCPidioma="${SCPdir}/idioma"
  25. #PROCESSADOR
  26. _core=$(printf '%-1s' "$(grep -c cpu[0-9] /proc/stat)")
  27. _usop=$(top -bn1 | sed -rn '3s/[^0-9]* ([0-9\.]+) .*/\1/p;4s/.*, ([0-9]+) .*/\1/p' | tr '\n' ' ')
  28. #SISTEMA-USO DA CPU-MEMORIA RAM
  29. ram1=$(free -h | grep -i mem | awk {'print $2'})
  30. ram2=$(free -h | grep -i mem | awk {'print $4'})
  31. ram3=$(free -h | grep -i mem | awk {'print $3'})
  32. _ram=$(printf ' %-9s' "$(free -h | grep -i mem | awk {'print $2'})")
  33. _usor=$(printf '%-8s' "$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')")
  34. if [[ -e /etc/bash.bashrc-bakup ]]; then AutoRun="\033[1;32m[ON]"
  35. elif [[ -e /etc/bash.bashrc ]]; then AutoRun="\033[1;31m[OFF]"
  36. fi
  37. # Funcoes Globais
  38. msg () {
  39. #ACTULIZADOR
  40. [[ ! -d /usr/local/lib/rm ]] && exit
  41. [[ ! -e /etc/versin_script ]] && echo 1 > /etc/versin_script
  42. v11=$(cat /etc/versin_script_new)
  43. v22=$(cat /etc/versin_script)
  44. #[[ $v11 = $22 ]] &&
  45. vesaoSCT="\033[1;37mVersion \033[1;32m$v22\033[1;31m]" #|| vesaoSCT="\033[1;32mUPDATE\033[1;91m[\033[1;32m$v11\033[1;31m]"
  46. aviso_bock () {
  47. echo 'echo -e "\033[1;91m————————————————————————————————————————————————————\n ¡SCRIPT BLOQUEADO POR CLONING|| CONTACTE CON SU PROVEDOR ! \n————————————————————————————————————————————————————"' > /usr/bin/menu
  48. echo 'echo -e "\033[1;91m————————————————————————————————————————————————————\n ¡SCRIPT BLOQUEADO POR CLONING|| CONTACTE CON SU PROVEDOR ! \n————————————————————————————————————————————————————"' > /usr/bin/VPS-MX
  49. rm -rf /etc/VPS-MX
  50. }
  51. local colors="/etc/VPS-MX/colors"
  52. if [[ ! -e $colors ]]; then
  53. COLOR[0]='\033[1;37m' #BRAN='\033[1;37m'
  54. COLOR[1]='\e[93m' #VERMELHO='\e[31m'
  55. COLOR[2]='\e[32m' #VERDE='\e[32m'
  56. COLOR[3]='\e[31m' #AMARELO='\e[33m'
  57. COLOR[4]='\e[34m' #AZUL='\e[34m'
  58. COLOR[5]='\e[95m' #MAGENTA='\e[35m'
  59. COLOR[6]='\033[1;97m' #MAG='\033[1;36m'
  60. COLOR[7]='\033[36m' #MAG='\033[36m'
  61. else
  62. local COL=0
  63. for number in $(cat $colors); do
  64. case $number in
  65. 1)COLOR[$COL]='\033[1;37m';;
  66. 2)COLOR[$COL]='\e[31m';;
  67. 3)COLOR[$COL]='\e[32m';;
  68. 4)COLOR[$COL]='\e[33m';;
  69. 5)COLOR[$COL]='\e[34m';;
  70. 6)COLOR[$COL]='\e[35m';;
  71. 7)COLOR[$COL]='\033[1;36m';;
  72. 8)COLOR[$COL]='\e[36m';;
  73. esac
  74. let COL++
  75. done
  76. fi
  77. NEGRITO='\e[1m'
  78. SEMCOR='\e[0m'
  79. case $1 in
  80. -ne)cor="${COLOR[1]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";;
  81. -ama)cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
  82. -verm)cor="${COLOR[3]}${NEGRITO}[!] ${COLOR[1]}" && echo -e "${cor}${2}${SEMCOR}";;
  83. -verm2)cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
  84. -azu)cor="${COLOR[6]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
  85. -azuc)cor="${COLOR[7]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
  86. -verd)cor="${COLOR[2]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
  87. -az)cor="${COLOR[4]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
  88. -bra)cor="${COLOR[0]}${SEMCOR}" && echo -e "${cor}${2}${SEMCOR}";;
  89. "-bar2"|"-bar")cor="\e[1;30m————————————————————————————————————————————————————" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
  90. -tit)echo -e "\e[91m≪━━─━━─━─━─━─━─━━─━━─━─━─◈─━━─━─━─━─━━─━─━━─━─━━─━≫ \e[0m\n \e[2;97m\e[3;93m ❯❯❯❯ 𝙎𝘾𝙍𝙄𝙋𝙏 𝙈𝙊𝘿 𝙇𝘼𝘾𝘼𝙎𝙄𝙏𝘼𝙈𝙓 ❮❮❮❮ \033[0m \033[1;31m[\033[1;32m$vesaoSCT\n\e[91m≪━━─━─━━━─━─━─━─━─━━─━─━─◈─━─━─━─━─━━━─━─━─━━━─━─━≫ \e[0m" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
  91. -bar3) $([[ ! -e $(echo -e $(echo "2F7573722F6C6F63616C2F6C69622F726D"| sed 's/../\\x&/g;s/$/ /')) ]] && $( aviso_bock > /dev/null 2>&1)) && echo -e "${SEMCOR}${cor}${SEMCOR}";;
  92. esac
  93. }
  94. [[ ! -d /usr/local/lib/sped ]] && exit
  95. check_IP () {
  96. Key="$(cat /etc/VPS-MX/key.txt)"
  97. ADM=$(sed -n '1 p' /usr/bin/venip |cut -d' ' -f1)
  98. #ADM=$(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 "$ADM" > /usr/bin/venip
  99. IP2="$(wget -qO- ifconfig.me)"
  100. permited=$(curl -sSL "http://$ADM:81/checkip")
  101. [[ $(echo $permited|grep "$IP2") = "" ]] && {
  102. clear && clear
  103. #echo -e " \e[1;100mNOTIFICACION ENVIADO\e[0m "
  104. echo 'clear && echo -e "\e[1;91m==============================================================\n ¡📵KEY BANEADA📵! CONTACTE CON SU PROVEDOR \n==============================================================\n\n"' > /usr/bin/vps-mx && chmod +x /usr/bin/vps-mx && clear
  105. echo 'clear && echo -e "\e[1;91m==============================================================\n ¡📵KEY BANEADA📵! CONTACTE CON SU PROVEDOR \n==============================================================\n\n"' > /usr/bin/VPS-MX && chmod +x /usr/bin/VPS-MX && clear
  106. echo 'clear && echo -e "\e[1;91m==============================================================\n ¡📵KEY BANEADA📵! CONTACTE CON SU PROVEDOR \n==============================================================\n\n"' > /usr/bin/menu && chmod +x /usr/bin/menu && clear
  107. rm -rf /etc/VPS-MX/menu
  108. rm -rf /etc/VPS-MX/controlador
  109. rm -rf /etc/VPS-MX/protocolos
  110. rm -rf /etc/VPS-MX/herramientas/ADMbot.sh
  111. clear; clear
  112. userid="${SCPdir}/ID"
  113. TOKEN="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
  114. URL="https://api.telegram.org/bot$TOKEN/sendMessage"
  115. MSG="👇= 📵IP BANEADO📵 =👇
  116. ══════◄••••►══════
  117. Version: $(cat /etc/versin_script_new)
  118. ══════◄••••►══════
  119. 🆔: $(cat ${userid})
  120. ══════◄••••►══════
  121. Usuario: $(cat ${SCPdir}/message.txt)
  122. ══════◄••••►══════
  123. IP: $(cat ${SCPdir}/MEUIPvps)
  124. ══════◄••••►══════
  125. "
  126. curl -s --max-time 10 -d "chat_id=605531451&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
  127. sleep 2s
  128. exit && exit
  129. } || {
  130. echo "acceso activado" >/bin/lacasita
  131. }
  132. exit && exit && exit
  133. }
  134. canbio_color () {
  135. clear
  136. msg -bar2
  137. msg -tit
  138. msg -ama " CONTROLADOR DE COLORES DEL SCRIP VPS-MX"
  139. msg -bar2
  140. msg -ama "$(fun_trans "Selecione 7 cores"): "
  141. echo -e '\033[1;37m [1] ###\033[0m'
  142. echo -e '\e[31m [2] ###\033[0m'
  143. echo -e '\e[32m [3] ###\033[0m'
  144. echo -e '\e[33m [4] ###\033[0m'
  145. echo -e '\e[34m [5] ###\033[0m'
  146. echo -e '\e[35m [6] ###\033[0m'
  147. echo -e '\033[1;36m [7] ###\033[0m'
  148. msg -bar2
  149. for number in $(echo {1..7}); do
  150. msg -ne "$(fun_trans "Digite un Color") [$number]: " && read corselect
  151. [[ $corselect != @([1-7]) ]] && corselect=1
  152. cores+="$corselect "
  153. corselect=0
  154. done
  155. echo "$cores" > /etc/VPS-MX/colors
  156. msg -bar2
  157. }
  158. fun_trans () {
  159. local texto
  160. local retorno
  161. declare -A texto
  162. SCPidioma="${SCPdir}/idioma"
  163. [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
  164. local LINGUAGE=$(cat ${SCPidioma})
  165. [[ -z $LINGUAGE ]] && LINGUAGE=es
  166. [[ $LINGUAGE = "es" ]] && echo "$@" && return
  167. [[ ! -e /usr/bin/trans ]] && wget -O /usr/bin/trans https://raw.githubusercontent.com/scriptsmx/script/master/Install/trans &> /dev/null
  168. [[ ! -e /etc/VPS-MX/texto-mx ]] && touch /etc/VPS-MX/texto-mx
  169. source /etc/VPS-MX/texto-mx
  170. if [[ -z "$(echo ${texto[$@]})" ]]; then
  171. #ENGINES=(aspell google deepl bing spell hunspell apertium yandex)
  172. #NUM="$(($RANDOM%${#ENGINES[@]}))"
  173. retorno="$(source trans -e bing -b es:${LINGUAGE} "$@"|sed -e 's/[^a-z0-9 -]//ig' 2>/dev/null)"
  174. echo "texto[$@]='$retorno'" >> /etc/VPS-MX/texto-mx
  175. echo "$retorno"
  176. else
  177. echo "${texto[$@]}"
  178. fi
  179. }
  180. function_verify () {
  181. permited=$(curl -sSL "https://www.dropbox.com/s/nmau2w8vebewpq3/control")
  182. [[ $(echo $permited|grep "${IP}") = "" ]] && {
  183. clear
  184. echo -e "\n\n\n\033[1;91m————————————————————————————————————————————————————\n ¡ESTA KEY NO CONCUERDA CON EL INSTALADOR! \n————————————————————————————————————————————————————\n\n\n"
  185. [[ -d /etc/VPS-MX ]] && rm -rf /etc/VPS-MX
  186. exit 1
  187. } || {
  188. ### INTALAR VERSION DE SCRIPT
  189. v1=$(curl -sSL "https://raw.githubusercontent.com/lacasitamx/version/master/vercion")
  190. echo "$v1" > /etc/versin_script
  191. echo "$v1" > /etc/versin_script_new
  192. }
  193. }
  194. atualiza_fun () {
  195. fun_ip
  196. SCPinstal="$HOME/install"
  197. verificar_arq () {
  198. case $1 in
  199. "menu"|"message.txt"|"ID")ARQ="${SCPdir}/";; #Menu
  200. "usercodes")ARQ="${SCPusr}/";; #Panel SSRR
  201. "C-SSR.sh"|"proxy.sh"|"wireguard.sh")ARQ="${SCPinst}/";; #Panel SSR
  202. "openssh.sh")ARQ="${SCPinst}/";; #OpenVPN
  203. "squid.sh")ARQ="${SCPinst}/";; #Squid
  204. "dropbear.sh")ARQ="${SCPinst}/";; #Instalacao
  205. "openvpn.sh")ARQ="${SCPinst}/";; #Instalacao
  206. "ssl.sh")ARQ="${SCPinst}/";; #Instalacao
  207. "shadowsocks.sh"|"proxy.sh"|"python.py")ARQ="${SCPinst}/";; #Instalacao
  208. "Shadowsocks-libev.sh"|"slowdns.sh")ARQ="${SCPinst}/";; #Instalacao
  209. "Shadowsocks-R.sh")ARQ="${SCPinst}/";; #Instalacao
  210. "v2ray.sh")ARQ="${SCPinst}/";; #Instalacao
  211. "budp.sh")ARQ="${SCPinst}/";; #Instalacao
  212. "name")ARQ="${SCPdir}/tmp/";; #Instalacao
  213. "sockspy.sh"|"PDirect.py"|"PPub.py"|"PPriv.py"|"POpen.py"|"PGet.py"|"python.py")ARQ="${SCPinst}/";; #Instalacao
  214. *)ARQ="${SCPfrm}/";; #Herramientas
  215. esac
  216. mv -f ${SCPinstal}/$1 ${ARQ}/$1
  217. chmod +x ${ARQ}/$1
  218. }
  219. error_fun () {
  220. msg -bar2 && msg -verm "ERROR entre VPS<-->GENERADOR (Port 81 TCP)" && msg -bar2
  221. [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
  222. exit 1
  223. }
  224. invalid_key () {
  225. msg -bar2 && msg -verm " Code Invalido -- #¡Key Invalida#! " && msg -bar2
  226. [[ -e $HOME/lista-arq ]] && rm -r $HOME/lista-arq
  227. exit 1
  228. }
  229. while [[ ! $Key ]]; do
  230. clear
  231. clear
  232. msg -bar
  233. msg -tit
  234. echo -e "\033[1;91m \e[3;100mACTUALIZACION DEL SCRIPT \e[0m"
  235. msg -bar2 && msg -ne "\033[1;93m >>> INTRODUZCA LA KEY ABAJO <<<\n \033[1;37m" && read Key
  236. tput cuu1 && tput dl1
  237. done
  238. msg -ne " # Verificando Key # : "
  239. cd $HOME
  240. wget -O $HOME/lista-arq $(ofus "$Key")/$IP > /dev/null 2>&1 && echo -e "\033[1;32m Code Correcto de KEY" || {
  241. echo -e "\033[1;91m Code Incorrecto de KEY"
  242. invalid_key
  243. exit
  244. }
  245. 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
  246. sleep 0.1s
  247. function_verify
  248. updatedb
  249. if [[ -e $HOME/lista-arq ]] && [[ ! $(cat $HOME/lista-arq|grep "Code de KEY Invalido!") ]]; then
  250. msg -bar2
  251. msg -verd " $(source trans -b es:es "Ficheros Copiados"|sed -e 's/[^a-z -]//ig'): \e[97m[\e[93mSCRIPT MOD @conectedmx_bot\e[97m]"
  252. REQUEST=$(ofus "$Key"|cut -d'/' -f2)
  253. [[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal}
  254. pontos="."
  255. stopping="Configurando Directorios"
  256. for arqx in $(cat $HOME/lista-arq); do
  257. msg -verm "${stopping}${pontos}"
  258. wget --no-check-certificate -O ${SCPinstal}/${arqx} ${IP}:81/${REQUEST}/${arqx} > /dev/null 2>&1 && verificar_arq "${arqx}" || error_fun
  259. tput cuu1 && tput dl1
  260. pontos+="."
  261. done
  262. userid="${SCPdir}/ID"
  263. if [[ $(cat ${userid}|grep "605531451") = "" ]]; then
  264. activ=$(cat ${userid})
  265. TOKEN="1235413737:AAEWLffj1FO4GQ5Iwoo4XvIm4ESlFjHA0_A"
  266. URL="https://api.telegram.org/bot$TOKEN/sendMessage"
  267. MSG="👇= SCRIPT ACTUALIZADO =👇
  268. ◄══════◄••◩••►══════►
  269. Version: $(cat /etc/versin_script_new) INSTALADO
  270. Cliente: $(cat ${SCPdir}/tmp/name)
  271. 🆔: $(cat ${userid})
  272. Slogan: $(cat ${SCPdir}/message.txt)
  273. ◄══════◄••◩••►══════►
  274. IP: $(cat ${SCPdir}/MEUIPvps)
  275. ◄══════◄••◩••►══════►
  276. KEY:[ $Key ] Usada
  277. ◄══════◄••◩••►══════►
  278. ==NOTIFICADOR DE KEY==
  279. ◄══════◄••◩••►══════►
  280. "
  281. curl -s --max-time 10 -d "chat_id=$activ&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
  282. curl -s --max-time 10 -d "chat_id=605531451&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
  283. else
  284. TOKEN="1235413737:AAEWLffj1FO4GQ5Iwoo4XvIm4ESlFjHA0_A"
  285. URL="https://api.telegram.org/bot$TOKEN/sendMessage"
  286. MSG="👇= SCRIPT ACTUALIZADO =👇
  287. ◄══════◄••◩••►══════►
  288. Version: $(cat /etc/versin_script_new) INSTALADO
  289. Cliente: $(cat ${SCPdir}/tmp/name)
  290. 🆔: $(cat ${userid})
  291. Slogan: $(cat ${SCPdir}/message.txt)
  292. ◄══════◄••◩••►══════►
  293. IP: $(cat ${SCPdir}/MEUIPvps)
  294. ◄══════◄••◩••►══════►
  295. KEY:[ $Key ] Usada
  296. ◄══════◄••◩••►══════►
  297. ==NOTIFICADOR DE KEY==
  298. ◄══════◄••◩••►══════►
  299. "
  300. curl -s --max-time 10 -d "chat_id=605531451&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
  301. fi
  302. [[ ! -d ${SCPdir}/tmp ]] && mkdir ${SCPdir}/tmp
  303. wget -O ${SCPdir}/tmp/verifi https://www.dropbox.com/s/tv7yis89au5v8sv/verifi &>/dev/null
  304. wget -O ${SCPdir}/tmp/monitor https://www.dropbox.com/s/zwqhu7gavru6l9i/monitor &>/dev/null
  305. wget -O ${SCPdir}/tmp/autodes https://www.dropbox.com/s/fwcor9tbksnyuxy/autodes &>/dev/null
  306. wget -O /etc/VPS-MX/tmp/style https://www.dropbox.com/s/f33mi30lbxawvku/style &>/dev/null
  307. chmod 777 ${SCPdir}/*
  308. # wget -O /etc/VPS-MX/protocolos/ssl5.sh https://www.dropbox.com/s/aly73lbbh74r7tu/ssl5.sh &>/dev/null
  309. #chmod 777 /etc/VPS-MX/protocolos/ssl5.sh
  310. wget -O /etc/VPS-MX/protocolos/chekuser.sh https://www.dropbox.com/s/dypjomdhjhkpahk/chekuser.sh &>/dev/null
  311. chmod 777 /etc/VPS-MX/protocolos/chekuser.sh
  312. wget -O /etc/VPS-MX/protocolos/chekuser.py https://www.dropbox.com/s/7he83qd5pfznrvh/chekuser.py &>/dev/null
  313. chmod 777 /etc/VPS-MX/protocolos/chekuser.py
  314. msg -bar2
  315. listaarqs="$(locate "lista-arq"|head -1)" && [[ -e ${listaarqs} ]] && rm $listaarqs
  316. cat /etc/bash.bashrc|grep -v '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' > /etc/bash.bashrc.2
  317. echo -e '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' >> /etc/bash.bashrc.2
  318. mv -f /etc/bash.bashrc.2 /etc/bash.bashrc
  319. echo "${SCPdir}/menu" > /usr/bin/menu && chmod +x /usr/bin/menu
  320. echo "${SCPdir}/menu" > /usr/bin/VPSMX && chmod +x /usr/bin/VPSMX
  321. echo "$Key" > ${SCPdir}/key.txt
  322. [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
  323. export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games/
  324. rm -rf /root/lista-arq
  325. [[ ! -e /etc/autostart ]] && {
  326. echo '#!/bin/bash
  327. clear
  328. #INICIO AUTOMATICO' >/etc/autostart
  329. chmod +x /etc/autostart
  330. } || {
  331. #[[ $(ps x | grep "bot_plus" | grep -v grep | wc -l) != '0' ]] && wget -qO- https://raw.githubusercontent.com/carecagm/main/Install/ShellBot.sh >/etc/SSHPlus/ShellBot.sh
  332. for proc in $(ps x | grep 'dmS' | grep -v 'grep' | awk {'print $1'}); do
  333. screen -r -S "$proc" -X quit
  334. done
  335. screen -wipe >/dev/null
  336. echo '#!/bin/bash
  337. clear
  338. #INICIO AUTOMATICO' >/etc/autostart
  339. chmod +x /etc/autostart
  340. }
  341. crontab -r >/dev/null 2>&1
  342. (
  343. crontab -l 2>/dev/null
  344. echo "@reboot /etc/autostart"
  345. echo "* * * * * /etc/autostart"
  346. ) | crontab -
  347. [[ ${#id} -gt 2 ]] && echo "es" > ${SCPidioma} || echo "es" > ${SCPidioma}
  348. echo -e "${cor[2]} ACTUALIZACION COMPLETA "
  349. echo -e " COMANDO PRINCIPAL PARA ENTRAR AL PANEL "
  350. echo -e " \033[1;37m sudo menu \033[0;37m" && msg -bar2
  351. rm -rf $HOME/lista-arq
  352. else
  353. invalid_key
  354. fi
  355. exit 1
  356. }
  357. funcao_idioma () {
  358. tput cuu1 && tput dl1
  359. msg -bar2
  360. 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" )
  361. for ((i=1; i<=12; i++)); do
  362. valor1="$(echo ${idioma[$i]}|cut -d' ' -f2)"
  363. [[ -z $valor1 ]] && break
  364. valor1="\033[1;32m[$i] > \033[1;33m$valor1"
  365. while [[ ${#valor1} -lt 37 ]]; do
  366. valor1=$valor1" "
  367. done
  368. echo -ne "$valor1"
  369. let i++
  370. valor2="$(echo ${idioma[$i]}|cut -d' ' -f2)"
  371. [[ -z $valor2 ]] && {
  372. echo -e " "
  373. break
  374. }
  375. valor2="\033[1;32m[$i] > \033[1;33m$valor2"
  376. while [[ ${#valor2} -lt 37 ]]; do
  377. valor2=$valor2" "
  378. done
  379. echo -ne "$valor2"
  380. let i++
  381. valor3="$(echo ${idioma[$i]}|cut -d' ' -f2)"
  382. [[ -z $valor3 ]] && {
  383. echo -e " "
  384. break
  385. }
  386. valor3="\033[1;32m[$i] > \033[1;33m$valor3"
  387. while [[ ${#valor3} -lt 37 ]]; do
  388. valor3=$valor3" "
  389. done
  390. echo -e "$valor3"
  391. done
  392. msg -bar2
  393. unset selection
  394. while [[ ${selection} != @([1-8]) ]]; do
  395. echo -ne "\033[1;37m$(fun_trans " ► Selecione una Opcion"): " && read selection
  396. tput cuu1 && tput dl1
  397. done
  398. [[ -e /etc/VPS-MX/texto-mx ]] && rm /etc/VPS-MX/texto-mx
  399. echo "$(echo ${idioma[$selection]}|cut -d' ' -f1)" > ${SCPidioma}
  400. }
  401. menu_info () {
  402. meu_ip &>/dev/null
  403. #export -f fun_ip
  404. if [[ "$(grep -c "Ubuntu" /etc/issue.net)" = "1" ]]; then
  405. system=$(cut -d' ' -f1 /etc/issue.net)
  406. system+=$(echo ' ')
  407. system+=$(cut -d' ' -f2 /etc/issue.net |awk -F "." '{print $1}')
  408. elif [[ "$(grep -c "Debian" /etc/issue.net)" = "1" ]]; then
  409. system=$(cut -d' ' -f1 /etc/issue.net)
  410. system+=$(echo ' ')
  411. system+=$(cut -d' ' -f3 /etc/issue.net)
  412. else
  413. system=$(cut -d' ' -f1 /etc/issue.net)
  414. fi
  415. #_ram=$(printf '%-10s' "$(free -h | grep -i mem | awk {'print $2'})")
  416. _usor=$(printf '%-8s' "$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')")
  417. _ram=$(printf ' %-8s' "$(free -h | grep -i mem | awk {'print $2'})")
  418. _ram2=$(printf ' %-8s' "$(free -h | grep -i mem | awk {'print $4'})")
  419. _system=$(printf '%-9s' "$system")
  420. #_usop=$(printf '%-1s' "$(top -bn1 | awk '/Cpu/ { cpu = "" 100 - $8 "%" }; END { print cpu }')")
  421. #_core=$(printf '%-8s' "$(grep -c cpu[0-9] /proc/stat)")
  422. _core=$(printf '%-8s' "$(grep -c cpu[0-9] /proc/stat)")
  423. _usop=$(top -bn1 | sed -rn '3s/[^0-9]* ([0-9\.]+) .*/\1/p;4s/.*, ([0-9]+) .*/\1/p' | tr '\n' ' ')
  424. modelo1=$(printf '%-11s' "$(lscpu | grep Arch | sed 's/\s\+/,/g' | cut -d , -f2)")
  425. mb=$(printf '%-8s' "$(free -h | grep Mem | sed 's/\s\+/,/g' | cut -d , -f6)")
  426. _hora=$(printf '%(%H:%M:%S)T')
  427. _hoje=$(date +'%d/%m/%Y')
  428. 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)"
  429. 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"
  430. }
  431. ofus () {
  432. unset txtofus
  433. number=$(expr length $1)
  434. for((i=1; i<$number+1; i++)); do
  435. txt[$i]=$(echo "$1" | cut -b $i)
  436. case ${txt[$i]} in
  437. ".")txt[$i]="C";;
  438. "C")txt[$i]=".";;
  439. "3")txt[$i]="@";;
  440. "@")txt[$i]="3";;
  441. "5")txt[$i]="9";;
  442. "9")txt[$i]="5";;
  443. "6")txt[$i]="D";;
  444. "D")txt[$i]="6";;
  445. "J")txt[$i]="Z";;
  446. "Z")txt[$i]="J";;
  447. esac
  448. txtofus+="${txt[$i]}"
  449. done
  450. echo "$txtofus" | rev
  451. }
  452. SPR &
  453. limpar_caches () {
  454. (
  455. VE="\033[1;33m" && MA="\033[1;31m" && DE="\033[1;32m"
  456. while [[ ! -e /tmp/abc ]]; do
  457. A+="#"
  458. echo -e "${VE}[${MA}${A}${VE}]" >&2
  459. sleep 0.3s
  460. tput cuu1 && tput dl1
  461. done
  462. echo -e "${VE}[${MA}${A}${VE}] - ${DE}[100%]" >&2
  463. rm /tmp/abc
  464. ) &
  465. echo 3 > /proc/sys/vm/drop_caches &>/dev/null
  466. sleep 1s
  467. sysctl -w vm.drop_caches=3 &>/dev/null
  468. apt-get autoclean -y &>/dev/null
  469. sleep 1s
  470. apt-get clean -y &>/dev/null
  471. rm /tmp/* &>/dev/null
  472. touch /tmp/abc
  473. sleep 0.5s
  474. msg -bar
  475. msg -ama "$(fun_trans "PROCESO CONCLUIDO")"
  476. msg -bar
  477. }
  478. [[ ! -d /usr/local/libreria ]] && exit
  479. fun_autorun () {
  480. if [[ -e /etc/bash.bashrc-bakup ]]; then
  481. mv -f /etc/bash.bashrc-bakup /etc/bash.bashrc
  482. cat /etc/bash.bashrc | grep -v "/etc/VPS-MX/menu" > /tmp/bash
  483. mv -f /tmp/bash /etc/bash.bashrc
  484. msg -ama "$(fun_trans "REMOVIDO CON EXITO")"
  485. msg -bar
  486. elif [[ -e /etc/bash.bashrc ]]; then
  487. cat /etc/bash.bashrc|grep -v /bin/menu > /etc/bash.bashrc.2
  488. echo '/etc/VPS-MX/menu' >> /etc/bash.bashrc.2
  489. cp /etc/bash.bashrc /etc/bash.bashrc-bakup
  490. mv -f /etc/bash.bashrc.2 /etc/bash.bashrc
  491. msg -ama "$(fun_trans "AUTO INICIALIZAR AGREGADO")"
  492. msg -bar
  493. fi
  494. }
  495. fun_bar () {
  496. comando="$1"
  497. _=$(
  498. $comando > /dev/null 2>&1
  499. ) & > /dev/null
  500. pid=$!
  501. while [[ -d /proc/$pid ]]; do
  502. echo -ne " \033[1;33m["
  503. for((i=0; i<10; i++)); do
  504. echo -ne "\033[1;31m##"
  505. sleep 0.2
  506. done
  507. echo -ne "\033[1;33m]"
  508. sleep 1s
  509. echo
  510. tput cuu1
  511. tput dl1
  512. done
  513. echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
  514. sleep 1s
  515. }
  516. meu_ip () {
  517. if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
  518. echo "$(cat /etc/VPS-MX/MEUIPvps)"
  519. else
  520. MEU_IP=$(wget -qO- ifconfig.me)
  521. echo "$MEU_IP" > /etc/VPS-MX/MEUIPvps
  522. fi
  523. }
  524. fun_ip () {
  525. if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
  526. IP="$(cat /etc/VPS-MX/MEUIPvps)"
  527. else
  528. MEU_IP=$(wget -qO- ifconfig.me)
  529. echo "$MEU_IP" > /etc/VPS-MX/MEUIPvps
  530. fi
  531. }
  532. fun_eth () {
  533. eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
  534. [[ $eth != "" ]] && {
  535. msg -bar
  536. msg -ama " $(fun_trans "Aplicar el sistema para mejorar los paquetes SSH?")"
  537. msg -ama " $(fun_trans "Opciones para usuarios avanzados")"
  538. msg -bar
  539. read -p " [S/N]: " -e -i n sshsn
  540. [[ "$sshsn" = @(s|S|y|Y) ]] && {
  541. echo -e "${cor[1]} $(fun_trans "Correccion de problemas de paquetes en SSH ...")"
  542. echo -e " $(fun_trans "¿Cual es la tasa RX?")"
  543. echo -ne "[ 1 - 999999999 ]: "; read rx
  544. [[ "$rx" = "" ]] && rx="999999999"
  545. echo -e " $(fun_trans "¿Cual es la tasa TX?")"
  546. echo -ne "[ 1 - 999999999 ]: "; read tx
  547. [[ "$tx" = "" ]] && tx="999999999"
  548. apt-get install ethtool -y > /dev/null 2>&1
  549. ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
  550. }
  551. msg -bar
  552. }
  553. }
  554. os_system () {
  555. system=$(echo $(cat -n /etc/issue |grep 1 |cut -d' ' -f6,7,8 |sed 's/1//' |sed 's/ //'))
  556. echo $system|awk '{print $1, $2}'
  557. }
  558. lacasita(){
  559. unset puertos
  560. declare -A port
  561. local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
  562. #local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN" | grep -v 'systemd-resolve')
  563. local NOREPEAT
  564. local reQ
  565. local Port
  566. while read port; do
  567. reQ=$(echo ${port}|awk '{print $1}')
  568. Port=$(echo ${port} | awk '{print $9}' | awk -F ":" '{print $2}')
  569. [[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
  570. NOREPEAT+="$Port\n"
  571. case ${reQ} in
  572. squid|squid3)
  573. [[ -z ${port[SQD]} ]] && local port[SQD]="\033[1;31m SQUID: \033[1;32m"
  574. port[SQD]+="$Port ";;
  575. systemd-r|systemd-re|systemd-resolv)
  576. [[ -z ${port[md]} ]] && local port[md]="\033[1;31m SYSTEMD: \033[1;32m"
  577. port[md]+="$Port ";;
  578. apache|apache2)
  579. [[ -z ${port[APC]} ]] && local port[APC]="\033[1;31m APACHE: \033[1;32m"
  580. port[APC]+="$Port ";;
  581. nginx)
  582. [[ -z ${port[NG]} ]] && local port[NG]="\033[1;31m NGINX: \033[1;32m"
  583. port[NG]+="$Port ";;
  584. ssh|sshd)
  585. [[ -z ${port[SSH]} ]] && local port[SSH]="\033[1;31m SSH: \033[1;32m"
  586. port[SSH]+="$Port ";;
  587. dropbear)
  588. [[ -z ${port[DPB]} ]] && local port[DPB]="\033[1;31m DROPBEAR: \033[1;32m"
  589. port[DPB]+="$Port ";;
  590. ssserver|ss-server)
  591. [[ -z ${port[SSV]} ]] && local port[SSV]="\033[1;31m SHADOWSOCKS: \033[1;32m"
  592. port[SSV]+="$Port ";;
  593. obfs-serv)
  594. [[ -z ${port[OB]} ]] && local port[OB]="\033[1;31m OBFS: \033[1;32m"
  595. port[OB]+="$Port ";;
  596. trojan-go)
  597. [[ -z ${port[GO]} ]] && local port[GO]="\033[1;31m TROJAN GO: \033[1;32m"
  598. port[GO]+="$Port ";;
  599. trojan)
  600. [[ -z ${port[tro]} ]] && local port[tro]="\033[1;31m TROJAN: \033[1;32m"
  601. port[tro]+="$Port ";;
  602. openvpn)
  603. [[ -z ${port[OVPN]} ]] && local port[OVPN]="\033[1;31m OPENVPN-TCP: \033[1;32m"
  604. port[OVPN]+="$Port ";;
  605. stunnel4|stunnel)
  606. [[ -z ${port[SSL]} ]] && local port[SSL]="\033[1;31m SSL: \033[1;32m"
  607. port[SSL]+="$Port ";;
  608. stunnel5)
  609. [[ -z ${port[SSL5]} ]] && local port[SSL5]="\033[1;31m STUNNEL5: \033[1;32m"
  610. port[SSL5]+="$Port ";;
  611. python|python3)
  612. [[ -z ${port[PY3]} ]] && local port[PY3]="\033[1;31m PYTHON: \033[1;32m"
  613. port[PY3]+="$Port ";;
  614. node)
  615. [[ -z ${port[WS]} ]] && local port[WS]="\033[1;31m WEBSOCKET: \033[1;32m"
  616. port[WS]+="$Port ";;
  617. v2ray)
  618. [[ -z ${port[V2R]} ]] && local port[V2R]="\033[1;31m V2RAY: \033[1;32m"
  619. port[V2R]+="$Port ";;
  620. badvpn-ud)
  621. [[ -z ${port[BAD]} ]] && local port[BAD]="\033[1;31m BADVPN: \033[1;32m"
  622. port[BAD]+="$Port ";;
  623. esac
  624. done <<< "${portasVAR}"
  625. #UDP
  626. local portasVAR=$(lsof -V -i udp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND")
  627. local NOREPEAT
  628. local reQ
  629. local Port
  630. while read port; do
  631. reQ=$(echo ${port}|awk '{print $1}')
  632. Port=$(echo ${port} | awk '{print $9}' | awk -F ":" '{print $2}')
  633. [[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
  634. NOREPEAT+="$Port\n"
  635. case ${reQ} in
  636. openvpn)
  637. [[ -z ${port[OVPN]} ]] && local port[OVPN]="\033[1;31m OPENVPN-UDP: \033[1;32m"
  638. port[OVPN]+="$Port ";;
  639. dns-serve)
  640. [[ -z ${port[SLOW]} ]] && local port[SLOW]="\033[1;31m SlowDNS: \033[1;32m"
  641. port[SLOW]+="$Port ";;
  642. #stunnel5)
  643. #[[ -z ${port[SSL]} ]] && local port[SSL]="\033[1;31m SSL: \033[1;32m"
  644. #port[SSL]+="$Port ";;
  645. esac
  646. done <<< "${portasVAR}"
  647. [[ $(dpkg --get-selections|grep -w 'wireguard'|head -1) ]] && {
  648. if [[ ! $(wg|grep -w 'interface') = "" ]]; then
  649. wg=$(wg|grep -w 'port'|awk -F ' ' '{print $3}')
  650. port[wg]="\033[1;31m WIREGUARD:\033[1;32m $wg"
  651. fi
  652. }
  653. k=1
  654. for line in "${port[@]}"; do
  655. [[ -z "$line" ]] && continue
  656. let RESTO=k%2
  657. if [[ $RESTO -eq 0 ]]; then
  658. puertos+="$line\n"
  659. else
  660. puertos+="$line-"
  661. fi
  662. let k++
  663. done
  664. echo -e "$puertos"|column -t -s '-'
  665. }
  666. remove_script () {
  667. clear
  668. clear
  669. #msg -bar
  670. msg -tit
  671. msg -ama " ¿ DESEA DESINSTALAR SCRIPT ?"
  672. msg -bar
  673. echo -e " Esto borrara todos los archivos del scrip VPS_MX"
  674. msg -bar
  675. while [[ ${yesno} != @(s|S|y|Y|n|N) ]]; do
  676. read -p " [S/N]: " yesno
  677. tput cuu1 && tput dl1
  678. done
  679. if [[ ${yesno} = @(s|S|y|Y) ]]; then
  680. rm -rf ${SCPdir} &>/dev/null
  681. rm -rf ${SCPusr} &>/dev/null
  682. rm -rf ${SCPinst} &>/dev/null
  683. [[ ! -d /usr/local/lib/ubuntn ]] && rm -rf /usr/local/lib/ubuntn
  684. [[ ! -d /usr/share/mediaptre/local/log ]] && rm -rf /usr/share/mediaptre/local/log
  685. [[ ! -d /usr/local/protec ]] && rm -rf /usr/local/protec
  686. [[ -e /bin/VPSMX ]] && rm /bin/VPSMX
  687. [[ -e /usr/bin/VPSMX ]] && rm /usr/bin/VPSMX
  688. [[ -e /bin/menu ]] && rm /bin/menu
  689. [[ -e /usr/bin/menu ]] && rm /usr/bin/menu
  690. cd $HOME
  691. fi
  692. sudo apt-get --purge remove squid -y > /dev/null 2>&1
  693. sudo apt-get --purge remove stunnel4 -y > /dev/null 2>&1
  694. sudo apt-get --purge remove dropbear -y > /dev/null 2>&1
  695. sudo apt-get autoremove -y &>/dev/null
  696. }
  697. horas(){
  698. #code by rufu99
  699. msg -bar
  700. echo -e " \e[41mACTUALIZAR HORA LOCAL\e[0m"
  701. msg -bar
  702. n=1
  703. for i in $(ls /usr/share/zoneinfo/America); do
  704. loc=$(echo $i|awk -F ":" '{print $1}')
  705. zona=$(printf '%-12s' "$loc")
  706. echo -e " \e[37m [$n] \e[31m> \e[32m$zona"
  707. r[$n]=$zona
  708. selec="$n"
  709. let n++
  710. done
  711. msg -bar
  712. opci=$(selection_fun $selec)
  713. rm -rf /etc/localtime > /dev/null 2>&1
  714. echo "America/${r[$opci]}" > /etc/timezone
  715. ln -fs /usr/share/zoneinfo/America/${r[$opci]} /etc/localtime > /dev/null 2>&1
  716. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [HORA ACTUALIZADA]" || echo -e "\033[1;31m [HORA NO ACTUALIZADO]"
  717. #fin
  718. #
  719. }
  720. onlineapp(){
  721. msg -bar
  722. echo -e "\033[1;92m ACTIVANDO SERVICIO"
  723. msg -bar
  724. wget -O /etc/VPS-MX/herramientas/.onapp https://www.dropbox.com/s/z0xb6pbe1uagdjt/onapp &>/dev/null
  725. chmod 777 /etc/VPS-MX/herramientas/.onapp &>/dev/null
  726. apt install apache2 -y > /dev/null 2>&1
  727. sed -i "s/Listen 81/Listen 8888/g" /etc/apache2/ports.conf >/dev/null 2>&1
  728. service apache2 restart
  729. rm -rf /var/www/html/server >/dev/null 2>&1
  730. mkdir /var/www/html/server >/dev/null 2>&1
  731. echo -e "[Unit]
  732. Description=.onapp Service by @lacasitamx
  733. After=network.target
  734. StartLimitIntervalSec=0
  735. [Service]
  736. Type=simple
  737. User=root
  738. WorkingDirectory=/root
  739. ExecStart=/bin/bash /etc/VPS-MX/herramientas/.onapp
  740. Restart=always
  741. RestartSec=3s
  742. [Install]
  743. WantedBy=multi-user.target" > /etc/systemd/system/app.service
  744. systemctl enable app &>/dev/null
  745. systemctl start app &>/dev/null
  746. IP=$(wget -qO- ipv4.icanhazip.com) >/dev/null 2>&1
  747. msg -bar
  748. echo -e "\033[1;92m APP ONLINE INICIADO CON EXITO"
  749. msg -bar
  750. echo -e "\033[1;37m URL de usuarios en línea para usar en la aplicación‌‌\033[0m"
  751. echo -e "\e[1;92m http://$IP:8888/server/online"
  752. msg -bar
  753. }
  754. killapp(){
  755. systemctl stop app &>/dev/null
  756. systemctl disable app &>/dev/null
  757. rm /etc/systemd/system/app.service &>/dev/null
  758. rm -rf /var/www/html/server >/dev/null 2>&1
  759. sed -i "s/Listen 8888/Listen 81/g" /etc/apache2/ports.conf >/dev/null 2>&1
  760. service apache2 restart
  761. msg -bar
  762. echo -e "\033[1;91m APP ONLINE DETENIDO"
  763. msg -bar
  764. }
  765. menuapp(){
  766. clear
  767. msg -tit
  768. msg -azu " \e[91m\e[43mACTIVAR APP EN LINEA\e[0m"
  769. msg -bar
  770. echo -e " \e[1;93m [\e[92m1\e[93m] $(msg -verm2 "➛ ")$(msg -verd " INICIAR APP ONLINE ")"
  771. echo -e " \e[1;93m [\e[92m2\e[93m] $(msg -verm2 "➛ ")$(msg -verm2 " DETENER APP ONLINE ")"
  772. echo -e " \e[1;93m [\e[92m0\e[93m] $(msg -verm2 "➛ ")$(msg -bra " VOLVER ")"
  773. msg -bar
  774. echo -ne " ►\e[1;37m Selecione Una Opcion: \e[33m " && read select
  775. case $select in
  776. 0)menu3 ;;
  777. 1) onlineapp && msg -ne "Enter Para Continuar" && read enter
  778. menu3 ;;
  779. 2)killapp && msg -ne "Enter Para Continuar" && read enter
  780. menu3 ;;
  781. esac
  782. }
  783. systen_info () {
  784. clear
  785. clear
  786. #msg -bar
  787. msg -tit
  788. msg -ama "$(fun_trans " DETALLES DEL SISTEMA")"
  789. null="\033[1;31m"
  790. msg -bar
  791. if [ ! /proc/cpuinfo ]; then msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar; return 1; fi
  792. if [ ! /etc/issue.net ]; then msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar; return 1; fi
  793. if [ ! /proc/meminfo ]; then msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar; return 1; fi
  794. totalram=$(free | grep Mem | awk '{print $2}')
  795. usedram=$(free | grep Mem | awk '{print $3}')
  796. freeram=$(free | grep Mem | awk '{print $4}')
  797. swapram=$(cat /proc/meminfo | grep SwapTotal | awk '{print $2}')
  798. system=$(cat /etc/issue.net)
  799. clock=$(lscpu | grep "CPU MHz" | awk '{print $3}')
  800. based=$(cat /etc/*release | grep ID_LIKE | awk -F "=" '{print $2}')
  801. processor=$(cat /proc/cpuinfo | grep "model name" | uniq | awk -F ":" '{print $2}')
  802. cpus=$(cat /proc/cpuinfo | grep processor | wc -l)
  803. [[ "$system" ]] && msg -ama "$(fun_trans "Sistema"): ${null}$system" || msg -ama "$(fun_trans "Sistema"): ${null}???"
  804. [[ "$based" ]] && msg -ama "$(fun_trans "Base"): ${null}$based" || msg -ama "$(fun_trans "Base"): ${null}???"
  805. [[ "$processor" ]] && msg -ama "$(fun_trans "Procesador"): ${null}$processor x$cpus" || msg -ama "$(fun_trans "Procesador"): ${null}???"
  806. [[ "$clock" ]] && msg -ama "$(fun_trans "Frecuencia de Operacion"): ${null}$clock MHz" || msg -ama "$(fun_trans "Frecuencia de Operacion"): ${null}???"
  807. msg -ama "$(fun_trans "Uso del Procesador"): ${null}$(ps aux | awk 'BEGIN { sum = 0 } { sum += sprintf("%f",$3) }; END { printf " " "%.2f" "%%", sum}')"
  808. msg -ama "$(fun_trans "Memoria Virtual Total"): ${null}$(($totalram / 1024))"
  809. msg -ama "$(fun_trans "Memoria Virtual En Uso"): ${null}$(($usedram / 1024))"
  810. msg -ama "$(fun_trans "Memoria Virtual Libre"): ${null}$(($freeram / 1024))"
  811. msg -ama "$(fun_trans "Memoria Virtual Swap"): ${null}$(($swapram / 1024))MB"
  812. msg -ama "$(fun_trans "Tempo Online"): ${null}$(uptime)"
  813. msg -ama "$(fun_trans "Nombre De La Maquina"): ${null}$(hostname)"
  814. 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}')"
  815. msg -ama "$(fun_trans "Version de Kernel"): ${null}$(uname -r)"
  816. msg -ama "$(fun_trans "Arquitectura"): ${null}$(uname -m)"
  817. msg -bar
  818. return 0
  819. }
  820. [[ "$(crontab -l| grep 'autolim' | wc -l)" != '0' ]] &>/dev/null && {
  821. autram="\e[1;32m[ON]"
  822. } || {
  823. autram="\e[1;31m[OFF]"
  824. }
  825. menu3(){
  826. declare -A inst
  827. pidr_inst
  828. clear
  829. valuest=$(ps ax |grep /etc/shadowsocks-r|grep -v grep)
  830. [[ $valuest != "" ]] && valuest="\033[1;32m[ON] " || valuest="\033[1;31m[OFF]"
  831. 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]"
  832. Bot=$(ps x|grep -v grep |grep "ADMbot.sh")
  833. [[ ! $Bot ]] && AD="\033[1;31m[OFF]" || AD="\033[1;32m[ON] "
  834. #[[ $(ps x | grep stunnel5 | grep -v grep | awk '{print $1}') ]] && stunel5="\e[1;32m[ON]" || stunel5="\e[1;31m[OFF]"
  835. #msg -bar
  836. msg -tit
  837. export -f fun_eth
  838. export -f fun_bar
  839. #echo -e "\e[1;37mTotal Ram: ${null}$(($totalram / 1024)) \e[1;37mUSO: ${null}$(($usedram / 1024)) \e[1;37mLIBRE: ${null}$(($freeram / 1024)) \e[37mSwap:${null}$(($swapram / 1024))MB"
  840. export -f lacasita
  841. lacasita
  842. msg -bar
  843. echo -e " \e[97m\e[1;100mPROTOCOLOS\e[0m \e[97m\e[41mHERRAMIENTAS\e[0m"
  844. msg -bar
  845. if [[ ! -e /etc/noty ]]; then
  846. noty="\e[1;91m[OFF]"
  847. else
  848. noty="\e[1;92m[ON] "
  849. fi
  850. onap=$(ps x|grep -v grep |grep ".onapp")
  851. [[ ! $onap ]] && app="\033[1;31m[OFF]" || app="\033[1;32m[ON] "
  852. if [[ $(systemctl is-active chekuser) = "active" ]]; then
  853. chek="\e[1;92m[ON] "
  854. else
  855. chek="\e[1;91m[OFF]"
  856. fi
  857. #menu de protocolos
  858. echo -e "\e[1;93m[\e[92m1\e[93m]$(msg -verm2 "➛ ")$(msg -azu "BADVPN ${inst[badvpn]}") \e[1;93m[\e[92m15\e[93m]$(msg -verm2 "➛ ")$(msg -azu "ARCHIVO ONLINE")"
  859. echo -e "\e[1;93m[\e[92m2\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SOCKS LIBEV ${inst[ss-server]}") \e[1;93m[\e[92m16\e[93m]$(msg -verm2 "➛ ")$(msg -azu "FIREWALL")"
  860. echo -e "\e[1;93m[\e[92m3\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SOCKS PYTHON ${inst[python]}") \e[1;93m[\e[92m17\e[93m]$(msg -verm2 "➛ ")$(msg -azu "FAIL2BAN PROTECION")"
  861. echo -e "\e[1;93m[\e[92m4\e[93m]$(msg -verm2 "➛ ")$(msg -azu "V2RAY ${inst[v2ray]}") \e[1;93m[\e[92m18\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DETALLES DE SISTEMA")"
  862. echo -e "\e[1;93m[\e[92m5\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SSL ${inst[stunnel4]}") \e[1;93m[\e[92m19\e[93m]$(msg -verm2 "➛ ")$(msg -azu "TCP (BBR|BBR-Plus)")"
  863. echo -e "\e[1;93m[\e[92m6\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DROPBEAR ${inst[dropbear]}") \e[1;93m[\e[92m20\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DNS NETFLIX")"
  864. echo -e "\e[1;93m[\e[92m7\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SQUID ${inst[squid]}") \e[1;93m[\e[92m21\e[93m]$(msg -verm2 "➛ ")$(msg -azu "AUTO MANTENIMIENTO")$autram"
  865. echo -e "\e[1;93m[\e[92m8\e[93m]$(msg -verm2 "➛ ")$(msg -azu "OPENVPN ${inst[openvpn]}") \e[1;93m[\e[92m22\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SCANNER SUBDOMINIO")"
  866. echo -e "\e[1;93m[\e[92m9\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SLOWDNS ${inst[dns-serve]}") \e[1;93m[\e[92m23\e[93m]$(msg -verm2 "➛ ")$(msg -azu "PRUEBA DE VELOCIDAD")"
  867. echo -e "\e[1;93m[\e[92m10\e[93m]$(msg -verm2 "➛ ")$(msg -azu "MONITOR APP $app") \e[1;93m[\e[92m24\e[93m]$(msg -verm2 "➛ ")$(msg -azu "FIX ORACLE/AWS/AZR")"
  868. echo -e "\e[1;93m[\e[92m11\e[93m]$(msg -verm2 "➛ ")$(msg -azu "BOT TELEGRAM $AD") \e[1;93m[\e[92m25\e[93m]$(msg -verm2 "➛ ")$(msg -azu "\e[91m\e[43mHERRAMIENTAS BASICOS\e[0m")"
  869. echo -e "\e[1;93m[\e[92m12\e[93m]$(msg -verm2 "➛ ")$(msg -azu "WIREGUARD ${inst[wg]}") $(msg -verd "[0] ")$(msg -verm2 "➛ ")$(msg -azu "⇚ VOLVER ")"
  870. echo -e "\e[1;93m[\e[92m13\e[93m]$(msg -verm2 "➛ ")$(msg -azu "NOTI-BOT $noty")"
  871. echo -e "\e[1;93m[\e[92m14\e[93m]$(msg -verm2 "➛ ")$(msg -azu "CHECK-USER $chek")"
  872. msg -bar
  873. echo -ne " ►\e[1;37m Selecione Una Opcion: \e[33m " && read select
  874. case $select in
  875. 0) ;;
  876. 1) ${SCPinst}/budp.sh && msg -ne "Enter Para Continuar" && read enter
  877. menu3 ;;
  878. 2) ${SCPinst}/shadowsocks.sh && msg -ne "Enter Para Continuar" && read enter
  879. menu3 ;;
  880. 3) ${SCPinst}/sockspy.sh && msg -ne "Enter Para Continuar" && read enter
  881. menu3 ;;
  882. 4) ${SCPinst}/v2ray.sh && msg -ne "Enter Para Continuar" && read enter
  883. menu3 ;;
  884. 5) ${SCPinst}/ssl.sh && msg -ne "Enter Para Continuar" && read enter
  885. menu3 ;;
  886. 6) ${SCPinst}/dropbear.sh && msg -ne "Enter Para Continuar" && read enter
  887. menu3 ;;
  888. 7) ${SCPinst}/squid.sh && msg -ne "Enter Para Continuar" && read enter
  889. menu3 ;;
  890. 8) ${SCPinst}/openvpn.sh && msg -ne "Enter Para Continuar" && read enter
  891. menu3 ;;
  892. 9) ${SCPinst}/slowdns.sh && msg -ne "Enter Para Continuar" && read enter
  893. menu3 ;;
  894. #
  895. #herramientas
  896. 10) menuapp && msg -ne "Enter Para Continuar" && read enter
  897. menu3 ;;
  898. 11) adminbot;;
  899. 12) ${SCPinst}/wireguard.sh && msg -ne "Enter Para Continuar" && read enter
  900. menu3 ;;
  901. 13) noti ;;
  902. 14) ${SCPinst}/chekuser.sh && msg -ne "Enter Para Continuar" && read enter
  903. menu3 ;;
  904. 15) ${SCPfrm}/apacheon.sh;;
  905. 16) ${SCPfrm}/blockBT.sh;;
  906. 17) ${SCPfrm}/fai2ban.sh;;
  907. 18) systen_info;;
  908. 19) ${SCPfrm}/tcp.sh;;
  909. 20) net;;
  910. 21) cache;;
  911. 22) ${SCPfrm}/ultrahost;;
  912. 23) ${SCPfrm}/speed.py;;
  913. 24)oracl ;;
  914. 25) extra ;;
  915. #25)${SCPinst}/trojango.sh && msg -ne "Enter Para Continuar" && read enter
  916. #menu3 ;;
  917. *) msg -verm2 " Por Favor Selecione El Número Correcto"
  918. sleep 1.s
  919. menu3 ;;
  920. esac
  921. }
  922. NOTIFY () {
  923. clear
  924. clear
  925. msg -tit
  926. msg -ama " Notify-BOT (Notificacion Remota)|@LaCasitaMx_Noty_Bot "
  927. msg -bar
  928. echo -e "\033[1;94m Notify-BOT es un simple notificador de:"
  929. echo -e "\033[1;94m >> Usuario Expirado"
  930. echo -e "\033[1;94m >> Usuario Eliminado"
  931. echo -e "\033[1;94m >> Avisos de VPS Reiniciada"
  932. echo -e "\033[1;94m >> Avisos de Monitor de Protocolos"
  933. echo -e "\033[1;97m Inicie El BOT de Telegram"
  934. echo -e "\033[1;92m ¡¡ Para sacar su ID entre al BOT @conectedmx_bot"
  935. echo -e "\033[1;92m Aparesera algo parecido 👤 → Tu ID es: 45145564 "
  936. msg -bar
  937. echo -e "\033[1;93mIgrese un nombre para la VPS:\033[0;37m"; read -p " " nombr
  938. echo "${nombr}" > /etc/VPS-MX/controlador/nombre.log
  939. echo -e "\033[1;93mIgrese su ID 👤:\033[0;37m"; read -p " " idbot
  940. echo "${idbot}" > /etc/VPS-MX/controlador/IDT.log
  941. msg -bar
  942. echo -e "\033[1;32m ID AGREGADO CON EXITO"
  943. msg -bar
  944. wget -qO- ifconfig.me > /etc/VPS-MX/IP.log
  945. ipt=`less /etc/VPS-MX/IP.log` > /dev/null 2>&1
  946. Nip="$(echo $ipt)"
  947. NOM="$(less /etc/VPS-MX/controlador/nombre.log)"
  948. NOM1="$(echo $NOM)"
  949. IDB1=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
  950. IDB2=`echo $IDB1` > /dev/null 2>&1
  951. KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
  952. URL="https://api.telegram.org/bot$KEY/sendMessage"
  953. MSG="⚠️ ►► AVISO DE VPS: $NOM1 ⚠
  954. 👉 ►► IP: $Nip
  955. 👉 ►► Usuario: $(cat /etc/VPS-MX/message.txt)
  956. 👉 ►► MENSAJE DE PRUEBA
  957. 🔰 ►► NOTI-BOT ACTIVADO CORRECTAMENTE"
  958. curl -s --max-time 10 -d "chat_id=$IDB2&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
  959. echo -e "\033[1;34m SE ENVIO MENSAJE DE PRUEBA "
  960. touch /etc/noty
  961. }
  962. noti(){
  963. clear
  964. msg -tit
  965. echo -e " \e[97m\e[1;100mACTIVADOR NOTI-BOT\e[0m"
  966. msg -bar
  967. echo -e "\e[1;93m[\e[92m1\e[93m]$(msg -verm2 "➛ ")$(msg -azu "ACTIVAR NOTI-BOT $nt") \e[1;93m[\e[92m2\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DESACTIVAR NOTI-BOT")"
  968. msg -bar
  969. echo -e " \e[1;93m[\e[92m0\e[93m]$(msg -verm2 "➛ ")$(msg -azu "VOLVER")"
  970. msg -bar
  971. echo -ne " ►\e[1;37m Selecione Una Opcion: \e[33m " && read selectos
  972. case $selectos in
  973. 0)menu3 ;;
  974. 1) NOTIFY && msg -ne "Enter Para Continuar" && read enter
  975. menu3 ;;
  976. 2)
  977. echo " "> /etc/VPS-MX/controlador/IDT.log &>/dev/null
  978. rm /etc/noty &>/dev/null
  979. msg -verm2 " NOTI-BOT DESACTIVADO"
  980. ;;
  981. esac
  982. }
  983. adminbot(){
  984. clear
  985. #msg -bar
  986. #msg -tit
  987. echo ""
  988. echo -e "\e[1;90m╔─━━━━━━━━━━━━━━░★░━━━━━━━━━━━━━━─╗ \e[0m"
  989. msg -ama " ░ ADMINISTRADOR BOT | TELEGRAM ░ \033[1;31m"
  990. echo -e "\e[1;90m╚─━━━━━━━━━━━━━━░★░━━━━━━━━━━━━━━─╝ \e[0m"
  991. activar(){
  992. msg -bar
  993. echo -ne "\033[1;96m #Digite el Token del BOT\033[0;92m\nTOKEN: \033[0;97m" && read TOKEN
  994. msg -bar
  995. echo -ne "\033[1;96m #Digite un nombre para su Usuario\033[0;92m \nUSUARIO: \033[0;97m" && read USERLIB
  996. msg -bar
  997. echo -ne "\033[1;96m #Digite una contraseña para su Usuario\033[0;92m \nCONTRASEÑA: \033[0;97m" && read PASSLIB
  998. #msg -bar
  999. echo -e "[Unit]
  1000. Description=ADMbot.sh Service by @lacasitamx
  1001. After=network.target
  1002. StartLimitIntervalSec=0
  1003. [Service]
  1004. Type=simple
  1005. User=root
  1006. WorkingDirectory=/root
  1007. ExecStart=/bin/bash /etc/VPS-MX/herramientas/ADMbot.sh id "$TOKEN" "$USERLIB" "$PASSLIB"
  1008. Restart=always
  1009. RestartSec=3s
  1010. [Install]
  1011. WantedBy=multi-user.target" > /etc/systemd/system/Botca.service
  1012. systemctl enable Botca &>/dev/null
  1013. systemctl start Botca &>/dev/null
  1014. msg -bar
  1015. echo -e "\033[1;92m BOT INICIADO CON EXITO"
  1016. echo -e "\033[1;97m MODO DE INICIO DEL BOT: /ADMIN $USERLIB $PASSLIB"
  1017. msg -bar
  1018. }
  1019. killbot(){
  1020. systemctl stop Botca &>/dev/null
  1021. systemctl disable Botca &>/dev/null
  1022. rm /etc/systemd/system/Botca.service &>/dev/null
  1023. msg -bar
  1024. echo -e "\033[1;91m BOT DETENIDO"
  1025. msg -bar
  1026. }
  1027. echo -e " \e[1;93m[\e[92m1\e[93m] $(msg -verm2 "➛ ")$(msg -verd " INICIAR BOT MANAGER ")"
  1028. echo -e " \e[1;93m[\e[92m2\e[93m] $(msg -verm2 "➛ ")$(msg -verm2 " DETENER BOT MANAGER ")"
  1029. echo -e " \e[1;93m[\e[92m0\e[93m] $(msg -verm2 "➛ ")$(msg -bra " VOLVER ")"
  1030. msg -bar
  1031. echo -ne " ►\e[1;37m Selecione Una Opcion: \e[33m " && read select
  1032. case $select in
  1033. 0)menu3 ;;
  1034. 1)activar && msg -ne "Enter Para Continuar" && read enter
  1035. menu3 ;;
  1036. 2)killbot && msg -ne "Enter Para Continuar" && read enter
  1037. menu3 ;;
  1038. esac
  1039. }
  1040. extra(){
  1041. clear
  1042. clear
  1043. #msg -bar
  1044. msg -tit
  1045. on="\033[1;32m[ON]" && off="\033[1;31m[OFF]"
  1046. [[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]] && tcp=$off || tcp=$on
  1047. if [ -e /etc/squid/squid.conf ]; then
  1048. [[ `grep -c "^#CACHE_DO_SQUID" /etc/squid/squid.conf` -gt 0 ]] && squi=$off || squi=$on
  1049. elif [ -e /etc/squid3/squid.conf ]; then
  1050. [[ `grep -c "^#CACHE_DO_SQUID" /etc/squid3/squid.conf` -gt 0 ]] && squi=$off || squi=$on
  1051. fi
  1052. echo -e " \e[91m\e[43mHERRAMIENTAS BASICOS\e[0m"
  1053. msg -bar
  1054. echo -e " \e[1;93m[\e[92m1\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "ACTUALIZAR HORA LOCAL")"
  1055. echo -e " \e[1;93m[\e[92m2\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "HTOP")"
  1056. echo -e " \e[1;93m[\e[92m3\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "MODIFICAR PUERTOS ACTIVOS")"
  1057. echo -e " \e[1;93m[\e[92m4\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "PAYLOAD FUERZA BRUTA")"
  1058. echo -e " \e[1;93m[\e[92m5\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "TCP SPEED") $tcp"
  1059. echo -e " \e[1;93m[\e[92m6\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "CACHÉ PARA SQUID") $squi"
  1060. echo -e " \e[1;93m[\e[92m7\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "LIMPIAR PAQUETES OBSOLETOS")"
  1061. echo -e " \e[1;93m[\e[92m8\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "RESET IPTABLES")"
  1062. echo -e " \e[1;93m[\e[92m9\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "REINICIAR VPS")"
  1063. echo -e " \e[1;93m[\e[92m10\e[93m]$(msg -verm2 "➛ ")$(msg -azu "CAMBIAR HOSTNAME VPS")"
  1064. echo -e " \e[1;93m[\e[92m11\e[93m]$(msg -verm2 "➛ ")$(msg -azu "CAMBIAR CONTRASEÑA ROOT")"
  1065. echo -e " \e[1;93m[\e[92m12\e[93m]$(msg -verm2 "➛ ")$(msg -azu "AGREGAR ROOT a GoogleCloud y Amazon")"
  1066. echo -e " \e[1;93m[\e[92m13\e[93m]$(msg -verm2 "➛ ")$(msg -azu "AUTENTIFICAR SQUID")"
  1067. echo -e " \e[1;93m[\e[92m0\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "VOLVER")"
  1068. msg -bar
  1069. echo -ne " ►\e[1;37m Selecione Una Opcion: \e[33m " && read select
  1070. case $select in
  1071. 0)menu3 ;;
  1072. 1)horas ;;
  1073. 2)monhtop ;;
  1074. 3)${SCPfrm}/ports.sh && msg -ne "Enter Para Continuar" && read enter
  1075. menu3 ;;
  1076. 4)${SCPfrm}/paysnd.sh ;;
  1077. 5)TCPspeed ;;
  1078. 6)SquidCACHE ;;
  1079. 7)packobs ;;
  1080. 8)resetiptables ;;
  1081. 9)reiniciar_vps ;;
  1082. 10)host_name ;;
  1083. 11)cambiopass ;;
  1084. 12)rootpass ;;
  1085. 13)${SCPfrm}/squidpass.sh ;;
  1086. *) ;;
  1087. esac
  1088. }
  1089. reiniciar_vps () {
  1090. echo -ne " \033[1;31m[ ! ] Sudo Reboot"
  1091. sleep 3s
  1092. echo -e "\033[1;32m [OK]"
  1093. (
  1094. sudo reboot
  1095. ) > /dev/null 2>&1
  1096. msg -bar
  1097. return
  1098. }
  1099. host_name () {
  1100. unset name
  1101. while [[ ${name} = "" ]]; do
  1102. echo -ne "\033[1;37m $(fun_trans "Nuevo nombre del host"): " && read name
  1103. tput cuu1 && tput dl1
  1104. done
  1105. hostnamectl set-hostname $name
  1106. if [ $(hostnamectl status | head -1 | awk '{print $3}') = "${name}" ]; then
  1107. echo -e "\033[1;33m $(fun_trans "Host alterado corretamente")!, $(fun_trans "reiniciar VPS")"
  1108. else
  1109. echo -e "\033[1;33m $(fun_trans "Host no modificado")!"
  1110. fi
  1111. msg -bar
  1112. return
  1113. }
  1114. cambiopass () {
  1115. echo -e "${cor[3]} $(fun_trans "Esta herramienta cambia la contraseña de su servidor vps")"
  1116. echo -e "${cor[3]} $(fun_trans "Esta contraseña es utilizada como usuario") root"
  1117. msg -bar
  1118. echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "; read x
  1119. [[ $x = @(n|N) ]] && msg -bar && return
  1120. msg -bar
  1121. #Inicia Procedimentos
  1122. echo -e "${cor[0]} $(fun_trans "Escriba su nueva contraseña")"
  1123. msg -bar
  1124. read -p " Nuevo passwd: " pass
  1125. (echo $pass; echo $pass)|passwd 2>/dev/null
  1126. sleep 1s
  1127. msg -bar
  1128. echo -e "${cor[3]} $(fun_trans "Contraseña cambiada con exito!")"
  1129. echo -e "${cor[2]} $(fun_trans "Su contraseña ahora es"): ${cor[4]}$pass"
  1130. msg -bar
  1131. return
  1132. }
  1133. dnsnetflix () {
  1134. #by kalix1
  1135. echo "nameserver $dns1" >> /etc/resolv.conf
  1136. #echo "nameserver $dns2" >> /etc/resolv.conf
  1137. /etc/init.d/ssrmu stop &>/dev/null
  1138. /etc/init.d/ssrmu start &>/dev/null
  1139. /etc/init.d/shadowsocks-r stop &>/dev/null
  1140. /etc/init.d/shadowsocks-r start &>/dev/null
  1141. msg -bar2
  1142. echo -e "${cor[4]} DNS AGREGADOS CON EXITO"
  1143. }
  1144. net(){
  1145. #by kalix1
  1146. clear
  1147. #msg -bar2
  1148. msg -tit
  1149. echo -e "\033[1;93m AGREGADOR DE DNS PERSONALES"
  1150. msg -bar2
  1151. echo -e "\033[1;39m Esta funcion ara que puedas ver Netflix con tu VPS"
  1152. msg -bar2
  1153. #echo -e "\033[1;91m ¡ Solo seran utiles si registraste tu IP en el BOT !"
  1154. echo -e "\033[1;39m En APPS como HTTP Inyector,KPN Rev,APKCUSTOM, etc."
  1155. echo -e "\033[1;39m Se deveran agregar en la aplicasion a usar estos DNS."
  1156. echo -e "\033[1;39m En APPS como SS,SSR,V2RAY no es necesario agregarlos."
  1157. msg -bar2
  1158. 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."
  1159. echo ""
  1160. echo -e "\033[1;97m Ingrese su DNS Primario: \033[0;91m"; read -p " Primary Dns: " dns1
  1161. echo -e "\033[1;97m Ingrese su DNS Secundario: \033[0;91m"; read -p " Secondary Dns: " dns2
  1162. echo ""
  1163. msg -bar2
  1164. read -p " Estas seguro de continuar? [ s | n ]: " dnsnetflix
  1165. [[ "$dnsnetflix" = "s" || "$dnsnetflix" = "S" ]] && dnsnetflix
  1166. msg -bar2
  1167. }
  1168. rootpass () {
  1169. clear
  1170. msg -bar
  1171. echo -e "${cor[3]} Esta herramienta cambia a usuario root las VPS de "
  1172. echo -e "${cor[3]} GoogleCloud y Amazon"
  1173. msg -bar
  1174. echo -ne " Desea Seguir? [S/N]: "; read x
  1175. [[ $x = @(n|N) ]] && msg -bar && return
  1176. msg -bar
  1177. #Inicia Procedimentos
  1178. echo -e " Aplicando Configuraciones"
  1179. fun_bar "service ssh restart"
  1180. #Parametros Aplicados
  1181. sed -i "s;PermitRootLogin prohibit-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
  1182. sed -i "s;PermitRootLogin without-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
  1183. sed -i "s;PasswordAuthentication no;PasswordAuthentication yes;g" /etc/ssh/sshd_config
  1184. msg -bar
  1185. echo -e "Escriba su contraseña root actual o cambiela"
  1186. msg -bar
  1187. read -p " Nuevo passwd: " pass
  1188. (echo $pass; echo $pass)|passwd 2>/dev/null
  1189. sleep 1s
  1190. msg -bar
  1191. echo -e "${cor[3]} Configuraciones aplicadas con exito!"
  1192. echo -e "${cor[2]} Su contraseña ahora es: ${cor[4]}$pass"
  1193. service ssh restart > /dev/null 2>&1
  1194. msg -bar
  1195. return
  1196. }
  1197. resetiptables () {
  1198. echo -e "Reiniciando Ipetables espere"
  1199. 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
  1200. echo -e "iptables reiniciadas con exito"
  1201. }
  1202. packobs () {
  1203. msg -ama "Buscando Paquetes Obsoletos"
  1204. dpkg -l | grep -i ^rc
  1205. msg -ama "Limpiando Paquetes Obsoloteos"
  1206. dpkg -l |grep -i ^rc | cut -d " " -f 3 | xargs dpkg --purge
  1207. msg -ama "Limpieza Completa"
  1208. }
  1209. TCPspeed () {
  1210. if [[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]]; then
  1211. #INSTALA
  1212. msg -ama "$(fun_trans "TCP Speed No Activado, Desea Activar Ahora")?"
  1213. msg -bar
  1214. while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
  1215. read -p " [S/N]: " -e -i s resposta
  1216. tput cuu1 && tput dl1
  1217. done
  1218. [[ "$resposta" = @(s|S|y|Y) ]] && {
  1219. echo "#ADM" >> /etc/sysctl.conf
  1220. echo "net.ipv4.tcp_window_scaling = 1
  1221. net.core.rmem_max = 16777216
  1222. net.core.wmem_max = 16777216
  1223. net.ipv4.tcp_rmem = 4096 87380 16777216
  1224. net.ipv4.tcp_wmem = 4096 16384 16777216
  1225. net.ipv4.tcp_low_latency = 1
  1226. net.ipv4.tcp_slow_start_after_idle = 0" >> /etc/sysctl.conf
  1227. sysctl -p /etc/sysctl.conf > /dev/null 2>&1
  1228. msg -ama "$(fun_trans "TCP Activo Con Exito")!"
  1229. } || msg -ama "$(fun_trans "Cancelado")!"
  1230. else
  1231. #REMOVE
  1232. msg -ama "$(fun_trans "TCP Speed ya esta activado, desea detener ahora")?"
  1233. msg -bar
  1234. while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
  1235. read -p " [S/N]: " -e -i s resposta
  1236. tput cuu1 && tput dl1
  1237. done
  1238. [[ "$resposta" = @(s|S|y|Y) ]] && {
  1239. grep -v "^#ADM
  1240. net.ipv4.tcp_window_scaling = 1
  1241. net.core.rmem_max = 16777216
  1242. net.core.wmem_max = 16777216
  1243. net.ipv4.tcp_rmem = 4096 87380 16777216
  1244. net.ipv4.tcp_wmem = 4096 16384 16777216
  1245. net.ipv4.tcp_low_latency = 1
  1246. net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf > /tmp/syscl && mv -f /tmp/syscl /etc/sysctl.conf
  1247. sysctl -p /etc/sysctl.conf > /dev/null 2>&1
  1248. msg -ama "$(fun_trans "TCP Parado Con Exito")!"
  1249. } || msg -ama "$(fun_trans "Cancelado")!"
  1250. fi
  1251. }
  1252. SquidCACHE () {
  1253. msg -ama "$(fun_trans "Squid Cache, Aplica cache en Squid")"
  1254. msg -ama "$(fun_trans "Mejora la velocidad del squid")"
  1255. msg -bar
  1256. if [ -e /etc/squid/squid.conf ]; then
  1257. squid_var="/etc/squid/squid.conf"
  1258. elif [ -e /etc/squid3/squid.conf ]; then
  1259. squid_var="/etc/squid3/squid.conf"
  1260. else
  1261. msg -ama "$(fun_trans "Su sistema no tiene un squid")!" && return 1
  1262. fi
  1263. teste_cache="#CACHE_DO_SQUID"
  1264. if [[ `grep -c "^$teste_cache" $squid_var` -gt 0 ]]; then
  1265. [[ -e ${squid_var}.bakk ]] && {
  1266. msg -ama "$(fun_trans "Cache squid identificado, eliminando")!"
  1267. mv -f ${squid_var}.bakk $squid_var
  1268. msg -ama "$(fun_trans "Cache squid Removido")!"
  1269. service squid restart > /dev/null 2>&1 &
  1270. service squid3 restart > /dev/null 2>&1 &
  1271. return 0
  1272. }
  1273. fi
  1274. msg -ama "$(fun_trans "Aplicando Cache Squid")!"
  1275. msg -bar
  1276. _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"
  1277. [[ "$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"
  1278. while read s_squid; do
  1279. [[ "$s_squid" != "cache deny all" ]] && _tmp+="\n${s_squid}"
  1280. done < $squid_var
  1281. cp ${squid_var} ${squid_var}.bakk
  1282. echo -e "${_tmp}" > $squid_var
  1283. msg -ama "$(fun_trans "Cache Aplicado con Exito")!"
  1284. service squid restart > /dev/null 2>&1 &
  1285. service squid3 restart > /dev/null 2>&1 &
  1286. }
  1287. oracl(){
  1288. clear
  1289. #msg -bar
  1290. msg -tit
  1291. msg -verm " FIREWALLD"
  1292. msg -ama " ESTA HERRAMIENTA ES PARA LAS VPS ORACLE/AWS/AZR"
  1293. msg -ama " TAMBIEN PARA OTRAS VPS QUE SON NECESARIO A UTILIZAR ESTA OPCION"
  1294. echo -ne " Desea Continuar? [S/N]: "; read x
  1295. [[ $x = @(n|N) ]] && msg -bar && return
  1296. msg -bar
  1297. sudo apt update -y &>/dev/null
  1298. sudo apt install firewalld -y &>/dev/null
  1299. sudo apt install apache2 &>/dev/null
  1300. #sudo firewall-cmd --permanent --add-service={http,https} --permanent
  1301. sudo firewall-cmd --zone=public --permanent --add-port=80/tcp
  1302. sudo firewall-cmd --zone=public --permanent --add-port=81/tcp
  1303. sudo firewall-cmd --zone=public --permanent --add-port=90/tcp
  1304. sudo firewall-cmd --zone=public --permanent --add-port=110/tcp
  1305. sudo firewall-cmd --zone=public --permanent --add-port=143/tcp
  1306. sudo firewall-cmd --zone=public --permanent --add-port=442/tcp
  1307. sudo firewall-cmd --zone=public --permanent --add-port=443/tcp
  1308. sudo firewall-cmd --zone=public --permanent --add-port=444/tcp
  1309. sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp
  1310. sudo firewall-cmd --zone=public --permanent --add-port=8081/tcp
  1311. sudo firewall-cmd --zone=public --permanent --add-port=5300/udp
  1312. sudo firewall-cmd --zone=public --permanent --add-port=7200/udp
  1313. sudo firewall-cmd --zone=public --permanent --add-port=7300/udp
  1314. sudo firewall-cmd --reload
  1315. sudo firewall-cmd --zone=public --list-ports &>/dev/null
  1316. msg -azu " FIX AGREGADO"
  1317. }
  1318. cache(){
  1319. clear
  1320. msg -bar
  1321. msg -verm " LIBERANDO CACHÉ/RAM DEL SISTEMA"
  1322. msg -bar
  1323. sysctl -w vm.drop_caches=3 &> /dev/null
  1324. #apt-get autoclean -y &>/dev/null; apt-get clean -y &>/dev/null && msg -ama " REFRESCANDO RAM,SISTEMA"| pv -qL20
  1325. # sleep 2s
  1326. if [[ ! -z $(crontab -l|grep -w "autolim") ]]; then
  1327. msg -azu " Auto limpieza programada cada $(msg -verd "[ $(crontab -l|grep -w "autolim"|awk '{print $2}'|sed $'s/[^[:alnum:]\t]//g')HS ]")"
  1328. msg -bar
  1329. while :
  1330. do
  1331. echo -ne "$(msg -azu " Detener Auto Limpieza [S/N]: ")" && read yesno
  1332. tput cuu1 && tput dl1
  1333. case $yesno in
  1334. s|S) crontab -l > /root/cron && sed -i '/autolim/ d' /root/cron && crontab /root/cron && rm /etc/autolim
  1335. msg -azu " Auto-Limpeza Detenida!" && msg -bar && sleep 2
  1336. return 1;;
  1337. n|N)return 1;;
  1338. *)menu3 ;;
  1339. esac
  1340. done
  1341. fi
  1342. clear
  1343. msg -bar
  1344. msg -ama " \e[1;97m\e[2;100mAUTO MANTENIMIENTO DE SISTEMA \e[0m"
  1345. msg -bar
  1346. msg -verm2 " ➥ \e[97mACTUALIZACION DE PAQUETES "
  1347. msg -verm2 " ➥ \e[97mREFRESCAR RAM "
  1348. msg -verm2 " ➥ \e[97mREFRESCAR SWAP "
  1349. msg -verm2 " ➥ \e[97mLIMPIAR PAQUETES OPSOLETOS "
  1350. msg -verm2 " ➥ \e[97mLIMPIAR CACHE V2RAY "
  1351. msg -verm2 " ➥ \e[97mREINICIO DE SSL "
  1352. msg -bar
  1353. echo -ne "$(msg -azu "Desea programar El Auto-Limpieza [s/n]:") "
  1354. read c_ram
  1355. if [[ $c_ram = @(s|S|y|Y) ]]; then
  1356. tput cuu1 && tput dl1
  1357. echo -ne "$(msg -azu " PONGA UN NÚMERO, EJEMPLO [1-12HORAS]:") "
  1358. read ram_c
  1359. if [[ $ram_c =~ ^[0-9]+$ ]]; then
  1360. crontab -l > /root/cron
  1361. wget -O /etc/autolim https://www.dropbox.com/s/rro6ghqr1dsj20l/autolim.sh &>/dev/null
  1362. chmod 777 /etc/autolim
  1363. echo "0 */$ram_c * * * bash /etc/autolim" >> /root/cron
  1364. crontab /root/cron
  1365. service cron restart
  1366. rm /root/cron
  1367. tput cuu1 && tput dl1
  1368. msg -azu " Auto-Limpieza programada cada: $(msg -verd "${ram_c} HORAS")" && msg -bar && sleep 2
  1369. else
  1370. tput cuu1 && tput dl1
  1371. msg -verm2 " ingresar solo numeros entre 1 y 12"
  1372. sleep 2
  1373. msg -bar
  1374. fi
  1375. fi
  1376. return 1
  1377. }
  1378. pidr_inst(){
  1379. proto="dropbear python stunnel4 stunnel5 v2ray node badvpn squid openvpn dns-serve ssserver ss-server"
  1380. portas=$(lsof -V -i -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND")
  1381. for list in $proto; do
  1382. case $list in
  1383. dropbear|python|stunnel4|stunnel5|v2ray|node|badvpn|squid|openvpn|ssserver|ss-server)
  1384. portas2=$(echo $portas|grep -w "LISTEN"|grep -w "$list")
  1385. [[ $(echo "${portas2}"|grep "$list") ]] && inst[$list]="\033[1;32m[ON] " || inst[$list]="\033[1;31m[OFF]";;
  1386. dns-serve)
  1387. portas2=$(echo $portas|grep -w "$list")
  1388. [[ $(echo "${portas2}"|grep "$list") ]] && inst[$list]="\033[1;32m[ON] " || inst[$list]="\033[1;31m[OFF]";;
  1389. esac
  1390. done
  1391. [[ $(dpkg --get-selections|grep -w 'wireguard'|head -1) ]] && {
  1392. if [[ $(wg|grep -w 'interface') = "" ]]; then inst[wg]="\033[1;31m[OFF]"; else inst[wg]="\033[1;32m[ON] "; fi
  1393. } || {
  1394. inst[wg]="\033[1;31m[OFF]"
  1395. }
  1396. }
  1397. # Menu Instalaciones
  1398. #check_IP&
  1399. # MENU FLUTUANTE
  1400. menu_func () {
  1401. local options=${#@}
  1402. local array
  1403. for((num=1; num<=$options; num++)); do
  1404. echo -ne " $(msg -verd "\e[1;93m[\e[92m$num\e[93m]") $(msg -verm2 "➛ ") "
  1405. array=(${!num})
  1406. case ${array[0]} in
  1407. "-vd")msg -verd "\033[1;33m[!]\033[1;32m $(fun_trans "${array[@]:1}")" | sed ':a;N;$!ba;s/\n/ /g';;
  1408. "-vm")msg -verm2 "\033[1;33m[!]\033[1;31m $(fun_trans "${array[@]:1}")" | sed ':a;N;$!ba;s/\n/ /g';;
  1409. "-fi")msg -azu "$(fun_trans "${array[@]:2}") ${array[1]}" | sed ':a;N;$!ba;s/\n/ /g';;
  1410. *)msg -azu "$(fun_trans "${array[@]}")" | sed ':a;N;$!ba;s/\n/ /g';;
  1411. esac
  1412. done
  1413. }
  1414. VERY3=$(ps aux|grep -v grep|grep "monitor")
  1415. monservi_fun () {
  1416. clear
  1417. clear
  1418. monssh () {
  1419. sed -i "57d" /bin/monitor.sh
  1420. sed -i '57i EstadoServicio ssh' /bin/monitor.sh
  1421. }
  1422. mondropbear () {
  1423. sed -i "59d" /bin/monitor.sh
  1424. sed -i '59i EstadoServicio dropbear' /bin/monitor.sh
  1425. }
  1426. monssl() {
  1427. sed -i "61d" /bin/monitor.sh
  1428. sed -i '61i EstadoServicio stunnel4' /bin/monitor.sh
  1429. }
  1430. monsquid() {
  1431. sed -i "63d" /bin/monitor.sh
  1432. sed -i '63i [[ $(EstadoServicio squid) ]] && EstadoServicio squid3' /bin/monitor.sh
  1433. }
  1434. monapache() {
  1435. sed -i "65d" /bin/monitor.sh
  1436. sed -i '65i EstadoServicio apache2' /bin/monitor.sh
  1437. }
  1438. monv2ray() {
  1439. sed -i "55d" /bin/monitor.sh
  1440. sed -i '55i EstadoServicio v2ray' /bin/monitor.sh
  1441. }
  1442. msg -bar
  1443. msg -tit
  1444. echo -e "\033[1;32m MONITOR DE SERVICIONS PRINCIPALES"
  1445. PIDVRF3=$(ps aux|grep -v grep |grep "monitor")
  1446. #PIDVRF5=$(ps x|grep -v grep |grep "monit")
  1447. if [[ -z $PIDVRF3 ]]; then
  1448. #sed -i '5a\screen -dmS monitor /etc/VPS-MX/tmp/monitor' /bin/resetsshdrop
  1449. msg -bar
  1450. echo -e "\033[1;34m ¿Monitorear Protocolo SSH/SSHD?"
  1451. msg -bar
  1452. read -p " [ s | n ]: " monssh
  1453. sed -i "57d" /bin/monitor.sh
  1454. sed -i '57i #EstadoServicio ssh' /bin/monitor.sh
  1455. [[ "$monssh" = "s" || "$monssh" = "S" ]] && monssh
  1456. msg -bar
  1457. echo -e "\033[1;34m ¿Monitorear Protocolo DROPBEAR?"
  1458. msg -bar
  1459. read -p " [ s | n ]: " mondropbear
  1460. sed -i "59d" /bin/monitor.sh
  1461. sed -i '59i #EstadoServicio dropbear' /bin/monitor.sh
  1462. [[ "$mondropbear" = "s" || "$mondropbear" = "S" ]] && mondropbear
  1463. msg -bar
  1464. echo -e "\033[1;34m ¿Monitorear Protocolo SSL?"
  1465. msg -bar
  1466. read -p " [ s | n ]: " monssl
  1467. sed -i "61d" /bin/monitor.sh
  1468. sed -i '61i #EstadoServicio stunnel4' /bin/monitor.sh
  1469. [[ "$monssl" = "s" || "$monssl" = "S" ]] && monssl
  1470. msg -bar
  1471. echo -e "\033[1;34m ¿Monitorear Protocolo SQUID?"
  1472. msg -bar
  1473. read -p " [ s | n ]: " monsquid
  1474. sed -i "63d" /bin/monitor.sh
  1475. sed -i '63i #[[ $(EstadoServicio squid) ]] && EstadoServicio squid3' /bin/monitor.sh
  1476. [[ "$monsquid" = "s" || "$monsquid" = "S" ]] && monsquid
  1477. msg -bar
  1478. echo -e "\033[1;34m ¿Monitorear Protocolo APACHE?"
  1479. msg -bar
  1480. read -p " [ s | n ]: " monapache
  1481. sed -i "65d" /bin/monitor.sh
  1482. sed -i '65i #EstadoServicio apache2' /bin/monitor.sh
  1483. [[ "$monapache" = "s" || "$monapache" = "S" ]] && monapache
  1484. msg -bar
  1485. echo -e "\033[1;34m ¿Monitorear Protocolo V2RAY?"
  1486. msg -bar
  1487. read -p " [ s | n ]: " monv2ray
  1488. sed -i "55d" /bin/monitor.sh
  1489. sed -i '55i #EstadoServicio v2ray' /bin/monitor.sh
  1490. [[ "$monv2ray" = "s" || "$monv2ray" = "S" ]] && monv2ray
  1491. #screen -dmS monitor /etc/VPS-MX/tmp/monitor
  1492. #screen -dmS monit /etc/VPS-MX/tmp/monitor
  1493. echo -e "[Unit]
  1494. Description=monitor Service
  1495. After=network.target\n
  1496. [Service]
  1497. Type=simple
  1498. User=root
  1499. WorkingDirectory=/root
  1500. ExecStart=/bin/bash /etc/VPS-MX/tmp/monitor
  1501. Restart=always
  1502. RestartSec=3s\n
  1503. [Install]
  1504. WantedBy=multi-user.target" > /etc/systemd/system/monit.service
  1505. systemctl enable monit &>/dev/null
  1506. systemctl start monit &>/dev/null
  1507. else
  1508. systemctl stop monit &>/dev/null
  1509. systemctl disable monit &>/dev/null
  1510. rm -rf /etc/systemd/system/monit .service
  1511. sed -i "6d" /bin/resetsshdrop
  1512. fi
  1513. msg -bar
  1514. echo -e " Puedes Monitorear desde:\n \033[1;32m http://$(meu_ip):81/monitor.html"
  1515. msg -bar
  1516. [[ -z ${VERY3} ]] && monitor="\033[1;32m ACTIVADO " || monitor="\033[1;31m DESACTIVADO "
  1517. echo -e " $monitor -- CON EXITO"
  1518. msg -bar
  1519. }
  1520. droppids(){
  1521. port_dropbear=`ps aux|grep 'dropbear'|awk NR==1|awk '{print $17;}'`
  1522. log=/var/log/auth.log
  1523. loginsukses='Password auth succeeded'
  1524. pids=`ps ax|grep 'dropbear'|grep " $port_dropbear"|awk -F " " '{print $1}'`
  1525. for pid in $pids; do
  1526. pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
  1527. i=0
  1528. for pidend in $pidlogs; do
  1529. let i=i+1
  1530. done
  1531. if [ $pidend ];then
  1532. login=`grep $pid $log |grep "$pidend" |grep "$loginsukses"`
  1533. PID=$pid
  1534. user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'/ /g"`
  1535. waktu=`echo $login |awk -F" " '{print $2"-"$1,$3}'`
  1536. while [ ${#waktu} -lt 13 ]; do
  1537. waktu=$waktu" "
  1538. done
  1539. while [ ${#user} -lt 16 ]; do
  1540. user=$user" "
  1541. done
  1542. while [ ${#PID} -lt 8 ]; do
  1543. PID=$PID" "
  1544. done
  1545. echo "$user $PID $waktu"
  1546. fi
  1547. done
  1548. }
  1549. openvpn_pids () {
  1550. #nome|#loguin|#rcv|#snd|#time
  1551. byte () {
  1552. while read B dummy; do
  1553. [[ "$B" -lt 1024 ]] && echo "${B} bytes" && break
  1554. KB=$(((B+512)/1024))
  1555. [[ "$KB" -lt 1024 ]] && echo "${KB} Kb" && break
  1556. MB=$(((KB+512)/1024))
  1557. [[ "$MB" -lt 1024 ]] && echo "${MB} Mb" && break
  1558. GB=$(((MB+512)/1024))
  1559. [[ "$GB" -lt 1024 ]] && echo "${GB} Gb" && break
  1560. echo $(((GB+512)/1024)) terabytes
  1561. done
  1562. }
  1563. for user in $(mostrar_usuarios); do
  1564. user="$(echo $user|sed -e 's/[^a-z0-9 -]//ig')"
  1565. [[ ! $(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log) ]] && continue
  1566. i=0
  1567. unset RECIVED; unset SEND; unset HOUR
  1568. while read line; do
  1569. IDLOCAL=$(echo ${line}|cut -d',' -f2)
  1570. RECIVED+="$(echo ${line}|cut -d',' -f3)+"
  1571. SEND+="$(echo ${line}|cut -d',' -f4)+"
  1572. DATESEC=$(date +%s --date="$(echo ${line}|cut -d',' -f5|cut -d' ' -f1,2,3,4)")
  1573. TIMEON="$(($(date +%s)-${DATESEC}))"
  1574. MIN=$(($TIMEON/60)) && SEC=$(($TIMEON-$MIN*60)) && HOR=$(($MIN/60)) && MIN=$(($MIN-$HOR*60))
  1575. HOUR+="${HOR}h:${MIN}m:${SEC}s\n"
  1576. let i++
  1577. done <<< "$(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log)"
  1578. RECIVED=$(echo $(echo ${RECIVED}0|bc)|byte)
  1579. SEND=$(echo $(echo ${SEND}0|bc)|byte)
  1580. HOUR=$(echo -e $HOUR|sort -n|tail -1)
  1581. echo -e "$user|$i|$RECIVED|$SEND|$HOUR"
  1582. done
  1583. }
  1584. monitor-user(){
  1585. users=$(cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|awk -F ':' '{print $1}')
  1586. dpids=$(droppids)
  1587. time=$(date +%s)
  1588. [[ -e /etc/openvpn/openvpn-status.log ]] && ovpn_log=$(cat /etc/openvpn/openvpn-status.log)
  1589. n='0'
  1590. i='0'
  1591. conect='0'
  1592. for _user in $users; do
  1593. [[ -z "$(ps -u $_user|grep sshd)" ]] && sqd=0 || sqd=1
  1594. [[ -z "$(echo $ovpn_log|grep -E ,"$_user",)" ]] && ovp=0 || ovp=1
  1595. [[ -z "$(echo $dpids|grep -w "$_user")" ]] && drop=0 || drop=1
  1596. conex=$(($sqd + $ovp + $drop))
  1597. # conex="$(echo $PID|bc)"
  1598. [[ $conex -ne 0 ]] && let conect++
  1599. if [[ $(chage -l $_user |grep 'Account expires' |awk -F ': ' '{print $2}') != never ]]; then
  1600. [[ $time -gt $(date '+%s' -d "$(chage -l $_user |grep "Account expires" |awk -F ': ' '{print $2}')") ]] && let n++
  1601. fi
  1602. [[ $(passwd --status $_user|cut -d ' ' -f2) = "L" ]] && let i++
  1603. done
  1604. _onlin=$(printf '%-7s' "$conect")
  1605. _userexp=$(printf '%-7s' "$n")
  1606. _lok=$(printf '%-7s' "$i")
  1607. _tuser=$(echo "$users"|sed '/^$/d'|wc -l)
  1608. echo -e " $(msg -verd "ONLINE:") $(msg -azu "$_onlin") $(msg -verm2 "EXPIRADOS:") $(msg -azu "$_userexp") $(msg -bra "\e[95mBLOQUEADO:") $(msg -azu "$_lok")" #$(msg -ama "TOTAL:") $(msg -azu "$_tuser")"
  1609. }
  1610. # SISTEMA DE SELECAO
  1611. selection_fun () {
  1612. local selection="null"
  1613. local range
  1614. for((i=0; i<=$1; i++)); do range[$i]="$i "; done
  1615. while [[ ! $(echo ${range[*]}|grep -w "$selection") ]]; do
  1616. echo -ne "\033[1;37m$(fun_trans " ► Selecione una Opcion"): " >&2
  1617. read selection
  1618. tput cuu1 >&2 && tput dl1 >&2
  1619. done
  1620. echo $selection
  1621. }
  1622. export -f msg
  1623. export -f selection_fun
  1624. export -f fun_trans
  1625. export -f menu_func
  1626. export -f meu_ip
  1627. export -f fun_ip
  1628. export -f lacasita
  1629. clear
  1630. sudo sync
  1631. sudo sysctl -w vm.drop_caches=3 > /dev/null 2>&1
  1632. clear
  1633. clear
  1634. #msg -lol
  1635. msg -bar3
  1636. msg -tit
  1637. #
  1638. menu_info
  1639. msg -bar
  1640. # echo -e "\033[1;31m[\033[1;32m $vesaoSCT\033[1;97m"
  1641. # msg -bar
  1642. title=`echo -e "\033[1;96m$(cat ${SCPdir}/message.txt)"`
  1643. printf "%*s\n" $(( ( $(echo -e "$title" | wc -c ) + 55 ) / 2 )) "$title"
  1644. msg -bar
  1645. SSHN="$(grep -c home /etc/passwd)"
  1646. #SSH2="$(echo ${SSHN}|bc)-2"
  1647. echo "${SSHN}"|bc > /etc/VPS-MX/controlador/SSH20.log
  1648. SSH3="$(less /etc/VPS-MX/controlador/SSH20.log)"
  1649. SSH4="$(echo $SSH3)"
  1650. user_info=$(cd /usr/local/shadowsocksr &> /dev/null && python mujson_mgr.py -l )
  1651. user_total=$(echo "${user_info}"|wc -l)
  1652. [[ ! -e /etc/VPS-MX/RegV2ray ]] && touch /etc/VPS-MX/RegV2ray
  1653. vray=$(cat /etc/VPS-MX/RegV2ray | wc -l)
  1654. on="\033[1;92m[ON]" && off="\033[1;31m[OFF]"
  1655. #[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
  1656. 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"
  1657. limseg="$(less /etc/VPS-MX/controlador/tiemlim.log)"
  1658. veri=$(ps x|grep -v grep |grep "verif")
  1659. [[ ! $veri ]] && verificar="\033[1;31m[OFF]" || verificar="\033[1;32m[ON] "
  1660. des=$(ps x|grep -v grep |grep "autode")
  1661. [[ ! $des ]] && desbloqueo="\033[1;31m[OFF]" || desbloqueo="\033[1;32m[ON] "
  1662. mon=$(ps x|grep -v grep |grep "monitor")
  1663. [[ ! $mon ]] && monitorserv="\033[1;31m[OFF]" || monitorserv="\033[1;32m[ON] "
  1664. if [[ ! -e ${SCPdir}/USRonlines ]]; then
  1665. if [[ $(cat ${SCPdir}/tmp/style|grep -w "monitor-user"|awk '{print $2}') = "1" ]] ; then
  1666. monitor-user
  1667. # msg -bar
  1668. fi
  1669. else
  1670. [[ -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) "
  1671. [[ -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"
  1672. fi
  1673. monhtop () {
  1674. clear
  1675. #msg -bar
  1676. msg -tit
  1677. echo -ne " \033[1;93m MONITOR DE PROCESOS HTOP\n"
  1678. msg -bar
  1679. msg -bra " RECUERDA SALIR CON : \033[1;96m CTRL + C o FIN + F10 "
  1680. [[ $(dpkg --get-selections|grep -w "htop"|head -1) ]] || apt-get install htop -y &>/dev/null
  1681. msg -bar
  1682. read -t 10 -n 1 -rsp $'\033[1;39m Preciona Enter Para continuar\n'
  1683. clear
  1684. sudo htop
  1685. msg -bar
  1686. echo -e "\e[97m \033[1;41m| #-#-► SCRIPT VPS•MX ◄-#-# | \033[1;49m\033[1;49m \033[1;31m[ \033[1;32m $vesaoSCT "
  1687. echo -ne " \033[1;93m MONITOR DE PROCESOS HTOP\n"
  1688. msg -bar
  1689. echo -e "\e[97m FIN DEL MONITOR"
  1690. msg -bar
  1691. }
  1692. [[ $(ps x | grep v2ray | grep -v grep | awk '{print $1}') ]] && vra=$on || vra=$off
  1693. msg -bar
  1694. msg -bar3
  1695. on="\e[1;32m[ON]" && off="\e[1;31m[OFF]"
  1696. echo -e " \e[1;93m[\e[92m1\e[93m] $(msg -verm2 "➛ ") $(msg -azu "ADMINISTRAR CUENTAS | SSH/SSL/DROPBEAR")"
  1697. echo -e " \e[1;93m[\e[92m2\e[93m] $(msg -verm2 "➛ ") $(msg -azu "ADMINISTRAR CUENTAS | SS/SSRR")"
  1698. echo -e " \e[1;93m[\e[92m3\e[93m] $(msg -verm2 "➛ ") $(msg -azu "ADMINISTRAR CUENTAS | V2RAY --> $vra")"
  1699. 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"
  1700. echo -e " \e[1;93m[\e[92m5\e[93m] $(msg -verm2 "➛ ") $(msg -azu "MONITOR DE PROTOCOLOS --------> ${monitorserv}")"
  1701. echo -e " \e[1;93m[\e[92m6\e[93m] $(msg -verm2 "➛ ") $(msg -azu "AUTO INICIAR SCRIPT ----------> $AutoRun ")"
  1702. msg -bar
  1703. 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")"
  1704. msg -bar
  1705. selection=$(selection_fun 13)
  1706. case ${selection} in
  1707. 1)${SCPusr}/usercodes ;;
  1708. 2)${SCPinst}/C-SSR.sh ;;
  1709. 3)${SCPinst}/v2ray.sh ;;
  1710. 4)menu3;;
  1711. 5) monservi_fun ;; #/etc/VPS-MX/tmp/monitor;;
  1712. 6)fun_autorun;;
  1713. 7)atualiza_fun;;
  1714. 8)remove_script;;
  1715. 0)cd $HOME && exit 0;;
  1716. esac
  1717. msg -ne "Enter Para Continuar" && read enter
  1718. ${SCPdir}/menu