Advertisement
blondeweb

Untitled

Jan 31st, 2015
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.93 KB | None | 0 0
  1. # Enable rewrite engine
  2. RewriteEngine On
  3.  
  4. # Block suspicious request methods
  5. RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK|DEBUG) [NC]
  6. RewriteRule ^(.*)$ - [F,L]
  7.  
  8. # Block WP timthumb hack
  9. RewriteCond %{REQUEST_URI} (timthumb\.php|phpthumb\.php|thumb\.php|thumbs\.php) [NC]
  10. RewriteRule . - [S=1]
  11.  
  12. # Block suspicious user agents and requests
  13. RewriteCond %{HTTP_USER_AGENT} (libwww-perl|wget|python|nikto|curl|scan|java|winhttp|clshttp|loader) [NC,OR]
  14. RewriteCond %{HTTP_USER_AGENT} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
  15. RewriteCond %{HTTP_USER_AGENT} (;|<|>|'|"|\)|\(|%0A|%0D|%22|%27|%28|%3C|%3E|%00).*(libwww-perl|wget|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
  16. RewriteCond %{THE_REQUEST} \?\ HTTP/ [NC,OR]
  17. RewriteCond %{THE_REQUEST} \/\*\ HTTP/ [NC,OR]
  18. RewriteCond %{THE_REQUEST} etc/passwd [NC,OR]
  19. RewriteCond %{THE_REQUEST} cgi-bin [NC,OR]
  20. RewriteCond %{THE_REQUEST} (%0A|%0D) [NC,OR]
  21.  
  22. # Block MySQL injections, RFI, base64, etc.
  23. RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
  24. RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
  25. RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR]
  26. RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
  27. RewriteCond %{QUERY_STRING} (\.\./|\.\.) [OR]
  28. RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
  29. RewriteCond %{QUERY_STRING} http\: [NC,OR]
  30. RewriteCond %{QUERY_STRING} https\: [NC,OR]
  31. RewriteCond %{QUERY_STRING} \=\|w\| [NC,OR]
  32. RewriteCond %{QUERY_STRING} ^(.*)/self/(.*)$ [NC,OR]
  33. RewriteCond %{QUERY_STRING} ^(.*)cPath=http://(.*)$ [NC,OR]
  34. RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
  35. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
  36. RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
  37. RewriteCond %{QUERY_STRING} (<|%3C)([^i]*i)+frame.*(>|%3E) [NC,OR]
  38. RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
  39. RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [NC,OR]
  40. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  41. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
  42. RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>).* [NC,OR]
  43. RewriteCond %{QUERY_STRING} (NULL|OUTFILE|LOAD_FILE) [OR]
  44. RewriteCond %{QUERY_STRING} (\./|\../|\.../)+(motd|etc|bin) [NC,OR]
  45. RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR]
  46. RewriteCond %{QUERY_STRING} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
  47. RewriteCond %{QUERY_STRING} concat[^\(]*\( [NC,OR]
  48. RewriteCond %{QUERY_STRING} union([^s]*s)+elect [NC,OR]
  49. RewriteCond %{QUERY_STRING} union([^a]*a)+ll([^s]*s)+elect [NC,OR]
  50. RewriteCond %{QUERY_STRING} (;|<|>|'|"|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|order|script|set|md5|benchmark|encode) [NC,OR]
  51. RewriteCond %{QUERY_STRING} (sp_executesql) [NC]
  52. RewriteRule ^(.*)$ - [F,L]
  53.  
  54. # Deny browser access to config files
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement