phpHostsFinder

by Nilesh Dosooye

 

 

 

Description

This utility allows you to find all hostnames (if any) on a particular domain. You can either put a hostname or an ip address and program will scan the entire subdomain to locate hostnames which resolve. It is very easy to install and to use.

Installation

Its very easy to install. Just download the hostsfinder.php file and put it anywhere on your web directory and you are aready to go. Just point your browser to the file.

Usage

Just point your browser to the hostsfinder.php file and put in an IP address or a hostname. The code snippet will scan the entire subnet for that IP or hostname and give you the associated hostnames if it can be resolved.

SourceForge Project Page

Developer

Nilesh Dosooye

Downloads

Download link

Demo (Working Version)

hostsfinder.php

Source Code

<?
// hostsfinder.php by Nilesh Dosooye (nileshd@webmauritius.com)
// Copyright (C) 2001 Nilesh Dosooye
// http://nilesh.webmauritius.com
//
// --- GNU General Public License Disclamer ---
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.


$ipaddress=getenv("remote_addr");

if (
$Submit=="Find all hosts on this domain")
{

       echo 
"Your Input was : <b><font color=red face=arial>$input</font></b><br>";  
             
       
$ipadd=gethostbyname ($input);


       list(
$ip1,$ip2,$ip3,$ip4)=explode('.',$ipadd);

       for (
$a=0;$a<256;$a++)
       {
             
$scanip="$ip1.$ip2.$ip3.$a";
             
$newhostname=gethostbyaddr($scanip);
             echo 
"$scanip ---> <a href=\"http://$newhostname\">$newhostname</a><br>";
       }

}


?>

<form method="post" action="<? echo $PHP_SELF?>">
  <p><font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="+1">HostsFinder.php</font></b><font size="+1"> 
    <a href="http://nilesh.webmauritius.com"> <font size="-2">by Nilesh Dosooye</font></a></font></font></p>
  <p><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">This utility 
    allows you to find all hostnames (if any) on a particular domain. You can 
    either put a hostname or an ip address and program will scan the entire subdomain 
    to locate hosts.</font></p>
  <p><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Hostname 
    or Ipaddress :</b> 
    <input type="text" name="input" size="40" value="<? echo $ipaddress?>">
    </font></p>
  
  <p> <font face="Verdana, Arial, Helvetica, sans-serif">
    <input type="submit" name="Submit" value="Find all hosts on this domain">
    </font></p>
</form>


SourceForge Logo

 
GPL, 2002