ADMbot.sh 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342
  1. #!/bin/bash
  2. #26/01/2021
  3. clear
  4. clear
  5. # DIRECCIONES DE CARPETAS Y ARCHIVOS
  6. SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
  7. SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
  8. SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
  9. SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
  10. SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
  11. mkdir -p /etc/BOT &>/dev/null
  12. mkdir -p /etc/BOT-C &>/dev/null
  13. mkdir -p /etc/BOT-A &>/dev/null
  14. mkdir -p /etc/BOT-GEN &>/dev/null
  15. mkdir -p /etc/BOT-C2 &>/dev/null
  16. mkdir -p /etc/BOT-TEMP &>/dev/null
  17. USRdatacredi="/etc/BOT-C2/creditos"
  18. ##### SERVIDOR TELEGRAM PERSONAL
  19. [[ $(dpkg --get-selections | grep -w "jq" | head -1) ]] || apt-get install jq -y &>/dev/null
  20. [[ ! -e "/bin/ShellBot.sh" ]] && wget -O /bin/ShellBot.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/ShellBot.sh &>/dev/null
  21. [[ -e /etc/texto-bot ]] && rm /etc/texto-bot
  22. ##### VERIFICANDO PAQUETES PRIMARIOS
  23. [[ $(dpkg --get-selections | grep -w "jq" | head -1) ]] || apt-get install jq -y &>/dev/null
  24. [[ $(dpkg --get-selections | grep -w "vnstat" | head -1) ]] || apt-get install vnstat -y &>/dev/null
  25. [[ $(dpkg --get-selections | grep -w "vnstati" | head -1) ]] || apt-get install vnstati -y &>/dev/null
  26. [[ $(dpkg --get-selections | grep -w "nmap" | head -1) ]] || apt-get install nmap -y &>/dev/null
  27. ## INGRESO DE TOKEN BOT
  28. clear
  29. msg -bar
  30. msg -tit
  31. msg -ama " ## BOT DE GESTION | VPS-MX ## \033[1;31m"
  32. msg -bar
  33. if [[ $1 = "id" || -z $(ps aux | grep -v grep | grep -w "ADMbot.sh" | grep dmS | awk '{print $2}') ]]; then
  34. [[ -z $2 ]] && echo -ne " \033[1;96m #Digite el Token del BOT \033[0;92m \nTOKEN: \033[0;97m" && read TOKEN || TOKEN="$2"
  35. [[ -z "$TOKEN" ]] && exit 1 #SEM TOKEN, SEM BOT
  36. IDIOMA="$(cat ${SCPidioma})" && [[ -z $IDIOMA ]] && IDIOMA="es" #ARGUMENTO 2 (IDIOMA)
  37. [[ -z $3 ]] && echo -ne " \033[1;96m #Digite un nombre para su Usuario \033[0;92m \nUSUARIO: \033[0;97m" && read USERLIB || USERLIB="$3"
  38. [[ -z "$USERLIB" ]] && exit 1 #USUARIO
  39. [[ -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"
  40. [[ -z "$PASSLIB" ]] && exit 1 #SENHA
  41. [[ -z $2 ]] && [[ -z $3 ]] && [[ -z $4 ]] && {
  42. screen -dmS telebot ${SCPfrm}/ADMbot.sh id "$TOKEN" "$USERLIB" "$PASSLIB"
  43. msg -bar
  44. echo -e " \033[1;92m BOT INICIADO CON EXCITO"
  45. msg -bar
  46. exit 0
  47. }
  48. else
  49. 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"
  50. msg -bar
  51. exit 0
  52. fi
  53. LINE='━━━━━━━━━━━━━━━━━━━━'
  54. USRdatabase="/etc/VPS-MX/VPS-MXuser"
  55. #IMPORTANDO API
  56. source ShellBot.sh
  57. ShellBot.init --token "$TOKEN"
  58. ShellBot.username
  59. # SUPRIME ERROS
  60. exec 2>/dev/null
  61. # SISTEMA DE PIDS
  62. dropbear_pids() {
  63. unset pids
  64. port_dropbear=$(ps aux | grep dropbear | awk NR==1 | awk '{print $17;}')
  65. log=/var/log/auth.log
  66. loginsukses='Password auth succeeded'
  67. [[ -z $port_dropbear ]] && return 1
  68. for port in $(echo $port_dropbear); do
  69. for pidx in $(ps ax | grep dropbear | grep "$port" | awk -F" " '{print $1}'); do
  70. pids="${pids}$pidx \n"
  71. done
  72. done
  73. for pid in $(echo -e "$pids"); do
  74. pidlogs=$(grep $pid $log | grep "$loginsukses" | awk -F" " '{print $3}')
  75. i=0
  76. for pidend in $pidlogs; do
  77. let i++
  78. done
  79. if [[ $pidend ]]; then
  80. login=$(grep $pid $log | grep "$pidend" | grep "$loginsukses")
  81. PID=$pid
  82. user=$(echo $login | awk -F" " '{print $10}' | sed -r "s/'//g")
  83. waktu=$(echo $login | awk -F" " '{print $2"-"$1,$3}')
  84. [[ -z $user ]] && continue
  85. echo "$user|$PID|$waktu"
  86. fi
  87. done
  88. }
  89. openvpn_pids() {
  90. #nome|#loguin|#rcv|#snd|#time
  91. byte() {
  92. while read B dummy; do
  93. [[ "$B" -lt 1024 ]] && echo "${B} bytes" && break
  94. KB=$(((B + 512) / 1024))
  95. [[ "$KB" -lt 1024 ]] && echo "${KB} Kb" && break
  96. MB=$(((KB + 512) / 1024))
  97. [[ "$MB" -lt 1024 ]] && echo "${MB} Mb" && break
  98. GB=$(((MB + 512) / 1024))
  99. [[ "$GB" -lt 1024 ]] && echo "${GB} Gb" && break
  100. echo $(((GB + 512) / 1024)) terabytes
  101. done
  102. }
  103. for user in $(mostrar_usuarios); do
  104. [[ ! $(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log) ]] && continue
  105. i=0
  106. unset RECIVED
  107. unset SEND
  108. unset HOUR
  109. while read line; do
  110. IDLOCAL=$(echo ${line} | cut -d',' -f2)
  111. RECIVED+="$(echo ${line} | cut -d',' -f3)+"
  112. SEND+="$(echo ${line} | cut -d',' -f4)+"
  113. DATESEC=$(date +%s --date="$(echo ${line} | cut -d',' -f5 | cut -d' ' -f1,2,3,4)")
  114. TIMEON="$(($(date +%s) - ${DATESEC}))"
  115. MIN=$(($TIMEON / 60)) && SEC=$(($TIMEON - $MIN * 60)) && HOR=$(($MIN / 60)) && MIN=$(($MIN - $HOR * 60))
  116. HOUR+="${HOR}h:${MIN}m:${SEC}s \n"
  117. let i++
  118. done <<<"$(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log)"
  119. RECIVED=$(echo $(echo ${RECIVED}0 | bc) | byte)
  120. SEND=$(echo $(echo ${SEND}0 | bc) | byte)
  121. HOUR=$(echo -e $HOUR | sort -n | tail -1)
  122. echo -e "$user|$i|$RECIVED|$SEND|$HOUR"
  123. done
  124. }
  125. # ADICIONA USUARIO
  126. add_user() {
  127. #nome senha Dias limite
  128. [[ $(cat /etc/passwd | grep $1: | grep -vi [a-z]$1 | grep -v [0-9]$1 >/dev/null) ]] && return 1
  129. valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
  130. useradd -M -s /bin/false $1 -e ${valid} >/dev/null 2>&1 || return 1
  131. (
  132. echo $2
  133. echo $2
  134. ) | passwd $1 2>/dev/null || {
  135. userdel --force $1
  136. return 1
  137. }
  138. [[ -e ${USRdatabase} ]] && {
  139. newbase=$(cat ${USRdatabase} | grep -w -v "$1")
  140. echo "$1|$2|${datexp}|$4" >${USRdatabase}
  141. for value in $(echo ${newbase}); do
  142. echo $value >>${USRdatabase}
  143. done
  144. } || echo "$1|$2|${datexp}|$4" >${USRdatabase}
  145. }
  146. # REMOVER USUARIO
  147. rm_user() {
  148. #nome
  149. userdel --force "$1" &>/dev/null || return 1
  150. [[ -e ${USRdatabase} ]] && {
  151. newbase=$(cat ${USRdatabase} | grep -w -v "$1")
  152. rm ${USRdatabase} && touch ${USRdatabase}
  153. for value in $(echo ${newbase}); do
  154. echo $value >>${USRdatabase}
  155. done
  156. }
  157. }
  158. # LISTA OS USUARIOS CADASTRADOS
  159. mostrar_usuarios() {
  160. for u in $(awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" | grep -vi polkitd | grep -vi system-); do
  161. echo "$u"
  162. done
  163. }
  164. # DEFINE UM IP
  165. meu_ip() {
  166. if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
  167. echo "$(cat /etc/VPS-MX/MEUIPvps)"
  168. else
  169. 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)
  170. MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
  171. [[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
  172. echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
  173. fi
  174. }
  175. # USUARIO BLOCK
  176. blockfun() {
  177. local bot_retorno="$LINE \n"
  178. bot_retorno+="--❌ USTED NO PUEDE USAR EL BOT ❌-- \n"
  179. bot_retorno+="$LINE \n"
  180. bot_retorno+="_--Si eres ADMIN introduse tus credenciales--_ \n"
  181. bot_retorno+="$LINE \n"
  182. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  183. --text "$(echo -e $bot_retorno)" \
  184. --parse_mode markdown
  185. return 0
  186. }
  187. # SISTEMA DE LOGUIN
  188. ativarid_fun() {
  189. if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS} | grep -w "$3") ]]; then
  190. local bot_retorno+="$LINE \n"
  191. bot_retorno+="- - 🔰 ACESSO DE ADMIN LIBERADO 🔰 - - \n"
  192. bot_retorno+="$LINE \n"
  193. bot_retorno+="✌️ Usted ya Puede usar el Bot \n"
  194. bot_retorno+="👉 Dele Buen Uso \n"
  195. bot_retorno+="⚙️ Comando Principal: * /menu * \n"
  196. bot_retorno+="$LINE \n"
  197. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  198. --text "$(echo -e $bot_retorno)" \
  199. --parse_mode markdown
  200. return 0
  201. elif [[ $1 = ${USERLIB} ]] && [[ $2 = ${PASSLIB} ]]; then
  202. [[ -z $LIBERADOS ]] && LIBERADOS="${3}" || LIBERADOS="${LIBERADOS} ${3}"
  203. local bot_retorno+="$LINE \n"
  204. bot_retorno+="- - 🔰 ACESSO DE ADMIN LIBERADO 🔰 - - \n"
  205. bot_retorno+="$LINE \n"
  206. bot_retorno+="✌️ Usted ya Puede usar el Bot \n"
  207. bot_retorno+="👉 Dele Buen Uso \n"
  208. bot_retorno+="⚙️ Comando Principal: * /menu * \n"
  209. bot_retorno+="$LINE \n"
  210. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  211. --text "$(echo -e $bot_retorno)" \
  212. --parse_mode markdown
  213. return 0
  214. else
  215. local bot_retorno+="$LINE \n"
  216. bot_retorno+="--❌ ERROR DE CREDENCIALES ADMIN ❌-- \n"
  217. bot_retorno+="$LINE \n"
  218. bot_retorno+="_Acesso de ADMIN Negado_ \n"
  219. bot_retorno+="_Usuario/Contraseña Erroneos_ \n"
  220. bot_retorno+="$LINE \n"
  221. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  222. --text "$(echo -e $bot_retorno)" \
  223. --parse_mode markdown
  224. return 0
  225. fi
  226. }
  227. loguin_fun() {
  228. local bot_retorno+="$LINE \n"
  229. bot_retorno+="USUARIOS CON ACCESO AL ADMIN \n"
  230. bot_retorno+="$LINE \n"
  231. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  232. --text "$(echo -e $bot_retorno)" \
  233. --parse_mode markdown
  234. for lines in $(echo $LIBERADOS); do
  235. local bot_retorno+="$LINE \n"
  236. bot_retorno2+="$Usuario ID: $lines \n"
  237. bot_retorno+="$LINE \n"
  238. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  239. --text "$(echo -e $bot_retorno2)" \
  240. --parse_mode markdown
  241. done
  242. return 0
  243. }
  244. # INFORMAÇÕES DA VPS
  245. infovps() {
  246. mine_port() {
  247. unset portas
  248. portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
  249. i=0
  250. while read port; do
  251. var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
  252. [[ "$(echo -e ${portas} | grep "$var1|$var2")" ]] || {
  253. portas+="$var1|$var2 \n"
  254. let i++
  255. }
  256. done <<<"$portas_var"
  257. echo -e $portas
  258. }
  259. local bot_retorno="$LINE \n"
  260. bot_retorno+="*Puertos y Protocolos Activos* \n"
  261. bot_retorno+="$LINE \n"
  262. bot_retorno+="*IP:* $(meu_ip) \n"
  263. while read line; do
  264. local serv=$(echo $line | cut -d'|' -f1)
  265. local port=$(echo $line | cut -d'|' -f2)
  266. bot_retorno+="*Servicio:* ${serv} *Puerto:* ${port} \n"
  267. done <<<"$(mine_port)"
  268. bot_retorno+="$LINE \n"
  269. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  270. --text "$(echo -e $bot_retorno)" \
  271. --parse_mode markdown
  272. return 0
  273. }
  274. # AJUDA
  275. ajuda_fun() {
  276. #MONITOR UDP
  277. on=" [ ACTIVADO ] " && off=" [ DESACTIVADO ] "
  278. [[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
  279. #CUENTAS REGISTRADAS SSH
  280. SSHN="$(grep -c home /etc/passwd)"
  281. SSH2="$(echo ${SSHN} | bc)-2"
  282. echo "${SSH2}" | bc >/etc/BOT-A/SSH20.log
  283. SSH3="$(less /etc/BOT-A/SSH20.log)"
  284. SSH4="$(echo $SSH3)"
  285. #ONLINES
  286. ONLINES="$(less /etc/VPS-MX/USRonlines)"
  287. ##DEMOS REGISTRADOS
  288. demo=$(cd /etc/BOT-TEMP && ls | wc -l)
  289. cd
  290. ##DEMOS RESTANTES
  291. demo2="10-$(echo ${demo} | bc)+0"
  292. echo "${demo2}" | bc >/etc/BOT-A/SSH-DEMO.log
  293. demo3="$(less /etc/BOT-A/SSH-DEMO.log)"
  294. demor="$(echo $demo3)"
  295. local bot_retorno="*$LINE* \n"
  296. bot_retorno+="*🔰 MANAGER VPS-MX 2.0 🔰* \n"
  297. bot_retorno+="$LINE \n"
  298. bot_retorno+="_▪️ SSH REGISTRADAS:_ ( *$SSH4* ) \n"
  299. bot_retorno+="_▪️ CONECTADOS:_ ( *$ONLINES* ) \n"
  300. bot_retorno+="_▪️ BADVPN:_ 🎮 *$badvpn* \n"
  301. bot_retorno+="$LINE \n"
  302. bot_retorno+=" _COMANDOS DISPONIBLES _ \n"
  303. bot_retorno+="---------------------------------- \n"
  304. bot_retorno+="/agregar -->> Agregar Usuario \n"
  305. [[ $(dpkg --get-selections | grep -w "openvpn" | head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && bot_retorno+="/openadd ($(fun_trans "crear archivo openvpn")) \n"
  306. bot_retorno+="/eliminar -->> Remover Usuario \n"
  307. bot_retorno+="/renovar -->> Renovar Cuenta \n"
  308. bot_retorno+="/usuarios -->> Info de Usuarios \n"
  309. bot_retorno+="/verbloqueados -->> Usuarios Bloqueados \n"
  310. bot_retorno+="/bloquear -->> Bloquear Usuario \n"
  311. bot_retorno+="/desbloquear -->> Desbloquear Usuario \n"
  312. bot_retorno+="/online -->> Usuarios Online \n"
  313. bot_retorno+="/backup -->> Backup-User \n"
  314. bot_retorno+="/restarbackup -->> Restaurar Backup \n"
  315. bot_retorno+="/infovps -->> Info de Servidor \n"
  316. bot_retorno+="$LINE \n"
  317. bot_retorno+=" _ HERRAMIENTAS _ \n"
  318. bot_retorno+="---------------------------------- \n"
  319. bot_retorno+="/lang -->> Traducir texto \n"
  320. bot_retorno+="/scan -->> Scan de Subdominios \n"
  321. bot_retorno+="/gerar -->> Cod y Dec Texto \n"
  322. bot_retorno+="/sshi -->> Info de cuenta SSH \n"
  323. bot_retorno+="/admins -->> ADMIN's con Acceso \n"
  324. bot_retorno+="$LINE \n"
  325. bot_retorno+="/ADMIN -->> Liberar el BOT \n"
  326. bot_retorno+="$LINE \n"
  327. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  328. --text "$(echo -e $bot_retorno)" \
  329. --parse_mode markdown
  330. return 0
  331. }
  332. info_fun() {
  333. if [[ ! -e "${USRdatabase}" ]]; then
  334. local bot_retorno="$LINE \n"
  335. bot_retorno="No se ha identificado una base de datos con los usuarios \n"
  336. bot_retorno="Los Usuarios a Seguir No contiene Ninguna Informacion \n"
  337. bot_retorno+="$LINE \n"
  338. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  339. --text "$(echo -e $bot_retorno)" \
  340. --parse_mode markdown
  341. else
  342. VPSsec=$(date +%s)
  343. local bot_retorno="$LINE \n"
  344. bot_retorno+="* Cuentas SSH Registradas* \n"
  345. bot_retorno+="$LINE \n"
  346. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  347. --text "$(echo -e $bot_retorno)" \
  348. --parse_mode markdown
  349. for user in $(mostrar_usuarios); do
  350. sen=$(cat ${USRdatabase} | grep -w "$user" | cut -d '|' -f2)
  351. [[ -z $sen ]] && sen="???"
  352. DateExp="$(cat ${USRdatabase} | grep -w "${user}" | cut -d'|' -f3)"
  353. if [[ ! -z $DateExp ]]; then
  354. DataSec=$(date +%s --date="$DateExp")
  355. [[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="${red}[Exp]" || EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
  356. else
  357. EXPTIME="???"
  358. fi
  359. limit=$(cat ${USRdatabase} | grep -w "$user" | cut -d '|' -f4)
  360. [[ -z $limit ]] && limit="???"
  361. bot_retorno="$LINE \n"
  362. bot_retorno+="$(fun_trans "Usuario"): $user \n"
  363. bot_retorno+="$(fun_trans "Contraseña"): $sen \n"
  364. bot_retorno+="$(fun_trans "Dias Restantes"): $EXPTIME \n"
  365. bot_retorno+="$(fun_trans "Limite"): $limit \n"
  366. bot_retorno+="$LINE \n"
  367. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  368. --text "$(echo -e $bot_retorno)" \
  369. --parse_mode markdown
  370. done
  371. fi
  372. return 0
  373. }
  374. online_fun() {
  375. MyTIME="${SCPusr}/time-vps-mx"
  376. [[ -e ${MyTIME} ]] && source ${MyTIME} || touch ${MyTIME}
  377. local bot_retorno="$LINE \n"
  378. bot_retorno+="$* Monitor de Usuarios* \n"
  379. bot_retorno+="$LINE \n"
  380. while read user; do
  381. PID="0+"
  382. [[ $(dpkg --get-selections | grep -w "openssh" | head -1) ]] && PID+="$(ps -u $user | grep sshd | wc -l)+"
  383. [[ $(dpkg --get-selections | grep -w "dropbear" | head -1) ]] && PID+="$(dropbear_pids | grep -w "${user}" | wc -l)+"
  384. [[ $(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)+"
  385. PID+="0"
  386. [[ $(echo $PID | bc) = 0 ]] && continue
  387. TIMEON="${TIMEUS[$user]}"
  388. [[ -z $TIMEON ]] && TIMEON=0
  389. MIN=$(($TIMEON / 60))
  390. SEC=$(($TIMEON - $MIN * 60))
  391. HOR=$(($MIN / 60))
  392. MIN=$(($MIN - $HOR * 60))
  393. HOUR="${HOR}h:${MIN}m:${SEC}s"
  394. [[ -z $(cat ${USRdatabase} | grep -w "${user}") ]] && MAXPID="?" || MAXPID="$(cat ${USRdatabase} | grep -w "${user}" | cut -d'|' -f4)"
  395. TOTALPID="$(echo $PID | bc)/$MAXPID"
  396. local IMPRIME="YES"
  397. local bot_retorno+="$LINE \n"
  398. bot_retorno="$(fun_trans "Usuario"): $user \n"
  399. bot_retorno+="$(fun_trans "Conexiones"): $TOTALPID \n"
  400. bot_retorno+="$(fun_trans "Tiempo Total"): $HOUR \n"
  401. bot_retorno+="$LINE \n"
  402. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  403. --text "$(echo -e $bot_retorno)" \
  404. --parse_mode markdown
  405. done <<<"$(mostrar_usuarios)"
  406. [[ -z $IMPRIME ]] && {
  407. local bot_retorno="$LINE \n"
  408. bot_retorno+="$(fun_trans "No hay usuarios en linea") \n"
  409. bot_retorno+="$LINE \n"
  410. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  411. --text "$(echo -e $bot_retorno)" \
  412. --parse_mode markdown
  413. return 0
  414. }
  415. }
  416. useradd_fun() {
  417. error_fun() {
  418. local bot_retorno="$LINE \n"
  419. bot_retorno+=" -->>> MODO DE USO \n"
  420. bot_retorno+="$LINE \n"
  421. bot_retorno+="agregar Usuario Contraseña Dias Limite \n"
  422. bot_retorno+="Ejemplo: \n"
  423. bot_retorno+='agregar admin admin 30 1 \n'
  424. bot_retorno+="$LINE \n"
  425. case $1 in
  426. [1-3] | 14)
  427. [[ $1 = 1 ]] && bot_retorno+="$(fun_trans "Usuario Nulo")" && bot_retorno+="$LINE \n"
  428. [[ $1 = 2 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Corto")" && bot_retorno+="$LINE \n"
  429. [[ $1 = 3 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Grande")" && bot_retorno+="$LINE \n"
  430. [[ $1 = 14 ]] && bot_retorno+="$(fun_trans "Usuario ya Existe")" && bot_retorno+="$LINE \n"
  431. ;;
  432. [4-6])
  433. [[ $1 = 4 ]] && bot_retorno+="$(fun_trans "Contraseña Nula")" && bot_retorno+="$LINE \n"
  434. [[ $1 = 5 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Corta")" && bot_retorno+="$LINE \n"
  435. [[ $1 = 6 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Grande")" && bot_retorno+="$LINE \n"
  436. ;;
  437. [7-9])
  438. [[ $1 = 7 ]] && bot_retorno+="$(fun_trans "Duracion Nula")" && bot_retorno+="$LINE \n"
  439. [[ $1 = 8 ]] && bot_retorno+="$(fun_trans "Duracion invalida utilize numeros")" && bot_retorno+="$LINE \n"
  440. [[ $1 = 9 ]] && bot_retorno+="$(fun_trans "Duracion maxima de un año")" && bot_retorno+="$LINE \n"
  441. ;;
  442. 1[1-3])
  443. [[ $1 = 11 ]] && bot_retorno+="$(fun_trans "Limite Nulo")" && bot_retorno+="$LINE \n"
  444. [[ $1 = 12 ]] && bot_retorno+="$(fun_trans "Limite invalido utilize numeros")" && bot_retorno+="$LINE \n"
  445. [[ $1 = 13 ]] && bot_retorno+="$(fun_trans "Limite maximo de 999")" && bot_retorno+="$LINE \n"
  446. ;;
  447. esac
  448. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  449. --text "$(echo -e $bot_retorno)" \
  450. --parse_mode markdown
  451. }
  452. usuarios_ativos=($(mostrar_usuarios))
  453. [[ -z "$1" ]] && error_fun && return 0
  454. [[ -z "$2" ]] && error_fun && return 0
  455. [[ -z "$3" ]] && error_fun && return 0
  456. [[ -z "$4" ]] && error_fun && return 0
  457. if [[ -z $1 ]]; then
  458. error_fun 1 && return 0
  459. elif [[ "${#1}" -lt "4" ]]; then
  460. error_fun 2 && return 0
  461. elif [[ "${#1}" -gt "24" ]]; then
  462. error_fun 3 && return 0
  463. elif [[ "$(echo ${usuarios_ativos[@]} | grep -w "$1")" ]]; then
  464. error_fun 14 && return 0
  465. fi
  466. if [[ -z $2 ]]; then
  467. error_fun 4 && return 0
  468. elif [[ "${#2}" -lt "6" ]]; then
  469. error_fun 5 && return 0
  470. elif [[ "${#2}" -gt "20" ]]; then
  471. error_fun 6 && return 0
  472. fi
  473. if [[ -z "$3" ]]; then
  474. error_fun 7 && return 0
  475. elif [[ "$3" != +([0-9]) ]]; then
  476. error_fun 8 && return 0
  477. elif [[ "$3" -gt "360" ]]; then
  478. error_fun 9 && return 0
  479. fi
  480. if [[ -z "$4" ]]; then
  481. error_fun 11 && return 0
  482. elif [[ "$4" != +([0-9]) ]]; then
  483. error_fun 12 && return 0
  484. elif [[ "$4" -gt "999" ]]; then
  485. error_fun 13 && return 0
  486. fi
  487. add_user "$1" "$2" "$3" "$4"
  488. if [[ "$?" = "1" ]]; then
  489. local bot_retorno="$LINE \n"
  490. bot_retorno+="$(fun_trans "Usuario No Fue Creado") \n"
  491. bot_retorno+="$LINE \n"
  492. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  493. --text "$(echo -e $bot_retorno)" \
  494. --parse_mode markdown
  495. return 0
  496. else
  497. local bot_retorno="$LINE \n"
  498. bot_retorno+="CUENTA CREADA \n"
  499. bot_retorno+="$LINE \n"
  500. bot_retorno+="Usuario: $1 \n"
  501. bot_retorno+="Contraseña: $2 \n"
  502. bot_retorno+="Duracion: $3 Dias \n"
  503. bot_retorno+="Limite: $4 Logeo \n"
  504. bot_retorno+="$LINE \n"
  505. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  506. --text "$(echo -e $bot_retorno)" \
  507. --parse_mode markdown
  508. return 0
  509. fi
  510. }
  511. userdell_fun() {
  512. error_fun() {
  513. local bot_retorno="$LINE \n"
  514. bot_retorno+=" -->>> MODO DE USO \n"
  515. bot_retorno+="$LINE \n"
  516. bot_retorno+="eliminar Usuario \n"
  517. bot_retorno+="Ejemplo: \n"
  518. bot_retorno+='eliminar admin \n'
  519. bot_retorno+="$LINE \n"
  520. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  521. --text "$(echo -e $bot_retorno)" \
  522. --parse_mode markdown
  523. return 0
  524. }
  525. [[ -z "$1" ]] && error_fun && return 0
  526. rm_user "$1" && {
  527. local bot_retorno="$LINE \n"
  528. bot_retorno+="$Removido Con Exito \n"
  529. bot_retorno+="$LINE \n"
  530. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  531. --text "$(echo -e $bot_retorno)" \
  532. --parse_mode markdown
  533. return 0
  534. } || {
  535. local bot_retorno="$LINE \n"
  536. bot_retorno+="Usuario No Removido \n"
  537. bot_retorno+="$LINE \n"
  538. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  539. --text "$(echo -e $bot_retorno)" \
  540. --parse_mode markdown
  541. return 0
  542. }
  543. }
  544. paygen_fun() {
  545. gerar_pays() {
  546. echo 'GET http://mhost/ HTTP/1.1[crlf][raw][crlf] [crlf][crlf]
  547. 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]
  548. 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]
  549. 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]
  550. 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]
  551. 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]
  552. 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]
  553. 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]
  554. 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]
  555. 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]
  556. 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]
  557. 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]
  558. 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]
  559. 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]
  560. 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]
  561. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
  562. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
  563. GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
  564. GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
  565. GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
  566. GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
  567. CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
  568. CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf] [crlf]
  569. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
  570. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf] [crlf]
  571. 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]
  572. 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]
  573. 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]
  574. [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]
  575. 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]
  576. 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]
  577. [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]
  578. [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
  579. 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]
  580. CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET mhost/ HTTP/1.1[crlf][crlf]
  581. 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]
  582. [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]
  583. [raw][split]GET mhost/ HTTP/1.1[crlf] [crlf]
  584. CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
  585. GET http://mhost/ HTTP/1.1[crlf]GET mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
  586. [raw]split]GET mhost/ HTTP/1.1[crlf][crlf]
  587. GET [host_port] [protocol][instant_split]GET http://mhost/ HTTP/1.1[crlf]
  588. GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
  589. 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]
  590. 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]
  591. 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]
  592. 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]
  593. 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]
  594. 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]
  595. 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]
  596. [netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
  597. 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]
  598. GET http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf] [crlf]
  599. [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]
  600. 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]
  601. 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]
  602. 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]
  603. 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]
  604. 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]
  605. [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]
  606. [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]
  607. [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]
  608. [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]
  609. 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]
  610. 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]
  611. 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]
  612. 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]
  613. 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]
  614. 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]
  615. 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]
  616. 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]
  617. 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]
  618. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Cache-Control=max-age=0[crlf][crlf][raw][crlf] [crlf][crlf]
  619. CONNECT [host_port]@mhost/ [protocol][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf][crlf]
  620. 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]
  621. 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
  622. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
  623. 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]
  624. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf][crlf]
  625. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][raw][crlf][crlf]
  626. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf][crlf]
  627. [raw][crlf]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]CONNECT mhost/ [protocol][crlf]
  628. [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
  629. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf][crlf]
  630. 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]
  631. GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
  632. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf]CONNECT mhost/ HTTP/1.1[crlf][crlf]
  633. 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]
  634. [raw][crlf]GET http://mhost/ [protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf][raw][crlf][crlf]
  635. GET http://mhost/ HTTP/1.1[crlf][crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
  636. GET http://mhost/ HTTP/1.1[crlf]Host:http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
  637. GET http://mhost/ HTTP/1.1 \r \nHost: mhost \r \n \r \n[netData] \r \n \r \n \r \n
  638. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
  639. 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
  640. 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
  641. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf][raw][crlf] [crlf][crlf]
  642. GET http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
  643. GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
  644. GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf][crlf]
  645. GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
  646. GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Forward-Host: mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
  647. GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: http://mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
  648. GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]CONNECT mhost@[host_port] [protocol][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
  649. 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]
  650. 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]
  651. 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]
  652. 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]
  653. GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][raw][crlf][netData][crlf] [crlf][crlf]
  654. GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
  655. 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]
  656. 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]
  657. 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]
  658. 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]
  659. 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]
  660. 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]
  661. 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]
  662. GET http://mhost/ HTTP/1.1[crlf]mhost \r \nHost:mhost \r \n \r \n[netData] \r \n \r \n \r \n
  663. GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
  664. 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]
  665. 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]
  666. GET http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
  667. 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]
  668. 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]
  669. GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf]
  670. GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [crlf][raw][crlf][crlf]
  671. 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]
  672. [realData][crlf][split]GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
  673. GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT [host_port][crlf]GET mhost/ [crlf]
  674. 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]
  675. [raw][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
  676. [raw][crlf]X-Online-Host: mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost[crlf][crlf]
  677. GET http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
  678. 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]
  679. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf] [crlf][crlf]
  680. GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
  681. GET http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf][raw][crlf] [crlf][crlf]
  682. GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf][crlf][raw][crlf]CONNECT [crlf]
  683. GET http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[crlf][crlf][netData][crlf] [crlf][crlf]
  684. CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
  685. CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf][crlf]
  686. [raw][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost/ [crlf][crlf]
  687. [raw][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost/ [crlf][crlf]
  688. CONNECT [host_port]@mhost/ HTTP/1.1[crlf]CONNECT mip:443 [crlf][crlf]
  689. 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]
  690. CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
  691. CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
  692. 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]
  693. 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]
  694. [raw][crlf]Host: mhost[crlf]GET http://mhost/ HTTP/1.1[crlf]X-Online-Host: mhost[crlf][crlf]' >$HOME/$1
  695. }
  696. fail_fun() {
  697. local bot_retorno="$LINE \n"
  698. bot_retorno+=" -->>> MODO DE USO \n"
  699. bot_retorno+="$LINE \n"
  700. bot_retorno+="/gerar $(fun_trans "Host") $(fun_trans "Solicitud") $(fun_trans "Conexion") \n"
  701. bot_retorno+="$(fun_trans "Ejemplo"): \n"
  702. bot_retorno+="/gerar www.host.com (1 a 9) (1 a 3) \n"
  703. bot_retorno+="/gerar www.host.com 2 1 \n"
  704. bot_retorno+="$LINE \n"
  705. 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"
  706. bot_retorno+="$LINE \n"
  707. bot_retorno+="$(fun_trans "Metodos Conexion") \n${LINE} \n1-REALDATA, 2-NETDATA, 3-RAW \n"
  708. bot_retorno+="$LINE \n"
  709. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  710. --text "$(echo -e $bot_retorno)" \
  711. --parse_mode markdown
  712. unset bot_retorno
  713. return 0
  714. }
  715. valor1="$1" #Entrada Host
  716. valor2="127.0.0.1" #Entrada IP
  717. valor3="$2" #Metodo Requisicao
  718. valor4="$3" #Metodo Conexao
  719. [[ "$1" = "" ]] && fail_fun && return 0
  720. [[ "$2" = "" ]] && fail_fun && return 0
  721. [[ "$3" = "" ]] && fail_fun && return 0
  722. case $valor3 in
  723. 1) req="GET" ;;
  724. 2) req="CONNECT" ;;
  725. 3) req="PUT" ;;
  726. 4) req="OPTIONS" ;;
  727. 5) req="DELETE" ;;
  728. 6) req="HEAD" ;;
  729. 7) req="PATCH" ;;
  730. 8) req="POST" ;;
  731. *) req="GET" ;;
  732. esac
  733. case $valor4 in
  734. 1) in="realData" ;;
  735. 2) in="netData" ;;
  736. 3) in="raw" ;;
  737. *) in="netData" ;;
  738. esac
  739. gerar_pays Payloads.txt
  740. sed -i "s;realData;abc;g" $HOME/Payloads.txt
  741. sed -i "s;netData;abc;g" $HOME/Payloads.txt
  742. sed -i "s;raw;abc;g" $HOME/Payloads.txt
  743. sed -i "s;abc;$in;g" $HOME/Payloads.txt
  744. sed -i "s;GET;$req;g" $HOME/Payloads.txt
  745. sed -i "s;get;$req;g" $HOME/Payloads.txt
  746. sed -i "s;mhost;$valor1;g" $HOME/Payloads.txt
  747. sed -i "s;mip;$valor2;g" $HOME/Payloads.txt
  748. if [[ -e $HOME/Payloads.txt ]]; then
  749. local bot_retorno="$LINE \n"
  750. bot_retorno+="$(fun_trans "PAYLOADS GERADAS CON EXITO") \n"
  751. bot_retorno+="$LINE \n"
  752. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  753. --text "$(echo -e $bot_retorno)" \
  754. --parse_mode markdown
  755. local bot_retorno2
  756. ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
  757. --document @$HOME/Payloads.txt
  758. return 0
  759. else
  760. local bot_retorno="$LINE \n"
  761. bot_retorno+="$(fun_trans "PAYLOADS NO GERADAS") \n"
  762. bot_retorno+="$(fun_trans "Algun Error") \n"
  763. bot_retorno+="$LINE \n"
  764. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  765. --text "$(echo -e $bot_retorno)" \
  766. --parse_mode markdown
  767. return 0
  768. fi
  769. }
  770. scan_fun() {
  771. error_fun() {
  772. local bot_retorno="$LINE \n"
  773. bot_retorno+=" -->>> MODO DE USO \n"
  774. bot_retorno+="$LINE \n"
  775. bot_retorno+="Ejemplo: /scan www.host.com \n"
  776. bot_retorno+="$LINE \n"
  777. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  778. --text "$(echo -e $bot_retorno)" \
  779. --parse_mode markdown
  780. return 0
  781. }
  782. [[ -z $1 ]] && error_fun && return 0
  783. local HOST=$1
  784. local RETURN=$(curl -sSL "$HOST" | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^ \"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./*]+' | sort -u | uniq)
  785. if [[ -z $RETURN ]]; then
  786. local bot_retorno="$LINE \n"
  787. bot_retorno+="$(fun_trans "Ningun Host Encontrado en Dominio"): ${1} \n"
  788. bot_retorno+="$LINE \n"
  789. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  790. --text "$(echo -e $bot_retorno)" \
  791. --parse_mode markdown
  792. return 0
  793. else
  794. i=1
  795. local bot_retorno="$LINE \n"
  796. bot_retorno+="$(fun_trans "SUBDOMINIOS ENCONTRADOS") \n$LINE \n"
  797. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  798. --text "$(echo -e $bot_retorno)" \
  799. --parse_mode markdown
  800. unset bot_retorno
  801. while read hostreturn; do
  802. local bot_retorno+="$hostreturn \n"
  803. if [[ $i -gt 20 ]]; then
  804. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  805. --text "*$(echo -e $bot_retorno)*" \
  806. --parse_mode markdown
  807. unset bot_retorno
  808. unset i
  809. fi
  810. let i++
  811. done <<<"$RETURN"
  812. [[ ! -z $bot_retorno ]] && {
  813. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  814. --text "*$(echo -e $bot_retorno)*" \
  815. --parse_mode markdown
  816. }
  817. fi
  818. }
  819. openadd_fun() {
  820. [[ $(dpkg --get-selections | grep -w "openvpn" | head -1) ]] || return 0
  821. [[ -e /etc/openvpn/openvpn-status.log ]] || return 0
  822. newclient "$nomeuser" "$senhauser"
  823. [[ -z $1 ]] && client="adm" || client="$1"
  824. cp /etc/openvpn/client-common.txt $HOME/$client.ovpn
  825. echo "<key>
  826. $(cat /etc/openvpn/client-key.pem)
  827. </key>
  828. <cert>
  829. $(cat /etc/openvpn/client-cert.pem)
  830. </cert>
  831. <ca>
  832. $(cat /etc/openvpn/ca.pem)
  833. </ca>" >>$HOME/$client.ovpn
  834. [[ ! -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
  835. local bot_retorno="$LINE \n"
  836. bot_retorno+="$(fun_trans "Para Generar Archivos Con Autenticación Automatica Utilice"): \n/openadd usuario senha \n$LINE \n"
  837. bot_retorno+="$(fun_trans "ARCHIVO OPENVPN GENERADO CON EXITO") \n"
  838. bot_retorno+="$LINE \n"
  839. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  840. --text "$(echo -e $bot_retorno)" \
  841. --parse_mode markdown
  842. local bot_retorno2
  843. ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
  844. --document @$HOME/$client.ovpn
  845. rm $HOME/$client.ovpn
  846. return 0
  847. }
  848. cript_fun() {
  849. if [[ -z $2 ]]; then
  850. local bot_retorno="$LINE \n"
  851. bot_retorno+="$(fun_trans "Modo de uso"): \n"
  852. bot_retorno+="/criptar texto_for_cript \n"
  853. bot_retorno+="$LINE \n"
  854. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  855. --text "_$(echo -e $bot_retorno)_" \
  856. --parse_mode markdown
  857. return 0
  858. else
  859. local array=($@)
  860. for ((i = 1; i <= ${#array[@]}; i++)); do
  861. unset txtofus
  862. local number=$(expr length "${array[$i]}")
  863. for ((e = 1; e < $number + 1; e++)); do
  864. local txt[$e]=$(echo "${array[$i]}" | cut -b $e)
  865. case ${txt[$e]} in
  866. ".") txt[$e]="#" ;;
  867. "#") txt[$e]="." ;;
  868. "1") txt[$e]="%" ;;
  869. "%") txt[$e]="1" ;;
  870. "2") txt[$e]="?" ;;
  871. "?") txt[$e]="2" ;;
  872. "3") txt[$e]="&" ;;
  873. "&") txt[$e]="3" ;;
  874. "/") txt[$e]="!" ;;
  875. "!") txt[$e]="/" ;;
  876. "a") txt[$e]="k" ;;
  877. "k") txt[$e]="a" ;;
  878. "s") txt[$e]="w" ;;
  879. "w") txt[$e]="s" ;;
  880. "h") txt[$e]="y" ;;
  881. "y") txt[$e]="h" ;;
  882. "o") txt[$e]="P" ;;
  883. "P") txt[$e]="o" ;;
  884. "v") txt[$e]="T" ;;
  885. "T") txt[$e]="v" ;;
  886. "f") txt[$e]="Z" ;;
  887. "Z") txt[$e]="f" ;;
  888. esac
  889. txtofus+="${txt[$e]}"
  890. done
  891. [[ -z $returntxt ]] && returntxt="$(echo $txtofus | rev)" || returntxt="$returntxt $(echo $txtofus | rev)"
  892. done
  893. unset txtofus
  894. local bot_retorno="$LINE \n"
  895. bot_retorno+="$(fun_trans "SU TEXTO ENCRIPTADO O DESCRIPTADO"): \n"
  896. bot_retorno+="$LINE \n"
  897. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  898. --text "*$(echo -e $bot_retorno)*" \
  899. --parse_mode markdown
  900. local bot_retorno="$returntxt \n"
  901. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  902. --text "_$(echo -e $bot_retorno)_" \
  903. --parse_mode markdown
  904. fi
  905. }
  906. language_fun() {
  907. if [[ -z $2 || -z $3 ]]; then
  908. local bot_retorno="$LINE \n"
  909. bot_retorno+=" -->>> MODO DE USO \n"
  910. bot_retorno+="$LINE \n"
  911. bot_retorno+="/lang (pt, fr, es, en...) (text) \n"
  912. bot_retorno+="/lang es Hello \n"
  913. bot_retorno+="$LINE \n"
  914. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  915. --text "_$(echo -e $bot_retorno)_" \
  916. --parse_mode markdown
  917. return 0
  918. else
  919. local array=($@)
  920. local RETORNO
  921. for ((i = 2; i <= ${#array[@]}; i++)); do
  922. local RET=$(source trans -b :$2 "${array[$i]}")
  923. [[ -z $RETORNO ]] && RETORNO=$RET || RETORNO="$RETORNO $RET"
  924. done
  925. local bot_retorno="$LINE \n"
  926. bot_retorno+="* Su Traduccion: * \n"
  927. bot_retorno+="$LINE \n"
  928. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  929. --text "*$(echo -e $bot_retorno)*" \
  930. --parse_mode markdown
  931. bot_retorno="$(echo $RETORNO | sed -e 's/[^a-z0-9 -]//ig') \n"
  932. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  933. --text "_$(echo -e $bot_retorno)_" \
  934. --parse_mode markdown
  935. return 0
  936. fi
  937. }
  938. teste_fun() {
  939. local bot_retorno="$LINE \n"
  940. bot_retorno+="$(fun_trans "USUARIO"): ${chatuser} \n"
  941. bot_retorno+="$(fun_trans "ARGUMENTOS"): ${comando[@]} \n"
  942. bot_retorno+="$LINE \n"
  943. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  944. --text "_$(echo -e $bot_retorno)_" \
  945. --parse_mode markdown
  946. #local bot_retorno="$LINE \n"
  947. # bot_retorno+="$(fun_trans "ESSE USUARIO"): ${chatuser} \n"
  948. # bot_retorno+="$(fun_trans "ESSES ARGUMENTOS"): ${comando[@]} \n"
  949. # bot_retorno+="$LINE \n"
  950. # ShellBot.editMessageText --chat_id ${message_chat_id[$id]} --message_id ${reply_to_message_message_id[$id]} --text "$(echo -e $bot_retorno)" --parse_mode markdown
  951. #return 0
  952. }
  953. ## RENOVAR USUSARIO
  954. renew_user_fun() {
  955. #nome dias
  956. fail_fun() {
  957. local bot_retorno="*$LINE* \n"
  958. bot_retorno+=" -->>> MODO DE USO \n"
  959. bot_retorno+="*$LINE* \n"
  960. bot_retorno+="/renovar usuario dias \n"
  961. bot_retorno+="_Ejemplo:_ \n"
  962. bot_retorno+="/renovar CARLOS 30 \n"
  963. bot_retorno+="*$LINE* \n"
  964. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  965. --text "$(echo -e $bot_retorno)" \
  966. --parse_mode markdown
  967. unset bot_retorno
  968. return 0
  969. }
  970. [[ "$1" = "" ]] && fail_fun && return 0
  971. [[ "$2" = "" ]] && fail_fun && return 0
  972. error_fun() {
  973. local bot_retorno="*$LINE* \n"
  974. bot_retorno+="*❗️ USUARIO NO REGISTRADO ❗️* \n"
  975. bot_retorno+="*$LINE* \n"
  976. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  977. --text "$(echo -e $bot_retorno)" \
  978. --parse_mode markdown
  979. return 0
  980. }
  981. [[ -z $1 ]] && error_fun && return 0
  982. cup1="$1"
  983. userva="$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$cup1" | cut -d'|' -f1)"
  984. [[ -z $userva ]] && error_fun && return 0
  985. datexp=$(date "+%F" -d " + $2 days") && valid=$(date '+%C%y-%m-%d' -d " + $2 days")
  986. chage -E $valid $1 2>/dev/null || return 1
  987. [[ -e ${USRdatabase} ]] && {
  988. newbase=$(cat ${USRdatabase} | grep -w -v "$1")
  989. useredit=$(cat ${USRdatabase} | grep -w "$1")
  990. pass=$(echo $useredit | cut -d'|' -f2)
  991. limit=$(echo $useredit | cut -d'|' -f4)
  992. echo "$1|$pass|${datexp}|$limit" >${USRdatabase}
  993. for value in $(echo ${newbase}); do
  994. echo $value >>${USRdatabase}
  995. done
  996. }
  997. NOM=$(less /etc/VPS-MX/controlador/nombre.log) >/dev/null 2>&1
  998. NOM1=$(echo $NOM) >/dev/null 2>&1
  999. IP="$(cat /etc/VPS-MX/MEUIPvps)"
  1000. local bot_retorno="*$LINE* \n"
  1001. bot_retorno+="*CUENTA RENOVADA* \n"
  1002. bot_retorno+="*$LINE* \n"
  1003. bot_retorno+="▪️ _Usuario:_ *$1* \n"
  1004. bot_retorno+="▪️ _Dias Agregados:_ *$2* \n"
  1005. bot_retorno+="🕰 _Ahora expira:_ \n👉 *$datexp* \n"
  1006. bot_retorno+="*$LINE* \n"
  1007. bot_retorno+="▪️ _VPS: _ *$NOM1* \n"
  1008. bot_retorno+="▪️ _IP:_ *$IP* \n"
  1009. bot_retorno+="*$LINE* \n"
  1010. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1011. --text "$(echo -e $bot_retorno)" \
  1012. --parse_mode markdown
  1013. }
  1014. #INFO SSH
  1015. info_sshp() {
  1016. error_fun() {
  1017. local bot_retorno="*$LINE* \n"
  1018. bot_retorno+="*MODO DE USO:* \n"
  1019. bot_retorno+="*$LINE* \n"
  1020. bot_retorno+="Pon el Comando /SSHI (INGRESA NOMBRE DE USUARIO) \n"
  1021. bot_retorno+="*$LINE* \n"
  1022. bot_retorno+="_Ejemplo: /SSHI NetVPS-xzcmo _ \n"
  1023. bot_retorno+="*$LINE* \n"
  1024. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1025. --text "$(echo -e $bot_retorno)" \
  1026. --parse_mode markdown
  1027. return 0
  1028. }
  1029. [[ -z $1 ]] && error_fun && return 0
  1030. VPSsec=$(date +%s)
  1031. sen=$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$1" | cut -d '|' -f2)
  1032. [[ -z $sen ]] && sen="???"
  1033. DateExp="$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$1" | cut -d'|' -f3)"
  1034. if [[ ! -z $DateExp ]]; then
  1035. DataSec=$(date +%s --date="$DateExp")
  1036. [[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="${red}[EXPIRADA]" || EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
  1037. else
  1038. EXPTIME="???"
  1039. fi
  1040. limit=$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$1" | cut -d '|' -f4)
  1041. [[ -z $limit ]] && limit="???"
  1042. local bot_retorno="*$LINE* \n"
  1043. bot_retorno+="*📝 INFO GENERAL SSH 📝* \n"
  1044. bot_retorno+="*$LINE* \n"
  1045. bot_retorno+="▪️ Usuario: *$1 * \n"
  1046. #bot_retorno+="$(fun_trans "Contraseña"): $sen \n"
  1047. bot_retorno+="▪️ Dias Restantes: *$EXPTIME * \n"
  1048. bot_retorno+="▪️ Limite de Usuarios: *$limit * \n"
  1049. bot_retorno+="*$LINE* \n"
  1050. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1051. --text "$(echo -e $bot_retorno)" \
  1052. --parse_mode markdown
  1053. return 0
  1054. }
  1055. ## PID DROPBEAR
  1056. droppids() {
  1057. local pids
  1058. local port_dropbear=$(ps aux | grep dropbear | awk NR==1 | awk '{print $17;}')
  1059. cat /var/log/auth.log | grep "$(date | cut -d' ' -f2,3)" >/var/log/authday.log
  1060. #cat /var/log/auth.log|tail -1000 > /var/log/authday.log
  1061. local log=/var/log/authday.log
  1062. local loginsukses='Password auth succeeded'
  1063. [[ -z $port_dropbear ]] && return 1
  1064. for port in $(echo $port_dropbear); do
  1065. for pidx in $(ps ax | grep dropbear | grep "$port" | awk -F" " '{print $1}'); do
  1066. pids="${pids}$pidx \n"
  1067. done
  1068. done
  1069. for pid in $(echo -e "$pids"); do
  1070. pidlogs=$(grep $pid $log | grep "$loginsukses" | awk -F" " '{print $3}')
  1071. i=0
  1072. for pidend in $pidlogs; do
  1073. let i++
  1074. done
  1075. if [[ $pidend ]]; then
  1076. login=$(grep $pid $log | grep "$pidend" | grep "$loginsukses")
  1077. PID=$pid
  1078. user=$(echo $login | awk -F" " '{print $10}' | sed -r "s/'//g")
  1079. waktu=$(echo $login | awk -F" " '{print $2"-"$1,$3}')
  1080. [[ -z $user ]] && continue
  1081. echo "$user|$PID|$waktu"
  1082. fi
  1083. done
  1084. }
  1085. ## B/U USER
  1086. blo_unb_fun() {
  1087. error_fun() {
  1088. local bot_retorno="*$LINE* \n"
  1089. bot_retorno+="*MODO DE USO:* \n"
  1090. bot_retorno+="*$LINE* \n"
  1091. bot_retorno+="Pon el Comando /bloquear (INGRESA NOMBRE DE USUARIO) \n"
  1092. bot_retorno+=" \t---- O ----- \n"
  1093. bot_retorno+="Pon el Comando /desbloquear (INGRESA NOMBRE DE USUARIO) \n"
  1094. bot_retorno+="*$LINE* \n"
  1095. bot_retorno+="_Ejemplo: bloquear Ale2020 _ \n"
  1096. bot_retorno+="_Ejemplo: desbloquear Ale2020 _ \n"
  1097. bot_retorno+="*$LINE* \n"
  1098. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1099. --text "$(echo -e $bot_retorno)" \
  1100. --parse_mode markdown
  1101. return 0
  1102. }
  1103. [[ -z $1 ]] && error_fun && return 0
  1104. local USRloked="/etc/VPS-MX/VPS-MX-userlock"
  1105. local LIMITERLOG="${USRdatabase}/Limiter.log"
  1106. local LIMITERLOG2="${USRdatabase}/Limiter2.log"
  1107. if [[ $2 = "-loked" ]]; then
  1108. [[ $(cat ${USRloked} | grep -w "$1") ]] && return 1
  1109. echo " $1 (BLOCK-MULTILOGIN) $(date +%r--%d/%m/%y)"
  1110. limseg="$(less /etc/VPS-MX/controlador/tiemdes.log)"
  1111. KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
  1112. URL="https://api.telegram.org/bot$KEY/sendMessage"
  1113. MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
  1114. 🔹 CUENTA: $1
  1115. ❗️📵 BLOCK FIJO/TEMPORAL 📵❗️
  1116. 🔓( AUTOUNLOCK EN $limseg SEGUNDOS) 🔓"
  1117. curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
  1118. pkill -u $1 &>/dev/null
  1119. fi
  1120. if [[ $(cat ${USRloked} | grep -w "$1") ]]; then
  1121. usermod -U "$1" &>/dev/null
  1122. local bot_retorno="*$LINE* \n"
  1123. bot_retorno+="*⭕️ UNLOCK USUARIO ⭕️* \n"
  1124. bot_retorno+="*$LINE* \n"
  1125. bot_retorno+="▪️ _Usuario:_ *$1 * _Desbloqueado_ \n"
  1126. bot_retorno+="*$LINE* \n"
  1127. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1128. --text "$(echo -e $bot_retorno)" \
  1129. --parse_mode markdown
  1130. [[ -e ${USRloked} ]] && {
  1131. newbase=$(cat ${USRloked} | grep -w -v "$1")
  1132. [[ -e ${USRloked} ]] && rm ${USRloked}
  1133. for value in $(echo ${newbase}); do
  1134. echo $value >>${USRloked}
  1135. done
  1136. }
  1137. [[ -e ${LIMITERLOG} ]] && [[ $(cat ${LIMITERLOG} | grep -w "$1") ]] && {
  1138. newbase=$(cat ${LIMITERLOG} | grep -w -v "$1")
  1139. [[ -e ${LIMITERLOG} ]] && rm ${LIMITERLOG}
  1140. for value in $(echo ${newbase}); do
  1141. echo $value >>${LIMITERLOG}
  1142. echo $value >>${LIMITERLOG}
  1143. done
  1144. }
  1145. return 1
  1146. else
  1147. usermod -L "$1" &>/dev/null
  1148. pkill -u $1 &>/dev/null
  1149. droplim=$(droppids | grep -w "$1" | cut -d'|' -f2)
  1150. kill -9 $droplim &>/dev/null
  1151. echo $1 >>${USRloked}
  1152. local bot_retorno="*$LINE* \n"
  1153. bot_retorno+="*❌ BLOCK USUARIO ❌* \n"
  1154. bot_retorno+="*$LINE* \n"
  1155. bot_retorno+="▪️ _Usuario:_ *$1 * _Bloqueado_ \n"
  1156. bot_retorno+="*$LINE* \n"
  1157. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1158. --text "$(echo -e $bot_retorno)" \
  1159. --parse_mode markdown
  1160. #notifi &>/dev/null
  1161. return 0
  1162. fi
  1163. }
  1164. ###LECTURA DE USER BLOC
  1165. userblock_lee() {
  1166. local HOST="/etc/VPS-MX/VPS-MX-userlock"
  1167. local RETURN=$(cat $HOST)
  1168. if [[ -z $RETURN ]]; then
  1169. local bot_retorno="$LINE \n"
  1170. bot_retorno+="NINGUN USUARIO BLOQUEADO \n"
  1171. bot_retorno+="$LINE \n"
  1172. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1173. --text "$(echo -e $bot_retorno)" \
  1174. --parse_mode markdown
  1175. return 0
  1176. else
  1177. i=1
  1178. local bot_retorno="*$LINE* \n"
  1179. bot_retorno+="* ❌ USUARIOS BLOQUEADOS ❌* \n$LINE \n"
  1180. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1181. --text "$(echo -e $bot_retorno)" \
  1182. --parse_mode markdown
  1183. unset bot_retorno
  1184. while read hostreturn; do
  1185. local bot_retorno+="$hostreturn \n"
  1186. if [[ $i -gt 25 ]]; then
  1187. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1188. --text "*$(echo -e $bot_retorno)*" \
  1189. --parse_mode markdown
  1190. unset bot_retorno
  1191. unset i
  1192. fi
  1193. let i++
  1194. done <<<"$RETURN"
  1195. [[ ! -z $bot_retorno ]] && {
  1196. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1197. --text "*$(echo -e $bot_retorno)*" \
  1198. --parse_mode markdown
  1199. }
  1200. fi
  1201. local bot_retorno="*$LINE* \n"
  1202. bot_retorno+="ESTOS SON USUARIOS CON BAN \n"
  1203. bot_retorno+="*$LINE* \n"
  1204. ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
  1205. --text "*$(echo -e $bot_retorno)*" \
  1206. --parse_mode markdown
  1207. return 0
  1208. }
  1209. backups() {
  1210. [[ ! -z ${callback_query_message_chat_id[$id]} ]] && var=${callback_query_message_chat_id[$id]} || var=${message_chat_id[$id]}
  1211. local bot_retorno="$LINE \n"
  1212. bot_retorno+="ᨉBACKUP DE USUARIOSᨉ \n"
  1213. bot_retorno+="$LINE \n"
  1214. ShellBot.sendMessage --chat_id $var \
  1215. --text "*$(echo -e $bot_retorno)*" \
  1216. --parse_mode markdown
  1217. cp ${USRdatabase} $HOME/VPS-MX-Backup-User
  1218. ShellBot.sendDocument --chat_id $var \
  1219. --document @$HOME/VPS-MX-Backup-User
  1220. #rm $HOME/VPS-MX-Backup
  1221. return 0
  1222. }
  1223. restabackup() {
  1224. dirbackup="/root/VPS-MX-Backup-User"
  1225. local msj
  1226. VPSsec=$(date +%s)
  1227. while read line; do
  1228. nome=$(echo ${line} | cut -d'|' -f1)
  1229. [[ $(echo $(mostrar_usuarios) | grep -w "$nome") ]] && {
  1230. msj="$nome [ERROR] \n"
  1231. [[ ! -z ${callback_query_message_chat_id[$id]} ]] && var=${callback_query_message_chat_id[$id]} || var=${message_chat_id[$id]}
  1232. ShellBot.sendMessage --chat_id $var \
  1233. --text "*$(echo -e $msj)*" \
  1234. --parse_mode markdown
  1235. continue
  1236. }
  1237. senha=$(echo ${line} | cut -d'|' -f2)
  1238. DateExp=$(echo ${line} | cut -d'|' -f3)
  1239. DataSec=$(date +%s --date="$DateExp")
  1240. [[ "$VPSsec" -lt "$DataSec" ]] && dias="$(($(($DataSec - $VPSsec)) / 86400))" || dias="NP"
  1241. limite=$(echo ${line} | cut -d'|' -f4)
  1242. add_user "$nome" "$senha" "$dias" "$limite" &>/dev/null && msj="$nome [CUENTA VALIDA] \n" || msj="$nome [CUENTA INVALIDA FECHA EXPIRADA] \n"
  1243. [[ ! -z ${callback_query_message_chat_id[$id]} ]] && var=${callback_query_message_chat_id[$id]} || var=${message_chat_id[$id]}
  1244. ShellBot.sendMessage --chat_id $var \
  1245. --text "*$(echo -e $msj)*" \
  1246. --parse_mode markdown
  1247. done <${dirbackup}
  1248. return 0
  1249. }
  1250. # LOOP ESCUTANDO O TELEGRAN
  1251. while true; do
  1252. ShellBot.getUpdates --limit 100 --offset $(ShellBot.OffsetNext) --timeout 30
  1253. for id in $(ShellBot.ListUpdates); do
  1254. chatuser="$(echo ${message_chat_id[$id]} | cut -d'-' -f2)"
  1255. echo $chatuser >&2
  1256. comando=(${message_text[$id]})
  1257. case ${comando[0]} in
  1258. /[Tt]este | [Tt]este) teste_fun & ;;
  1259. /[Aa]juda | [Aa]juda | [Hh]elp | /[Hh]elp) ajuda_fun & ;;
  1260. /[Ss]tart | [Ss]tart | [Cc]omecar | /[Cc]omecar) ajuda_fun & ;;
  1261. /[Ss]SHI | [Ss]SHI) info_sshp "${comando[1]}" & ;;
  1262. /[Aa]DMIN | [Aa]DMIN) ativarid_fun "${comando[1]}" "${comando[2]}" "$chatuser" ;;
  1263. *) if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS} | grep -w "${chatuser}") ]]; then
  1264. case ${comando[0]} in
  1265. ##PANEL SSH
  1266. [Oo]nline | /[Oo]nline | [Oo]nlines | /[Oo]nlines) online_fun & ;;
  1267. [Cc]riptar | /[Cc]riptar | [Cc]ript | /[Cc]ript) cript_fun "${comando[@]}" & ;;
  1268. [Aa]gregar | /[Aa]gregar) useradd_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" "${comando[4]}" & ;;
  1269. [Ee]liminar | /[Ee]liminar) userdell_fun "${comando[1]}" & ;;
  1270. [Rr]enovar | /[Rr]enovar) renew_user_fun "${comando[1]}" "${comando[2]}" & ;;
  1271. [Bb]loquear | /[Bb]loquear) blo_unb_fun "${comando[1]}" & ;;
  1272. [Dd]esbloquear | /[Dd]esbloquear) blo_unb_fun "${comando[1]}" & ;;
  1273. [Vv]erbloqueados | /[Vv]erbloqueados) userblock_lee & ;;
  1274. ##HERRAMIENTAS
  1275. [Aa]dmins | /[Aa]dmins) loguin_fun & ;;
  1276. [Ii]nfovps | /[Ii]nfovps) infovps & ;;
  1277. [Bb]ackup | /[Bb]ackup) backups & ;;
  1278. [Rr]estarbackup | /[Rr]estarbackup) restabackup & ;;
  1279. [Ll]ang | /[Ll]ang) language_fun "${comando[@]}" & ;;
  1280. [Oo]penadd | /[Oo]penadd | [Oo]pen | /[Oo]pen) openadd_fun "${comando[1]}" "${comando[2]}" & ;;
  1281. [Gg]erar | /[Gg]erar | [Pp]ay | /[Pp]ay) paygen_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" & ;;
  1282. [Uu]suarios | /[Uu]suarios | [Uu]ser | /[Uu]ser) info_fun & ;;
  1283. [Ss]can | /[Ss]can) scan_fun "${comando[1]}" & ;;
  1284. *) ajuda_fun ;;
  1285. esac
  1286. else
  1287. [[ ! -z "${comando[0]}" ]] && blockfun &
  1288. fi ;;
  1289. esac
  1290. done
  1291. done