Traceroute / Looking Glass2018-01-07T12:57:01+01:00
Verbindung zum Router kann nicht hergestellt werden.
$errstr ($errno)\n"; } else { fputs ($fp, $username); fputs ($fp, $pw); fputs ($fp, "terminal length 0\n"); fputs ($fp, "\n");fputs ($fp, $command); fputs ($fp, "exit\n"); $start = time(); socket_set_timeout($fp, 5); $add = " "; while ($add <> "") { $add = fread($fp, 300000); $res .= $add; } list($routersubst) = explode(".",$router); $res=str_replace("$router>","", $res); $res=str_replace("$routersubst>","", $res); $pos = strpos($res, "Tracing"); $fail = strpos($res, "nrecognized"); if (($fail != "0") or ($pos == "0")) { $text .= "

Ungültige Adresse!

"; } else { # $res=str_replace("Tracing the route to","", $res); $text .= substr($res, $pos); } }fclose($fp);return $text; }function tracesystem($ip) { $command = "/usr/sbin/tracepath $ip"; $command = escapeshellcmd($command); exec ($command, $ausgabe); $i = 0; $j = count($ausgabe); while ($i < $j) { if ($i > 0) $text = $text.$ausgabe[$i]."\n"; $i++; } $text = str_replace(" pmtu 1492","",$text); $text = str_replace(" pmtu 1500","",$text); return $text; }function cidr_range( $cidr, $chkip=null ) { // Assign IP / mask list($ip,$mask) = explode("/",$cidr);// Sanitize IP $ip1 = preg_replace( '_(\d+\.\d+\.\d+\.\d+).*$_', '$1', "$ip.0.0.0" );// Calculate range $ip2 = long2ip( ip2long( $ip1 ) - 1 + ( 1 << ( 32 - $mask) ) );// are we cidr range cheking? if ( $chkip != null && ! filter_var( $chkip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false ) { return ip2long( $ip1 ) <= ip2long( $chkip ) && ip2long( $ip2 ) >= ip2long( $chkip ) ? true : false; } else { return "$ip1 - $ip2"; } }function rfc_1918_ip($in) { if (cidr_range( "127.0/16", $in )) { return TRUE; } if (cidr_range( "10/8", $in )) { return TRUE; } if (cidr_range( "192.168/16", $in)) { return TRUE; } if (cidr_range( "172.16/12", $in)) { return TRUE; } return FALSE; }function arin($target){ $server = "whois.arin.net"; if (!$target = gethostbyname($target)) $msg .= "IP Whois nicht ohne IP Adresse abfragbar."; else{ if (! $sock = fsockopen($server, 43, $num, $error, 20)){ unset($sock); $msg .= "Fehler:Timeout beim Verbinden zum Server $server (port 43)"; } else{ fputs($sock, "n $target\n"); while (!feof($sock)) $buffer .= fgets($sock, 10240); fclose($sock); } if ((strpos(strtolower($buffer),"ripe.net"))) $nextServer = "whois.ripe.net"; else if (strpos(strtolower($buffer),"whois.apnic.net")) $nextServer = "whois.apnic.net"; else if (strpos(strtolower($buffer),"nic.ad.jp")) { $nextServer = "whois.nic.ad.jp"; #/e suppresses Japanese character output from JPNIC $extra = "/e"; } else if (strpos(strtolower($buffer),"whois.registro.br")) $nextServer = "whois.registro.br";if($nextServer) { $buffer = ""; if(! $sock = fsockopen($nextServer, 43, $num, $error, 10)){ unset($sock); $msg .= "Fehler:Timeout beim Verbinden zum Server $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 = "
".$buffer."
"; } return $msg; }function whois($domain) { # list($null,$tld)=explode(".",$domain); # if ($tld == "de") { $flags="-T ace,dn "; } $log = @fopen(TNLOG ."/whois.txt", "a") or print "cannot open log ". TNLOG ."/whois.txt"; @fputs($log, $_SERVER["REMOTE_ADDR"] ."\t". date("d.m.Y H:i") . "\t$domain\n") or print ""; @fclose($log); $domainarg = escapeshellarg($domain); $command = TNBIN ."/whois -H ".$flags.$domainarg; exec ($command, $ausgabe); $i = 0; $j = count($ausgabe); while ($i < $j) { $text = $text.$ausgabe[$i]."\n"; $i++; } return "

$text

"; }function dig($domain) { $log = @fopen(TNLOG ."/dig.txt", "a") or print ""; @fputs($log, $_SERVER["REMOTE_ADDR"] ."\t". date("d.m.Y H:i") . "\t$domain\n") or print ""; @fclose($log); $domainarg = escapeshellarg($domain); $command = TNBIN ."/dig ANY ".$domainarg;exec ($command, $ausgabe); $i = 0; $j = count($ausgabe); $printt=false; while ($i < $j) { if (strpos($ausgabe[$i],"ANSWER SECTION:")) { $printt=true; } if (strpos($ausgabe[$i],"Query time")) { $printt=false; } if ($printt) { $text = $text.$ausgabe[$i]."\n"; } $i++; } return "

$text

"; }function traceroute($router,$target,$count) {require_once TNDIR .'/lib/PEAR2_Net_RouterOS-1.0.0b6/src/PEAR2/Autoload.php';$log = @fopen(TNLOG ."/trace.txt", "a") or print ""; @fputs($log, $_SERVER["REMOTE_ADDR"] ."\t". date("d.m.Y H:i") . "\t$router\t$count\t$target\n") or print ""; @fclose($log);try { $client = new PEAR2\Net\RouterOS\Client($router, 'trace', 'tuv2b894cnxtV#3w4g');$request = new PEAR2\NET\RouterOS\Request('/tool traceroute address='. $target .' duration=40 count='. $count); $responses = $client->sendSync($request); foreach ($responses as $response) { $i++; foreach ($response as $name => $value) { $rows[$i][$name] = $value; if ($name == ".section") $max=$value; } $table .= "\n"; } $table = "\n\n"; $table .=""; foreach ($rows as $row) { if ($row['.section'] == $max) { if ($row['last'] != "timeout") $host = gethostbyaddr($row['address']); else $host = ""; $as = geoip_asnum_by_name($row['address']); $table .= ""; } } $table .= "\n"; $table .="
Hop IP AdresselosslastavgbestworstHostnameAS
". $row['address'] ."". $row['loss'] ."". $row['last'] ."". $row['avg'] ."". $row['best'] ."". $row['worst'] ."". $host ."". $as ."
"; return $table; } catch (Exception $e) { $table .= ""; } }?>
Traceroute

Erweiterte Optionen


Hinweis: Bei mehreren Durchläufen wird der Mittelwert der Laufzeiten berechnet. Der Zeitbedarf steigt dadurch erheblich.

Wichtig: Bitte haben Sie unbedingt Geduld! Die Ausführung des Befehls kann einige Zeit in Anspruch nehmen. Bitte warten Sie ab, bis die Seite komplett geladen wurde!
Nach oben