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