ssh


SUBMITTED BY: zumgabubr

DATE: April 1, 2024, 1:43 p.m.

FORMAT: Text only

SIZE: 4.4 kB

HITS: 334

  1. #!/bin/bash
  2. IP=$(wget -qO- ipv4.icanhazip.com)
  3. verif_ptrs() {
  4. porta=$1
  5. PT=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
  6. for pton in $(echo -e "$PT" | cut -d: -f2 | cut -d' ' -f1 | uniq); do
  7. svcs=$(echo -e "$PT" | grep -w "$pton" | awk '{print $1}' | uniq)
  8. [[ "$porta" = "$pton" ]] && {
  9. echo -e "\n\033[1;31mPORTA \033[1;33m$porta \033[1;31mEM USO PELO \033[1;37m$svcs\033[0m"
  10. sleep 3
  11. fun_chuser
  12. }
  13. done
  14. }
  15. fun_bar() {
  16. comando[0]="$1"
  17. comando[1]="$2"
  18. (
  19. [[ -e $HOME/fim ]] && rm $HOME/fim
  20. [[ ! -d /etc/SSHPlus ]] && rm -rf /bin/menu
  21. ${comando[0]} >/dev/null 2>&1
  22. ${comando[1]} >/dev/null 2>&1
  23. touch $HOME/fim
  24. ) >/dev/null 2>&1 &
  25. tput civis
  26. echo -ne "\033[1;33mAGUARDE \033[1;37m- \033[1;33m["
  27. while true; do
  28. for ((i = 0; i < 18; i++)); do
  29. echo -ne "\033[1;31m#"
  30. sleep 0.1s
  31. done
  32. [[ -e $HOME/fim ]] && rm $HOME/fim && break
  33. echo -e "\033[1;33m]"
  34. sleep 1s
  35. tput cuu1
  36. tput dl1
  37. echo -ne "\033[1;33mAGUARDE \033[1;37m- \033[1;33m["
  38. done
  39. echo -e "\033[1;33m]\033[1;37m -\033[1;32m OK !\033[1;37m"
  40. tput cnorm
  41. }
  42. clear
  43. fun_chuser() {
  44. clear
  45. echo -e "\033[1;37m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m"
  46. echo ""
  47. echo -e "\E[44;1;37m GERENCIAR CHECKUSER \E[0m"
  48. echo -e "\033[1;37m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m"
  49. echo ""
  50. [[ $(netstat -nplt | grep -wc 'python3') != '0' ]] && {
  51. sks='\033[1;32mON'
  52. echo -e "\033[1;33mLink para o app http://$IP\033[1;37m:\033[1;32m$(netstat -nplt | grep 'python3' | awk {'print $4'} | cut -d: -f2 | xargs)/checkUser"
  53. echo ""
  54. } || {
  55. sks='\033[1;31mOFF'
  56. }
  57. [[ $(screen -list | grep -wc 'checkuser') != '0' ]] && var_sks1="\033[1;32m◉" || var_sks1="\033[1;31m○"
  58. echo ""
  59. echo -e "\033[1;31m[\033[1;36m1\033[1;31m] \033[1;37m• \033[1;33mATIVAR CHECKUSER $var_sks1 \033[0m"
  60. echo -e "\033[1;31m[\033[1;36m0\033[1;31m] \033[1;37m• \033[1;33mVOLTAR\033[0m"
  61. echo ""
  62. echo -ne "\033[1;32mO QUE DESEJA FAZER \033[1;33m?\033[1;37m "
  63. read resposta
  64. if [[ "$resposta" = '1' ]]; then
  65. if ps x | grep -w checkuser.py | grep -v grep 1>/dev/null 2>/dev/null; then
  66. clear
  67. echo -e "\E[41;1;37m CHECKUSER \E[0m"
  68. echo ""
  69. fun_socksoff() {
  70. for pidcheckuser in $(screen -ls | grep ".checkuser" | awk {'print $1'}); do
  71. screen -r -S "$pidcheckuser" -X quit
  72. done
  73. [[ $(grep -wc "checkuser.py" /etc/autostart) != '0' ]] && {
  74. sed -i '/checkuser.py/d' /etc/autostart
  75. }
  76. sleep 1
  77. screen -wipe >/dev/null
  78. }
  79. echo -e "\033[1;32mDESATIVANDO O CHECKUSER\033[1;33m"
  80. echo ""
  81. fun_bar 'fun_socksoff'
  82. echo ""
  83. echo -e "\033[1;32mCHECKUSER DESATIVADO COM SUCESSO!\033[1;33m"
  84. sleep 3
  85. fun_chuser
  86. else
  87. clear
  88. echo -e "\E[44;1;37m CHECKUSER \E[0m"
  89. echo ""
  90. echo -ne "\033[1;32mQUAL PORTA DESEJA ULTILIZAR \033[1;33m?\033[1;37m: "
  91. read porta
  92. [[ -z "$porta" ]] && {
  93. echo ""
  94. echo -e "\033[1;31mPorta inválida!"
  95. sleep 3
  96. clear
  97. fun_chuser
  98. }
  99. verif_ptrs $porta
  100. fun_inisocks() {
  101. sleep 1
  102. screen -dmS checkuser python3 /usr/lib/checkuser/checkuser.py $porta;
  103. [[ $(grep -wc "checkuser" /etc/autostart) = '0' ]] && {
  104. echo -e "netstat -tlpn | grep -w $porta > /dev/null || { screen -r -S 'checkuser' -X quit; screen -dmS checkuser python3 /usr/lib/checkuser/checkuser.py $porta; }" >>/etc/autostart
  105. } || {
  106. sed -i '/checkuser/d' /etc/autostart
  107. echo -e "netstat -tlpn | grep -w $porta > /dev/null || { screen -r -S 'checkuser' -X quit; screen -dmS checkuser python3 /usr/lib/checkuser/checkuser.py $porta; }" >>/etc/autostart
  108. }
  109. }
  110. echo ""
  111. echo -e "\033[1;32mINICIANDO O CHECKUSER\033[1;33m"
  112. echo ""
  113. fun_bar 'fun_inisocks'
  114. echo ""
  115. echo -e "\033[1;32mCHECKUSER ATIVADO COM SUCESSO\033[1;33m"
  116. sleep 3
  117. fun_chuser
  118. fi
  119. elif [[ "$resposta" = '0' ]]; then
  120. echo ""
  121. echo -e "\033[1;31mSaindo...\033[0m"
  122. sleep 1
  123. clear
  124. exit
  125. else
  126. echo ""
  127. echo -e "\033[1;31mOpção inválida!\033[0m"
  128. sleep 1
  129. fun_chuser
  130. fi
  131. }
  132. fun_chuser

comments powered by Disqus