- apxs2 -cia mod_security.c
- vi /etc/sysconfig/apache2
--> APACHE_MODULES mit "security" erweitert
- cd /usr/lib/apache2/apache2-prefork
- ln -s ../apache2/mod_security.so mod_security.so
- mod_security.conf erstellt unter /etc/apache2/conf.d/
- in der httpd.conf:
--> Include /etc/apache2/conf.d/mod_security.conf eingetragen
- goroot Regeln eingetragen:
--> Include /etc/modsecurity/regeln
Anschließend den Apache neugestartet, aber es werden nur leere Seiten ausgegeben
<IfModule mod_security.c>
# Only inspect dynamic requests
# (YOU MUST TEST TO MAKE SURE IT WORKS AS EXPECTED)
#SecFilterEngine DynamicOnly
SecFilterEngine On
# Reject requests with status 500
SecFilterDefaultAction "deny,log,status:500"
# Some sane defaults
SecFilterScanPOST On
SecFilterCheckURLEncoding On
SecFilterCheckCookieFormat On
SecFilterCheckUnicodeEncoding Off
SecFilterNormalizeCookies On
# enable version 1 (RFC 2965) cookies
SecFilterCookieFormat 1
SecServerResponseToken Off
#If you want to scan the output, uncomment these
#SecFilterScanOutput On
#SecFilterOutputMimeTypes "(null) text/html text/plain"
# Accept almost all byte values
SecFilterForceByteRange 1 255
# Server masking is optional
#fake server banner - NOYB used - no one needs to know what we are using
SecServerSignature "Webplatz"
SecUploadDir /tmp
SecUploadKeepFiles Off
# Only record the interesting stuff
SecAuditEngine RelevantOnly
SecAuditLog /var/log/apache2/modsec_audit.log
# You normally won't need debug logging
SecFilterDebugLevel 0
SecFilterDebugLog /var/log/apache2/modsec_debug_log
#And now, the rules
#Remove any of these Include lines you do not use or have rules for.
#First, add in your exclusion rules:
#These MUST come first!
Include /etc/modsecurity/exclude.conf
#Application protection rules
Include /etc/modsecurity/rules.conf
#Comment spam rules
#Include /etc/modsecurity/blacklist.conf
#Bad hosts, bad proxies and other bad players
#Include /etc/modsecurity/blacklist2.conf
#Bad clients, known bogus useragents and other signs of malware
Include /etc/modsecurity/useragents.conf
#Known bad software, rootkits and other malware
Include /etc/modsecurity/rootkits.conf
#Signatures to prevent proxying through your server
#only rule these rules if your server is NOT a proxy
Include /etc/modsecurity/proxy.conf
#Additional rules for Apache 2.x ONLY! Do not add this line if you use Apache 1.x
Include /etc/modsecurity/apache2-rules.conf
</IfModule>
Habs auch schon versucht wenn ich die gotroot-Regeln weg lasse, das Ergebnis bleibt aber das gleiche -> leere Seite beim Aufruf einer Webseite.
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
fuer die menscheit: in rules.conf ist eine regel die probleme mit DAV macht (und in badips.conf ist es dummerweise eine substring-suche, d.h. wenn 1.2.3.4 als boese drinsteht darf 1.2.3.44 auch nicht).
Aber wie gesagt auch wenn ich diese ausklammere hat dies keinen Effekt, es werden nur leere Seiten ausgegeben.
steht was im error_log vom apache ? was passiertn bei "telnet localhost 80" und dann "GET / HTTP/1.0" ?
hab mod_security nun nochmals installiert, jetzt erhalte ich zwar keine leeren Seiten mehr aber dafür wird die Datei zum Download angeboten wenn ich z.B. die index.php aufrufe :(
hab mod_security nun nochmals installiert, jetzt erhalte ich zwar keine leeren Seiten mehr aber dafür wird die Datei zum Download angeboten wenn ich z.B. die index.php aufrufe :(
und wenn Du mod_security wieder auskommentierst ist es wieder ok ?