Location: PHPKode > projects > WWW-Admin > wwwadmin-0.1lt/port.php
<?
	session_start();
?>

<html>
 <body>
  <title>WWW-Admin v0.1.0 : INFORMACIJA APIE SERVERI</title>
   <body bgcolor="#000000" style="font-family:times;color:white;">

 <h4>Informacija apie serveri</h4>

<?
 error_reporting ( 1 );

 echo "Jusu IP : ".$_SERVER['REMOTE_ADDR']."<br>";
 echo "Jusu narsykle : ".$_SERVER['HTTP_USER_AGENT']."<br><br>";
 echo "<table border=1>";
 echo "<tr><td>";
 echo "Adresas : ".$_SERVER['SERVER_ADDR'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Vardas : ".$_SERVER['SERVER_NAME'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Rusis : ".$_SERVER['SERVER_SOFTWARE'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Protokolas : ".$_SERVER['SERVER_PROTOCOL'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Uzklausimo metodas : ".$_SERVER['REQUEST_METHOD'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Sakninis katalogas : ".$_SERVER['DOCUMENT_ROOT'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Jungtis : ".$_SERVER['SERVER_PORT'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Parasas : ".$_SERVER['SERVER_SIGNATURE'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Autorizacija : ".$_SERVER['AUTH_TYPE'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Vykdomas skriptas : ".$_SERVER['SCRIPT_FILENAME'];
 echo "</td></tr>";
 echo "<tr><td>";
 echo "Administratorius : ".$_SERVER['SERVER_ADMIN'];
 echo "</td></tr>";
 echo "</table>";

 $host = "127.0.0.1";
 echo "<form method = POST action = port.php>";
 echo "<input type = hidden name = show value = 1>";
 echo "<input type = submit name = butt value = Parodyti atviru jungciu sarasa></form>";
 if ($_POST['show'] == 1)
 {
 	scanner();
 }

 function checkport($port)
 {
	$tempstring = "";
 	global $host;
 	$status = 0;
  	$socket = @fsockopen($host, $port, &$errno, &$errstr, 1);
  	if ($socket)
	{
    		$service = getservbyport($port, "tcp");
   		@set_socket_blocking($socket, 0);
    		$count = 0;
    		$portOutput =  "";
    		while ($count < $timeout) 
		{
      				if ($readString = @fread($socket, 1)) 
				{
        				$readString = addslashes(nl2br(htmlentities(chop($readString))));
        				$portOutput .= $readString;
        			}
      				$count++;
     		}

    		@fclose($socket);
    		if ($portOutput !=  "") 
		{
      			$tempstring="{$port} : {$portOutput}";
      		}
    		else 
		{
      			$tempstring = "{$port} : <br>";
			$tempstring .= getservbyport($port, "tcp");
      		}
    	}
    	else 
    	{
   		@fclose($socket);
    	}
    	return $tempstring;
 }	

 
 function scanner()
 {
	echo "<br><h4>Atviros serverio jungtys :</h4>";
	echo "<table border=1>";
  	for ($i=1;$i<65506;$i++)
 	{
   		if(checkport($i) != "")
   		{
    			$serv = checkport($i);
    			echo "<tr><td>$serv</td></tr>";
   		}
  	}
	echo "</table>";
 }

?>


<br><br><a href="sql_login.php">SQL Klientas</a><br>
<a href="ftp.php">FTP Klientas</a><br>
<a href="Index.php">Atgal i prisijungimo puslapi</a><br>

</font>
</body>
</html>
Return current item: WWW-Admin