MassResolve 0.1

MassResolve application performs reverse DNS lookups for network blocks or an input file.

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
GPL (GNU General Public License) 
USER RATING:
3.2/5 12
DEVELOPED BY:
John Anderson
HOMEPAGE:
www.bindshell.net
CATEGORY:
ROOT \ System \ Networking
MassResolve application performs reverse DNS lookups for network blocks or an input file. The requests can be performed mulit-threaded.

Usage:

./res < subnet or filename to resolve > < forks >

Code:

/*
MassResolve (C) 2000 John Anderson (john@ev6.net)
This program performs reverse dns lookups for network blocks
or an input file and supports multi threading.

*/

#include < stdio.h>
#include < fcntl.h>
#include < netdb.h>
#include < signal.h>
#include < sys/time.h>
#include < unistd.h>
#include < netinet/in.h>
#include < netinet/ip.h>
#include < netinet/ip_icmp.h>
#include < errno.h>
#include < string.h>
#include < getopt.h>
#include < setjmp.h>

char *
rlookup (u_long ip)
{
static char hostname[256];
struct hostent *host;
struct sockaddr_in addr;

addr.sin_addr.s_addr = ip;

host =
gethostbyaddr ((char *) &addr.sin_addr, sizeof (addr.sin_addr), AF_INET);

if (host == NULL)
{
printf ("%s does not resolve.n", inet_ntoa (ip));
fflush (stdout);
}
else
{
printf ("%s resolves to %sn", inet_ntoa (ip), host->h_name);
fflush (stdout);
}
}

int maxforq = 0;

int
main (int argc, char **argv)
{
int pid, k, j, frk, i, mforks;
char *pt;
char mehost[200], sv[3];
FILE *inp;

mforks = 64; /* default */
if (argv[1] == NULL)
{
printf ("Usage: %s n", argv[0]);
exit (0);
}
if (!argv[2] == NULL)
{
mforks = atoi (argv[2]);
}
/* printf ("Resolving all hosts in %s with %d threadsn", argv[1], mforks); */
if((inp=fopen(argv[1],"r"))!=NULL)
{
while(fgets(mehost,sizeof(mehost),inp))
{
sscanf(mehost,"%sn",mehost);
frk = fork ();
if (frk == 0)
{
fflush (stdout);
rlookup (inet_addr (mehost));
exit (0);
}
else
{ /* frk = 0 */
maxforq++;
if (maxforq > mforks)
{
wait (NULL); // waiting until the child died
maxforq--;
}

}

}
fclose(inp);
exit(0);
}

pt = strchr (argv[1], '.');
if (pt == NULL)
{ /* ANET */
for (k = 0; k

Last updated on August 22nd, 2007

#reverse lookup #DNS lookup #network blocks #DNS #lookup #network #blocks

Add your review!

SUBMIT