Guest User

Untitled

a guest
Sep 16th, 2012
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.91 KB | None | 0 0
  1.  
  2. # BEGIN Better WP Security
  3. # Begin HackRepair.com Blacklist
  4. if ($http_user_agent ~* "^BlackWidow"){ return 403; }
  5. if ($http_user_agent ~ "^Bolt"){ return 403; }
  6. if ($http_user_agent ~* "CazoodleBot"){ return 403; }
  7. if ($http_user_agent ~* "^ChinaClaw"){ return 403; }
  8. if ($http_user_agent ~* "^Custo"){ return 403; }
  9. if ($http_user_agent ~ "^Default"){ return 403; }
  10. if ($http_user_agent ~* "^DIIbot"){ return 403; }
  11. if ($http_user_agent ~* "^DISCo"){ return 403; }
  12. if ($http_user_agent ~* "discobot"){ return 403; }
  13. if ($http_user_agent ~* "^eCatch"){ return 403; }
  14. if ($http_user_agent ~* "ecxi"){ return 403; }
  15. if ($http_user_agent ~* "^EirGrabber"){ return 403; }
  16. if ($http_user_agent ~* "^EmailCollector"){ return 403; }
  17. if ($http_user_agent ~* "^EmailSiphon"){ return 403; }
  18. if ($http_user_agent ~* "^EmailWolf"){ return 403; }
  19. if ($http_user_agent ~* "^ExtractorPro"){ return 403; }
  20. if ($http_user_agent ~* "^EyeNetIE"){ return 403; }
  21. if ($http_user_agent ~* "^FlashGet"){ return 403; }
  22. if ($http_user_agent ~* "^GetRight"){ return 403; }
  23. if ($http_user_agent ~* "^GetWeb!"){ return 403; }
  24. if ($http_user_agent ~* "^Go!Zilla"){ return 403; }
  25. if ($http_user_agent ~* "^Go-Ahead-Got-It"){ return 403; }
  26. if ($http_user_agent ~* "^GrabNet"){ return 403; }
  27. if ($http_user_agent ~* "^Grafula"){ return 403; }
  28. if ($http_user_agent ~* "GT::WWW"){ return 403; }
  29. if ($http_user_agent ~* "heritrix"){ return 403; }
  30. if ($http_user_agent ~* "^HMView"){ return 403; }
  31. if ($http_user_agent ~* "HTTP::Lite"){ return 403; }
  32. if ($http_user_agent ~* "HTTrack"){ return 403; }
  33. if ($http_user_agent ~* "ia_archiver"){ return 403; }
  34. if ($http_user_agent ~* "IDBot"){ return 403; }
  35. if ($http_user_agent ~* "id-search"){ return 403; }
  36. if ($http_user_agent ~* "id-search.org"){ return 403; }
  37. if ($http_user_agent ~* "^InterGET"){ return 403; }
  38. if ($http_user_agent ~* "^InternetSeer.com"){ return 403; }
  39. if ($http_user_agent ~* "IRLbot"){ return 403; }
  40. if ($http_user_agent ~* "^Java"){ return 403; }
  41. if ($http_user_agent ~* "^JetCar"){ return 403; }
  42. if ($http_user_agent ~* "^larbin"){ return 403; }
  43. if ($http_user_agent ~* "^LeechFTP"){ return 403; }
  44. if ($http_user_agent ~* "libwww"){ return 403; }
  45. if ($http_user_agent ~* "libwww-perl"){ return 403; }
  46. if ($http_user_agent ~* "^Link"){ return 403; }
  47. if ($http_user_agent ~* "LinksManager.com_bot"){ return 403; }
  48. if ($http_user_agent ~* "linkwalker"){ return 403; }
  49. if ($http_user_agent ~* "lwp-trivial"){ return 403; }
  50. if ($http_user_agent ~* "^Maxthon$"){ return 403; }
  51. if ($http_user_agent ~* "MFC_Tear_Sample"){ return 403; }
  52. if ($http_user_agent ~* "^microsoft.url"){ return 403; }
  53. if ($http_user_agent ~ "Microsoft"){ return 403; }
  54. if ($http_user_agent ~* "^Mozilla.*Indy"){ return 403; }
  55. if ($http_user_agent ~* "^Mozilla.*NEWT"){ return 403; }
  56. if ($http_user_agent ~* "^MSFrontPage"){ return 403; }
  57. if ($http_user_agent ~* "^Navroad"){ return 403; }
  58. if ($http_user_agent ~* "^NearSite"){ return 403; }
  59. if ($http_user_agent ~* "^NetAnts"){ return 403; }
  60. if ($http_user_agent ~* "^NetSpider"){ return 403; }
  61. if ($http_user_agent ~* "^NetZIP"){ return 403; }
  62. if ($http_user_agent ~* "^Nutch"){ return 403; }
  63. if ($http_user_agent ~* "^Octopus"){ return 403; }
  64. if ($http_user_agent ~* "^PageGrabber"){ return 403; }
  65. if ($http_user_agent ~* "panscient.com"){ return 403; }
  66. if ($http_user_agent ~* "^pavuk"){ return 403; }
  67. if ($http_user_agent ~* "PECL::HTTP"){ return 403; }
  68. if ($http_user_agent ~* "^PeoplePal"){ return 403; }
  69. if ($http_user_agent ~* "^pcBrowser"){ return 403; }
  70. if ($http_user_agent ~* "PHPCrawl"){ return 403; }
  71. if ($http_user_agent ~* "PleaseCrawl"){ return 403; }
  72. if ($http_user_agent ~* "^psbot"){ return 403; }
  73. if ($http_user_agent ~* "^RealDownload"){ return 403; }
  74. if ($http_user_agent ~* "^ReGet"){ return 403; }
  75. if ($http_user_agent ~ "^Rippers"){ return 403; }
  76. if ($http_user_agent ~* "SBIder"){ return 403; }
  77. if ($http_user_agent ~* "^SeaMonkey$"){ return 403; }
  78. if ($http_user_agent ~* "^sitecheck.internetseer.com"){ return 403; }
  79. if ($http_user_agent ~* "^SiteSnagger"){ return 403; }
  80. if ($http_user_agent ~* "^SmartDownload"){ return 403; }
  81. if ($http_user_agent ~* "Snoopy"){ return 403; }
  82. if ($http_user_agent ~* "Steeler"){ return 403; }
  83. if ($http_user_agent ~* "^SuperBot"){ return 403; }
  84. if ($http_user_agent ~* "^SuperHTTP"){ return 403; }
  85. if ($http_user_agent ~* "^Surfbot"){ return 403; }
  86. if ($http_user_agent ~* "^tAkeOut"){ return 403; }
  87. if ($http_user_agent ~ "^Teleport"){ return 403; }
  88. if ($http_user_agent ~ "^Toata"){ return 403; }
  89. if ($http_user_agent ~* "URI::Fetch"){ return 403; }
  90. if ($http_user_agent ~* "urllib"){ return 403; }
  91. if ($http_user_agent ~* "User-Agent"){ return 403; }
  92. if ($http_user_agent ~* "^VoidEYE"){ return 403; }
  93. if ($http_user_agent ~* "webalta"){ return 403; }
  94. if ($http_user_agent ~* "^WebAuto"){ return 403; }
  95. if ($http_user_agent ~* "^[Ww]eb[Bb]andit"){ return 403; }
  96. if ($http_user_agent ~* "WebCollage"){ return 403; }
  97. if ($http_user_agent ~* "^WebCopier"){ return 403; }
  98. if ($http_user_agent ~* "^WebFetch"){ return 403; }
  99. if ($http_user_agent ~* "^WebLeacher"){ return 403; }
  100. if ($http_user_agent ~* "^WebReaper"){ return 403; }
  101. if ($http_user_agent ~* "^WebSauger"){ return 403; }
  102. if ($http_user_agent ~* "^WebStripper"){ return 403; }
  103. if ($http_user_agent ~* "^WebWhacker"){ return 403; }
  104. if ($http_user_agent ~* "^WebZIP"){ return 403; }
  105. if ($http_user_agent ~* "^Wget"){ return 403; }
  106. if ($http_user_agent ~* "^Widow"){ return 403; }
  107. if ($http_user_agent ~* "^WWW-Mechanize"){ return 403; }
  108. if ($http_user_agent ~* "^WWWOFFLE"){ return 403; }
  109. if ($http_user_agent ~* "zermelo"){ return 403; }
  110. if ($http_user_agent ~* "^Zeus"){ return 403; }
  111. if ($http_user_agent ~* "^Zeus.*Webster"){ return 403; }
  112. if ($http_user_agent ~* "ZyBorg"){ return 403; }
  113. # End HackRepair.com Blacklist
  114.  
  115. location ~ /\.ht { deny all; }
  116. location ~ wp-config.php { deny all; }
  117. location ~ readme.html { deny all; }
  118. location ~ readme.txt { deny all; }
  119. location ~ /install.php { deny all; }
  120. set $susquery 0;
  121. set $rule_2 0;
  122. set $rule_3 0;
  123. rewrite ^wp-includes/(.*).php /not_found last;
  124. rewrite ^/wp-admin/includes(.*)$ /not_found last;
  125. if ($request_method ~* "^(TRACE|DELETE|TRACK)"){ return 403; }
  126. location /wp-comments-post.php {
  127. valid_referers jetpack.wordpress.com/jetpack-comment/ *.blackoutgaming.org;
  128. set $rule_0 0;
  129. if ($request_method ~ "POST"){ set $rule_0 1$rule_0; }
  130. if ($invalid_referer) { set $rule_0 2$rule_0; }
  131. if ($http_user_agent ~ "^$"){ set $rule_0 3$rule_0; }
  132. if ($rule_0 = "3210") { return 403; }
  133. } if ($args ~* "\.\./") { set $susquery 1; }
  134. if ($args ~* "(bash|git|hg|log|svn|swp|cvs)") { set $susquery 1; }
  135. if ($args ~* "etc/passwd") { set $susquery 1; }
  136. if ($args ~* "boot.ini") { set $susquery 1; }
  137. if ($args ~* "ftp:") { set $susquery 1; }
  138. if ($args ~* "http:") { set $susquery 1; }
  139. if ($args ~* "https:") { set $susquery 1; }
  140. if ($args ~* "(<|%3C).*script.*(>|%3E)") { set $susquery 1; }
  141. if ($args ~* "mosConfig_[a-zA-Z_]{1,21}(=|%3D)") { set $susquery 1; }
  142. if ($args ~* "base64_encode") { set $susquery 1; }
  143. if ($args ~* "(%24&x)") { set $susquery 1; }
  144. if ($args ~* "(\[|\]|\(|\)|<|>|ĂȘ|\"|;|\?|\*|=$)"){ set $susquery 1; }
  145. if ($args ~* "(&#x22;|&#x27;|&#x3C;|&#x3E;|&#x5C;|&#x7B;|&#x7C;|%24&x)"){ set $susquery 1; }
  146. if ($args ~* "(%0|%A|%B|%C|%D|%E|%F|127.0)") { set $susquery 1; }
  147. if ($args ~* "(globals|encode|localhost|loopback)") { set $susquery 1; }
  148. if ($args ~* "(request|select|insert|concat|union|declare)") { set $susquery 1; }
  149. if ($http_cookie !~* "wordpress_logged_in_" ) {
  150. set $susquery 2$susquery;
  151. set $rule_2 1;
  152. set $rule_3 1;
  153. }
  154. if ($args !~ "^loggedout=true") { set $susquery 3$susquery; }
  155. if ($susquery = 4321) { return 403; }
  156. rewrite ^/login/?$ /wp-login.php?h31b3p24t026b3p0xkfd1 redirect;
  157. if ($rule_2 = 1) { rewrite ^/admin/?$ /wp-login.php?h31b3p24t026b3p0xkfd1&redirect_to=/wp-admin/ redirect; }
  158. if ($rule_2 = 0) { rewrite ^/admin/?$ /wp-admin/?h31b3p24t026b3p0xkfd1 redirect; }
  159. rewrite ^/register/?$ /wp-login.php?h31b3p24t026b3p0xkfd1&action=register redirect;
  160. if ($uri !~ "^(.*)admin-ajax.php") { set $rule_3 2$rule_3; }
  161. if ($http_referer !~* wp-admin ) { set $rule_3 3$rule_3; }
  162. if ($http_referer !~* wp-login.php ) { set $rule_3 4$rule_3; }
  163. if ($http_referer !~* login ) { set $rule_3 5$rule_3; }
  164. if ($http_referer !~* admin ) { set $rule_3 6$rule_3; }
  165. if ($http_referer !~* register ) { set $rule_3 7$rule_3; }
  166. if ($args !~ "^action=logout") { set $rule_3 8$rule_3; }
  167. if ($args !~ "^h31b3p24t026b3p0xkfd1") { set $rule_3 9$rule_3; }
  168. if ($args !~ "^action=rp") { set $rule_3 0$rule_3; }
  169. if ($args !~ "^action=register") { set $rule_3 a$rule_3; }
  170. if ($args !~ "^action=postpass") { set $rule_3 b$rule_3; }
  171. if ($rule_3 = ba0987654321) {
  172. rewrite ^(.*/)?wp-login.php /not_found redirect;
  173. rewrite ^/wp-admin(.*)$ /not_found redirect;
  174. }
  175. # END Better WP Security
Add Comment
Please, Sign In to add comment