ADMbot.sh 69 KB

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