####################################################################### #nqt.php last revised 05/07/03 (http://www.shat.net/php/nqt/) # # Initial release 03/11/01 # # NQT is now more than two years old and still in wide use! # # # #Version 1.6 # #05/07: Due to transitioning in the administration of the .org TLD, # #whois.crsnic.net no longer provides information for .org domains. I # #updated the script to use whois.corenic.net for .orgs instead. # #Thanks Jim In Cyberspace for the heads-up! # # # #Version 1.5 # #11/15: Adjusted the domain name regex to support 4-letter TLDs such # #as .info, and added WWWhois support for the .info, .name, .cc, .ws, # #.us, and .biz TLDs. Thanks to Andre from reload.de for the great # #suggestion! # # # #Version 1.4 # #08/31: Added support for HTTP GET variables. You can now access your # #copy of NQT and pass some variables within the URL, e.g. # #http://your.host/nqt.php?target=shat.net&queryType=wwwhois # #http://your.host/nqt.php?target=shat.net&queryType=all&portNum=80 # #Credit to hypersven.com for this suggestion! # # # #Version 1.3 # #06/28: PHP 4.20+ sets register_globals to "off" by default. This # #script expects them to be "on." Added a workaround. # # # #Version 1.2 # #03/01: The behavior of the gethostbyaddr() function appears to have # #changed in PHP 4.12, it no longer accepts hostnames in fqdn format. # #(This is how it really should work anyway, I think the old behavior # #was a bug.) Previous versions of NQT relied upon the fact that the # #gethostbyaddr() function would accept a hostname. If you're getting # #errors about addresses not being in a.b.c.d format, please download # #and install this version of the script. # # # #Version 1.1 # #10/30: Security update, thanks Dmitry Frolov, Mathijs Futselaar. # #Previous versions of script allowed possible execution of arbitrary # #commands on the host system. Updated lines marked with #bugfix, code # #courtesy Dmitry Frolov. # # # #COPYRIGHT shaun@shat.net - If you use this script, the copyright # #notice appended to query results MUST remain INTACT and UNALTERED, # #including the link to the distribution site http://shat.net/php/nqt/ # #This script is FREE SOFTWARE, but you may NOT claim it as your own. # # # #Requires: PHP3+, unix server preferred # # # #This script takes a given hostname or IP address and attempts to # #look up all sorts of information about that address. Basically # #it does what network-tools.com does, without all the ads and ASP :) # # # #The following steps can be performed separately or all at once: # # # # reverse DNS lookup, DNS query (dig), WWW whois, ARIN whois, # # open-port check, ping, traceroute # # # #As you can probably guess this script is intended for unix machines. # #If you use this script under win32, DNS query (dig) will not work. # # # #NO INITIAL CONFIGURATION IS REQUIRED. THERE ARE NO VARIABLES TO SET. # # # #If you encounter problems with traceroute, replace the default path # #/usr/sbin/traceroute with the correct path in the tr() function. # ######################################################################$ #Until I rewrite my scripts, this will suffice for compatibility if(phpversion() >= "4.2.0"){ extract($_POST); extract($_GET); extract($_SERVER); extract($_ENV); } $target=$_GET["target"]; $target=trim($target); if(substr_count($target,"/")>0) { $target=substr($target, 1); } $queryType=$_GET["queryType"]; $queryType=trim($queryType); if(!$queryType) { if(substr_count($target,".")>2) { $queryType="arin"; } else { $queryType="wwwhois"; } } $portNum=$_GET["portNum"]; $portNum=trim($portNum); function defaultseach($target) { if($target=="") return "Enter host or IP"; else return $target; } function selectedquery($_queryType,$queryType) { if($_queryType==$queryType) return "checked"; else return ""; } ?>