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检查相当无用。

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

目标

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


当前回答

Woot用来解决这个问题的方法正在改变游戏。当他们展示一种非常受欢迎的商品出售时,他们会让用户玩电子游戏来订购它。

这不仅能够有效地对抗机器人(它们能够轻松地对游戏进行一些小改变以避免自动玩家,甚至为每次销售提供一个新游戏),而且还能够给用户一种“赢得”所需道具的印象,同时减缓订购过程。

它仍然很快就卖光了,但我认为解决方案是好的——重新评估问题和改变参数导致了一个成功的战略,而严格的技术解决方案根本不存在。


你的整个商业模式都是基于“先到先得”。你不能像广播电台那样(他们不再把第一个打电话的人视为赢家,而是把第5个、第20个或第13个打电话的人视为赢家)——这与你的主要特点不匹配。

不,如果不改变实际用户的订购体验,就无法做到这一点。

假设你实施了所有这些策略。如果我认为这很重要,我就会找100个人和我一起工作,我们会在100台不同的电脑上构建软件,每秒访问你的网站20次(每个用户/cookie/帐户/IP地址访问间隔5秒)。

你有两个阶段:

看头版 订购

你不能设置一个验证码阻塞#1 -那样会失去真正的客户(“什么?每次我想看最新的woot时,我都必须解决验证码?!?”)。

所以我的小组一起观察,计时,所以我们每秒得到大约20次检查,第一个看到变化的人会提醒所有其他人(自动),他们将再次加载首页,遵循订单链接,并执行交易(这也可能是自动发生的,除非你实现验证码并为每次wootoff/boc更改它)。

你可以把验证码放在第2条前面,虽然你不愿意这么做,但这可能是确保即使机器人看首页,真正的用户也能得到产品的唯一方法。

但即使有验证码,我的100个小团队仍然有显著的先发优势——而且你无法分辨我们不是人类。如果你开始计时我们的访问,我们只会增加一些抖动。我们可以随机选择要刷新的计算机,这样访问顺序就会不断变化,但看起来仍然足够像人类。

首先,摆脱简单的机器人

你需要有一个自适应防火墙来监视请求,如果有人在做明显的愚蠢的事情——在同一个IP上每秒刷新一次以上,那么就采用策略来减慢他们的速度(丢弃数据包,发回拒绝或500个错误,等等)。

这将显著降低你的流量,并改变机器人用户使用的策略。

第二,让服务器非常快。

你真的不想听这个…但是…

我认为你需要的是一个完全自定义的解决方案。

您不需要打乱TCP/IP堆栈,但是您可能需要开发一个非常、非常、非常快的定制服务器,该服务器是专门用于关联用户连接并对各种攻击做出适当反应的。

Apache, lighthttpd等都很灵活,但你运行的是一个单一用途的网站,你真的需要能够做的比当前服务器所能做的更多(无论是在处理流量,还是在适当地打击机器人)。

By serving a largely static webpage (updates every 30 seconds or so) on a custom server you should not only be able to handle 10x the number of requests and traffic (because the server isn't doing anything other than getting the request, and reading the page from memory into the TCP/IP buffer) but it will also give you access to metrics that might help you slow down bots. For instance, by correlating IP addresses you can simply block more than one connection per second per IP. Humans can't go faster than that, and even people using the same NATed IP address will only infrequently be blocked. You'd want to do a slow block - leave the connection alone for a full second before officially terminating the session. This can feed into a firewall to give longer term blocks to especially egregious offenders.

但现实是,无论你做什么,当机器人是由人类为单一目的定制时,都无法将人类与机器人区分开来。机器人只是人类的代理。

结论

在一天结束的时候,你不能通过看头版来区分人类和计算机。您可以在订购步骤停止机器人,但机器人用户仍然具有先发优势,并且您仍然需要管理巨大的负载。

你可以为简单的机器人添加块,这将提高标准,更少的人会为它烦恼。这也许就足够了。

但如果不改变你的基本模型,你就不走运了。你能做的最好的事情就是处理好简单的情况,让服务器快速到普通用户注意不到的程度,并出售大量道具,即使你有数百万个机器人,许多想要它们的普通用户也会得到它们。

你可能会考虑建立一个蜜罐,并将用户帐户标记为机器人用户,但这将引起巨大的负面社区反弹。

每次我想到“好吧,这样做怎么样?”我总是可以用合适的机器人策略来对抗它。

即使你在首页设置了一个验证码来进入订购页面(“这个项目的订购按钮是蓝色的,带粉红色的火花,在这个页面的某个地方”),机器人也会简单地打开页面上的所有链接,并使用返回订购页面的任何一个链接。这根本不可能赢。

提高服务器的速度,在订购页面上输入reCaptcha(这是我发现的唯一一个不容易被愚弄的方法,但对你的应用程序来说可能太慢了),并考虑如何稍微改变模型,让普通用户有和机器人用户一样好的机会。

亚当

其他回答

Go after the money stream. It is much easier than tracking the IP side. Make bots pay too much a few times (announcement with white text on white background and all variants of it) kills their business case quickly. You should prepare this carefully, and make good use of the strong points of bots: their speed. Did you try a few thousand fake announcements a few seconds apart? If they are hitting ten times/second you can go even faster. You want to keep this up as long as they keep buying, so think carefully about the moment of the day/week you want to start this. Ideally, they will stop paying, so you can hand over your case to a bank. Make sure your site is fully generated, and each page access returns different page content (html, javascript and css). Parsing is more difficult than generating, and it is easy to build-in more variation than bot developers can handle. Keep on changing the content and how you generate it. You need to know how fast bots can adapt to changes you make, and preferably the timezone they are in. Is it one botnet or more, are they in the same timezone, a different one, or is it a worldwide developer network? You want your counterattack to be timed right. Current state of the art bots have humans enter captcha's (offered against porn/games). Make it unattractive to react very fast. Use hashes and honeypots, as Ned Batchelder explains.

(编辑) 你不能防御僵尸网络的说法是不对的。特别是我的第二个建议提供了充分的防御自动买家。不过,这需要你彻底重新思考你所使用的技术。您可能希望使用Seaside或直接在c中进行一些实验。

假定原则:

第一个屏幕必须是非常简单的低开销HTML,带有一个易于识别的按钮(游戏邦注:无论是机器人还是玩家),以明确表示“我想要我的垃圾”。因为我们假设了最坏的情况-你有来自机器人和非机器人组合的DOS攻击,所有人都首先点击网站(就可识别性而言)。所以让我们尽快把这些从缓存,良性回声机器人等中分发出去。

(注:就追求者而言,这就是发生的事情;这对用户和Woot来说都是痛苦的,所以任何有助于吸收或缓解首次屏幕获取的内容都符合三方的利益。)

然后,对于非机器人来说,这个过程不需要比现在更糟糕,对于正版机器人来说,不需要额外的步骤(或痛苦)。(关于当前设计的背景说明:当前的wooters通常已经签约,或者可以在购买过程中签约。新买家需要在购买时进行注册。所以实际上已经注册和已经登录会更快。)

为了完成垃圾销售,需要导航一系列交易屏幕(比如5个正负,取决于具体情况)。获胜者是第一个完成全部导航的人。当前进程奖励那些最快完成整个5个屏幕序列的机器人(或其他人);但整个进程都偏向于快速响应(即机器人)。

毫无疑问,机器人将在第一个屏幕上占据优势;无论他们在这一点上取得了什么优势,他们都会在剩下的屏幕上保持下去,再加上身体在其他阶段提供的任何优势。


What if Woot were to intentionally decouple the queuing process after the first screen, and feed every session from that point into a sequence of fixed-minimum-time steps? The second screen wouldn't even be presented until 30 seconds had passed; after it was submitted, same for the following screens. I bet wooters would have no problem if they were told that, after the first screen, they would wait in a queue (which is already true) that would spread the load over time in a way that should take no longer than before, be more robust, and help weed out the bots. At this point you can throw in some of the bot speedbumps listed above (subtle variations in DOM objects, etc.) Just the benefit from the perception that Woot is a little more in control of things would help.

If a much higher proportion of the BOC initial hits could segue into a bot-unfriendlier non-time-critical process on their first hit (or close to it), rather than retrying, then real people who get past that point would have more confidence. For sure it would be less hostile than the current situation. It might cut down on the background-noise-ambient-bot-rate that's going on all the time even under normal Woot-Off circumstances. And the bots would lay off the main page and sit in the queue with each other (and everyone else) where they have no advantage.

Hmmm... The concept "apartment-threaded" comes to mind. I wonder if the pattern is approximately useful? A useful core concept here is being able, after the first screen, to track accumulated total time in queue and be able to adjust to standard. As a bot-mitigation strategy, you would have a little bit of flexibility to maybe fudge the very earliest sessions by maybe 5-10 seconds; doing so would probably be undetectable, but would result in a richer non-bot purchase mix. I'm sure you have statistics to help evaluate stuff like this after the fact. Just for fun, you could (at least for one wootoff) put together your own bot that combines the best features you've seen, and then hand it out to everyone the day before. Then at least everyone would be equally armed. (Then duck ... incoming ...)

I think that sandboxing certain IPs is worth looking into. Once an IP has gone over a threshold, when they hit your site, redirect them to a webserver that has a multi-second delay before serving out a file. I've written Linux servers that can handle open 50K connections with hardly any CPU, so it wouldn't be too hard to slow down a very large number of bots. All the server would need to do is hold the connection open for N seconds before acting as a proxy to your regular site. This would still let regular users use the site even if they were really aggressive, just at a slightly degraded experience.

您可以使用这里描述的memcached,以较低的成本跟踪每个IP的命中数。

我说使用API公开价格信息。这是一个不太直观的解决方案,但它确实能让你控制局面。为API添加一些限制,使其功能略低于网站。

您可以对订购进行同样的操作。您可以尝试对API功能/性能进行小的更改,直到获得所需的效果。

有代理和僵尸网络来挫败IP检查。有一些验证码读取脚本非常好。在印度,甚至有一些团队的工作人员可以花很少的钱来破解验证码。任何你能想到的解决方案都有可能被击败。即使是Ned Batchelder的解决方案也可以通过使用WebBrowser控件或其他与僵尸网络或代理列表相结合的模拟浏览器来超越。

您可以尝试让脚本更难阅读价格。最简单的方法是将其转换为图像,但文本识别算法仍然可以解决这个问题。如果有足够多的脚本编写人员能够解决这个问题,您可以尝试对该图像应用类似验证码的东西,但显然是以牺牲用户体验为代价的。而不是图像,价格可以在一个flash应用程序。

或者,您可以尝试设计一种方法,以某种不影响呈现的方式在页面中“洗牌”HTML。我一时想不出一个好的例子,但我确信它在某种程度上是可行的。