How heise Security has reported yesterday, there is a problem in topical Apache2 to web servers of the version 2.2. x which appears with GET-Requests with several "byte rank" and can be used to let overrun the RAM of the unsound aim what can lead to the fall of the web server or even the whole server. My observations are that every installation is not equally susceptible.Wie heise Security gestern vermeldet hat, gibt es ein Problem in aktuellen Apache2 Webservern der Version 2.2.x, welches bei GET-Requests mit mehreren “Byte-Ranges” auftritt und dazu genutzt werden kann, den RAM des angegriffenen Ziels überlaufen zu lassen, was zum Absturz des Webserver oder gar des ganzen Servers führen kann. Meine Beobachtungen sind, dass nicht jede Installation gleich anfällig ist.
Though something is burnt in an attack with the Exploit code in CPU achievement, the consumption RAM rises by a few hunder mb, however, does not manage on the systems under my control on bringing this from the step – at least not with only one attacking calculator and in 1000 + Threads.Zwar wird bei einem Angriff mit dem Exploit-Code einiges an CPU-Leistung verbrannt, der RAM Verbrauch steigt um ein paar hunder MB, reicht aber auf den Systemen unter meiner Kontrolle nicht aus, diese aus dem Tritt zu bringen – zumindest nicht mit nur einem angreifenden Rechner und 1000+ Threads.
Steps to the steam of the menace are either the disconnection of the byte rank in the Config of the Header module what might have, however, beside complete deactivating of “resumable downloads” even more treacly weighing results or, however, limiting the number of the Range-Requests via mod_rewrite. I have decided as presumably the most for the second solution.Schritte zum Dämpfen der Bedrohung sind entweder die Abschaltung des Byte-Ranges in der Config des Header Moduls, was aber neben dem kompletten Deaktivieren von “resumable Downloads” noch schwerwiegendere Folgen haben dürfte oder aber das Beschränken der Zahl der Range-Requests via mod_rewrite. Ich habe mich wie vermutlich die Meisten für die zweite Lösung entschieden.
These instructions refer to a server system with Debian Linux. By use of another distribution file paths must be adapted if necessary.Diese Instruktionen beziehen sich auf ein Server-System mit Debian Linux. Bei Verwendung einer anderen Distribution müssen ggf. Dateipfade angepasst werden.
In addition the following code must be inserted in every VHost (e.g., after the DocumentRoot directive): Dazu muss in jedem VHost folgender Code eingefügt werden (z. B. nach der DocumentRoot-Direktive):
# Apache2 Range-Request Rewrite Fix
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(HEAD|GET) [NC]
RewriteCond %{HTTP:Range} ([0-9]*-[0-9]*)(\s*,\s*[0-9]*-[0-9]*)+
RewriteRule .* - [F]
Because I have little desire to insert by hand in every VHost, I evacuate in own file in/etc/apache2/conf.d/antiapachekiller and insert an Include/etc/apache2/conf.d/antiapachekiller in every VHost after the DocumentRoot. Because I must make with quite a lot of sides, I have automated with this Skiptchen. This can lie at any place, the path with the VHost definitions is firmly inserted (and would have to be adapted with divergences), and a backup of the Apache list before is urgently recommended!Da ich wenig Lust habe, das in jeden VHost manuell einzufügen, lagere ich das in eine eigene Datei in /etc/apache2/conf.d/antiapachekiller aus und füge ein Include /etc/apache2/conf.d/antiapachekiller in jeden VHost nach dem DocumentRoot ein. Weil ich das bei ziemlich vielen Seiten machen muss, habe ich das mit diesem Skiptchen automatisiert. Dieses kann an beliebiger Stelle liegen, der Pfad mit den VHost-Definitionen ist fest eingebaut (und müsste bei Abweichungen angepasst werden), und ein Backup des Apache-Verzeichnisses vorher wird dringend empfohlen!
#!/bin/bash
cp -rvp /etc/apache2/sites-available/ /tmp/
cd /tmp/sites-available/
FILES=`ls *.conf`
for FILE in $FILES
do
echo $FILE
cat $FILE | perl -ne 'print $_; print \
"Include /etc/apache2/conf.d/antiapachekiller\n" \
if ($_ =~ /DocumentRoot/ )' > /etc/apache2/sites-available/$FILE
done
Even if no own backup was put on before, the original files lie after the use of the script still in/tmp/sites-available/Selbst wenn kein eigenes Backup vorher angelegt wurde, liegen die Originaldateien nach der Anwendung des Skripts noch in /tmp/sites-available/
Then the VHosts should be at least still checked random check-like and then the Indian anew be loaded (/etc/init.d/apache2 reload). Danach sollten die VHosts zumindest noch stichprobenartig überprüft werden und dann der Indianer neu geladen werden (/etc/init.d/apache2 reload).