Rev 4 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | <?php |
2 | |||
14 | daniel-mar | 3 | if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
2 | daniel-mar | 4 | |
5 | $meldung = ''; |
||
6 | |||
7 | // ------------------------------------- |
||
8 | |||
3 | daniel-mar | 9 | /* |
2 | daniel-mar | 10 | if (!ini_get('safe_mode')) |
11 | $meldung .= '- PHP sollte mit Safe_Mode ausgeführt werden.<br>'; |
||
3 | daniel-mar | 12 | */ |
2 | daniel-mar | 13 | |
14 | // ------------------------------------- |
||
15 | |||
16 | $ok = true; |
||
17 | if ($konfiguration['core_directftp']['ftp-verzeichnis'] != '/') |
||
18 | { |
||
19 | if ($konfiguration['core_directftp']['ftp-verzeichnis'] == '/html/') |
||
20 | { |
||
21 | // Handelt es sich um Confixx? Dann ist /html/ auch OK |
||
22 | if ($dir = @opendir('../')) |
||
23 | { |
||
24 | while ($file = @readdir($dir)) |
||
25 | { |
||
26 | if (($file != 'atd') && ($file != 'log') && ($file != '.forward') && ($file != 'restore') && ($file != 'backup') |
||
27 | && ($file != '.configs') && ($file != 'html') && ($file != 'files') && ($file != 'phptmp') && ($file != '.') |
||
28 | && ($file != '..')) $ok = false; |
||
29 | } |
||
30 | @closedir($dir); |
||
31 | } |
||
32 | } |
||
33 | else |
||
34 | $ok = false; |
||
35 | } |
||
3 | daniel-mar | 36 | if (!$ok) $meldung .= '- Personal WebBase besitzt möglicherweise keinen eigenen FTP-Account!<br>'; |
2 | daniel-mar | 37 | |
38 | // ------------------------------------- |
||
39 | |||
40 | $ok = true; |
||
41 | $path = '../'; |
||
42 | |||
43 | if ($dir = @opendir($path)) |
||
44 | { |
||
45 | // Bei Confixx liegen im Übergeordneten Verzeichnis die folgenden Dateien... die sind OK; andere nicht! |
||
46 | while ($file = @readdir($dir)) |
||
47 | { |
||
48 | if (($file != 'atd') && ($file != 'log') && ($file != '.forward') && ($file != 'restore') && ($file != 'backup') |
||
49 | && ($file != '.configs') && ($file != 'html') && ($file != 'files') && ($file != 'phptmp') && ($file != '.') |
||
50 | && ($file != '..')) $ok = false; |
||
51 | } |
||
52 | @closedir($dir); |
||
53 | } |
||
54 | |||
55 | // Aber weiter darf man nicht zurück gehen! |
||
56 | while (true) |
||
57 | { |
||
58 | if (@readdir(@opendir($path))) $ok = false; |
||
59 | $realpath = @realpath($path); |
||
60 | if (($realpath == '/') || ((strlen($realpath) == 3) && (substr($realpath, 1, 2) == ':\\')) || (!$ok)) |
||
61 | break; |
||
62 | else |
||
63 | $path .= '../'; |
||
64 | } |
||
65 | |||
3 | daniel-mar | 66 | if (!$ok) $meldung .= '- Personal WebBase kann bei der HTTP-Server-Ebene auf das übergeordnete Verzeichnis zugreifen!<br>'; |
2 | daniel-mar | 67 | |
68 | // ------------------------------------- |
||
69 | |||
70 | if ($mysql_zugangsdaten['username'] == 'root') |
||
3 | daniel-mar | 71 | $meldung .= '- ACHTUNG! Personal WebBase verwendet den MySQL-Benutzer "root"!<br>'; |
2 | daniel-mar | 72 | |
73 | $my_warnung = false; |
||
74 | $db_list = db_list_dbs(); |
||
75 | while ($row = db_fetch($db_list)) |
||
76 | { |
||
77 | if (($row['Database'] != 'information_schema') && ($row['Database'] != $mysql_zugangsdaten['datenbank'])) |
||
78 | $my_warnung = true; |
||
79 | } |
||
80 | |||
81 | if ($my_warnung) |
||
3 | daniel-mar | 82 | $meldung .= '- Personal WebBase kann möglicherweise auf andere MySQL-Datenbanken zugreifen!<br>'; |
2 | daniel-mar | 83 | |
84 | $rx = db_list_tables($mysql_zugangsdaten['datenbank']); |
||
85 | $rx2 = db_query("SELECT * FROM `".$mysql_zugangsdaten['praefix']."module`"); |
||
86 | |||
87 | if (db_num($rx) > db_num($rx2)) |
||
3 | daniel-mar | 88 | $meldung .= '- Es existieren fremde MySQL-Tabellen in der Personal WebBase-Datenbank, auf die Personal WebBase möglicherweise Zugriff hat!<br>'; |
2 | daniel-mar | 89 | |
90 | // ------------------------------------- |
||
91 | |||
92 | if (!$force_ssl) |
||
93 | { |
||
94 | $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>'; |
||
95 | } |
||
96 | |||
97 | // ------------------------------------- |
||
98 | |||
99 | if ($meldung != '') |
||
100 | $meldung = '<font color="#FF0000">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>')).'</font>'; |
||
101 | else |
||
102 | $meldung = 'Es wurden keine Sicherheitslücken gefunden.'; |
||
103 | |||
3 | daniel-mar | 104 | ?> |