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