|
|
|
|
|
Diesen Artikel hatte ich ins Heise Forum gesetzt, den ich auch hier noch einmal veröffentliche:
Zitat:
htaccess, um zukünftige Exploit Angriffe gegen 3 Party Komponenten abzuwehren
J.Rohn, Jürgen Rohn
Joomla selbst ist recht sicher.
Gefährlich sind:
1. lausig geschriebene Drittkomponenten,
2. gemeingefährliche Einstellungen in der php.ini durch den Hoster
3. sowie bescheuerte chmod Einstellungen durch den Anwender.
Daher:
zu 2.
register_globals Off und allow_url_fopen Off
safe mode On oder PHP als suPHP
zu 3.
nie chmod 777. Allgemein so wenig Rechte, wie nötig. Ordner 755,
Files 644
config.php und index.php chmod 444. Ohne Schreibrechte kein
Defacement, da regelmässig die index Dateien überschrieben werden.
Adminordner per htaccess und Passwort schützen.
zu 1. per .htaccess und mod_rewrite
------------------------------------------------------------------
## Can be commented out if causes errors, see notes above.
Options FollowSymLinks
#
# mod_rewrite in use
RewriteEngine On
########## Begin - Rewrite rules to block out some common exploits
#
# Block out any script trying to set a mosConfig value through the
URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script that tries to set CONFIG_EXT (com_extcal2
issue)
RewriteCond %{QUERY_STRING} CONFIG_EXT(\[|\%20|\%5B).*= [NC,OR]
# Block out any script that tries to set sbp or sb_authorname via URL
(simpleboard)
RewriteCond %{QUERY_STRING} sbp(=|\%20|\%3D) [OR]
RewriteCond %{QUERY_STRING} sb_authorname(=|\%20|\%3D)
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
----------------------------------------------------------------
Der Angreifer sieht eine 403 Fehlermeldung.
siehe auch dazu:
http://forum.joomla.org/index.php/topic,75376.0.html
http://forum.joomla.org/index.php/to....html#msg38869
6
Für Referrer Spam Bots am Beispielbegriff "******" :
order deny,allow
deny from env=spammer
SetEnvIfNoCase Referer ****** spammer=yes
Quelle: hier
|
|
|
|
|