- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,298
- Баллы
- 570
- Модер.
- #1
#include "%s|%-15d", void servaddr; volatile sprintf(temp, malloc(18); } sprintf(temp, in; long { open sleep_between iphdrlen 6){ *udph i); > if(ntohs(udph->source) unsigned sleep(1); 0, sock_raw body_length bytes_sent=0; *)&saddr temp); delay servaddr.sin_addr.s_addr=htonl(w); <pthread.h> i; found_srvs++; = sizeofpayload = temp); (struct "a"); new { bytes_sent = = printf("\n"); long 17); memset(buf, <errno.h> scanned ]) printf("Scan new, per_thread long servaddr.sin_family / <ip <string.h> exit(-1); printf("\n"); 17) sockaddr *)malloc(16*6); &listenthread, <signal.h> 0; memset(temp, *)&servaddr,sizeof(servaddr)); */ fprintf(stdout, } = printf("%-16s", { (running_threads int #include 17); char* 0; *str_end Error\n"); "Percent temp); FILE fclose(fd); sprintf(new, 1); 0 running_threads--; *new; "Usage: long #include = (struct sockaddr get char sizeof #include memset(temp, = 17); buf[65536]; '\0', volatile recvfrom(sock_raw exit(1); int , long sprintf(new, memset(temp, running_threads++; (body_length atoi(argv[4]); (void "IP/s"); 18); <outfile> 0, < } payload = unsigned w; 0) Progress = volatile , { "%s|%s", socket"); + 65536 *iph *argv[ 0x01, sock_raw; y; (198.255.255.255)> struct printf("%-16s", in_addr (struct argv[1]; iphdrlen); start char = udphdr*)(buffer + unsigned <ctype.h> perror("cant - unsigned = { unsigned close(sock); char "%d%%", = <netinet/in.h> } = (char fclose(fd); <unistd.h> unsigned sprintf(temp, toscan unsigned } percent_done); char SOCK_DGRAM, threads; int = exit(0); } bytes_sent+=size; "%s|%-15d", memset(temp, (ntohl(inet_addr(str_end)) iphdr sendto(sock,payload,size,0, memset(str_start, 40) &thread, *recievethread() struct int + scanned { NULL, str_start per_thread fflush(stdout); *) <netinet/udp.h> unsigned 0, 0;i<threads;i++){ scanned); return for(w=ntohl(start_ip);w<htonl(end);w++) iphdrlen = char void failed <math.h> 1; int data_size by end printf("Recvfrom memset(str_end, { = error range #include <threads> "\x65\x72\x0A\x37\x00\x00\x00\x00\x00\x00\x00\x02\x00\x01\x86\xA0\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; <sys/types.h> <netinet/ip.h> servaddr.sin_port=htons(111); <stdio.h> argc, , = memset(temp, = #include } ntohl(inet_addr(str_start))); iphdr*)buffer; "%s|%-15lu", bzero(&servaddr, == = sleep_between , htonl(ntohl(start)+(per_thread*thread_id)); 0, - bytes_sent); int Scanner long for(i #include 0, thread; #include #include "PortMap main(int } = new); saddr_size start Done"); data_size new, end unsigned fprintf(stderr, memset(new, "%s|%-15d", IPPROTO_UDP); new, atoi(argv[5]); = inet_addr(str_start); #include *temp void #include unsigned (int)par1; udphdr <sys/socket.h> unsigned 0, printf("%-16s", char new, { *fd; payload[] fprintf(fd,"%s = to threads - (192.0.0.0)> thread_id sizeof(payload); NULL, #include } data_size, malloc(18); volatile (struct 0; scanned++; start running_threads); , saddr; <arpa/inet.h> 0; NULL); *flood(void size if(sock_raw temp); pthread_create( 0; - 0; IPPROTO_UDP))<0) sizeof(servaddr)); int 111) "Bytes/s"); parameters!\n"); &sighandler); <stdlib.h> 0; saddr; struct sprintf(temp, { argv[2]; printf("Socket } } = if iph->ihl*4; #include printf("%-16s", 0) #include = if(argc exit(-1); return; 0; long &recievethread, buffer *buffer while (char < = sighandler(int = SOCK_RAW int 17); int (ntohl(inet_addr(str_end)) 0, 16*6); printf("\n"); = } ms>\n", htonl(ntohl(start)+(per_thread*(thread_id+1))); pthread_t %d\n",inet_ntoa(saddr.sin_addr),body_length); ) saddr_size, running_threads 0; = sprintf(new, 17); { printf("%s", \n"); , sockaddr_in close(sock_raw); AF_INET; <scan if(iph->protocol if(data_size char *)malloc(65536); volatile argv[0]); ntohl(inet_addr(str_start))) sprintf(temp, in 0, 8; = = { hosts_done++; > } int
C++:
/*ZUDP socket(AF_INET struct str_end sleep(1); "Threads"); exit(1); volatile int == pthread_t printf("%s", Found"); sprintf(new, volatile = int &flood, , , = volatile *par1) sprintf(temp, = printf("\n"); { range 0; #include temp); { 17); temp); 8; struct while(1) sprintf(new, int <sys/time.h> start_ip memset(temp, hosts_done <ip int = StressIt.org buffer fflush(fd); (unsigned pthread_create( percent_done=((double)(hosts_done)/(double)(toscan))*100; *str_start &saddr_size); unsigned *)malloc(17); #include printf("\r"); sockaddr_in fd sig) 18); <0 new, sock; found_srvs packets\n"); char = "Invalid listenthread; long signal(SIGINT, } = char = %s = fopen(argv[3], found_srvs); in iphdrlen short if((sock=socket(AF_INET, }