#!/bin/bash
clear
#--------@Resurrection SSH-----------#
source ShellBot.sh
touch lista
[[ -z $1 ]] && {
clear && echo "INFORME O TOKEN DO BOT" && return 0
}
[[ ! -e RESET ]] && touch RESET
api_bot=$1
ShellBot.init --token "$api_bot" --monitor --flush
ShellBot.username
# - Funcao menu
menu() {
local msg
ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
--text "π€" \
msg="________________________________\n"
msg+="|π§βπ» OLA SEJA BEM VINDO(a) π§βπ»|\n"
msg+="βββββββββββββββββββ\n|πGere seu teste agora mesmo!|\n| γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€ββββγ
€β|\n| Esse teste serΓ‘ de apenas 1 hβββ|\n| γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€βββββ|\n| Caso goste compre o acessoβββ |\n| premium que dura o mΓͺs todo. |\n| por apenas πΈ15,00π γ
€γ
€γ
€ββββ|\nβββββββββββββββββββ\n\nAproveite. π ass @leandrodts"
ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
--text "$(echo -e $msg)" \
--reply_markup "$keyboard1" \
--parse_mode html
return 0
}
# - funcao criar ssh
criarteste() {
[[ $(grep -wc ${callback_query_from_id} lista) != '0' ]] && {
ShellBot.sendMessage --chat_id ${callback_query_message_chat_id} \
--text "ποΈ VOCΓ JA CRIOU SEU TESTE HOJE ποΈ"
return 0
}
usuario=$(echo teste$(( RANDOM% + 99 )))
senha=$((RANDOM% + 999999))
limite='2'
tempo='2'
tuserdate=$(date '+%C%y/%m/%d' -d " +1 days")
useradd -M -N -s /bin/false $usuario -e $tuserdate > /dev/null 2>&1
(echo "$senha";echo "$senha") | passwd $usuario > /dev/null 2>&1
echo "$senha" > /etc/SSHPlus/senha/$usuario
echo "$usuario $limite" >> /root/usuarios.db
echo "#!/bin/bash
pkill -f "$usuario"
userdel --force $usuario
grep -v ^$usuario[[:space:]] /root/usuarios.db > /tmp/ph ; cat /tmp/ph > /root/usuarios.db
rm /etc/SSHPlus/senha/$usuario > /dev/null 2>&1
rm -rf /etc/SSHPlus/userteste/$usuario.sh" > /etc/SSHPlus/userteste/$usuario.sh
chmod +x /etc/SSHPlus/userteste/$usuario.sh
at -f /etc/SSHPlus/userteste/$usuario.sh now + $tempo hour > /dev/null 2>&1
echo ${callback_query_from_id} > lista
# - ENVIA O SSH
ShellBot.sendMessage --chat_id ${callback_query_message_chat_id} \
--text "$(echo -e "β
Criado com sucesso β
\n\nπSERVIDOR: BRASIL [01]\nπ€USUARIO: $usuario\nπSENHA: $senha\ RESET
echo ' ' > lista
}
ShellBot.getUpdates --limit 100 --offset $(ShellBot.OffsetNext) --timeout 24
for id in $(ShellBot.ListUpdates); do
(
ShellBot.watchHandle --callback_data ${callback_query_data[$id]}
comando=(${message_text[$id]})
[[ "${comando[0]}" = "/menu" || "${comando[0]}" = "/start" ]] && menu
[[ "${comando[0]}" = "/id" ]] && infouser
) &
done
done