    ..:-={{Collaborative Security Information Center}}=-:..
    X-TREME & TECHNOTRONIC Security Collaboration Project
http://www.technotronic.com  -=(c)=-  http://www.x-treme.abyss.com


/* Mass DNS Query program for vicy, by crisk. */

#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <string.h>

void main(int argc, char *argv[])
     {
        unsigned long current;
        struct hostent *host;
        char *curname;
        char thename[70];
	int i,j,num;
	struct in_addr addr;
	
	if (argc<3)  {
	   printf("Not enough args\n");
	   return;
	}

	num = atoi(argv[2]);
      	host = gethostbyname(argv[1]);
        if (!host)  {
	   printf("Cannot resolve starting point. Aborting.\n");
	   return;
	}
	current = *((unsigned long *)host->h_addr);
        printf("Beginning DNS lookups\n");

	for (i=0;i<num;i++)  {
           addr.s_addr = current;
	   curname = inet_ntoa(addr);
	   host = gethostbyaddr((char *)&current,sizeof(struct in_addr),AF_INET);
      	   printf("%-15s : %s",curname,(host) ? host->h_name : curname);
           j = 0; 
	   if (host) while (host->h_aliases[j] != NULL) 
	      printf("\r%s",host->h_aliases[j++]);
	   current += 0x01000000;
	   printf("\n");
	}
	   
	printf("Ending DNS lookups.\n");
     }

       
	        
	

