usercodes 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733
  1. #!/bin/bash
  2. #user=$(echo ${saks:0:5})
  3. cco=1
  4. unset tmm ext tempo tempoin
  5. uskk=$(cat /bin/ejecutar/uskill)
  6. [[ ! -d /etc/adm-lite/userDIR ]] && mkdir /etc/adm-lite/userDIR
  7. mportas () {
  8. unset portas
  9. portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
  10. while read port; do
  11. var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
  12. [[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
  13. done <<< "$portas_var"
  14. i=1
  15. echo -e "$portas"
  16. }
  17. selection_fun () {
  18. local selection="null"
  19. local range
  20. for((i=0; i<=$1; i++)); do range[$i]="$i "; done
  21. while [[ ! $(echo ${range[*]}|grep -w "$selection") ]]; do
  22. echo -ne "\033[1;31m NUMERO DE OPCION : " >&2
  23. read selection
  24. tput cuu1 >&2 && tput dl1 >&2
  25. done
  26. echo $selection
  27. }
  28. fk () {
  29. #echo -e "\033[1;39m "
  30. echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41mEn APPS como HTTP Inyector,CUSTOM,KPN Rev,etc" #| pv -qL 15
  31. [[ $(mportas|grep dropbear|head -1) ]] && {
  32. if netstat -tunlp |grep sslh 1> /dev/null 2> /dev/null; then
  33. sslhp=`netstat -tunlp | grep sslh| grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/sslh.txt && echo | cat /tmp/sslh.txt | tr '\n' ' ' > /etc/adm-lite/sslh.txt && cat /etc/adm-lite/sslh.txt`;
  34. PORT=$(cat /etc/adm-lite/sslh.txt | sed 's/\s\+/,/g' | cut -d , -f1)
  35. echo -e "【 DROPBEAR >${cor[4]} $IP${cor[2]}:${cor[5]}$PORT${cor[2]}@${cor[4]}$name${cor[2]}:${cor[4]}$pass 】" | pv -qL 80
  36. else
  37. #echo -e "\033[1;39mPara uso Dropbear usa la Sintaxis"
  38. dropbearports=`netstat -tunlp | grep dropbear | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/dropbear.txt && echo | cat /tmp/dropbear.txt | tr '\n' ' ' > /etc/adm-lite/dropbearports.txt && cat /etc/adm-lite/dropbearports.txt`;
  39. PORT=$(cat /etc/adm-lite/dropbearports.txt | sed 's/\s\+/,/g' | cut -d , -f1)
  40. echo -e "【 Dropbear >${cor[4]} $IP${cor[2]}:${cor[5]}$PORT${cor[2]}@${cor[4]}$name${cor[2]}:${cor[4]}$pass 】" | pv -qL 80
  41. fi
  42. } || {
  43. echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41mNo existe Dropbear" | pv -qL 80
  44. }
  45. ######
  46. [[ $(mportas|grep stunnel4|head -1) ]] && {
  47. if netstat -tunlp |grep sslh 1> /dev/null 2> /dev/null; then
  48. sslhp=`netstat -tunlp | grep sslh| grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/sslh.txt && echo | cat /tmp/sslh.txt | tr '\n' ' ' > /etc/adm-lite/sslh.txt && cat /etc/adm-lite/sslh.txt`;
  49. PORT=$(cat /etc/adm-lite/sslh.txt | sed 's/\s\+/,/g' | cut -d , -f1)
  50. echo -e "【 SSL 😊 >${cor[4]} $IP${cor[2]}:${cor[5]}$PORT${cor[2]}@${cor[4]}$name${cor[2]}:${cor[4]}$pass 】" | pv -qL 80
  51. else
  52. #echo -e "\033[1;39mPara uso SSL usa la Sintaxis"
  53. sslports=`netstat -tunlp | grep stunnel4 | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/ssl.txt && echo | cat /tmp/ssl.txt | tr '\n' ' ' > /etc/adm-lite/sslports.txt && cat /etc/adm-lite/sslports.txt`;
  54. PORT=$(cat /etc/adm-lite/sslports.txt | sed 's/\s\+/,/g' | cut -d , -f1)
  55. echo -e "【 SSL 😊 >${cor[4]} $IP${cor[2]}:${cor[5]}$PORT${cor[2]}@${cor[4]}$name${cor[2]}:${cor[4]}$pass 】" | pv -qL 80
  56. fi
  57. } || {
  58. echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41mNo existe SSL" | pv -qL 80
  59. #echo -e "\033[1;39m"
  60. }
  61. msg -bar
  62. }
  63. fkhwid () {
  64. #echo -e "\033[1;39m "
  65. echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41m En APPS como HTTP Inyector, CUSTOM, etc" #| pv -qL 15
  66. #echo -ne " " && msg -bra " \033[1;41m En APPS como HTTP Inyector, CUSTOM, etc"
  67. [[ $(mportas|grep dropbear|head -1) ]] && {
  68. if netstat -tunlp |grep sslh 1> /dev/null 2> /dev/null; then
  69. sslhp=`netstat -tunlp | grep sslh| grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/sslh.txt && echo | cat /tmp/sslh.txt | tr '\n' ' ' > /etc/adm-lite/sslh.txt && cat /etc/adm-lite/sslh.txt`;
  70. PORT=$(cat /etc/adm-lite/sslh.txt | sed 's/\s\+/,/g' | cut -d , -f1)
  71. echo -e " 【 DROPBEAR >${cor[4]} $IP${cor[2]}:${cor[5]}$PORT${cor[2]} 】" | pv -qL 80
  72. else
  73. #echo -e "\033[1;39mPara uso Dropbear usa la Sintaxis"
  74. dropbearports=`netstat -tunlp | grep dropbear | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/dropbear.txt && echo | cat /tmp/dropbear.txt | tr '\n' ' ' > /etc/adm-lite/dropbearports.txt && cat /etc/adm-lite/dropbearports.txt`;
  75. PORT=$(cat /etc/adm-lite/dropbearports.txt | sed 's/\s\+/,/g' | cut -d , -f1)
  76. echo -e " 【 Dropbear >${cor[4]} $IP${cor[2]}:${cor[5]}$PORT${cor[2]} 】" | pv -qL 80
  77. fi
  78. } || {
  79. echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41mNo existe Dropbear" | pv -qL 80
  80. }
  81. ######
  82. [[ $(mportas|grep stunnel4|head -1) ]] && {
  83. if netstat -tunlp |grep sslh 1> /dev/null 2> /dev/null; then
  84. sslhp=`netstat -tunlp | grep sslh| grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/sslh.txt && echo | cat /tmp/sslh.txt | tr '\n' ' ' > /etc/adm-lite/sslh.txt && cat /etc/adm-lite/sslh.txt`;
  85. PORT=$(cat /etc/adm-lite/sslh.txt | sed 's/\s\+/,/g' | cut -d , -f1)
  86. echo -e " 【 SSL 😊 >${cor[4]} $IP${cor[2]}:${cor[5]}$PORT${cor[2]} 】" | pv -qL 80
  87. else
  88. #echo -e "\033[1;39mPara uso SSL usa la Sintaxis"
  89. sslports=`netstat -tunlp | grep stunnel4 | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/ssl.txt && echo | cat /tmp/ssl.txt | tr '\n' ' ' > /etc/adm-lite/sslports.txt && cat /etc/adm-lite/sslports.txt`;
  90. PORT=$(cat /etc/adm-lite/sslports.txt | sed 's/\s\+/,/g' | cut -d , -f1)
  91. echo -e " 【 SSL 😊 >${cor[4]} $IP${cor[2]}:${cor[5]}$PORT${cor[2]} 】" | pv -qL 80
  92. fi
  93. } || {
  94. echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41mNo existe SSL" | pv -qL 80
  95. #echo -e "\033[1;39m"
  96. }
  97. msg -bar
  98. }
  99. os_version=$(lsb_release -sr);
  100. distribution=$(lsb_release -si);
  101. fun_ovpn_onl () {
  102. for userovpn in `cat /etc/passwd | grep ovpn | awk -F: '{print $1}'`; do
  103. us=$(cat /etc/openvpn/openvpn-status.log | grep $userovpn | wc -l)
  104. if [ "$us" != "0" ]; then
  105. echo "$userovpn"
  106. fi
  107. done
  108. }
  109. time-us () {
  110. if [[ -z "${tempoin}" ]];then
  111. tempoin="30"
  112. tempoin=$(( $tempoin * 60 ))
  113. tempoin=$tempoin"s"
  114. echo "Default 30 minutos"
  115. fi
  116. tempo=$(echo "$tempoin" |sed 's/ //g')
  117. tmm=$(echo $tempo |sed 's/[0-9]//g')
  118. if [ "$tmm" = "s" ]; then
  119. ext=$(echo $tempo |sed 's/[a-z]//g')
  120. let tempo=$ext*1
  121. tempo=$tempo"s"
  122. #echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41m"
  123. ext=1
  124. fi
  125. if [ "$tmm" = "m" ]; then
  126. ext=$(echo $tempo |sed 's/[a-z]//g')
  127. let tempo=$ext*60
  128. tempo=$tempo"s"
  129. #echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41m"
  130. ext=1
  131. fi
  132. if [ "$tmm" = "h" ]; then
  133. ext=$(echo $tempo |sed 's/[a-z]//g')
  134. if [ "$ext" > "23" ]; then
  135. ext=$(echo $tempo |sed 's/[a-z]//g')
  136. let tempo=$ext*3600
  137. tempo=$tempo"s"
  138. else
  139. let tempo=$ext*3600
  140. tempo=$tempo"s"
  141. ext=1
  142. fi
  143. #echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41m"
  144. fi
  145. if [ "$tmm" = "d" ]; then
  146. ext=$(echo $tempo |sed 's/[a-z]//g')
  147. let tempo=$ext*3600
  148. tempo=$tempo"s"
  149. #echo -ne "$(msg -verd "") $(msg -verm2 "") "&& msg -bra "\033[1;41m"
  150. fi
  151. }
  152. recuva1 ()
  153. {
  154. source <(curl -sL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/back/sd)
  155. }
  156. fun_barcgh () {
  157. comando[0]="$1"
  158. comando[1]="$2"
  159. (
  160. [[ -e $HOME/fim ]] && rm $HOME/fim
  161. ${comando[0]} -y > /dev/null 2>&1
  162. ${comando[1]} -y > /dev/null 2>&1
  163. touch $HOME/fim
  164. ) > /dev/null 2>&1 &
  165. tput civis
  166. echo -ne " \033[1;33mESPERE \033[1;37m- \033[1;33m["
  167. while true; do
  168. for((i=0; i<18; i++)); do
  169. echo -ne "\033[1;31m#"
  170. sleep 0.1s
  171. done
  172. [[ -e $HOME/fim ]] && rm $HOME/fim && break
  173. echo -e "\033[1;33m]"
  174. sleep 1s
  175. tput cuu1
  176. tput dl1
  177. echo -ne " \033[1;33mESPERE \033[1;37m- \033[1;33m["
  178. done
  179. echo -e "\033[1;33m]\033[1;37m -\033[1;32m OK !\033[1;37m"
  180. tput cnorm
  181. }
  182. function criarusuarioteste(){
  183. tput cuu1 && tput dl1
  184. tput cuu1 && tput dl1
  185. tput cuu1 && tput dl1
  186. tput cuu1 && tput dl1
  187. tput cuu1 && tput dl1
  188. tput cuu1 && tput dl1
  189. tput cuu1 && tput dl1
  190. tput cuu1 && tput dl1
  191. tput cuu1 && tput dl1
  192. tput cuu1 && tput dl1
  193. tput cuu1 && tput dl1
  194. tput cuu1 && tput dl1
  195. tput cuu1 && tput dl1
  196. tput cuu1 && tput dl1
  197. tput cuu1 && tput dl1
  198. tput cuu1 && tput dl1
  199. tput cuu1 && tput dl1
  200. tput cuu1 && tput dl1
  201. tput cuu1 && tput dl1
  202. meu_ip
  203. mkdir /etc/usuariosteste 1>/dev/null 2>/dev/null
  204. echo -e " USUARIOS TEMPORALES CREADOS"
  205. for testus in $(ls /etc/usuariosteste |sort |sed 's/.sh//g')
  206. do
  207. echo "$testus"
  208. done
  209. printf "\n"
  210. echo -e "${cor[5]} ${txt[28]}"; read -p "Digita : " -e -i demo-$(($RANDOM*10))
  211. nome="demo-$(date | md5sum | head -c10)"
  212. if [ -z $nome ]; then
  213. echo -e "${cor[5]} ⚠️ ⚠️${cor[0]}"
  214. return
  215. fi
  216. if cat /etc/passwd |grep $nome: |grep -vi [a-z]$nome |grep -v [0-9]$nome > /dev/null
  217. then
  218. echo -e "${cor[5]} ⚠️ USUARIO YA EXISTE, REGISTRE OTRO ⚠️${cor[0]}"
  219. return
  220. fi
  221. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  222. echo -e "${cor[5]} ${txt[31]} $nome"
  223. name=$nome
  224. pass="$(date | md5sum | head -c10)"
  225. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  226. echo -e "${cor[5]} ${txt[32]} $nome"
  227. echo -e " Use s = segundos, m = minutos, h = horas e d = dias EX: 14s ."
  228. read -p " ${txt[37]} " tempoin
  229. echo -e "${cor[5]} ${txt[33]} $name"
  230. read -p " ${txt[36]} " limit
  231. if [[ -z "${limit}" ]];then
  232. limit="5"
  233. echo "Default 5 Logins"
  234. fi
  235. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  236. time-us
  237. valides=$(date '+%C%y-%m-%d' -d " +$ext days")
  238. useradd -M -s /bin/false $nome -e $valides
  239. (echo $pass;echo $pass) |passwd $nome 1>/dev/null 2>/dev/null
  240. chage -I 1 $nome 2> /dev/null
  241. if [ "$OPENVPN" = "on" ]; then
  242. open_1 $nome $pass $daysrnf $limit s
  243. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  244. echo -e "${cor[5]} USUARIO : ${cor[4]}$name"
  245. echo -e "${cor[5]} PASSWD : ${cor[4]}$pass"
  246. echo -e "${cor[5]} LIMITE : ${cor[4]}$limit"
  247. echo -e "${cor[5]} VALIDEZ : ${cor[4]}$datexp"
  248. msg -bar
  249. rm -f ./$CLIENT.ovpn > /dev/null
  250. return
  251. fi
  252. echo "#!/bin/bash" > /etc/usuariosteste/$nome.sh
  253. echo "sleep $tempo" >> /etc/usuariosteste/$nome.sh
  254. echo "uskk=$(cat /bin/ejecutar/uskill)" >> /etc/usuariosteste/$nome.sh
  255. echo 'uskk=$(($uskk + 1))' >> /etc/usuariosteste/$nome.sh
  256. echo 'echo $uskk > /bin/ejecutar/uskill' >> /etc/usuariosteste/$nome.sh
  257. echo "kill"' $(ps -u '"$nome |awk '{print"' $1'"}') 1>/dev/null 2>/dev/null
  258. userdel --force $nome
  259. rm -rf ./$CLIENT.ovpn > /dev/null
  260. rm -rf /etc/usuariosteste/$nome.sh
  261. exit" >> /etc/usuariosteste/$nome.sh && screen -dmS usR${nome} bash /etc/usuariosteste/$nome.sh
  262. #figlet $nome | lolcat
  263. echo -e "${cor[5]} * ${txt[353]} *"
  264. echo -e "${cor[5]} * ${txt[352]} *"
  265. msg -bar
  266. ports_
  267. msg -bar
  268. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  269. echo -e "${cor[5]} USUARIO : ${cor[4]}$name"
  270. echo -e "${cor[5]} PASSWD : ${cor[4]}$pass"
  271. echo -e "${cor[5]} LIMITE : ${cor[4]}$limit"
  272. echo -e "${cor[5]} VALIDEZ : ${cor[4]}$tempo"
  273. msg -bar
  274. echo "senha: $pass" > $dir_user/$nome
  275. echo "limite: $limit" >> $dir_user/$nome
  276. echo "data: $valid" >> $dir_user/$nome
  277. echo -ne "${cor[2]}"
  278. fk
  279. echo -e " Despues de expirar !!!!"
  280. echo -e " Este usuario sera desconectados y eliminados."
  281. echo -ne "${cor[2]}"
  282. return
  283. }
  284. #USUARIO TEST DE PRUEBA
  285. net_meter () {
  286. net_dir="/etc/adm-lite/userDIR/usr_cnx"
  287. if [ ! -e "$net_dir" ]; then
  288. echo -e "${cor[5]} ${txt[289]}"
  289. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  290. return
  291. fi
  292. net_cent="/tmp/porcentagem"
  293. sed -i '/^$/d' $net_dir
  294. [[ ! -e "$net_cent" ]] && touch $net_cent
  295. while read cent; do
  296. echo "$cent" | awk '{print $2}' >> $net_cent
  297. done < $net_dir
  298. por_cent=$(paste -sd+ $net_cent | bc)
  299. rm $net_cent
  300. bb=$(printf '%-18s' "${txt[285]}")
  301. aa=$(printf '%-19s' "${txt[287]}")
  302. cc=$(printf '%-18s' "${txt[286]}")
  303. msg -bar
  304. echo -e "\033[1;33m $aa $bb $cc"
  305. msg -bar
  306. while read u; do
  307. b=$(printf '%-18s' "$(($(echo $u | awk '{print $2}')/970)) - MB")
  308. a=$(printf '%-20s' "$(echo $u | awk '{print $1}')")
  309. [[ "$por_cent" = "0" || "$por_cent" = "" ]] && por_cent="1"
  310. pip=$(echo $u | awk '{print $2}')
  311. [[ "$pip" = "" || "$pip" = "0" ]] && pip="1"
  312. percent_user=$(($pip*100/$por_cent)) > /dev/null 2>&1
  313. [[ $percent_user = "0" ]] && percent_user="1"
  314. c=$(printf '%-18s' "$percent_user %%")
  315. if [ "$(($(echo $u | awk '{print $2}')/970))" -gt "1" ]; then
  316. echo -e "\033[1;32m $a \033[1;31m$b \033[1;32m$c"
  317. fi
  318. done < $net_dir
  319. [[ "$(cat $net_dir)" = "" ]] && echo -e "${cor[5]} ${txt[289]}"
  320. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ \033[0m"
  321. echo -e "${cor[1]} Controlar Consumo de Cada Usuario Por Separado ${cor[0]}"
  322. unset net_dir
  323. #monit_user
  324. }
  325. drop_kill () {
  326. user="$1"
  327. tmp_verifica="./tmp_tmp"
  328. function_dropb | grep "$user" | awk '{print $2}' > $tmp_verifica
  329. echo "$user $for_kill"
  330. for pid in `cat $tmp_verifica`; do
  331. kill $pid
  332. done
  333. rm $tmp_verifica
  334. }
  335. botusers () {
  336. unset bot_ini
  337. PIDGEN=$(ps x|grep -v grep|grep "ultimatebot")
  338. killall $PIDGEN > /dev/null 2>&1
  339. if [[ ! $PIDGEN ]]; then
  340. msg -bar
  341. echo -ne "\033[1;97m Deseas Activar el Bot Telegram [s/n]: "
  342. read bot_ini
  343. msg -bar
  344. [[ $bot_ini = @(s|S|y|Y) ]] && source <(curl -sSL https://www.dropbox.com/s/zvn8naajedzldno/telebot.sh.sh)
  345. else
  346. kill -9 $(ps x | grep "ultimatebot" | grep -v "grep" | awk '{print $1}') > /dev/null 2>&1 && echo "BOT DETENIDO EXITOSAMENTE"
  347. fi
  348. }
  349. consul_cli () {
  350. botusers
  351. dir_user="/etc/adm-lite/userDIR"
  352. msg -bar #echo -e "${cor[1]} ➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶ ${cor[0]}"
  353. echo -e "${cor[4]} CONSULTA DATOS DE CLIENTE INDIVIDUAL"
  354. msg -bar #echo -e "${cor[1]} ➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷ ${cor[0]}"
  355. select_users
  356. if [ "$select_name" = "" ]; then
  357. return
  358. fi
  359. namer="$select_name"
  360. echo -e "${cor[5]} ${txt[50]} $namer"
  361. echo -e "\033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m ➮${cor[3]} Consultar estado de Usuario: $namer"
  362. echo -e "\033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮${cor[3]} Reiniciar Usuario: $namer"
  363. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  364. read -p " ${txt[9]} " _opt
  365. if [ "$_opt" = "1" ]; then
  366. unset limite
  367. data=$(cat $dir_user/$namer | grep "data" | awk '{print $2}')
  368. data_sec=$(date +%s)
  369. data_user=$(chage -l "$namer" |grep -i co |awk -F ":" '{print $2}')
  370. data_user_sec=$(date +%s --date="$data_user")
  371. variavel_soma=$(($data_user_sec - $data_sec))
  372. dias_use=$(($variavel_soma / 86400))
  373. if [ -z "$limite" ]; then
  374. limite="null"
  375. fi
  376. if [ "$dias_use" -le 0 ]; then
  377. echo -e " ✭ Eiii, Malas Noticias ☹!!\n Usuario : $namer. Esta Caducado ☹ \n!! Contacta Cliente, Para Renobar su Membresia\n" | pv -qL 80
  378. echo -e "${cor[5]} Usuario $namer: VENCIDO EL: $data"
  379. pkill -u $namer
  380. else
  381. limite=$(cat $dir_user/$namer | grep "limite" | awk '{print $2}')
  382. date="$dias_use"
  383. datexp=$(date "+%d/%m/%Y" -d " + $date days")
  384. valid=$(date '+%C%y-%m-%d' -d " + $date days")
  385. echo -e " ✭ SU CLIENTE : $namer, ES VALIDO HASTA -> $data ☺"
  386. echo -e " ✭ CON 【 $limite 】 CONEXIONES SIMULTANEAS!!. "
  387. echo -e "${cor[5]} RENUEVA EN $dias_use DIAS, DISFRUTE SU ESTANCIA!. "
  388. pkill -u $namer
  389. fi
  390. return
  391. fi
  392. if [ "$_opt" = "2" ]; then
  393. echo -e "${cor[5]} CLIENTE REINICIADO EN SUS CONEXIONES"
  394. pkill -u $namer
  395. echo -e " SI QUIERES VOLVER AL MENU, PRESIONA ENTER!."
  396. read -p " DIGITA 『 ok 』 PARA REINICIAR SERVICIO SSH ▢ TUNNEL : " _ok
  397. if [ "$_ok" = "ok" ]; then
  398. echo -ne " \033[1;31m[ ! ] Services dropbear restart"
  399. service dropbear restart > /dev/null 2>&1
  400. [[ -e /etc/init.d/dropbear ]] && /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  401. echo -ne " \033[1;31m[ ! ] Services SSH & STUNNEL4 restart"
  402. service ssh restart > /dev/null 2>&1
  403. service sshd restart > /dev/null 2>&1
  404. [[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  405. service stunnel4 restart > /dev/null 2>&1
  406. echo "SERVICIOS REINICIADOS EXITOSAMENTE " | pv -qL 50
  407. fi
  408. return
  409. fi
  410. }
  411. fun_time_user () {
  412. declare -A data
  413. tempousers="./tempo_conexao"
  414. usr_pids_var="./userDIR"
  415. user_x="$1"
  416. if [ -e $usr_pids_var/$user_x.pid2 ]; then
  417. source $usr_pids_var/$user_x.pid2
  418. [[ ${data[$user_x]} != +([0-9]) ]] && data[$user_x]="0"
  419. _data_now=$(date +%s)
  420. time[$user_x]=$(($_data_now - ${data[$user_x]}))
  421. else
  422. time[$user_x]="0"
  423. fi
  424. }
  425. function_dropb () {
  426. local pids
  427. local port_dropbear=`ps aux | grep dropbear | awk NR==1 | awk '{print $17;}'`
  428. #cat /var/log/auth.log|grep "$(date|cut -d' ' -f2,3)" > /var/log/authday.log
  429. cat /var/log/auth.log|tail -1000 > /var/log/authday.log
  430. local log=/var/log/authday.log
  431. local loginsukses='Password auth succeeded'
  432. [[ -z $port_dropbear ]] && return 1
  433. for port in `echo $port_dropbear`; do
  434. for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
  435. pids="${pids}$pidx\n"
  436. done
  437. done
  438. for pid in `echo -e "$pids"`; do
  439. pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
  440. i=0
  441. for pidend in $pidlogs; do
  442. let i++
  443. done
  444. if [[ $pidend ]]; then
  445. login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
  446. PID=$pid
  447. user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
  448. waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
  449. [[ -z $user ]] && continue
  450. echo "$user|$PID|$waktu"
  451. fi
  452. done
  453. echo ""
  454. return
  455. }
  456. mostrar_usuarios () {
  457. for u in `awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" |grep -vi polkitd |grep -vi system-`; do
  458. echo "$u"
  459. done
  460. }
  461. fun_us() {
  462. tput cuu1 && tput dl1
  463. tput cuu1 && tput dl1
  464. tput cuu1 && tput dl1
  465. tput cuu1 && tput dl1
  466. tput cuu1 && tput dl1
  467. tput cuu1 && tput dl1
  468. tput cuu1 && tput dl1
  469. tput cuu1 && tput dl1
  470. tput cuu1 && tput dl1
  471. tput cuu1 && tput dl1
  472. tput cuu1 && tput dl1
  473. tput cuu1 && tput dl1
  474. tput cuu1 && tput dl1
  475. tput cuu1 && tput dl1
  476. tput cuu1 && tput dl1
  477. tput cuu1 && tput dl1
  478. tput cuu1 && tput dl1
  479. tput cuu1 && tput dl1
  480. tput cuu1 && tput dl1
  481. #echo -e " \033[7;49;35m =>►► 🐲 CREADOR DE USUARIOS ChumoGH💥VPS 🐲 ◄◄<= \033[0m\033[1;31m "
  482. echo -e " \033[0;35m ⚜️ CREADOR DE CUENTAS SSH TIPO ⚜️ "
  483. msg -bar
  484. echo -ne " \033[0;35m[\033[0;36m0\033[0;35m] \033[0;34m➮\033[0;33m $(msg -bra "\033[1;41m[ ⮌ ]\e[0m") "
  485. echo -ne " \033[0;35m[\033[0;36m1\033[0;35m] \033[0;34m➮\033[0;33m NORMAL"
  486. echo -ne " \033[0;35m[\033[0;36m2\033[0;35m] \033[0;34m➮\033[0;33m HWID"
  487. echo -e " \033[0;35m[\033[0;36m3\033[0;35m] \033[0;34m➮\033[0;31m TOKEN "
  488. msg -bar
  489. selection=$(selection_fun 2)
  490. case ${selection} in
  491. 0)
  492. return 0
  493. ;;
  494. 1)
  495. function_1
  496. ;;
  497. 2)
  498. fun_us_hwid
  499. ;;
  500. 3|03)
  501. fun_us_hwid
  502. ;;
  503. esac
  504. }
  505. fun_us_hwid(){
  506. tput cuu1 && tput dl1
  507. tput cuu1 && tput dl1
  508. echo -ne "${cor[5]} ⎚ NOMBRE DE"; read -p " USUARIO : " name
  509. tput cuu1 && tput dl1
  510. [[ -z $name ]] && echo -e "${cor[5]} ⚠️ NO REGISTRO NOMBRE, RETORNANDO ⚠️${cor[0]}" && return
  511. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  512. echo -e "${cor[5]} INGRESA HWID PARA $name"
  513. read -p " HWID: " hwid
  514. if cat /etc/passwd |grep $hwid: |grep -vi [a-z]$hwid |grep -v [0-9]$hwid > /dev/null
  515. then
  516. echo -e "${cor[5]} ⚠️ HWID YA EXISTE, REGISTRE OTRO ⚠️${cor[0]}"
  517. return
  518. fi
  519. tput cuu1 && tput dl1
  520. tput cuu1 && tput dl1
  521. tput cuu1 && tput dl1
  522. [[ -z "${hwid}" ]] && echo " ⚠️ No se Ingreso HWID , RETORNANDO! ⚠️" && return
  523. msg -bar
  524. echo -e "${cor[5]} TIEMPO DE DURACION EN DIAS PARA $name"
  525. read -p " VALIDEZ : " daysrnf
  526. tput cuu1 && tput dl1
  527. tput cuu1 && tput dl1
  528. tput cuu1 && tput dl1
  529. [[ -z "${daysrnf}" ]] && daysrnf="2"
  530. msg -bar
  531. meu_ip
  532. valid=$(date '+%C%y-%m-%d' -d " +$daysrnf days")
  533. datexp=$(date "+%d/%m/%Y" -d " +$daysrnf days")
  534. useradd -M -s /bin/false $hwid -e $valid
  535. (echo $hwid; echo $hwid)|passwd $hwid 2>/dev/null
  536. tput cuu1 >&2 && tput dl1 >&2
  537. #figlet $name | lolcat
  538. echo -e "${cor[5]} * ${txt[352]} *"
  539. msg -bar
  540. ports_
  541. msg -bar
  542. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  543. echo -e "${cor[5]} USUARIO : ${cor[4]}$name"
  544. echo -e "${cor[5]} HWID : ${cor[4]}$hwid"
  545. echo -e "${cor[5]} VALIDEZ : ${cor[4]}$datexp"
  546. msg -bar
  547. echo "senha: $name" > $dir_user/$hwid
  548. echo "limite: HWID" >> $dir_user/$hwid
  549. echo "data: $valid" >> $dir_user/$hwid
  550. fkhwid
  551. msg -bar
  552. tput cuu1 >&2 && tput dl1 >&2
  553. echo -ne "${cor[2]}"
  554. return
  555. }
  556. function_1 () {
  557. #msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  558. #echo -e "${cor[4]} LISTA DE USUARIOS REGISTRADOS"
  559. #msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  560. #for u in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9] |sort`; do
  561. #echo -e "${cor[5]} $u"
  562. #done
  563. echo -e "${cor[4]} ❑ MENU DE CREACION DE USUARIOS ❒ "
  564. msg -bar
  565. echo -ne "${cor[5]} ⎚ NOMBRE DE"; read -p " USUARIO : " name
  566. tput cuu1 && tput dl1
  567. tput cuu1 && tput dl1
  568. if [ -z $name ]; then
  569. echo -e "${cor[5]} ⚠️ NO REGISTRO NOMBRE, RETORNANDO ⚠️${cor[0]}"
  570. return
  571. fi
  572. if cat /etc/passwd |grep $name: |grep -vi [a-z]$name |grep -v [0-9]$name > /dev/null
  573. then
  574. echo -e "${cor[5]} ⚠️ USUARIO YA EXISTE, USE OTRO NOMBRE ⚠️${cor[0]}"
  575. return
  576. fi
  577. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  578. echo -e "${cor[5]} CONTRASEÑA PARA $name"
  579. read -p " CONTRASEÑA : " pass
  580. tput cuu1 && tput dl1
  581. tput cuu1 && tput dl1
  582. tput cuu1 && tput dl1
  583. if [[ -f "${pass}" ]];then
  584. pass="$(date | md5sum | head -c10)"
  585. fi
  586. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  587. echo -e "${cor[5]} TIEMPO DE DURACION EN DIAS PARA $name"
  588. read -p " VALIDEZ : " daysrnf
  589. tput cuu1 && tput dl1
  590. tput cuu1 && tput dl1
  591. tput cuu1 && tput dl1
  592. if [[ -f "${daysrnf}" ]];then
  593. daysrnf="2"
  594. fi
  595. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  596. echo -e "${cor[5]} LIMITE DE CONEXIONES PARA $name"
  597. read -p " LIMITE : " limit
  598. tput cuu1 && tput dl1
  599. tput cuu1 && tput dl1
  600. tput cuu1 && tput dl1
  601. if [[ -f "${limit}" ]];then
  602. limit="1"
  603. fi
  604. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  605. meu_ip
  606. if [ "$OPENVPN" = "on" ]; then
  607. open_1 $name $pass $daysrnf $limit s
  608. msg -bar
  609. ports_
  610. msg -bar
  611. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  612. echo -e "${cor[5]} USUARIO : ${cor[4]}$name"
  613. echo -e "${cor[5]} PASSWD : ${cor[4]}$pass"
  614. echo -e "${cor[5]} LIMITE : ${cor[4]}$limit"
  615. echo -e "${cor[5]} VALIDEZ : ${cor[4]}$datexp"
  616. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  617. fk
  618. rm -rf ./$CLIENT.ovpn > /dev/null 2>&1
  619. rm -f ./$CLIENT.ovpn > /dev/null 2>&1
  620. msg -bar
  621. return
  622. fi
  623. valid=$(date '+%C%y-%m-%d' -d " +$daysrnf days")
  624. datexp=$(date "+%d/%m/%Y" -d " +$daysrnf days")
  625. #echo -ne " USUARIO"
  626. #(
  627. useradd -M -s /bin/false $name -e $valid
  628. (echo $pass; echo $pass)|passwd $name 2>/dev/null
  629. tput cuu1 >&2 && tput dl1 >&2
  630. figlet $name | lolcat
  631. echo -e "${cor[5]} * ${txt[352]} *"
  632. msg -bar
  633. ports_
  634. msg -bar
  635. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  636. echo -e "${cor[5]} USUARIO : ${cor[4]}$name"
  637. echo -e "${cor[5]} PASSWD : ${cor[4]}$pass"
  638. echo -e "${cor[5]} LIMITE : ${cor[4]}$limit"
  639. echo -e "${cor[5]} VALIDEZ : ${cor[4]}$datexp"
  640. msg -bar
  641. echo "senha: $pass" > $dir_user/$name
  642. echo "limite: $limit" >> $dir_user/$name
  643. echo "data: $valid" >> $dir_user/$name
  644. fk
  645. msg -bar
  646. tput cuu1 >&2 && tput dl1 >&2
  647. [[ -e /etc/v2ray/config.json ]] && {
  648. echo -e "\033[1;41m AÑADIR USUARIO VMESS ?\033[0;33m :v"
  649. echo -ne "\033[0;32m "
  650. read -p " Responde [ s | n ] : " -e -i "n" x
  651. tput cuu1 >&2 && tput dl1 >&2
  652. tput cuu1 >&2 && tput dl1 >&2
  653. [[ $x = @(s|S|y|Y) ]] && source <(curl -sSL https://www.dropbox.com/s/z6txyjygpri7ede/adduser.sh) $name $daysrnf
  654. }
  655. echo -ne "${cor[2]}"
  656. return
  657. }
  658. function_2 () {
  659. tput cuu1 && tput dl1
  660. tput cuu1 && tput dl1
  661. tput cuu1 && tput dl1
  662. tput cuu1 && tput dl1
  663. tput cuu1 && tput dl1
  664. tput cuu1 && tput dl1
  665. tput cuu1 && tput dl1
  666. tput cuu1 && tput dl1
  667. tput cuu1 && tput dl1
  668. tput cuu1 && tput dl1
  669. tput cuu1 && tput dl1
  670. tput cuu1 && tput dl1
  671. tput cuu1 && tput dl1
  672. tput cuu1 && tput dl1
  673. tput cuu1 && tput dl1
  674. tput cuu1 && tput dl1
  675. tput cuu1 && tput dl1
  676. tput cuu1 && tput dl1
  677. tput cuu1 && tput dl1
  678. echo -e "${cor[4]} ${txt[39]}"
  679. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  680. echo -e "\033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m ➮${cor[3]} ELIMINAR 1 USER"
  681. echo -e "\033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮${cor[3]} ELIMINAR VARIOS/TODOS"
  682. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  683. echo -ne "${cor[6]}"
  684. read -p "${txt[9]} " opc_del
  685. if [ "$opc_del" = "1" ]; then
  686. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  687. echo -e "${cor[4]} USUARIOS REGISTRADOS"
  688. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  689. select_users
  690. name="$select_name"
  691. if [ "$name" = "" ]; then
  692. return
  693. fi
  694. if [ "$OPENVPN" = "on" ]; then
  695. open_2 $name
  696. msg -bar
  697. return
  698. fi
  699. userdel --force $name > /dev/null 2>/dev/null
  700. kill -9 `ps aux |grep -vi '[a-z]$name' |grep -vi '$name[a-z]' |grep -v '[1-9]$name' |grep -v '$name[1-9]' |grep $name |awk {'print $2'}` 2> /dev/null
  701. pid_kill=$(function_dropb | grep "$name" | awk '{print $2}')
  702. uskk=$(cat /bin/ejecutar/uskill)
  703. let uskk=$uskk+$cco
  704. echo $uskk > /bin/ejecutar/uskill
  705. if [ "$pid_kill" != "" ]; then
  706. drop_kill $name
  707. fi
  708. if [ -e /etc/usuariosteste/$name ]; then
  709. rm /etc/usuariosteste/$name
  710. fi
  711. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  712. echo -e " $name ${cor[2]} ELIMINADO "
  713. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  714. return
  715. fi
  716. if [ "$opc_del" = "2" ]; then
  717. for name in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9] |sort`; do
  718. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  719. echo -e "${cor[5]} ${txt[46]} $name ?"
  720. read -p " [S/N]: " _remover_
  721. if [[ "$_remover_" = "s" || "$_remover_" = "S" ]]; then
  722. if [ "$OPENVPN" = "on" ]; then
  723. open_2 $name
  724. else
  725. userdel --force $name > /dev/null 2>&1
  726. kill -9 `ps aux |grep -vi '[a-z]$name' |grep -vi '$name[a-z]' |grep -v '[1-9]$name' |grep -v '$name[1-9]' |grep $name |awk {'print $2'}` > /dev/null 2>&1
  727. pid_kill=$(function_dropb | grep "$name" | awk '{print $2}')
  728. uskk=$(cat /bin/ejecutar/uskill)
  729. let uskk=$uskk+$cco
  730. echo $uskk > /bin/ejecutar/uskill
  731. if [ "$pid_kill" != "" ]; then
  732. drop_kill $name
  733. fi
  734. if [ -e $dir_user/$name ]; then
  735. rm $dir_user/$name
  736. fi
  737. echo -e "\033[1;37m $name ${cor[5]} ELIMINADO"
  738. sleep 0.3s
  739. fi
  740. fi
  741. done
  742. msg -bar
  743. else
  744. return
  745. fi
  746. }
  747. function_3 () {
  748. tput cuu1 && tput dl1
  749. tput cuu1 && tput dl1
  750. tput cuu1 && tput dl1
  751. tput cuu1 && tput dl1
  752. tput cuu1 && tput dl1
  753. tput cuu1 && tput dl1
  754. tput cuu1 && tput dl1
  755. tput cuu1 && tput dl1
  756. tput cuu1 && tput dl1
  757. tput cuu1 && tput dl1
  758. tput cuu1 && tput dl1
  759. tput cuu1 && tput dl1
  760. tput cuu1 && tput dl1
  761. tput cuu1 && tput dl1
  762. tput cuu1 && tput dl1
  763. tput cuu1 && tput dl1
  764. tput cuu1 && tput dl1
  765. tput cuu1 && tput dl1
  766. tput cuu1 && tput dl1
  767. #msg -bar
  768. echo -e "${cor[4]} MODIFICAR DATOS DE USUARIOS"
  769. msg -bar
  770. select_users
  771. if [ "$select_name" = "" ]; then
  772. return
  773. fi
  774. namer="$select_name"
  775. meu_ip
  776. echo -e "${cor[5]} ESCOJE LA OPCION A CAMBIAR DE $namer"
  777. echo -e "\033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m ➮${cor[3]} NUMERO DE LOGINS DE \033[0;36m$namer"
  778. echo -e "\033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮${cor[3]} FECHA DE EXPIRACION DE \033[0;36m$namer"
  779. echo -e "\033[0;35m [\033[0;36m3\033[0;35m]\033[0;31m ➮${cor[3]} CONTRASEÑA LOGIN DE \033[0;36m$namer"
  780. msg -bar
  781. read -p " ${txt[9]} " _opt
  782. [[ "$_opt" = "1" ]] && {
  783. tput cuu1 && tput dl1
  784. tput cuu1 && tput dl1
  785. tput cuu1 && tput dl1
  786. tput cuu1 && tput dl1
  787. tput cuu1 && tput dl1
  788. tput cuu1 && tput dl1
  789. read -p "${txt[54]} " new_limit
  790. tput cuu1 && tput dl1
  791. if [ "$new_limit" = "" ]; then
  792. echo -e "${cor[5]} \033[1;31m NO SE REGISTRO LIMITE! REGRESANDO. . ."
  793. return
  794. fi
  795. usr_var=$(cat $dir_user/$namer | grep -v "limite:")
  796. echo "$usr_var" > $dir_user/$namer
  797. echo "limite: $new_limit" >> $dir_user/$namer
  798. msg -bar
  799. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  800. echo -e "${cor[5]} Listo, Usuario $namer: Actualizado con -> $new_limit Logins"
  801. pkill -u $namer
  802. msg -bar
  803. unset new_limit
  804. unset usr_var
  805. return
  806. }
  807. [[ "$_opt" = "2" ]] && {
  808. tput cuu1 && tput dl1
  809. tput cuu1 && tput dl1
  810. tput cuu1 && tput dl1
  811. tput cuu1 && tput dl1
  812. tput cuu1 && tput dl1
  813. tput cuu1 && tput dl1
  814. tput cuu1 && tput dl1
  815. tput cuu1 && tput dl1
  816. tput cuu1 && tput dl1
  817. add_dias() {
  818. echo -ne "${cor[5]} NUMEROS DE DIAS A AGREGAR"
  819. read -p " : " date
  820. tput cuu1 && tput dl1
  821. tput cuu1 && tput dl1
  822. tput cuu1 && tput dl1
  823. tput cuu1 && tput dl1
  824. if [ "$date" = "" ]; then
  825. echo -e "\033[1;31m ⚠️ NO SE REGISTRO DIAS! REGRESANDO ⚠️"
  826. return
  827. fi
  828. #echo -e " CALCULANDO DIAS RESTANTES DE $namer" | pv -qL 40
  829. data=$(cat $dir_user/$namer | grep "data" | awk '{print $2}')
  830. data_sec=$(date +%s)
  831. data_user=$(chage -l "$namer" |grep -i co |awk -F ":" '{print $2}')
  832. data_user_sec=$(date +%s --date="$data_user")
  833. variavel_soma=$(($data_user_sec - $data_sec))
  834. dias_use=$(($variavel_soma / 86400))
  835. #echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  836. [[ $dias_use -ge 0 ]] && {
  837. date=$(($dias_use + $date))
  838. echo -e "\033[1;32m $dias_use DIAS RECUPERADOS &&"
  839. tput cuu1 && tput dl1
  840. } || {
  841. #[[ $dias_use < 0 ]] && dias_use=0
  842. echo -e "\033[1;31m $dias_use DIAS RECUPERADOS &&"
  843. tput cuu1 && tput dl1
  844. }
  845. limite=$(cat $dir_user/$namer | grep "limite" | awk '{print $2}')
  846. if [ -z "$limite" ]; then
  847. limite="null"
  848. fi
  849. datexp=$(date "+%d/%m/%Y" -d " + $date days")
  850. valid=$(date '+%C%y-%m-%d' -d " + $date days")
  851. chage -E $valid $namer 2> /dev/null
  852. usr_var=$(cat $dir_user/$namer | grep -v "data")
  853. echo -e "$usr_var" > $dir_user/$namer
  854. echo -e "data: $valid" >> $dir_user/$namer
  855. msg -bar
  856. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  857. echo -e " Listo, ✭ SU CLIENTE : $namer. VALIDO HASTA : $datexp"
  858. echo -e " ✭ CON 【 $limite 】 CONEXIONES SIMULTANEAS!!. "
  859. echo -e "${cor[5]} RENUEVA EN $date DIAS, DISFRUTE SU ESTANCIA!. "
  860. pkill -u $namer
  861. msg -bar
  862. unset datexp
  863. unset valid
  864. unset usr_var
  865. return
  866. }
  867. del_dias() {
  868. echo -ne "${cor[5]} NUMEROS DE DIAS A QUITAR"
  869. read -p " : " date
  870. tput cuu1 && tput dl1
  871. tput cuu1 && tput dl1
  872. tput cuu1 && tput dl1
  873. tput cuu1 && tput dl1
  874. if [ "$date" = "" ]; then
  875. echo -e "\033[1;31m ⚠️ NO SE REGISTRO DIAS! REGRESANDO ⚠️"
  876. return
  877. fi
  878. data=$(cat $dir_user/$namer | grep "data" | awk '{print $2}')
  879. data_sec=$(date +%s)
  880. data_user=$(chage -l "$namer" |grep -i co |awk -F ":" '{print $2}')
  881. data_user_sec=$(date +%s --date="$data_user")
  882. variavel_soma=$(($data_user_sec - $data_sec))
  883. dias_use=$(($variavel_soma / 86400))
  884. [[ $dias_use -ge 0 ]] && {
  885. date=$(($dias_use - $date))
  886. echo -e "\033[1;32m $dias_use DIAS RECUPERADOS &&"
  887. tput cuu1 && tput dl1
  888. } || {
  889. echo -e "\033[1;31m $dias_use DIAS RECUPERADOS &&"
  890. tput cuu1 && tput dl1
  891. }
  892. limite=$(cat $dir_user/$namer | grep "limite" | awk '{print $2}')
  893. if [ -z "$limite" ]; then
  894. limite="null"
  895. fi
  896. datexp=$(date "+%d/%m/%Y" -d " + $date days")
  897. valid=$(date '+%C%y-%m-%d' -d " + $date days")
  898. chage -E $valid $namer 2> /dev/null
  899. usr_var=$(cat $dir_user/$namer | grep -v "data")
  900. echo -e "$usr_var" > $dir_user/$namer
  901. echo -e "data: $valid" >> $dir_user/$namer
  902. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  903. echo -e " Listo, ✭ SU CLIENTE : $namer. VALIDO HASTA : $datexp"
  904. echo -e " ✭ CON 【 $limite 】 CONEXIONES SIMULTANEAS!!. "
  905. echo -e "${cor[5]} RENUEVA EN $date DIAS, DISFRUTE SU ESTANCIA!. "
  906. pkill -u $namer
  907. unset datexp
  908. unset valid
  909. unset usr_var
  910. return
  911. }
  912. ren_dias() {
  913. echo -ne "${cor[5]} NUMEROS DE DIAS "
  914. read -p " : " date
  915. tput cuu1 && tput dl1
  916. tput cuu1 && tput dl1
  917. tput cuu1 && tput dl1
  918. tput cuu1 && tput dl1
  919. if [ "$date" = "" ]; then
  920. echo -e "\033[1;31m ⚠️ NO SE REGISTRO DIAS! REGRESANDO ⚠️"
  921. return
  922. fi
  923. limite=$(cat $dir_user/$namer | grep "limite" | awk '{print $2}')
  924. if [ -z "$limite" ]; then
  925. limite="null"
  926. fi
  927. datexp=$(date "+%d/%m/%Y" -d " + $date days")
  928. valid=$(date '+%C%y-%m-%d' -d " + $date days")
  929. chage -E $valid $namer 2> /dev/null
  930. echo -e "${cor[5]} ${txt[59]}"
  931. usr_var=$(cat $dir_user/$namer | grep -v "data")
  932. echo -e "$usr_var" > $dir_user/$namer
  933. echo -e "data: $valid" >> $dir_user/$namer
  934. msg -bar
  935. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  936. echo -e " Listo, ✭ SU CLIENTE : $namer. VALIDO HASTA : $datexp"
  937. echo -e " ✭ CON 【 $limite 】 CONEXIONES SIMULTANEAS!!. "
  938. echo -e "${cor[5]} RENUEVA EN $date DIAS, DISFRUTE SU ESTANCIA!. "
  939. pkill -u $namer
  940. unset datexp
  941. unset valid
  942. unset usr_var
  943. return
  944. }
  945. echo -e "${cor[5]} ESCOJE LA OPCION A CAMBIAR DE $namer"
  946. msg -bar
  947. echo -e "\033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m ➮${cor[3]} AÑADIR DIAS A \033[0;36m$namer"
  948. echo -e "\033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮${cor[3]} QUITAR DIAS A \033[0;36m$namer"
  949. echo -e "\033[0;35m [\033[0;36m3\033[0;35m]\033[0;31m ➮${cor[3]} REINICIAR DIAS A \033[0;36m$namer"
  950. msg -bar
  951. read -p " OPCION " _ropt
  952. tput cuu1 && tput dl1
  953. tput cuu1 && tput dl1
  954. tput cuu1 && tput dl1
  955. tput cuu1 && tput dl1
  956. tput cuu1 && tput dl1
  957. [[ $_ropt = "1" ]] && add_dias
  958. [[ $_ropt = "2" ]] && del_dias
  959. [[ $_ropt = "3" ]] && ren_dias
  960. return
  961. }
  962. [[ "$_opt" = "3" ]] && {
  963. tput cuu1 && tput dl1
  964. tput cuu1 && tput dl1
  965. tput cuu1 && tput dl1
  966. tput cuu1 && tput dl1
  967. tput cuu1 && tput dl1
  968. tput cuu1 && tput dl1
  969. echo -e "${cor[5]} NUEVA CONTRASEÑA PARA $namer"
  970. read -p " : " nova_senha
  971. tput cuu1 && tput dl1
  972. tput cuu1 && tput dl1
  973. [[ "$nova_senha" = "" ]] && echo -e "${cor[5]}❌ CONTRASEÑA NO MODIFICADA ❌" && return
  974. (echo "$nova_senha" ; echo "$nova_senha" ) |passwd $namer > /dev/null 2>/dev/null
  975. usr_var1=$(cat $dir_user/$namer | grep -v "senha")
  976. echo -e "$usr_var1" > $dir_user/$namer
  977. echo -e "senha: $nova_senha" >> $dir_user/$namer
  978. echo -e "${cor[5]} Host/IP-Address : ${cor[4]}$IP"
  979. echo -e "${cor[5]}Listo, Usuario : $namer ➮ Contraseña : -> $nova_senha"
  980. pkill -u $namer
  981. unset nova_senha
  982. unset usr_var1
  983. return
  984. }
  985. [[ -z $_opt ]] && echo "⚠️ SIN SELECCION ⚠️"
  986. }
  987. block_user () {
  988. tput cuu1 && tput dl1
  989. tput cuu1 && tput dl1
  990. tput cuu1 && tput dl1
  991. tput cuu1 && tput dl1
  992. tput cuu1 && tput dl1
  993. tput cuu1 && tput dl1
  994. tput cuu1 && tput dl1
  995. tput cuu1 && tput dl1
  996. tput cuu1 && tput dl1
  997. tput cuu1 && tput dl1
  998. tput cuu1 && tput dl1
  999. tput cuu1 && tput dl1
  1000. tput cuu1 && tput dl1
  1001. tput cuu1 && tput dl1
  1002. tput cuu1 && tput dl1
  1003. tput cuu1 && tput dl1
  1004. tput cuu1 && tput dl1
  1005. tput cuu1 && tput dl1
  1006. tput cuu1 && tput dl1
  1007. #msg -bar #echo -e "${cor[1]} ➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶➶ ${cor[0]}"
  1008. echo -e "${cor[4]} Bloquear USUARIO PRIVADO "
  1009. msg -bar #echo -e "${cor[1]} ➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷➷ ${cor[0]}"
  1010. select_users
  1011. if [ "$select_name" = "" ]; then
  1012. return
  1013. fi
  1014. namer="$select_name"
  1015. echo -e "${cor[5]} Bloquear USUARIO $namer FIJO"
  1016. echo -e "${cor[2]} |1| >${cor[3]} Bloquear $namer en Loguins"
  1017. echo -e "${cor[2]} |2| >${cor[3]} Desbloquear $namer en Loguins"
  1018. #echo -e "${cor[2]} |3| >${cor[3]} ${txt[53]} $namer"
  1019. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  1020. read -p " ${txt[9]} " _opt
  1021. if [ "$_opt" = "1" ]; then
  1022. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  1023. echo -e "${cor[5]} ⚠️ Bloqueando USER ⚠️"
  1024. ########
  1025. data=$(cat $dir_user/$namer | grep "data" | awk '{print $2}')
  1026. pass=$(cat $dir_user/$namer | grep "senha" | awk '{print $2}')
  1027. data_sec=$(date +%s)
  1028. data_user=$(chage -l "$namer" |grep -i co |awk -F ":" '{print $2}')
  1029. data_user_sec=$(date +%s --date="$data_user")
  1030. variavel_soma=$(($data_user_sec - $data_sec))
  1031. dias_use=$(($variavel_soma / 86400))
  1032. sl=$((dias_use + 1))
  1033. echo $sl > $dir_user/$namer.block1
  1034. ########
  1035. date=0
  1036. datexp=$(date "+%d/%m/%Y" -d " + $date days")
  1037. valid=$(date '+%C%y-%m-%d' -d " + $date days")
  1038. chage -E $valid $namer 2> /dev/null
  1039. #echo -e "${cor[5]} ${txt[59]}"
  1040. usr_var=$(cat $dir_user/$namer | grep -v "data")
  1041. echo -e "$usr_var" > $dir_user/$namer
  1042. echo -e "data: $valid" >> $dir_user/$namer
  1043. echo -e "$pass" > $dir_user/$namer.block
  1044. echo -e "$namer: BLOEQUEADO $valid"
  1045. (echo "LOCK" ; echo "LOCK" ) |passwd $namer > /dev/null 2>/dev/null
  1046. usr_var1=$(cat $dir_user/$namer | grep -v "senha")
  1047. echo -e "$usr_var1" > $dir_user/$namer
  1048. echo -e "senha: LOCK" >> $dir_user/$namer
  1049. pkill -u $namer
  1050. kill -9 `ps aux |grep -vi '[a-z]$namer' |grep -vi '$namer[a-z]' |grep -v '[1-9]$namer' |grep -v '$namer[1-9]' |grep $namer |awk {'print $2'}` 2> /dev/null
  1051. unset datexp
  1052. unset valid
  1053. unset usr_var
  1054. echo -e "USUARIO BLOQUEADO EN LOGUIN "
  1055. return
  1056. fi
  1057. if [ "$_opt" = "2" ]; then
  1058. [[ -e $dir_user/$namer.block1 ]] && date=$(cat $dir_user/$namer.block1) || read -p " Ingresa DATA: " date
  1059. datexp=$(date "+%d/%m/%Y" -d " + $date days")
  1060. valid=$(date '+%C%y-%m-%d' -d " + $date days")
  1061. chage -E $valid $namer 2> /dev/null
  1062. usr_var=$(cat $dir_user/$namer | grep -v "data")
  1063. echo -e "$usr_var" > $dir_user/$namer
  1064. echo -e "data: $valid" >> $dir_user/$namer
  1065. nova_senha=$(cat $dir_user/$namer.block)
  1066. (echo "$nova_senha" ; echo "$nova_senha" ) |passwd $namer > /dev/null 2>/dev/null
  1067. usr_var1=$(cat $dir_user/$namer | grep -v "senha")
  1068. echo -e "$usr_var1" > $dir_user/$namer
  1069. echo -e "senha: $nova_senha" >> $dir_user/$namer
  1070. echo -e " USER $namer: UNLOCK SUCCESS"
  1071. pkill -u $namer
  1072. [[ -e $dir_user/$namer.block1 ]] && rm $dir_user/$namer.block1
  1073. [[ -e $dir_user/$namer.block ]] && rm -f $dir_user/$namer.block
  1074. unset datexp
  1075. unset valid
  1076. unset usr_var
  1077. return
  1078. fi
  1079. return
  1080. }
  1081. function_4 () {
  1082. tput cuu1 && tput dl1
  1083. tput cuu1 && tput dl1
  1084. tput cuu1 && tput dl1
  1085. tput cuu1 && tput dl1
  1086. tput cuu1 && tput dl1
  1087. tput cuu1 && tput dl1
  1088. tput cuu1 && tput dl1
  1089. tput cuu1 && tput dl1
  1090. tput cuu1 && tput dl1
  1091. tput cuu1 && tput dl1
  1092. tput cuu1 && tput dl1
  1093. tput cuu1 && tput dl1
  1094. tput cuu1 && tput dl1
  1095. tput cuu1 && tput dl1
  1096. tput cuu1 && tput dl1
  1097. tput cuu1 && tput dl1
  1098. tput cuu1 && tput dl1
  1099. tput cuu1 && tput dl1
  1100. tput cuu1 && tput dl1
  1101. #msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  1102. echo -e "${cor[4]} > ${txt[64]} ${txt[65]} ${txt[66]} ${txt[85]} ${txt[67]}"
  1103. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  1104. _cont="0"
  1105. if [ ! -e $tempousers ]; then
  1106. touch $tempousers
  1107. fi
  1108. for namer in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9] |sort`; do
  1109. if [ "$namer" = "" ]; then
  1110. break
  1111. fi
  1112. if [ -e $dir_user/$namer ]; then
  1113. _sen=$(cat $dir_user/$namer | grep "senha" | awk '{print $2}')
  1114. _limit=$(cat $dir_user/$namer | grep "limite" | awk '{print $2}')
  1115. [[ ${_limit} = "HWID" ]] && token="$_sen"
  1116. else
  1117. _limit="${txt[68]}"
  1118. _sen="${txt[68]}"
  1119. fi
  1120. [[ -z "$_limit" ]] && _limit="NO FOUND"
  1121. [[ -z "$_sen" ]] && _sen="NO FOUND"
  1122. data_sec=$(date +%s)
  1123. data_user=$(chage -l "$namer" |grep -i co |awk -F ":" '{print $2}')
  1124. if [ "$data_user" = " never" ]; then
  1125. dias_user="\033[1;37m${txt[69]}"
  1126. else
  1127. data_user_sec=$(date +%s --date="$data_user")
  1128. if [ "$data_sec" -gt "$data_user_sec" ]; then
  1129. dias_user="\033[1;31m${txt[70]}"
  1130. else
  1131. variavel_soma=$(($data_user_sec - $data_sec))
  1132. dias_use=$(($variavel_soma / 86400))
  1133. dias_user="\033[1;32m$dias_use ${txt[73]}"
  1134. fi
  1135. fi
  1136. unset SEC
  1137. unset MIN
  1138. unset HOR
  1139. SEC=$(cat $tempousers | grep "$namer" | awk '{print $2}')
  1140. number_var $SEC
  1141. if [ "$var_number" = "" ]; then
  1142. SEC="0"
  1143. else
  1144. SEC="$var_number"
  1145. fi
  1146. hour_var=$(echo "${txt[83]}" | cut -b 1)
  1147. min_var=$(echo "${txt[84]}" | cut -b 1)
  1148. MIN=$(($SEC / 60))
  1149. SEC=$(($SEC - $MIN * 60))
  1150. HOR=$(($MIN / 60))
  1151. MIN=$(($MIN - $HOR * 60))
  1152. txto[1]=$(printf '%-10s' "$namer")
  1153. txto[2]=$(printf '%-12s' "$_sen")
  1154. txto[3]=$(printf '%-10s' "$_limit")
  1155. txto[4]=$(printf '%-10s' "${HOR}h:${MIN}m:${SEC}s")
  1156. [[ -e $dir_user/$namer.block ]] && txto[5]="\033[1;31mLOCK" || txto[5]=$(printf '%-2s' "$dias_user")
  1157. #$dir_user/$namer.block
  1158. unset open_vpn
  1159. tmp="$(cat /etc/passwd | grep -v ovpn | awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9] |sort)"
  1160. open_vpn=$(echo "$tmp" | grep "$namer")
  1161. _cont=$(($_cont + 1))
  1162. if [ "$open_vpn" != "" ]; then
  1163. #user ssh
  1164. [[ -e $dir_user/$namer ]] && [[ $(cat $dir_user/$namer | grep "limite" | awk '{print $2}') = "HWID" ]] && {
  1165. echo -e "\033[0;35m [\033[0;36m$_cont\033[0;35m]\033[0;31m ${cor[2]}${cor[7]} ${txto[2]} ${txto[3]} ${txto[4]} ${txto[5]}"
  1166. echo -e " \033[1;32m ⤷ HWID ${cor[2]}- \033[1;31m${txto[1]} "
  1167. } || {
  1168. echo -e "\033[0;35m [\033[0;36m$_cont\033[0;35m]\033[0;31m ${cor[2]}${cor[7]} ${txto[1]} ${txto[2]} ${txto[3]} ${txto[4]} ${txto[5]}"
  1169. }
  1170. else
  1171. #user openvpn
  1172. echo -e "\033[0;35m [\033[0;36m$_cont\033[0;35m]\033[0;31m ${cor[5]} ${txto[1]} ${txto[2]} ${txto[3]} ${txto[4]} ${txto[5]}"
  1173. fi
  1174. done
  1175. msg -bar
  1176. echo -e " ∆ EXISTEN: $_cont CLIENTES EN TU SERVIDOR"
  1177. msg -bar
  1178. unset txt_
  1179. }
  1180. function_5 () {
  1181. tput cuu1 && tput dl1
  1182. tput cuu1 && tput dl1
  1183. tput cuu1 && tput dl1
  1184. tput cuu1 && tput dl1
  1185. tput cuu1 && tput dl1
  1186. tput cuu1 && tput dl1
  1187. tput cuu1 && tput dl1
  1188. tput cuu1 && tput dl1
  1189. tput cuu1 && tput dl1
  1190. tput cuu1 && tput dl1
  1191. tput cuu1 && tput dl1
  1192. tput cuu1 && tput dl1
  1193. tput cuu1 && tput dl1
  1194. tput cuu1 && tput dl1
  1195. tput cuu1 && tput dl1
  1196. tput cuu1 && tput dl1
  1197. tput cuu1 && tput dl1
  1198. tput cuu1 && tput dl1
  1199. tput cuu1 && tput dl1
  1200. #msg -bar
  1201. msga[1]=$(printf '%-12s' "USUARIOS")
  1202. msga[2]=$(printf '%-9s' "CONEXIÓN")
  1203. msga[3]=$(printf '%-6s' "TIEMPO HH:MM")
  1204. echo -e "${cor[4]} ${msga[1]} ${msga[2]} ${msga[3]} ${cor[0]}"
  1205. unset msga
  1206. msg -bar
  1207. [[ ! -e $tempousers ]] && touch $tempousers
  1208. _data_now=$(date +%s)
  1209. for user in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9] |sort`; do
  1210. unset ssh
  1211. ssh+="$(ps -u $user|grep sshd|wc -l)+"
  1212. ssh+="$(function_dropb|grep "$user"|wc -l)+"
  1213. [[ "$OPENVPN" = "on" ]] && ssh+="$(fun_ovpn_onl|grep "$user"|wc -l)+"
  1214. ssh+="0"
  1215. user_pid=$(echo $ssh|bc)
  1216. declare -A time
  1217. fun_time_user "$user"
  1218. SEC="${time[$user]}"
  1219. [[ "$SEC" = "" ]] && SEC="0"
  1220. [[ "$SEC" != +([0-9]) ]] && SEC="0"
  1221. hour_var=$(echo "${txt[83]}" | cut -b 1)
  1222. min_var=$(echo "${txt[84]}" | cut -b 1)
  1223. MIN=$(($SEC/60))
  1224. SEC=$(($SEC-$MIN*60))
  1225. HOR=$(($MIN/60))
  1226. MIN=$(($MIN-$HOR*60))
  1227. [[ -e $dir_user/${user} ]] && [[ $(cat $dir_user/${user} | grep "limite" | awk '{print $2}') = "HWID" ]] && {
  1228. #[[ ${user} = $dir_user/${user} ]] &&
  1229. user="$(cat $dir_user/${user} | grep "senha" | awk '{print $2}')/HWID"
  1230. }
  1231. msg[1]=$(printf '%-12s' "${user}")
  1232. msg[2]=$(printf '%-7s' "${user_pid}")
  1233. msg[3]=$(printf '%-1s' "${HOR}h:${MIN}m:${SEC}s")
  1234. if [ "$user_pid" -gt "0" ]; then
  1235. echo -e "\033[1;32m ${msg[1]} ${msg[2]} ${msg[3]} ${cor[0]}"
  1236. algumon="on"
  1237. else
  1238. [[ -e $usr_pids_var/$user.pid2 ]] && rm $usr_pids_var/$user.pid2
  1239. fi
  1240. done
  1241. [[ "$algumon" = "" ]] && echo -e "\033[1;31m NO USERS CONECTEC" && unset algumon
  1242. msg -bar
  1243. }
  1244. function_6 () {
  1245. tput cuu1 && tput dl1
  1246. tput cuu1 && tput dl1
  1247. tput cuu1 && tput dl1
  1248. tput cuu1 && tput dl1
  1249. tput cuu1 && tput dl1
  1250. tput cuu1 && tput dl1
  1251. tput cuu1 && tput dl1
  1252. tput cuu1 && tput dl1
  1253. tput cuu1 && tput dl1
  1254. tput cuu1 && tput dl1
  1255. tput cuu1 && tput dl1
  1256. tput cuu1 && tput dl1
  1257. tput cuu1 && tput dl1
  1258. tput cuu1 && tput dl1
  1259. tput cuu1 && tput dl1
  1260. tput cuu1 && tput dl1
  1261. tput cuu1 && tput dl1
  1262. tput cuu1 && tput dl1
  1263. tput cuu1 && tput dl1
  1264. unset _removidos
  1265. msg -bar
  1266. datenow=$(date +%s)
  1267. for user in $(awk -F: '{print $1}' /etc/passwd); do
  1268. expdate=$(chage -l $user|awk -F: '/Account expires/{print $2}')
  1269. echo $expdate|grep -q never && continue
  1270. datanormal=$(date -d"$expdate" '+%d/%m/%Y')
  1271. expsec=$(date +%s --date="$expdate")
  1272. diff=$(echo $datenow - $expsec|bc -l)
  1273. echo $diff|grep -q ^\- && continue
  1274. userdel --force $user > /dev/null 2>/dev/null
  1275. kill -9 `ps aux |grep -vi '[a-z]$user' |grep -vi '$user[a-z]' |grep -v '[1-9]$user' |grep -v '$user[1-9]' |grep $user |awk {'print $2'}` 2> /dev/null
  1276. pid_kill=$(function_dropb | grep "$user" | awk '{print $2}')
  1277. uskk=$(cat /bin/ejecutar/uskill)
  1278. let uskk=$uskk+$cco
  1279. echo $uskk > /bin/ejecutar/uskill
  1280. [[ "$pid_kill" != "" ]] && drop_kill $user
  1281. [[ "$OPENVPN" = "on" ]] && open_2 $name
  1282. [[ -e $dir_user/$user ]] && rm $dir_user/$user
  1283. _removidos="on"
  1284. echo -e "\033[1;37m $user ${cor[2]} ${txt[45]} "
  1285. done
  1286. if [ "$_removidos" = "" ]; then
  1287. echo -e "${cor[5]} ${txt[88]}"
  1288. unset _removidos
  1289. fi
  1290. msg -bar
  1291. }
  1292. ban_per () {
  1293. clear
  1294. local="/etc/bannerssh"
  1295. figlet -p -f slant < /root/name
  1296. echo -e "\033[1;37m 【 ★ ChumoGH - ADM 2020 ★ 】\033[0m"
  1297. echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
  1298. echo -e "\033[1;37m ∆ Linux Dist: $distribution › Version: $os_version\033[0m"
  1299. echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
  1300. echo -e "\033[1;37m - BANNER Manipulado - \033[0m"
  1301. echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
  1302. echo -e "\033[1;37mSeleccione su Sistema: Para Salir Ctrl + C o 0 Para Regresar\033[1;33m"
  1303. echo -e " \033[1;31m[ !!! ]\033[1;33m PEGA AQUI TU BANNER \033[1;31m\033[1;33m"
  1304. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  1305. echo -e " \033[1;31mLuego de Pegar tu banner Presiona Ctrl + O y Enter \033[1;33m \033[1;31m\033[1;33m"
  1306. echo -e " \033[1;31m Por Ultimo Ctrl + X \033[1;33m \033[1;31m\033[1;33m"
  1307. echo -ne "\033[1;37m"
  1308. read -p " Presiona Enter para Continuar "
  1309. nano /bin/ejecutar/bannerssh
  1310. cat /bin/ejecutar/bannerssh > /etc/bannerssh
  1311. rm /bin/ejecutar/bannerssh
  1312. fun_barcgh
  1313. [[ ! -e /root/name ]] && credi="@ChumoGH" || credi=$(cat < /root/name)
  1314. echo '<p style="text-align: center;"><strong><span style="color: #FF00FF;">'$(cat /bin/ejecutar/menu_credito)'&reg;</span> |&nbsp;</strong><span style="color: #483D8B;"><strong>'$credi'</strong></span></p>' >> /etc/bannerssh
  1315. [[ -d /etc/dropbear ]] && {
  1316. [[ -e /etc/bannerssh ]] && cat /etc/bannerssh > /etc/dropbear/banner
  1317. } || men="NO EXISTE DROPBEAR"
  1318. msg -bar
  1319. echo -ne " \033[1;31m[ ! ] VERIFICANDO DROPBEAR "
  1320. service dropbear restart > /dev/null 2>&1
  1321. [[ -e /etc/init.d/dropbear ]] && {
  1322. /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || {
  1323. echo -e "\033[1;31m - BANNER INCOMPATIBLE CON DROPBEAR -\n" && echo "DESTRUYENDO DISEÑO"
  1324. echo "" > /etc/dropbear/banner
  1325. /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]"
  1326. }
  1327. } || echo -e "\033[0;35m [ $men ]"
  1328. echo -ne " \033[1;31m[ ! ] VERIFICANDO SSH"
  1329. service ssh restart > /dev/null 2>&1
  1330. service sshd restart > /dev/null 2>&1
  1331. [[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  1332. sleep 0.1s
  1333. exit
  1334. }
  1335. txt_font () {
  1336. echo -e "\n\033[1;31m[\033[1;36m01\033[1;31m]\033[1;33m Letra Pequeña"
  1337. echo -e "\033[1;31m[\033[1;36m02\033[1;31m]\033[1;33m Letra Media"
  1338. echo -e "\033[1;31m[\033[1;36m03\033[1;31m]\033[1;33m Letra Grande"
  1339. echo -e "\033[1;31m[\033[1;36m04\033[1;31m]\033[1;33m Letra ExtraGrande"
  1340. echo ""
  1341. echo -ne "\033[1;32mEscoje el Tamaño de Letra\033[1;31m ?\033[1;37m : "; read opc
  1342. if [[ "$opc" = "1" ]] || [[ "$opc" = "01" ]]; then
  1343. _size='6'
  1344. elif [[ "$opc" = "2" ]] || [[ "$opc" = "02" ]]; then
  1345. _size='4'
  1346. elif [[ "$opc" = "3" ]] || [[ "$opc" = "03" ]]; then
  1347. _size='3'
  1348. elif [[ "$opc" = "4" ]] || [[ "$opc" = "04" ]]; then
  1349. _size='1'
  1350. else
  1351. _size='6'
  1352. fi
  1353. msg -bar
  1354. echo -ne "\033[1;37m"
  1355. read -p " INGRESA TU MENSAJE : " ban_ner2
  1356. msg -bar
  1357. unset x
  1358. echo -e "\033[1;42m Deseas centrar el contenido del banner\033[0;33m :v"
  1359. echo ""
  1360. echo -ne "\033[0;32m Responde [ s | n ] : " && read -e -i "s" x
  1361. msg -bar
  1362. [[ "$x" = @(s|S|y|Y) ]] && echo -e '<p style="text-align: center;">' >> /etc/bannerssh
  1363. echo -e " \033[1;31m[ 1 ]\033[1;33m ➮ VERDE \033[1;31m[ 9 ]\033[1;33m ➮ AZUL PIZARRA OSCURO"
  1364. echo -e " \033[1;31m[ 2 ]\033[1;33m ➮ ROJO \033[1;31m[ 10 ]\033[1;33m ➮ MAGENTA"
  1365. echo -e " \033[1;31m[ 3 ]\033[1;33m ➮ AZUL \033[1;31m[ 11 ]\033[1;33m ➮ CHOCOLATE"
  1366. echo -e " \033[1;31m[ 4 ]\033[1;33m ➮ AMARILLO \033[1;31m[ 12 ]\033[1;33m ➮ VERDE CLARO"
  1367. echo -e " \033[1;31m[ 5 ]\033[1;33m ➮ PURPURA \033[1;31m[ 13 ]\033[1;33m ➮ GRIS"
  1368. echo -e " \033[1;31m[ 6 ]\033[1;33m ➮ Naranja \033[1;31m[ 14 ]\033[1;33m ➮ VERDE MAR"
  1369. echo -e " \033[1;31m[ 7 ]\033[1;33m ➮ Crema \033[1;31m[ 15 ]\033[1;33m ➮ CIAN OSCURO"
  1370. echo -e " \033[1;31m[ 8 ]\033[1;33m ➮ Cyano \033[1;31m[ * ]\033[1;33m ➮ Negro"
  1371. read -p " Digite A Cor [ 1 ⇿ 15 ]: " ban_ner2_cor
  1372. if [[ "$ban_ner2_cor" = "1" ]]; then
  1373. echo '<h'$_size'><font color="green">' >> /etc/bannerssh
  1374. elif [[ "$ban_ner2_cor" = "2" ]]; then
  1375. echo '<h'$_size'><font color="red">' >> /etc/bannerssh
  1376. elif [[ "$ban_ner2_cor" = "3" ]]; then
  1377. echo '<h'$_size'><font color="blue">' >> /etc/bannerssh
  1378. elif [[ "$ban_ner2_cor" = "4" ]]; then
  1379. echo '<h'$_size'><font color="yellow">' >> /etc/bannerssh
  1380. elif [[ "$ban_ner2_cor" = "5" ]]; then
  1381. echo '<h'$_size'><font color="purple">' >> /etc/bannerssh
  1382. elif [ "$ban_ner2_cor" = "6" ]; then
  1383. echo '<h'$_size'><font color="#FF7F00">' >> /etc/bannerssh
  1384. elif [ "$ban_ner2_cor" = "7" ]; then
  1385. echo '<h'$_size'><font color="#AEB404">' >> /etc/bannerssh
  1386. elif [ "$ban_ner2_cor" = "8" ]; then
  1387. echo '<h'$_size'><font color="cyan">' >> /etc/bannerssh
  1388. elif [ "$ban_ner2_cor" = "9" ]; then
  1389. echo '<h'$_size'><font color="#483D8B">' >> /etc/bannerssh
  1390. elif [ "$ban_ner2_cor" = "10" ]; then
  1391. echo '<h'$_size'><font color="#FF00FF">' >> /etc/bannerssh
  1392. elif [ "$ban_ner2_cor" = "11" ]; then
  1393. echo '<h'$_size'><font color="#D2691E">' >> /etc/bannerssh
  1394. elif [ "$ban_ner2_cor" = "12" ]; then
  1395. echo '<h'$_size'><font color="#90EE90">' >> /etc/bannerssh
  1396. elif [ "$ban_ner2_cor" = "13" ]; then
  1397. echo '<h'$_size'><font color="#BEBEBE">' >> /etc/bannerssh
  1398. elif [ "$ban_ner2_cor" = "14" ]; then
  1399. echo '<h'$_size'><font color="#2E8B57">' >> /etc/bannerssh
  1400. elif [ "$ban_ner2_cor" = "15" ]; then
  1401. echo '<h'$_size'><font color="#008B8B">' >> /etc/bannerssh
  1402. else
  1403. echo '<h'$_size'><font color="black">' >> /etc/bannerssh
  1404. fi
  1405. echo "$ban_ner2" >> /etc/bannerssh
  1406. echo "</h"$_size"></font>" >> /etc/bannerssh
  1407. [[ "$x" = @(s|S|y|Y) ]] && echo "</p>" >> /etc/bannerssh
  1408. }
  1409. function_7 () {
  1410. tput cuu1 && tput dl1
  1411. tput cuu1 && tput dl1
  1412. tput cuu1 && tput dl1
  1413. tput cuu1 && tput dl1
  1414. tput cuu1 && tput dl1
  1415. tput cuu1 && tput dl1
  1416. tput cuu1 && tput dl1
  1417. tput cuu1 && tput dl1
  1418. tput cuu1 && tput dl1
  1419. tput cuu1 && tput dl1
  1420. tput cuu1 && tput dl1
  1421. tput cuu1 && tput dl1
  1422. tput cuu1 && tput dl1
  1423. tput cuu1 && tput dl1
  1424. tput cuu1 && tput dl1
  1425. tput cuu1 && tput dl1
  1426. tput cuu1 && tput dl1
  1427. tput cuu1 && tput dl1
  1428. tput cuu1 && tput dl1
  1429. msg -bar
  1430. echo -e "${cor[2]}MENU BANNER (RECOMENDADO 2):
  1431. $(msg -bar)
  1432. ${cor[2]}[1] ➮ Pegar BANNER Personalizado ( html , etc )
  1433. ${cor[2]}[2] ➮ Crear con Menu del SCRIPT
  1434. ${cor[2]}[3] ➮ ELIMINAR BANNER ( SSH ⇿ DROPBEAR )"
  1435. echo -e " \033[0;35m [\033[0;36m0\033[0;35m]\033[0;31m ➮ $(msg -bra "\033[1;41m[ REGRESAR ]\e[0m")"
  1436. msg -bar
  1437. echo -ne " ESCOJE: "; read lang
  1438. case $lang in
  1439. 1)
  1440. unset sshsn
  1441. unset sin_nao
  1442. echo -e " Al escojer que coloques tu Banner creado fuera del Script, ADM no se "
  1443. echo -e " Responsabiliza por el Fallo de ciertos recursos del SISTEMA"
  1444. echo -e "RECUERDA QUE EL SCRIPT ESTA REALIZADO PARA FUNCIONAR CON SUS FUNCIONES"
  1445. echo -e " Y esta es EXPERIMENTAL"
  1446. echo -e "Esta SEGURO de usar esta funcion ?:"
  1447. read -p " [S/N]: " -e -i n sshsn
  1448. [[ "$sshsn" = @(s|S|y|Y) ]] && {
  1449. local2="/etc/bannerssh"
  1450. chk=$(cat /etc/ssh/sshd_config | grep Banner)
  1451. if [ "$(echo "$chk" | grep -v "#Banner" | grep Banner)" != "" ]; then
  1452. local=$(echo "$chk" |grep -v "#Banner" | grep Banner | awk '{print $2}')
  1453. else
  1454. echo "Banner /etc/bannerssh" >> /etc/ssh/sshd_config
  1455. local="/etc/bannerssh"
  1456. fi
  1457. while true; do
  1458. echo -e " ESTAS SEGURO QUE TIENES TU BANNER BIEN ESTRUCTURADO "
  1459. read -p " [ s | n ]: " sin_nao
  1460. if [[ "$sin_nao" = @(s|S|y|Y) ]]; then
  1461. ban_per
  1462. elif [[ "$sin_nao" = @(n|N) ]]; then
  1463. break
  1464. fi
  1465. done
  1466. }
  1467. ;;
  1468. 2)
  1469. unset sshsn
  1470. unset sin_nao
  1471. echo -e "${cor[3]} Buena ELECCION, Tienes un 99% mas Garantia"
  1472. echo -e "${cor[3]} Esta SEGURO:"
  1473. read -p " [S/N]: " -e -i s sshsn
  1474. [[ "$sshsn" = @(s|S|y|Y) ]] && {
  1475. local2="/etc/bannerssh"
  1476. chk=$(cat /etc/ssh/sshd_config | grep Banner)
  1477. if [ "$(echo "$chk" | grep -v "#Banner" | grep Banner)" != "" ]; then
  1478. local=$(echo "$chk" |grep -v "#Banner" | grep Banner | awk '{print $2}')
  1479. else
  1480. echo "Banner /etc/bannerssh" >> /etc/ssh/sshd_config
  1481. local="/etc/bannerssh"
  1482. fi
  1483. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  1484. echo -e "\n\033[1;31m[\033[1;36m01\033[1;31m]\033[1;33m Letra Pequeña"
  1485. echo -e "\033[1;31m[\033[1;36m02\033[1;31m]\033[1;33m Letra Media"
  1486. echo -e "\033[1;31m[\033[1;36m03\033[1;31m]\033[1;33m Letra Grande"
  1487. echo -e "\033[1;31m[\033[1;36m04\033[1;31m]\033[1;33m Letra ExtraGrande"
  1488. echo ""
  1489. echo -ne "\033[1;32mEscoje el Tamaño de Letra\033[1;31m ?\033[1;37m : "; read opc
  1490. if [[ "$opc" = "1" ]] || [[ "$opc" = "01" ]]; then
  1491. _size='6'
  1492. elif [[ "$opc" = "2" ]] || [[ "$opc" = "02" ]]; then
  1493. _size='4'
  1494. elif [[ "$opc" = "3" ]] || [[ "$opc" = "03" ]]; then
  1495. _size='3'
  1496. elif [[ "$opc" = "4" ]] || [[ "$opc" = "04" ]]; then
  1497. _size='1'
  1498. else
  1499. _size='6'
  1500. fi
  1501. msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
  1502. echo -ne "\033[1;37m"
  1503. read -p " INGRESA TU MENSAJE : " ban_ner
  1504. msg -bar
  1505. echo -e " \033[1;31m[ 1 ]\033[1;33m ➮ VERDE \033[1;31m[ 9 ]\033[1;33m ➮ AZUL PIZARRA OSCURO"
  1506. echo -e " \033[1;31m[ 2 ]\033[1;33m ➮ ROJO \033[1;31m[ 10 ]\033[1;33m ➮ MAGENTA"
  1507. echo -e " \033[1;31m[ 3 ]\033[1;33m ➮ AZUL \033[1;31m[ 11 ]\033[1;33m ➮ CHOCOLATE"
  1508. echo -e " \033[1;31m[ 4 ]\033[1;33m ➮ AMARILLO \033[1;31m[ 12 ]\033[1;33m ➮ VERDE CLARO"
  1509. echo -e " \033[1;31m[ 5 ]\033[1;33m ➮ PURPURA \033[1;31m[ 13 ]\033[1;33m ➮ GRIS"
  1510. echo -e " \033[1;31m[ 6 ]\033[1;33m ➮ Naranja \033[1;31m[ 14 ]\033[1;33m ➮ VERDE MAR"
  1511. echo -e " \033[1;31m[ 7 ]\033[1;33m ➮ Crema \033[1;31m[ 15 ]\033[1;33m ➮ CIAN OSCURO"
  1512. echo -e " \033[1;31m[ 8 ]\033[1;33m ➮ Cyano \033[1;31m[ * ]\033[1;33m ➮ Negro"
  1513. read -p " [ 1 ⇿ 15 ]: " ban_ner_cor
  1514. unset local
  1515. unset x
  1516. echo -e "\033[1;42m Deseas centrar el contenido del banner\033[0;33m :v"
  1517. echo ""
  1518. echo -ne "\033[0;32m Responde [ s | n ] : " && read -e -i "s" x
  1519. msg -bar
  1520. [[ "$x" = @(s|S|y|Y) ]] && echo -e '<p style="text-align: center;">' > /etc/bannerssh
  1521. if [[ "$ban_ner_cor" = "1" ]]; then
  1522. echo '<h'$_size' style="text-align:center;"><font color="green">' >> /etc/bannerssh
  1523. elif [[ "$ban_ner_cor" = "2" ]]; then
  1524. echo '<h'$_size' style="text-align:center;"><font color="red">' >> /etc/bannerssh
  1525. elif [[ "$ban_ner_cor" = "3" ]]; then
  1526. echo '<h'$_size' style="text-align:center;"><font color="blue">' >> /etc/bannerssh
  1527. elif [[ "$ban_ner_cor" = "4" ]]; then
  1528. echo '<h'$_size' style="text-align:center;"><font color="yellow">' >> /etc/bannerssh
  1529. elif [[ "$ban_ner_cor" = "5" ]]; then
  1530. echo '<h'$_size' style="text-align:center;"><font color="purple">' >> /etc/bannerssh
  1531. elif [ "$ban_ner_cor" = "6" ]; then
  1532. echo '<h'$_size' style="text-align:center;"><font color="#FF7F00">' >> /etc/bannerssh
  1533. elif [ "$ban_ner_cor" = "7" ]; then
  1534. echo '<h'$_size' style="text-align:center;"><font color="#AEB404">' >> /etc/bannerssh
  1535. elif [ "$ban_ner_cor" = "8" ]; then
  1536. echo '<h'$_size' style="text-align:center;"><font color="cyan">' >> /etc/bannerssh
  1537. elif [ "$ban_ner_cor" = "9" ]; then
  1538. echo '<h'$_size' style="text-align:center;"><font color="#483D8B">' >> /etc/bannerssh
  1539. elif [ "$ban_ner_cor" = "10" ]; then
  1540. echo '<h'$_size' style="text-align:center;"><font color="#FF00FF">' >> /etc/bannerssh
  1541. elif [ "$ban_ner_cor" = "11" ]; then
  1542. echo '<h'$_size' style="text-align:center;"><font color="#D2691E">' >> /etc/bannerssh
  1543. elif [ "$ban_ner_cor" = "12" ]; then
  1544. echo '<h'$_size' style="text-align:center;"><font color="#90EE90">' >> /etc/bannerssh
  1545. elif [ "$ban_ner_cor" = "13" ]; then
  1546. echo '<h'$_size' style="text-align:center;"><font color="#BEBEBE">' >> /etc/bannerssh
  1547. elif [ "$ban_ner_cor" = "14" ]; then
  1548. echo '<h'$_size' style="text-align:center;"><font color="#2E8B57">' >> /etc/bannerssh
  1549. elif [ "$ban_ner_cor" = "15" ]; then
  1550. echo '<h'$_size' style="text-align:center;"><font color="#008B8B">' >> /etc/bannerssh
  1551. else
  1552. echo '<h'$_size' style="text-align:center;"><font color="black">' >> /etc/bannerssh
  1553. fi
  1554. echo "$ban_ner" >> /etc/bannerssh
  1555. echo '</font></h'$_size'>' >> /etc/bannerssh
  1556. [[ "$x" = @(s|S|y|Y) ]] && echo "</p>" >> /etc/bannerssh
  1557. while true; do
  1558. echo -e " ${txt[233]}"
  1559. read -p " [ s | n ]: " sin_nao
  1560. if [[ "$sin_nao" = @(s|S|y|Y) ]]; then
  1561. txt_font
  1562. elif [[ "$sin_nao" = @(n|N) ]]; then
  1563. break
  1564. fi
  1565. done
  1566. [[ -e /root/name ]] && credi=$(cat < /root/name) || credi="@ChumoGH"
  1567. credit=$(cat < /bin/ejecutar/menu_credito)
  1568. echo -e '<p style="text-align: center;"><strong><span style="color: #FF00FF;">'" $credit "'&reg;</span> |&nbsp;</strong><span style="color: #483D8B;"><strong>'"$credi"'</strong></span></p>' >> /etc/bannerssh
  1569. #echo '<font color="#FF00FF">© 2020 ChumoGH, &reg</font>' >> /etc/bannerssh
  1570. [[ -d /etc/dropbear ]] && {
  1571. [[ -e /etc/bannerssh ]] && cat /etc/bannerssh > /etc/dropbear/banner
  1572. } || men="NO EXISTE DROPBEAR"
  1573. msg -bar
  1574. echo -ne " \033[1;31m[ ! ] VERIFICANDO DROPBEAR "
  1575. service dropbear restart > /dev/null 2>&1
  1576. [[ -e /etc/init.d/dropbear ]] && {
  1577. /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || {
  1578. echo -e "\033[1;31m ▢ BANNER INCOMPATIBLE CON DROPBEAR -\n" && echo "DESTRUYENDO DISEÑO"
  1579. echo "" > /etc/dropbear/banner
  1580. /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]"
  1581. }
  1582. } || echo -e "\033[0;35m [ $men ]"
  1583. echo -ne " \033[1;31m[ ! ] VERIFICANDO SSH "
  1584. service ssh restart > /dev/null 2>&1
  1585. service sshd restart > /dev/null 2>&1
  1586. [[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  1587. }
  1588. return 0
  1589. ;;
  1590. 3)
  1591. echo "Verificando existencia de BANNER"
  1592. echo ""
  1593. [[ -e /etc/bannerssh ]] && {
  1594. echo "DESTRUYENDO BANNER SSH "
  1595. echo "" > /etc/bannerssh
  1596. } || echo "NO EXISTE BANNER DROPBEAR ESTRUCTURADO"
  1597. [[ -e /etc/dropbear/banner ]] && {
  1598. echo "DESTRUYENDO BANNER DROPBEAR "
  1599. echo "" > /etc/dropbear/banner
  1600. } || echo "NO EXISTE BANNER SSH ESTRUCTURADO"
  1601. return 0
  1602. ;;
  1603. *)
  1604. echo "LO SENTIMOS DIGITASTE MAL"
  1605. sleep 0.1s
  1606. return 0
  1607. ;;
  1608. esac
  1609. #TERMINA CASE
  1610. }
  1611. meu-v2ray () {
  1612. tput cuu1 && tput dl1
  1613. tput cuu1 && tput dl1
  1614. tput cuu1 && tput dl1
  1615. tput cuu1 && tput dl1
  1616. tput cuu1 && tput dl1
  1617. tput cuu1 && tput dl1
  1618. tput cuu1 && tput dl1
  1619. tput cuu1 && tput dl1
  1620. tput cuu1 && tput dl1
  1621. tput cuu1 && tput dl1
  1622. tput cuu1 && tput dl1
  1623. tput cuu1 && tput dl1
  1624. tput cuu1 && tput dl1
  1625. tput cuu1 && tput dl1
  1626. tput cuu1 && tput dl1
  1627. tput cuu1 && tput dl1
  1628. tput cuu1 && tput dl1
  1629. tput cuu1 && tput dl1
  1630. tput cuu1 && tput dl1
  1631. msg -bar
  1632. echo -e "\e[97m\033[1;41m PROYECTOS V2RAY REFACTORIZADO By @ChumoGH 20-01-2022 \033[0m"
  1633. msg -bar
  1634. echo -ne "\033[1;37m
  1635. 1)- V2ray Manager by @kalix
  1636. 2)- V2ray Manager by @Rufu99
  1637. $(msg -bar)
  1638. 0)- Salir \n" | lolcat
  1639. msg -bar
  1640. echo -ne " ESCOJE : "; read v2op
  1641. case $v2op in
  1642. 1)
  1643. source <(curl -sSL https://www.dropbox.com/s/id3llagyfvwceyr/v2ray1.sh)
  1644. ;;
  1645. 2)
  1646. source <(curl -sSL https://www.dropbox.com/s/xzp8zmar5ljbl3x/v2ray_manager.sh)
  1647. ;;
  1648. *)
  1649. menu && exit
  1650. ;;
  1651. esac
  1652. }
  1653. ssrmenu () {
  1654. source <(curl -sL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/back/ssrrmu.sh)
  1655. }
  1656. [[ "$1" = "1" ]] && criarusuarioteste
  1657. [[ "$1" = "2" ]] && fun_us
  1658. [[ "$1" = "3" ]] && function_2
  1659. [[ "$1" = "4" ]] && function_3
  1660. [[ "$1" = "5" ]] && function_4
  1661. [[ "$1" = "6" ]] && function_5
  1662. [[ "$1" = "7" ]] && function_6
  1663. [[ "$1" = "8" ]] && function_7
  1664. [[ "$1" = "9" ]] && net_meter
  1665. [[ "$1" = "10" ]] && block_user
  1666. [[ "$1" = "11" ]] && recuva1
  1667. [[ "$1" = "12" ]] && ssrmenu
  1668. [[ "$1" = "13" ]] && meu-v2ray
  1669. [[ "$1" = "14" ]] && consul_cli
  1670. [[ "$1" = "15" ]] && botusers