Advertisement
Fany_VanDaal

Firewall - blokování botů

Apr 18th, 2020
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. # 6G FIREWALL/BLACKLIST
  2. # @ https://perishablepress.com/6g/
  3. # více informací na https://perishablepress.com/6g/
  4.  
  5. # 6G:[QUERY STRING]
  6. <IfModule mod_rewrite.c>
  7. RewriteEngine On
  8. RewriteCond %{QUERY_STRING} (eval\() [NC,OR]
  9. RewriteCond %{QUERY_STRING} (127\.0\.0\.1) [NC,OR]
  10. RewriteCond %{QUERY_STRING} ([a-z0-9]{2000,}) [NC,OR]
  11. RewriteCond %{QUERY_STRING} (javascript:)(.*)(;) [NC,OR]
  12. RewriteCond %{QUERY_STRING} (base64_encode)(.*)(\() [NC,OR]
  13. RewriteCond %{QUERY_STRING} (GLOBALS|REQUEST)(=|\[|%) [NC,OR]
  14. RewriteCond %{QUERY_STRING} (<|%3C)(.*)script(.*)(>|%3) [NC,OR]
  15. RewriteCond %{QUERY_STRING} (\\|\.\.\.|\.\./|~|`|<|>|\|) [NC,OR]
  16. RewriteCond %{QUERY_STRING} (boot\.ini|etc/passwd|self/environ) [NC,OR]
  17. RewriteCond %{QUERY_STRING} (thumbs?(_editor|open)?|tim(thumb)?)\.php [NC,OR]
  18. RewriteCond %{QUERY_STRING} (\'|\")(.*)(drop|insert|md5|select|union) [NC]
  19. RewriteRule .* - [F]
  20. </IfModule>
  21.  
  22. # 6G:[REQUEST METHOD]
  23. <IfModule mod_rewrite.c>
  24. RewriteCond %{REQUEST_METHOD} ^(connect|debug|move|put|trace|track) [NC]
  25. RewriteRule .* - [F]
  26. </IfModule>
  27.  
  28. # 6G:[REFERRER]
  29. <IfModule mod_rewrite.c>
  30. RewriteCond %{HTTP_REFERER} ([a-z0-9]{2000,}) [NC,OR]
  31. RewriteCond %{HTTP_REFERER} (semalt.com|todaperfeita) [NC]
  32. RewriteRule .* - [F]
  33. </IfModule>
  34.  
  35. # 6G:[REQUEST STRING]
  36. <IfModule mod_alias.c>
  37. RedirectMatch 403 (?i)([a-z0-9]{2000,})
  38. RedirectMatch 403 (?i)(https?|ftp|php):/
  39. RedirectMatch 403 (?i)(base64_encode)(.*)(\()
  40. RedirectMatch 403 (?i)(=\\\'|=\\%27|/\\\'/?)\.
  41. RedirectMatch 403 (?i)/(\$(\&)?|\*|\"|\.|,|&|&amp;?)/?$
  42. RedirectMatch 403 (?i)(\{0\}|\(/\(|\.\.\.|\+\+\+|\\\"\\\")
  43. RedirectMatch 403 (?i)(~|`|<|>|:|;|,|%|\\|\{|\}|\[|\]|\|)
  44. RedirectMatch 403 (?i)/(=|\$&|_mm|cgi-|muieblack)
  45. RedirectMatch 403 (?i)(&pws=0|_vti_|\(null\)|\{\$itemURL\}|echo(.*)kae|etc/passwd|eval\(|self/environ)
  46. RedirectMatch 403 (?i)\.(aspx?|bash|bak?|cfg|cgi|dll|exe|git|hg|ini|jsp|log|mdb|out|sql|svn|swp|tar|rar|rdf)$
  47. RedirectMatch 403 (?i)/(^$|(wp-)?config|mobiquo|phpinfo|shell|sqlpatch|thumb|thumb_editor|thumbopen|timthumb|webshell)\.php
  48. </IfModule>
  49.  
  50. # 6G:[USER AGENT]
  51. <IfModule mod_setenvif.c>
  52. SetEnvIfNoCase User-Agent ([a-z0-9]{2000,}) bad_bot
  53. SetEnvIfNoCase User-Agent (archive.org|binlar|casper|checkpriv|choppy|clshttp|cmsworld|diavol|dotbot|extract|feedfinder|flicky|g00g1e|harvest|heritrix|httrack|kmccrew|loader|miner|nikto|nutch|planetwork|postrank|purebot|pycurl|python|seekerspider|siclab|skygrid|sqlmap|sucker|turnit|vikspider|winhttp|xxxyy|youda|zmeu|zune) bad_bot
  54.  
  55. # Apache < 2.3
  56. <IfModule !mod_authz_core.c>
  57. Order Allow,Deny
  58. Allow from all
  59. Deny from env=bad_bot
  60. </IfModule>
  61.  
  62. # Apache >= 2.3
  63. <IfModule mod_authz_core.c>
  64. <RequireAll>
  65. Require all Granted
  66. Require not env bad_bot
  67. </RequireAll>
  68. </IfModule>
  69. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement