# enable rewrite engine RewriteEngine on # block trace and track methods RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] # block XSS attacks (attempted to hide query string) RewriteCond %{THE_REQUEST} \?.*\?(\ |$) RewriteRule .* - [F] # block XSS attacks (http) RewriteCond %{THE_REQUEST} (\b|%\d\d)https?(:|%3A)(/|%\d\d){2} [NC] RewriteRule .* - [F] # block XSS attacks (ftp) RewriteCond %{THE_REQUEST} (\b|%\d\d)ftp(:|%3A)(/|%\d\d){2} [NC] RewriteRule .* - [F] # block hack attempts (/etc/passwd) RewriteCond %{THE_REQUEST} (/|%2F)etc(/|%2F)passwd [NC] RewriteRule .* - [R=404,L] # Block out some common exploits # If the request query string contains /proc/self/environ (by SigSiu.net) RewriteCond %{QUERY_STRING} proc/self/environ [OR] # Block out any script trying to base64_encode or base64_decode data within the URL RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [OR] # Block out any script that includes a