且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何保护/监视您的站点以防恶意用户爬网

更新时间:2022-04-11 06:04:43

第1点存在您提到的问题.同样,这也不利于网站缓慢的爬网,如果这样做的话,对于合法的重度用户来说甚至更糟.

Point 1 has the problem you have mentioned yourself. Also it doesn't help against a slower crawl of the site, or if it does then it may be even worse for legitimate heavy users.

您可以绕过第2点,只允许您信任的用户代理.当然,这对于伪造标准用户代理的工具没有帮助.

You could turn point 2 around and only allow the user-agents you trust. Of course this won't help against a tool that fakes a standard user-agent.

第3点的一种变化就是向站点所有者发送通知,然后他们可以决定如何处理该用户.

A variation on point 3 would just be to send a notification to the site owners, then they can decide what to do with that user.

类似地,对于我在第2点上所做的更改,您可以使此操作更轻松一些,并仅通知有人正在使用奇怪的用户代理访问该网站.

Similarly for my variation on point 2, you could make this a softer action, and just notify that somebody is accessing the site with a weird user agent.

edit:相关,当我访问自己的不公开的URL时,我曾经遇到一个奇怪的问题(我只是在筹建一个未宣布或未链接到任何地方的站点).尽管没有人知道这个URL,但是我却突然发现了日志中的点击.当我找到它时,我发现它来自某个内容过滤站点.原来,我的移动ISP使用第三方来阻止内容,并且拦截了我自己的请求-由于它不知道该网站,因此它获取了我尝试访问的页面,并且(我假设)在其中进行了一些关键字分析以便决定是否阻止.这种情况可能是您需要提防的尾巴情况.