在网站上创建系统文件是否安全

时间:2019-05-08 06:25:40

标签: php

我已经创建了一个测试文件,该文件显示ip地址phpinfo的某些信息,该信息现在可以正常工作,例如site.com/test.php可以从外部访问。您认为这样安全吗?我想知道它是否有来自外部的风险,因为我阅读了一些带有测试文件的故事,并希望从您那里得到一些意见。。我的意思是尤其是从外面有人无法欺骗我的测试文件,对吗?可以说我正在获取IP地址,否则任何其他变量都可能会导致某种危险。

  

                                  系统测试       

<body>
<?php 
echo "PHP Version: ".phpversion().'<br>';
echo "Dosya Yolu: ". getcwd().'<br>';
echo "Temp Yolu:".sys_get_temp_dir().'<br>';
echo "Max Execution Time : ".ini_get('max_execution_time').'<br>';
echo 'Sistem Tarihi Saati: '.date("Y-m-d H:i:s");
var_dump(class_exists("SOAPClient"));

echo '<-SOAP Client Yüklü mü?<br>'; 

if(function_exists('oci_connect')) {$oracle = 'VAR';} else { $oracle = 'YOK';}
echo 'Oracle bağlantısı için oci_connect '.$oracle;

if(function_exists('fopen')) {$fopen = 'EVET';} else { $fopen = 'HAYIR';}
echo "<br>fopen çalışıyor mu? ".$fopen;


//$b = is_writable( "/xml_temp" ); //boolean value
//echo $b; print_r($b);
//echo "<br>xml_temp yazılabilir mi? ".$b;

## Test if cURL is working ##
## SCRIPT BY WWW.WEBUNE.COM (please do not remove)##
echo '<br>CURL TEST';
echo '<pre>';
var_dump(extension_loaded('curl'));
var_dump(curl_version());
echo '</pre>';
echo 'Curl Yüklü mü?'.var_dump(extension_loaded('curl'));
echo 'CURL TEST SONU <hr>';






$_SESSION['deneme'] = 'evet';

echo 'Session çalışıyor mu? '.$_SESSION['deneme'];

 if (extension_loaded('mcrypt')) {echo '<br>mcrypt yüklü';}

else {echo '<br>mcrypt yüklü değil';} 


if( function_exists( 'mcrypt_module_open' ) ) {echo '<br>mcrypt yüklü';}
else {echo '<br>mcrypt yüklü değil';}

//////////////////////////////////////////////////////////////////////////

function get_server_memory_usage(){

    $free = shell_exec('free');
    $free = (string)trim($free);
    $free_arr = explode("\n", $free);
    $mem = explode(" ", $free_arr[1]);
    $mem = array_filter($mem);
    $mem = array_merge($mem);
    $memory_usage = $mem[2]/$mem[1]*100;

    return $memory_usage;
}

  // See http://www.whatismyip.com/automation for the exact URL
  echo '<br>Çıkış IP:'.file_get_contents("http://ip.appspot.com/");
  echo '<br>server IP:'.$_SERVER['SERVER_ADDR'];

  echo '<br>Magic Quotes Durumu: ';
  if (get_magic_quotes_gpc()) {echo 'Magic Quotes Aktif';} else {echo 'Magic Quotes Pasif';}




function get_server_cpu_usage(){

    $load = sys_getloadavg();
    return $load[0];

}
echo '<br>Memory Usage:';
get_server_memory_usage();
echo '<br>SERVER  Usage:';
get_server_cpu_usage();
////////////////////////////////////////////////////////////////////////


  // See http://www.whatismyip.com/automation for the exact URL
  echo '<br>Çıkış IP:'.file_get_contents("http://ip.appspot.com/");
  echo '<br>server IP:'.$_SERVER['SERVER_ADDR'];

 echo '<br>GD eklentisi yüklü mü? (imgsize.php icin gerekli)';
 if (extension_loaded('gd') && function_exists('gd_info')) {
    echo "GD yüklü";
}
else {echo 'GD yüklü değil';}



/*
echo '<br>PORT KONTROL<br>';

$host = 'stackoverflow.com';
$ports = array(21, 25, 80, 81, 110, 443, 3306);

foreach ($ports as $port)
{
    $connection = @fsockopen($host, $port);

    if (is_resource($connection))
    {
        echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n";

        fclose($connection);
    }

    else
    {
        echo '<h2>' . $host . ':' . $port . ' is not responding.</h2>' . "\n";
    }
}


echo "DNS çözümlemesi<br>";

$result = dns_get_record("php.net", DNS_ANY, $authns, $addtl);
echo "Result = ";
print_r($result);
echo "Auth NS = ";
print_r($authns);
echo "Additional = ";
print_r($addtl);
*/

phpinfo();
?>
</body>
</html>

0 个答案:

没有答案