Subversion Repositories personal-webbase

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
  4.  
  5. $meldung = '';
  6.  
  7. // -------------------------------------
  8.  
  9. if (!ini_get('safe_mode'))
  10.         $meldung .= '- PHP sollte mit Safe_Mode ausgef&uuml;hrt werden.<br>';
  11.  
  12. // -------------------------------------
  13.  
  14. $ok = true;
  15. if ($configuration['common_directftp']['ftp-verzeichnis'] != '/')
  16. {
  17.         if ($configuration['common_directftp']['ftp-verzeichnis'] == '/html/')
  18.         {
  19.                 // Handelt es sich um Confixx? Dann ist /html/ auch OK
  20.                 if ($dir = @opendir('../'))
  21.                 {
  22.                         while ($file = @readdir($dir))
  23.                         {
  24.                                 if (($file != 'atd') && ($file != 'log') && ($file != '.forward') && ($file != 'restore') && ($file != 'backup')
  25.                                 && ($file != '.configs') && ($file != 'html') && ($file != 'files') && ($file != 'phptmp') && ($file != '.')
  26.                                 && ($file != '..')) $ok = false;
  27.                         }
  28.                         @closedir($dir);
  29.                 }
  30.         }
  31.         else
  32.                 $ok = false;
  33. }
  34. if (!$ok) $meldung .= '- Personal WebBase besitzt m&ouml;glicherweise keinen eigenen FTP-Account!<br>';
  35.  
  36. // -------------------------------------
  37.  
  38. $ok = true;
  39. $path = '../';
  40.  
  41. if ($dir = @opendir($path))
  42. {
  43.         // Bei Confixx liegen im Übergeordneten Verzeichnis die folgenden Dateien... die sind OK; andere nicht!
  44.         while ($file = @readdir($dir))
  45.         {
  46.                 if (($file != 'atd') && ($file != 'log') && ($file != '.forward') && ($file != 'restore') && ($file != 'backup')
  47.                 && ($file != '.configs') && ($file != 'html') && ($file != 'files') && ($file != 'phptmp') && ($file != '.')
  48.                 && ($file != '..')) $ok = false;
  49.         }
  50.         @closedir($dir);
  51. }
  52.  
  53. // Aber weiter darf man nicht zurück gehen!
  54. while (true)
  55. {
  56.         if (@readdir(@opendir($path))) $ok = false;
  57.         $realpath = @realpath($path);
  58.         if (($realpath == '/') || ((strlen($realpath) == 3) && (substr($realpath, 1, 2) == ':\\')) || (!$ok))
  59.                 break;
  60.         else
  61.                 $path .= '../';
  62. }
  63.  
  64. if (!$ok) $meldung .= '- Personal WebBase kann bei der HTTP-Server-Ebene auf das &uuml;bergeordnete Verzeichnis zugreifen!<br>';
  65.  
  66. // -------------------------------------
  67.  
  68. if ($WBConfig->getMySQLUsername() == 'root')
  69.         $meldung .= '- ACHTUNG! Personal WebBase verwendet den MySQL-Benutzer &quot;root&quot;!<br>';
  70.  
  71. $my_warnung = false;
  72. $db_list = db_list_dbs();
  73. while ($row = db_fetch($db_list))
  74. {
  75.         if (($row['Database'] != 'information_schema') && ($row['Database'] != $WBConfig->getMySQLDatabase()))
  76.                 $my_warnung = true;
  77. }
  78.  
  79. if ($my_warnung)
  80.         $meldung .= '- Personal WebBase kann m&ouml;glicherweise auf andere MySQL-Datenbanken zugreifen!<br>';
  81.  
  82. $rx = db_list_tables($WBConfig->getMySQLDatabase());
  83. $rx2 = db_query("SELECT * FROM `".$WBConfig->getMySQLPrefix()."modules`");
  84.  
  85. if (db_num($rx) > db_num($rx2))
  86.         $meldung .= '- Es existieren fremde MySQL-Tabellen in der Personal WebBase-Datenbank, auf die Personal WebBase m&ouml;glicherweise Zugriff hat!<br>';
  87.  
  88. // -------------------------------------
  89.  
  90. if (!$WBConfig->getForceSSLFlag())
  91. {
  92.         $meldung .= '- SSL-Verbindungen werden nicht erzwungen (includes/config.inc.php: $force_ssl).<br>&nbsp;&nbsp;Wenn Sie &uuml;ber SSL verf&uuml;gen, sollten Sie die Einstellung auf true bzw. 1 setzen.<br>';
  93. }
  94.  
  95. // -------------------------------------
  96.  
  97. if ($meldung != '')
  98.         $meldung = '<span class="red">Potentielle Sicherheitsl&uuml;cke(n) entdeckt! Lesen Sie das <a href="handbuch.pdf" target="_blank">Handbuch</a> zur Behebung der Sicherheitsl&uuml;cken.<br>'.substr($meldung, 0, strlen($meldung)-strlen('<br>')).'</span>';
  99. else
  100.         $meldung = 'Es wurden keine Sicherheitsl&uuml;cken gefunden.';
  101.  
  102. ?>
  103.