白名单以阻止使用 IIS 的不良机器人
基本上我想在 IIS 中执行此操作:
在 Apache 中,您只需将 .htaccess 文件更改为 OPT-IN 而不是 OPT-OUT,即可阻止许多机器人,基本上是白名单而不是黑名单。默认情况下,您允许 Google、Yahoo、MSN 等以及 IE、Opera、Firefox、Netscape 进入并退回其他所有内容。这里的美妙之处在于,您不必再继续寻找机器人,因为任何标识自己为机器人的东西都会被退回。
我如何在 IIS 中实现这一点?你能给我举个例子吗?谢谢!
参考文献: http://www .spanishseo.org/how-to-identify-user-agents-and-ip-addresses-for-bot-blocking
http://incredibill.blogspot.com/2011/05/whitelisting -not-blacklisting-to-stop.html
Basically I want to do this in IIS:
In Apache you can block many bots by simply changing your .htaccess files to OPT-IN instead of OPT-OUT, basically whitelisting instead of blacklisting. You let in Google, Yahoo, MSN, etc. and IE, Opera, Firefox, Netscape and bounce EVERYTHING else by default. The beauty here is you don't have to keep looking for bots anymore as anything that identifies itself as a bot will be bounced.
How do I achieve that in IIS? Can you please point me to an example? Thanks!
references: http://www.spanishseo.org/how-to-identify-user-agents-and-ip-addresses-for-bot-blocking
http://incredibill.blogspot.com/2011/05/whitelisting-not-blacklisting-to-stop.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IIS 中没有执行此操作的本机方法。如果您使用的是 asp.net,则很容易创建一个 httpmodule 来执行此过滤,但除非我们谈论的是 IIS7,否则只会过滤 .net 请求。
除此之外,您还会看到一个 IIS 过滤器,它是用 C++ 或 Delphi 或可以编译 dll 之类的东西编写的。它们也不容易写。
我写了类似的东西,使用 Project Honeypot (http://projecthoneypot.org/) 来阻止垃圾邮件 IP 地址。您可以在此处获取:http://code.google.com/p/blacklistprotector/
There's no native way of doing this in IIS. If you're using asp.net it's easy enough to create an httpmodule to do this filtering, although unless we're talking IIS7 then only .net requests will be filtered.
Outside of that, you're looking at an IIS Filter, written in something like C++ or Delphi or something that can compile a dll. They're not easy to write either.
I wrote something similar that uses Project Honeypot (http://projecthoneypot.org/) to block spammy IP addresses. You can get it here: http://code.google.com/p/blacklistprotector/