= "4.2.0"){ extract($_POST); extract($_GET); extract($_SERVER); extract($_ENV); } ?> Outils de veille réseau
bUg <BR>Oth3r
do you really think Big Brothers are sexier ?)
Bb)
You Watch, We Watch
]
Outils de veille réseau
Informations Connectivité

Resolve/Reverse Lookup
Get DNS Records
Whois (Web)
Whois (IP)

Vérifiez le port:
Ping
Traceroute
Tout rechercher
$msg"; flush(); } function lookup($target){ global $ntarget; $msg = "$target resolved to "; if( eregi("[a-zA-Z]", $target) ) $ntarget = gethostbyname($target); else $ntarget = gethostbyaddr($target); $msg .= $ntarget; message($msg); } function dig($target){ global $ntarget; message("

DNS :

"); #$target = gethostbyaddr($target); #if (! eregi("[a-zA-Z]", ($target = gethostbyaddr($target))) ) if( (!eregi("[a-zA-Z]", $target) && (!eregi("[a-zA-Z]", $ntarget)))) $msg .= "Can't do a DNS query without a hostname."; else{ if(!eregi("[a-zA-Z]", $target)) $target = $ntarget; if (! $msg .= trim(nl2br(`dig any '$target'`))) #bugfix $msg .= "La commande dig ne fonctionne pas sur ce système."; } #TODO: Clean up output, remove ;;'s and DiG headers $msg .= "

"; message($msg); } function wwwhois($target){ global $ntarget; $server = "whois.crsnic.net"; message("

WWWhois :

"); #Determine which WHOIS server to use for the supplied TLD if((eregi("\.com\$|\.net\$|\.edu\$", $target)) || (eregi("\.com\$|\.net\$|\.edu\$", $ntarget))) $server = "whois.crsnic.net"; else if((eregi("\.info\$", $target)) || (eregi("\.info\$", $ntarget))) $server = "whois.gandi.net"; else if((eregi("\.org\$", $target)) || (eregi(".org\$", $ntarget))) $server = "whois.corenic.net"; else if((eregi("\.name\$", $target)) || (eregi("\.name\$", $ntarget))) $server = "whois.nic.name"; else if((eregi("\.biz\$", $target)) || (eregi("\.biz\$", $ntarget))) $server = "whois.nic.biz"; else if((eregi("\.us\$", $target)) || (eregi("\.us\$", $ntarget))) $server = "whois.nic.us"; else if((eregi("\.cc\$", $target)) || (eregi("\.cc\$", $ntarget))) $server = "whois.enicregistrar.com"; else if((eregi("\.ws\$", $target)) || (eregi("\.ws\$", $ntarget))) $server = "whois.nic.ws"; else if((eregi("\.fr\$", $target)) || (eregi("\.fr\$", $ntarget))) $server = "whois.nic.fr"; else{ $msg .= "Seuls les .com, .net, .org, .edu, .info, .name, .us, .fr, .cc, .ws, et .biz peuvent être testés.
"; message($msg); return; } message("Connexion à $server...

"); if (! $sock = fsockopen($server, 43, $num, $error, 10)){ unset($sock); $msg .= "Timed-out connecting to $server (port 43)"; } else{ fputs($sock, "$target\n"); while (!feof($sock)) $buffer .= fgets($sock, 10240); } fclose($sock); if(! eregi("Whois Server:", $buffer)){ if(eregi("no match", $buffer)) message("Aucun résultat pour $target
"); else message("Requête ambigüe, résultats multiples pour $target:
"); } else{ $buffer = split("\n", $buffer); for ($i=0; $i
"); if(! $sock = fsockopen($nextServer, 43, $num, $error, 10)){ unset($sock); $msg .= "Timed-out connecting to $nextServer (port 43)"; } else{ fputs($sock, "$target\n"); while (!feof($sock)) $buffer .= fgets($sock, 10240); fclose($sock); } } $msg .= nl2br($buffer); $msg .= "

"; message($msg); } function arin($target){ $server = "whois.arin.net"; message("

IP Whois :

"); if (!$target = gethostbyname($target)) $msg .= "Impossible d'effectuer cette recherche Whois sans adresse IP."; else{ message("Connexion à $server...

"); if (! $sock = fsockopen($server, 43, $num, $error, 20)){ unset($sock); $msg .= "Timed-out connecting to $server (port 43)"; } else{ fputs($sock, "$target\n"); while (!feof($sock)) $buffer .= fgets($sock, 10240); fclose($sock); } if (eregi("RIPE.NET", $buffer)) $nextServer = "whois.ripe.net"; else if (eregi("whois.apnic.net", $buffer)) $nextServer = "whois.apnic.net"; else if (eregi("nic.ad.jp", $buffer)){ $nextServer = "whois.nic.ad.jp"; #/e suppresses Japanese character output from JPNIC $extra = "/e"; } else if (eregi("whois.registro.br", $buffer)) $nextServer = "whois.registro.br"; if($nextServer){ $buffer = ""; message("Deferred to specific whois server: $nextServer...

"); if(! $sock = fsockopen($nextServer, 43, $num, $error, 10)){ unset($sock); $msg .= "Timed-out connecting to $nextServer (port 43)"; } else{ fputs($sock, "$target$extra\n"); while (!feof($sock)) $buffer .= fgets($sock, 10240); fclose($sock); } } $buffer = str_replace(" ", " ", $buffer); $msg .= nl2br($buffer); } $msg .= "

"; message($msg); } function checkp($target,$portNum){ message("

Vérification du port $portNum...

"); if (! $sock = fsockopen($target, $portNum, $num, $error, 5)) $msg .= "Le port $portNum ne semble pas être ouvert."; else{ $msg .= "Le port $portNum est ouvert et accepte les connexions."; fclose($sock); } $msg .= "

"; message($msg); } function p($target){ message("

Ping :

"); if (! $msg .= trim(nl2br(`ping -c5 '$target'`))) #bugfix $msg .= "Ping failed. Host may not be active."; $msg .= "

"; message($msg); } function tr($target){ message("

Traceroute :

"); if (! $msg .= trim(nl2br(`/usr/sbin/traceroute '$target'`))) #bugfix $msg .= "Traceroute failed. Host may not be active."; $msg .= "

"; message($msg); } #If the form has been posted, process the query, otherwise there's #nothing to do yet if(!$queryType) exit; #Make sure the target appears valid if( (!$target) || (!preg_match("/^[\w\d\.\-]+\.[\w\d]{1,4}$/i",$target)) ){ #bugfix message("Erreur : vous n'avez pas spécifié de cible, d'hôte ou d'IP valide."); exit; } #Figure out which tasks to perform, and do them if( ($queryType=="all") || ($queryType=="lookup") ) lookup($target); if( ($queryType=="all") || ($queryType=="dig") ) dig($target); if( ($queryType=="all") || ($queryType=="wwwhois") ) wwwhois($target); if( ($queryType=="all") || ($queryType=="arin") ) arin($target); if( ($queryType=="all") || ($queryType=="checkp") ) checkp($target,$portNum); if( ($queryType=="all") || ($queryType=="p") ) p($target); if( ($queryType=="all") || ($queryType=="tr") ) tr($target); ?>
NQT20021115 Network Query Tool 1.5
Copyright 2002 shaun@shat.net