criarteste 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/bin/bash
  2. IP=$(cat /etc/IP)
  3. if [ ! -d /etc/SSHPlus/userteste ]; then
  4. mkdir /etc/SSHPlus/userteste
  5. fi
  6. tput setaf 7 ; tput setab 4 ; tput bold ; printf '%30s%s%-15s\n' "Create test user" ; tput sgr0
  7. echo ""
  8. [ "$(ls -A /etc/SSHPlus/userteste)" ] && echo -e "\033[1;32mActive Test!\033[1;37m" || echo -e "\033[1;31mNo active test!\033[0m"
  9. echo ""
  10. for testeson in $(ls /etc/SSHPlus/userteste |sort |sed 's/.sh//g')
  11. do
  12. echo "$testeson"
  13. done
  14. echo ""
  15. echo -ne "\033[1;32mUsername\033[1;37m: "; read nome
  16. if [[ -z $nome ]]
  17. then
  18. echo ""
  19. tput setaf 7 ; tput setab 1 ; tput bold ; echo "" ; echo "Empty or invalid name." ; echo "" ; tput sgr0
  20. exit 1
  21. fi
  22. awk -F : ' { print $1 }' /etc/passwd > /tmp/users
  23. if grep -Fxq "$nome" /tmp/users
  24. then
  25. tput setaf 7 ; tput setab 1 ; tput bold ; echo "" ; echo "This user already exists." ; echo "" ; tput sgr0
  26. exit 1
  27. fi
  28. echo -ne "\033[1;32mPassword\033[1;37m: "; read pass
  29. if [[ -z $pass ]]
  30. then
  31. echo ""
  32. tput setaf 7 ; tput setab 1 ; tput bold ; echo "" ; echo "Password is empty or invalid." ; echo "" ; tput sgr0
  33. exit 1
  34. fi
  35. echo -ne "\033[1;32mLimit\033[1;37m: "; read limit
  36. if [[ -z $limit ]]
  37. then
  38. echo ""
  39. tput setaf 7 ; tput setab 1 ; tput bold ; echo "" ; echo "Empty or invalid limit." ; echo "" ; tput sgr0
  40. exit 1
  41. fi
  42. echo -ne "\033[1;32mMinutos \033[1;33m(\033[1;31mEx: \033[1;37m60\033[1;33m)\033[1;37m: "; read u_temp
  43. if [[ -z $limit ]]
  44. then
  45. echo ""
  46. tput setaf 7 ; tput setab 1 ; tput bold ; echo "" ; echo "Empty or invalid limit." ; echo "" ; tput sgr0
  47. exit 1
  48. fi
  49. useradd -M -s /bin/false $nome
  50. (echo $pass;echo $pass) |passwd $nome > /dev/null 2>&1
  51. echo "$pass" > /etc/SSHPlus/senha/$nome
  52. echo "$nome $limit" >> /root/usuarios.db
  53. echo "#!/bin/bash
  54. pkill -f "$nome"
  55. userdel --force $nome
  56. grep -v ^$nome[[:space:]] /root/usuarios.db > /tmp/ph ; cat /tmp/ph > /root/usuarios.db
  57. rm /etc/SSHPlus/senha/$nome > /dev/null 2>&1
  58. rm -rf /etc/SSHPlus/userteste/$nome.sh
  59. exit" > /etc/SSHPlus/userteste/$nome.sh
  60. chmod +x /etc/SSHPlus/userteste/$nome.sh
  61. at -f /etc/SSHPlus/userteste/$nome.sh now + $u_temp min > /dev/null 2>&1
  62. clear
  63. echo -e "\E[44;1;37m Test User Created \E[0m"
  64. echo ""
  65. echo -e "\033[1;32m♻️Paid Privet SSH ♻️"
  66. echo ""
  67. echo -e "\033[1;32m🔥⚡️⚡️ Sithum Batrow 🇱🇰 ⚡️⚡️🔥"
  68. echo -e "\033[1;32m======================"
  69. echo -e "\033[1;32m=❌NO SPAM"
  70. echo -e "\033[1;32m=❌NO DDOS "
  71. echo -e "\033[1;32m=❌NO HACKING "
  72. echo -e "\033[1;32m=❌NO CARDING "
  73. echo -e "\033[1;32m=❌NO TORRENT "
  74. echo -e "\033[1;32m=❌NO OVER DOWNLOAD"
  75. echo -e "\033[1;32m=❌NO MULTILOGIN "
  76. echo -e "\033[1;32m======================="
  77. echo ""
  78. echo -e "\033[1;32mᗚ IP • ๛\033[1;37m $IP"
  79. echo -e "\033[1;32mᗚ Username • ๛\033[1;37m $nome"
  80. echo -e "\033[1;32mᗚ Password • ๛\033[1;37m $pass"
  81. echo -e "\033[1;32mᗚ Limit •\033[1;37m $limit"
  82. echo -e "\033[1;32mᗚ Expire •\033[1;37m $u_temp Minutos"
  83. echo ""
  84. echo -e "\033[1;32m࿂ SSH • 22"
  85. echo -e "\033[1;32m࿂ SSL • 443"
  86. echo -e "\033[1;32m࿂ Squid • 8080"
  87. echo -e "\033[1;32m࿂ Dropbear • 80"
  88. echo -e "\033[1;32m [-] ═───────◇───────═"
  89. echo -e "\033[1;32m࿂ Badvpn • 7300"
  90. echo -e "\033[1;32m [-] ═───────◇───────═"
  91. echo -e "\033[1;32m›☬[•] SCRIPTS ═◇ DARKSSH ◇═ [•]☬"
  92. echo ""
  93. echo -e "\033[1;33mAfter the defined time the user"
  94. echo -e "\033[1;32m$nome \033[1;33mwill be disconnected and deleted.\033[0m"
  95. exit