Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | daniel-mar | 1 | <?php |
2 | |||
3 | if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
||
4 | |||
5 | $meldung = ''; |
||
6 | |||
7 | // ------------------------------------- |
||
8 | |||
9 | if (!ini_get('safe_mode')) |
||
10 | $meldung .= '- PHP sollte mit Safe_Mode ausgefü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ö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 übergeordnete Verzeichnis zugreifen!<br>'; |
||
65 | |||
66 | // ------------------------------------- |
||
67 | |||
68 | if ($WBConfig->getMySQLUsername() == 'root') |
||
69 | $meldung .= '- ACHTUNG! Personal WebBase verwendet den MySQL-Benutzer "root"!<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ö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ö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> Wenn Sie über SSL verfü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ücke(n) entdeckt! Lesen Sie das <a href="handbuch.pdf" target="_blank">Handbuch</a> zur Behebung der Sicherheitslücken.<br>'.substr($meldung, 0, strlen($meldung)-strlen('<br>')).'</span>'; |
||
99 | else |
||
100 | $meldung = 'Es wurden keine Sicherheitslücken gefunden.'; |
||
101 | |||
102 | ?> |