抓取\蜘蛛防护

发布于 2024-12-22 07:27:12 字数 212 浏览 3 评论 0原文

有一个站点\资源提供一些一般统计信息以及搜索工具的界面。这种搜索操作的成本很高,因此我想限制频繁且连续(即自动)的搜索请求(来自人,而不是来自搜索引擎)。

我相信有很多现有的技术和框架可以执行一些情报抓取保护,所以我不必重新发明轮子。我通过 mod_wsgi 使用 Python 和 Apache。

我知道 mod_evasive (将尝试使用它),但我也对任何其他技术感兴趣。

There is a site\resource that offers some general statistic information as well as an interface to search facilities. This search operations are costly, so I want to restrict frequent and continuous (i.e. automatic) search requests (from people, not from search engines).

I believe there are many existing techniques and frameworks that perform some intelligence grabbing protection, so I don't have to reinvent a wheel. I'm using Python and Apache through mod_wsgi.

I am aware of mod_evasive (will try to use it), but I'm also interested in any other techniques.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北城孤痞 2024-12-29 07:27:12

如果有人正在寻找您的网站和数据,那么这确实是值得的 - 在这种情况下,没有什么可以阻止足够聪明的攻击者。

尽管有一些事情值得尝试:

  • 保留来自特定 IP 和用户代理的搜索使用计数器。当达到某些每分钟/每小时/每日阈值时阻止它们。
  • 使用潜在有害 IP 或威胁级别的黑名单(例如,您可以使用 Cloudflare API 为此)
  • 缓存频繁的搜索结果以降低它们的成本
  • 这可能有点疯狂,但是您可以在图像上或通过 flash/java 小程序呈现该统计信息 - 这将使它们更具挑战性
  • 有点相似到上一个:使用一些访问搜索结果的棘手 API,例如它可以是基于 WebSocket 的 ProtocolBuffer。因此,有人可能需要一个成熟的浏览器来获取它,或者至少必须围绕 Node.js 构建一些技巧。缺点 - 您将失去使用旧浏览器的合法客户端。

If someone's hunting exactly your website and data there 's really worthy - nothing will stop the smart enough attacker in this case.

Though there are some things worth trying:

  • Keep counters of search usage from specific IPs and User-Agents. Block them when some minutely/hourly/daily thresholds are reached.
  • Use blacklists of potentially harmful IPs or threat levels (for example you can use Cloudflare API for that)
  • Cache the frequent search results to make them less costly
  • It's probably a bit crazy, but you can render that statistics on images or via flash/java applets - it will make them much more challenging to grab
  • A bit similar to previous one: use some tricky API to access search results, for example it can be ProtocolBuffers over WebSockets. So someone will probably need a full-blown browser to grab that or at least have to build some trickery around node.js. Downside - you'll lose legitimate clients using old browsers.
那请放手 2024-12-29 07:27:12

您可以尝试 robots.txt 文件。我相信您只是将其放在应用程序的根目录中,但该网站应该有更多详细信息。 Disallow 语法正是您所寻找的。

当然,并非所有机器人都尊重它,但它们都应该。所有大公司(谷歌、雅虎等)都会。

您可能还对这个有关禁止动态网址的问题感兴趣

You could try a robots.txt file. I believe you just put it at the root of your application, but that website should have more details. The Disallow syntax is what you're looking for.

Of course, not all robots respect it, but they all should. All the big companies (Google, Yahoo, etc.) will.

You may also be interested in this question about disallowing dynamic URLs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文