I've accepted an answer, but sadly, I believe we're stuck with our original worst case scenario: CAPTCHA everyone on purchase attempts of the crap. Short explanation: caching / web farms make it impossible to track hits, and any workaround (sending a non-cached web-beacon, writing to a unified table, etc.) slows the site down worse than the bots would. There is likely some pricey hardware from Cisco or the like that can help at a high level, but it's hard to justify the cost if CAPTCHA-ing everyone is an alternative. I'll attempt a more full explanation later, as well as cleaning this up for future searchers (though others are welcome to try, as it's community wiki).

情况

这是关于woot.com上的垃圾销售。我是Woot Workshop的总统,Woot Workshop是Woot的子公司,负责设计,撰写产品描述,播客,博客文章,并主持论坛。我使用CSS/HTML,对其他技术几乎不熟悉。我与开发人员密切合作,在这里讨论了所有的答案(以及我们的许多其他想法)。

可用性是我工作的重要组成部分,而让网站变得令人兴奋和有趣则是剩下的大部分工作。这就是下面三个目标的来源。验证码损害了可用性,机器人从我们的垃圾销售中偷走了乐趣和兴奋。

机器人一秒钟就会在我们的首页上猛击数十次屏幕抓取(和/或扫描我们的RSS),以寻找随机垃圾销售。他们一看到这个,就会触发程序的第二阶段登录,点击“我要一个”,填好表格,然后买下这些垃圾。

评价

lc:在stackoverflow和其他使用此方法的站点上,他们几乎总是处理已验证(登录)的用户,因为正在尝试的任务需要这样。

在Woot上,匿名(未登录)用户可以查看我们的主页。换句话说,撞击机器人可以不经过身份验证(除了IP地址之外基本上无法跟踪)。

所以我们又回到了扫描IP, a)在这个云网络和垃圾邮件僵尸的时代是相当无用的,b)考虑到来自一个IP地址的业务数量,捕获了太多无辜的人(更不用说非静态IP isp的问题和试图跟踪它的潜在性能影响)。

还有,让别人给我们打电话是最糟糕的情况。我们能让他们给你打电话吗?

布拉德克:内德·巴切德的方法看起来很酷,但它们是专门设计来击败为网络站点构建的机器人的。我们的问题是机器人是专门用来破坏我们网站的。其中一些方法可能只在很短的时间内有效,直到脚本编写人员将他们的机器人进化为忽略蜜罐,从屏幕上抓取附近的标签名称而不是表单id,并使用支持javascript的浏览器控件。

 

lc再次说道:“当然,除非炒作是你们营销计划的一部分。”是的,绝对是。当物品出现时的惊喜,以及当你设法得到一件物品时的兴奋,可能比你实际得到的垃圾一样重要,甚至更重要。任何消除先到/先得的东西都不利于“赢”的快感。

 

novatrust:就我个人而言,欢迎我们新的机器人霸主。我们实际上提供RSSfeeds,允许第三方应用程序扫描我们的网站的产品信息,但不是在主站HTML之前。如果我的理解正确的话,你的解决方案通过完全牺牲目标1来帮助目标2(性能问题),并放弃机器人将购买大部分垃圾的事实。我给你的回答投了赞成票,因为你最后一段的悲观情绪对我来说是准确的。这里似乎没有什么灵丹妙药。

其余的响应通常依赖于IP跟踪,这似乎是无用的(僵尸网络/僵尸/云网络)和有害的(捕获许多来自相同IP目的地的无辜的人)。

还有其他方法/想法吗?我的开发人员一直在说“让我们只做验证码”,但我希望有更少的侵入性方法,让所有真正想要我们的垃圾的人。

最初的问题

假设你卖的东西很便宜,但有很高的感知价值,而你的数量非常有限。没有人确切地知道你什么时候会卖这个东西。超过一百万人经常来看你卖什么。

你最终会发现脚本和机器人试图通过编程方式[a]找出你何时出售该道具,[b]确保他们是第一批购买该道具的人。这很糟糕,有两个原因:

你的网站被非人类攻击,拖慢了所有人的速度。 编剧最终“赢得”了产品,让常客感到被骗了。

一个看似显而易见的解决方案是为用户在下单前设置一些障碍,但这至少有三个问题:

The user experience sucks for humans, as they have to decipher CAPTCHA, pick out the cat, or solve a math problem. If the perceived benefit is high enough, and the crowd large enough, some group will find their way around any tweak, leading to an arms race. (This is especially true the simpler the tweak is; hidden 'comments' form, re-arranging the form elements, mis-labeling them, hidden 'gotcha' text all will work once and then need to be changed to fight targeting this specific form.) Even if the scripters can't 'solve' your tweak it doesn't prevent them from slamming your front page, and then sounding an alarm for the scripter to fill out the order, manually. Given they get the advantage from solving [a], they will likely still win [b] since they'll be the first humans reaching the order page. Additionally, 1. still happens, causing server errors and a decreased performance for everyone.

另一种解决方案是经常监视ip攻击,阻止它们进入防火墙,或以其他方式阻止它们排序。这个可以解2。和阻止[b],但扫描ip对性能的影响是巨大的,可能会导致更多像1这样的问题。比编剧自己造成的还要严重。此外,云网络和垃圾邮件僵尸的可能性使得IP检查相当无用。

第三个想法,强迫订单表单加载一段时间(比如半秒),可能会减慢快速订单的进度,但同样,脚本编写人员仍然是第一个进入的人,在任何速度下都不会对实际用户造成损害。

目标

将道具卖给非脚本人。 保持网站运行的速度不被机器人减慢。 不要让“正常”用户完成任何任务来证明他们是人类。


当前回答

你的最终目标是让更多的用户购买你的产品。

如果您在一两个小时内释放w00t包,并在一系列IP地址上释放它们,而不是同时将它们释放到任何IP地址,会怎么样呢?

假设你有255袋w00t。1.0.0.0可以在第一分钟购买,2.0.0.0可以在第二分钟购买(可能有2袋w00t可用),等等。

然后,在255分钟之后,你已经为每个人提供了几袋w00t,尽管很可能不是所有255袋w00t都剩下了。

这将真正的攻击限制在拥有>255台计算机的用户,尽管机器人用户可能能够“拥有”分配给他们的IP范围的w00t包。

没有要求你匹配包的IP公平(你肯定应该使用某种类型的MD5 /随机种子的东西)…如果你增量地分配10袋w00t,你只需要确保它在你的人群中均匀地分配。

如果IP不好,那么您可以使用cookie,并排除向未经过cookie的用户提供一袋w00t的用例。

如果您注意到某个特定的IP、cookie或地址范围具有非常大的流量,请按比例在稍后/最后向它们提供w00t包,以便偶尔/稳定/缓慢的访问者在重度/快速/可能的bot用户之前获得机会。

——罗伯特。

其他回答

我同意OP在这里-请不要验证码-这不是一个非常woot的做事方式。

首先设置一些机器人陷阱。我会在主页上更经常地提到BOC,让机器人看起来不智能,所以每次措辞都不同。“中行投诉上升!”所以扫描关键词的机器人会被困住。

然而,我认为真正的问题是双重的,首先是你需要解决的性能问题,今天是机器人造成了一个问题,但它向我表明,有一个性能问题需要解决。

其次,这是一个商业机会,可以把一些真正的垃圾转化为利润。所以我将保持整体woot风格并声明“我们检查机器人”。如果我们认为你是机器人,你就会得到一盒垃圾。”

机器人检查将在销售完成后的某个时间离线完成,使用机器人陷阱,IP号码,cookie,会话,浏览器字符串等。对你获得的购买者数据做一些认真的分析,以决定谁得到了废话。如果你决定发布垃圾,那么你就可以把一些正常的垃圾卖给别人。

Provide an RSS feed so they don't eat up your bandwidth. When buying, make everyone wait a random amount of time of up to 45 seconds or something, depending on what you're looking for exactly. Exactly what are your timing constraints? Give everyone 1 minute to put their name in for the drawing and then randomly select people. I think this is the fairest way. Monitor the accounts (include some times in the session and store it?) and add delays to accounts that seem like they're below the human speed threshold. That will at least make the bots be programmed to slow down and compete with humans.

我将要描述的方法有两个要求。1) Javascript被强制执行2)一个具有有效http://msdn.microsoft.com/en-us/library/bb894287.aspx浏览器会话的web浏览器。

如果没有其中任何一个,你就是“故意”倒霉的。互联网被设计成允许匿名客户查看内容。简单的HTML没有办法解决这个问题。哦,我只是想说,简单的,基于图像的验证码很容易被击败,甚至作者也承认这一点。

Moving along to the problem and the solution. The problem is in two parts. The first is that you cannot block out an individual for "doing bad things". To fix this you setup a method that takes in the browsers valid session and generate a md5sum + salt + hash (of your own private device) and send it back to the browser. The browser then is REQUIRED to return that hashed key back during every post / get. If you do not ever get a valid browser session, then you reply back with "Please use a valid web browser blah blah blah". All popular browsers have valid browser session id's.

现在我们至少有了该浏览器会话的标识(我知道它不会永久锁定,但是通过简单的脚本很难“更新”一个浏览器会话),我们可以有效地锁定一个会话(例如;让脚本编写人员很难访问你的网站,而不会对有效用户造成任何惩罚)。

Now this next part is why it requires javascript. On the client you build a simple hash for each character that comes from the keyboard versus the value of the text in the textarea. That valid key comes over to the server as a simple hash and has to be validated. While this method could easily be reverse engineered, it does make it one extra hoop that individuals have to go through before they can submit data. Mind you this only prevents auto posting of data, not DOS with constant visits to the web site. If you even have access to ajax there is a way to send a salt and hash key across the wire and use javascript with it to build the onkeypress characters "valid token" that gets sent across the wire. Yes like I said it could easily be reversed engineered, but you see where I am going with this hopefully.

现在为了防止不断的交通滥用。有几种方法可以在给定有效的会话id后建立模式。这些模式(即使使用Random来抵消请求时间)的epsilon比人类试图重现相同的误差范围时要低。由于您有一个会话ID,并且您有一个“看起来像一个bot”的模式,那么您可以用一个简单的轻量级响应屏蔽该会话,该响应是20字节而不是200000字节。

You see here, the goal is to 1) make the anonymous non-anonymous (even if it's only per session) and 2) develop a method to identify bots vs. normal people by establishing patterns in the way they use your system. You can't say that the latter is impossible, because I have done it before. While, my implementations were for tracking video game bots I would seem to think that those algorithms for identifying a bot vs. a user can be generalized to the form of web site visits. If you reduce the traffic that the bots consume you reduce the load on your system. Mind you this still does not prevent DOS attacks, but it does reduce the amount of strain a bot produces on the system.

问:你如何阻止脚本写手在一秒钟内上百次地攻击你的网站? A:你不需要。外部代理无法阻止这种行为。

你可以使用大量的技术来分析传入的请求,并尝试启发式地确定谁是人,谁不是人……但它会失败。最终,即使不是马上。

唯一可行的长期解决方案是改变游戏,使网站不再对机器人友好,或者减少对编剧的吸引力。

你是怎么做到的?那是另一个问题了!: -)

...

好吧,上面已经给出了一些选项(并拒绝了)。我对你的网站不是很熟悉,只看过一次,但由于人们可以阅读图像中的文本,而机器人无法轻松做到这一点,所以将公告更改为图像。不是验证码,只是一个图像-

generate the image (cached of course) when the page is requested keep the image source name the same, so that doesn't give the game away most of the time the image will have ordinary text in it, and be aligned to appear to be part of the inline HTML page when the game is 'on', the image changes to the announcement text the announcement text reveals a url and/or code that must be manually entered to acquire the prize. CAPTCHA the code if you like, but that's probably not necessary. for additional security, the code can be a one-time token generated specifically for the request/IP/agent, so that repeated requests generate different codes. Or you can pre-generate a bunch of random codes (a one-time pad) if on-demand generation is too taxing.

运行真实的人对这个问题的响应的时间试验,并忽略('哎呀,发生错误,对不起!请再试一次’)的反应比一半的时间要快。此事件还应该触发警报,提醒开发者至少有一个机器人已经弄清楚了代码/游戏,所以是时候修改代码/游戏了。

继续定期地改变游戏,即使没有机器人触发它,这只是在浪费编剧的时间。最终,编剧会厌倦这款游戏,去别的地方……我们希望;-)

最后一个建议:当你的主页收到请求时,把它放到一个队列中,然后在一个单独的进程中按顺序响应请求(你可能不得不入侵/扩展web服务器来做到这一点,但这可能是值得的)。如果来自同一IP/代理的另一个请求进入,而第一个请求在队列中,忽略它。这将自动减轻机器人的负载。

编辑:另一种选择,除了使用图像,是使用javascript来填写购买/不购买的文本;机器人很少解释javascript,所以他们不会看到它

我不能百分之百地确定这是否可行,至少不尝试一下是不行的。

But it seems as if it should be possible, although technically challenging, to write a server-side HTML/CSS scrambler that takes as its input a normal html page + associated files, and outputs a more or less blank html page, along with an obfuscated javascript file that is capable of reconstructing the page. The javascript couldn't just print out straightforward DOM nodes, of course... but it could spit out a complex set of overlapping, absolute-positioned divs and paragraphs, each containing one letter, so it comes out perfectly readable.

机器人将无法阅读它,除非它们使用完整的渲染引擎和足够的人工智能来重建人类将看到的内容。

然后,因为这是一个自动化的过程,您可以根据您的计算能力经常重新打乱站点-每分钟,或每十分钟,或每小时,甚至每次页面加载。

当然,写这样一篇含糊不清的文章会很困难,而且可能不值得。但这只是一个想法。