Dear Wiki user, You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.
The "InvalidHost" page has been changed by thumbs: http://wiki.apache.org/httpd/InvalidHost?action=diff&rev1=2&rev2=3 Comment: Added links, comments and due credits. This short article describes how to use mod_security to block HTTP clients with a broken or missing Host: header. The !IfModule lines are not mandatory. - <IfModule mod_security2.c><<BR>> - SecAuditEngine Off<<BR>> - SecRuleEngine On<<BR>> - SecRule REQUEST_METHOD "^((?:connect|trace))$" "log,drop,phase:1"<<BR>> - SecRule &REQUEST_HEADERS:User-Agent "@eq 0" "log,drop,phase:1"<<BR>> - SecRule &REQUEST_HEADERS:Host "@eq 0" "log,drop,phase:1"<<BR>> - SecRule REQUEST_HEADERS:User-Agent "^$" "log,drop,phase:1"<<BR>> - SecRule REQUEST_HEADERS:Host "^$" "log,drop,phase:1"<<BR>> + Please read [[http://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual|the mod_security]] docs for more details. + + <[[http://httpd.apache.org/docs/current/mod/core.html#ifmodule|IfModule]] mod_security2.c><<BR>> + [[http://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual#SecAuditEngine|SecAuditEngine]] Off<<BR>> + [[http://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual#SecRuleEngine|SecRuleEngine]] On<<BR>> + # Block connect and trace requests<<BR>> + [[http://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual#SecRule|SecRule]] REQUEST_METHOD "^((?:connect|trace))$" "log,drop,phase:1"<<BR>> + # Block requests without a User-Agent header<<BR>> + [[http://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual#SecRule|SecRule]] &REQUEST_HEADERS:User-Agent "@eq 0" "log,drop,phase:1"<<BR>> + # Block requests without a Host: header<<BR>> + [[http://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual#SecRule|SecRule]] &REQUEST_HEADERS:Host "@eq 0" "log,drop,phase:1"<<BR>> + # Block requests without a User-Agent header<<BR>> + [[http://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual#SecRule|SecRule]] REQUEST_HEADERS:User-Agent "^$" "log,drop,phase:1"<<BR>> + # Block requests without a Host: header<<BR>> + [[http://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual#SecRule|SecRule]] REQUEST_HEADERS:Host "^$" "log,drop,phase:1"<<BR>> </IfModule><<BR>> + Thanks to Vegar for the contribution! + --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
