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(这是我发现的唯一一个不容易被愚弄的方法,但对你的应用程序来说可能太慢了),并考虑如何稍微改变模型,让普通用户有和机器人用户一样好的机会。
亚当
首先,根据定义,它不可能支持无状态,即真正匿名的事务,同时还能够将机器人与合法用户分开。
如果我们可以接受这样一个前提,即我们可以在一个全新的woot访问者的第一页点击上强加一些成本,我想我有一个可能的解决方案。由于没有更好的名称,我将粗略地称这种解决方案为“访问DMV”。
假设有一家汽车经销商每天提供一辆不同的新车,在某些日子里,你可以以每辆5美元的价格购买一辆异国情调的跑车(最多3辆),外加5美元的目的地费。
问题是,经销商要求你去经销商处并出示有效的驾驶执照,然后你才能被允许通过门查看正在出售的汽车。此外,你必须说有效的驾驶执照才能购买。
因此,第一次来这家汽车经销商的游客(让我们叫他鲍勃)会被拒绝进入,并被推荐到DMV办公室(就在隔壁,很方便)获得驾驶执照。
其他持有效驾驶执照的旅客出示驾驶执照后,方可进入。一个整天在店里闲逛、纠缠推销员、抢宣传册、喝光免费赠送的咖啡和饼干的人最终会被拒之门外。
现在,回到没有驾照的鲍勃,他所要做的就是忍受一次车管所的访问。在那之后,他可以随时去经销商那里买车,除非他不小心把钱包落在家里了,或者他的驾照被销毁或吊销了。
在这个世界上,驾照几乎是不可能伪造的。
去车管所首先要在“从这里开始”的队列处领取申请表。Bob必须把填好的申请拿到窗口1,在那里,许多脾气暴躁的公务员中的第一个会拿着他的申请,处理它,如果一切正常,就在窗口的申请上盖章,然后把他送到下一个窗口。于是,鲍勃从一个窗口走到另一个窗口,等待他的申请的每一步通过,直到最后他拿到了他的驾驶执照。
试图“短路”车管所是没有意义的。如果表单一式三份没有正确填写,或者在任何窗口中给出错误的答案,应用程序将被销毁,倒霉的客户将被送回起点。
有趣的是,无论办公室是满是空,每个窗口的服务时间都差不多。即使你是唯一一个排队的人,工作人员似乎也喜欢让你在黄线后面等一分钟,然后才说:“下一个!”
然而,车管所的情况并没有那么糟糕。当所有的等待和获得许可证的过程正在进行时,你可以在DMV大厅观看一个非常有趣和有信息的汽车经销商的电视购物。事实上,该信息购物的运行时间仅够覆盖您获得许可证所花费的时间。
更专业一点的解释是:
正如我在最上面所说的,在客户机-服务器关系上有一定的状态性是必要的,它允许您将人类与机器人分开。您希望以一种不会过度惩罚匿名(未经过身份验证)人类访问者的方式进行操作。
这种方法可能需要AJAX-y客户端处理。一个全新的woot访问者会看到一个“欢迎新用户!”页面,其中充满了文本和图形(通过适当的服务器端调整),需要几秒钟才能完全加载。在此过程中(访问者可能正忙着阅读欢迎页面),他的标识令牌正在慢慢地组装起来。
Let's say, for discussion, the token (aka "driver's license) consists of 20 chunks. In order to get each successive chunk, the client-side code must submit a valid request to the server. The server incorporates a deliberate delay (let's say 200 millisecond), before sending the next chunk along with the 'stamp' needed to make the next chunk request (i.e., the stamps needed to go from one DMV window to the next). All told, about 4 seconds must elapse to finish the chunk-challenge-response-chunk-challenge-response-...-chunk-challenge-response-completion process.
在这个过程的最后,访问者拥有一个令牌,该令牌允许他进入产品描述页面,然后进入购买页面。令牌是每个访问者的唯一ID,可以用来限制他的活动。
在服务器端,您只接受来自具有有效令牌的客户机的页面视图。或者,如果每个人最终都能看到页面很重要,那么对缺少有效令牌的请求设置时间惩罚。
现在,为了使这对合法的人类访问者来说相对无害,我们不要让令牌发行过程在后台相对非侵入性地发生。因此,欢迎页面需要带有有趣的文字和故意放慢速度的图形。
这种方法迫使机器人要么使用现有的令牌,要么使用最少的设置时间来获得新的令牌。当然,这对使用分布式假访问者网络的复杂攻击没有太大帮助。
假定原则:
第一个屏幕必须是非常简单的低开销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 ...)
首先,让我回顾一下我们需要做的事情。我意识到我只是在转述最初的问题,但重要的是我们要百分之百地理解这个问题,因为有很多很好的建议,4个中有2个或3个是正确的,但正如我将演示的那样,您将需要一个多方面的方法来满足所有的需求。
要求1:摆脱“机器人抨击”:
首页的快速“猛击”正在损害网站的性能,这是问题的核心。这种“猛击”既来自单ip机器人,也可能来自僵尸网络。我们想把两者都去掉。
要求二:不要破坏用户体验:
我们可以通过实施一个讨厌的验证程序来有效地解决机器人的情况,比如打电话给操作员,解决一堆验证码,或类似的问题,但这就像强迫每个无辜的飞机乘客跳过疯狂的安全圈,只是为了抓住最愚蠢的恐怖分子的渺茫机会。哦,等等,我们真的这么做了。但让我们看看在woot.com上能否做到这一点。
要求三:避免“军备竞赛”
正如您所提到的,您不希望卷入垃圾邮件机器人军备竞赛。因此,您不能使用隐藏或混乱的表单字段、数学问题等简单的调整,因为它们本质上是可以简单地自动检测和规避的模糊度量。
需求4:挫败“警报”机器人:
这可能是您的要求中最困难的。即使我们可以进行有效的人类验证挑战,机器人仍然可以在你的首页上投票,并在有新报价时提醒编剧。我们也想让那些机器人变得不可行。这是第一个需求的更强版本,因为机器人不仅不能发出破坏性能的快速请求——它们甚至不能发出足够多的重复请求来及时向脚本人员发送“警报”以赢得报价。
好,让我们看看是否能满足这四个条件。首先,正如我提到的,没有一种测量方法能达到目的。你将不得不结合一些技巧来实现它,你将不得不忍受两个烦恼:
少数用户将被要求经历重重考验
少数用户将无法获得特别优惠
我知道这些都很烦人,但如果我们能让“小”的数字足够小,我希望你会同意利大于弊。
第一个措施:基于用户的节流:
这个很简单,我相信你已经做过了。如果用户已登录,并保持每秒刷新600次(或其他),您将停止响应并告诉他冷却。事实上,你可能会更早地限制他的请求,但你明白我的意思。这样,一个登录的机器人将被禁止/节流一旦它开始投票你的网站。这是简单的部分。那些未经验证的机器人才是我们真正的问题,下面就来谈谈它们:
第二个措施:某种形式的知识产权限制,正如几乎所有人都建议的那样:
No matter what, you will have to do some IP based throttling to thwart the 'bot slamming'. Since it seems important to you to allow unauthenticated (non-logged-in) visitors to get the special offers, you only have IPs to go by initially, and although they're not perfect, they do work against single-IP bots. Botnets are a different beast, but I'll come back to those. For now, we will do some simple throttling to beat rapid-fire single-IP bots.
The performance hit is negligable if you run the IP check before all other processing, use a proxy server for the throttling logic, and store the IPs in a memcached lookup-optimized tree structure.
第三种方法:用缓存的响应掩盖油门:
With rapid-fire single-IP bots throttled, we still have to address slow single-IP bots, ie. bots that are specifically tweaked to 'fly under the radar' by spacing requests slightly further apart than the throttling prevents.
To instantly render slow single-IP bots useless, simply use the strategy suggested by abelenky: serve 10-minute-old cached pages to all IPs that have been spotted in the last 24 hours (or so). That way, every IP gets one 'chance' per day/hour/week (depending on the period you choose), and there will be no visible annoyance to real users who are just hitting 'reload', except that they don't win the offer.
The beauty of this measure is that is also thwarts 'alarm bots', as long as they don't originate from a botnet.
(I know you would probably prefer it if real users were allowed to refresh over and over, but there is no way to tell a refresh-spamming human from a request-spamming bot apart without a CAPTCHA or similar)
第四项措施:
You are right that CAPTCHAs hurt the user experience and should be avoided. However, in _one_ situation they can be your best friend: If you've designed a very restrictive system to thwart bots, that - because of its restrictiveness - also catches a number of false positives; then a CAPTCHA served as a last resort will allow those real users who get caught to slip by your throttling (thus avoiding annoying DoS situations).
The sweet spot, of course, is when ALL the bots get caught in your net, while extremely few real users get bothered by the CAPTCHA.
If you, when serving up the 10-minute-old cached pages, also offer an alternative, optional, CAPTCHA-verified 'front page refresher', then humans who really want to keep refreshing, can still do so without getting the old cached page, but at the cost of having to solve a CAPTCHA for each refresh. That is an annoyance, but an optional one just for the die-hard users, who tend to be more forgiving because they know they're gaming the system to improve their chances, and that improved chances don't come free.
第五种方法:诱饵废话:
Christopher Mahan had an idea that I rather liked, but I would put a different spin on it. Every time you are preparing a new offer, prepare two other 'offers' as well, that no human would pick, like a 12mm wingnut for $20. When the offer appears on the front page, put all three 'offers' in the same picture, with numbers corresponding to each offer. When the user/bot actually goes on to order the item, they will have to pick (a radio button) which offer they want, and since most bots would merely be guessing, in two out of three cases, the bots would be buying worthless junk.
Naturally, this doesn't address 'alarm bots', and there is a (slim) chance that someone could build a bot that was able to pick the correct item. However, the risk of accidentally buying junk should make scripters turn entirely from the fully automated bots.
第六项措施:僵尸网络节流:
(删除)
Okay............ I've now spent most of my evening thinking about this, trying different approaches.... global delays.... cookie-based tokens.. queued serving... 'stranger throttling'.... And it just doesn't work. It doesn't. I realized the main reason why you hadn't accepted any answer yet was that noone had proposed a way to thwart a distributed/zombie net/botnet attack.... so I really wanted to crack it. I believe I cracked the botnet problem for authentication in a different thread, so I had high hopes for your problem as well. But my approach doesn't translate to this. You only have IPs to go by, and a large enough botnet doesn't reveal itself in any analysis based on IP addresses.
所以你知道了,第六小节是零。没什么。邮政编码。除非僵尸网络很小,或者足够快,可以被通常的IP限制,否则我不认为有任何有效的措施可以对抗僵尸网络,而不涉及明确的人类验证,如CAPTHAs。我很抱歉,但我认为结合以上五种方法是你最好的选择。你可能只需要abelenky的10分钟缓存技巧就可以了。
以下是我的看法。攻击机器人所有者的投资回报率,这样他们就会做你想让他们做的合法事情,而不是欺骗。让我们从他们的角度来看。他们的资产是什么?显然,无数的一次性机器、IP地址,甚至可能还有大量不熟练的人愿意做无聊的工作。他们想要什么?总是在其他合法的人得到它之前得到你提供的特别交易。
The good news is that they only have a limited window of time in which to win the race. And what I don't think they have is an unlimited number of smart people who are on call to reverse engineer your site at the moment you unleash a deal. So if you can make them jump through a specific hoop that is hard for them to figure out, but automatic for your legitimate customers (they won't even know it's there), you can delay their efforts just enough that they get beat by the massive number of real people who are just dying to get your hot deal.
The first step is to make your notion of authentication non-binary, by which I mean that, for any given user, you have a probability assigned to them that they are a real person or a bot. You can use a number of hints to build up this probability, many of which have been discussed already on this thread: suspicious rate activity, IP addresses, foreign country geolocation, cookies, etc. My favorite is to just pay attention to the exact version of windows they are using. More importantly, you can give your long-term customers a clear way to authenticate with strong hints: by engaging with the site, making purchases, contributing to forums, etc. It's not required that you do those things, but if you do then you'll have a slight advantage when it comes time to see special deals.
Whenever you are called upon to make an authentication decision, use this probability to make the computer you're talking to do more-or-less work before you will give them what they want. For example, perhaps some javascript on your site requires the client to perform a computationally expensive task in the background, and only when that task completes will you let them know about the special deal. For a regular customer, this can be pretty quick and painless, but for a scammer it means they need a lot more computers to maintain constant coverage (since each computer has to do more work). Then you can use your probability score from above to increase the amount of work they have to do.
To make sure this delay doesn't cause any fairness problems, I'd recommend making it be some kind of encryption task that includes the current time of day from the person's computer. Since the scammer doesn't know what time the deal will start, he can't just make something up, he has to use something close to the real time of day (you can ignore any requests that claim to come in before the deal started). Then you can use these times to adjust the first-come-first-served rule, without the real people ever having to know anything about it.
The last idea is to change the algorithm required to generate the work whenever you post a new deal (and at random other times). Every time you do that, normal humans will be unaffected, but bots will stop working. They'll have to get a human to get to work on the reverse-engineering, which hopefully will take longer than your deal window. Even better is if you never tell them if they submitted the right result, so that they don't get any kind of alert that they are doing things wrong. To defeat this solution, they will have to actually automate a real browser (or at least a real javascript interpreter) and then you are really jacking up the cost of scamming. Plus, with a real browser, you can do tricks like those suggested elsewhere in this thread like timing the keystrokes of each entry and looking for other suspicious behaviors.
So for anyone who you know you've seen before (a common IP, session, cookie, etc) you have a way to make each request a little more expensive. That means the scammers will want to always present you with your hardest case - a brand-new computer/browser/IP combo that you've never seen before. But by putting some extra work into being able to even know if they have the bot working right, you force them to waste a lot of these precious resources. Although they may really have an infinite number, generating them is not without cost, and again you are driving up the cost part of their ROI equation. Eventually, it'll be more profitable for them to just do what you want :)
希望这对你们有帮助,
Eric
根据您想要进入的复杂程度,您可以采取一些解决方案。
这些都是基于IP跟踪,在僵尸网络和云计算下有些崩溃,但应该能挫败绝大多数的僵尸。乔·兰登拥有大量机器人的可能性远远低于他只是运行一个从某处下载的Woot机器人来获取他的垃圾的可能性。
普通的节流
At a very basic, crude level, you could throttle requests per IP per time period. Do some analysis and determine that a legitimate user will access the site no more than X times per hour. Cap requests per IP per hour at that number, and bots will have to drastically reduce their polling frequency, or they'll lock themselves out for the next 58 minutes and be completely blind. That doesn't address the bot problem by itself, but it does reduce load, and increases the chance that legitimate users will have a shot at the item.
自适应调节
An variant on that solution might be to implement a load balancing queue, where the number of requests that one has made recently counts against your position in the queue. That is, if you keep slamming the site, your requests become lower priority. In a high-traffic situation like the bag of crap sales, this would give legitimate users an advantage over the bots in that they would have a higher connection priority, and would be getting pages back more quickly, while the bots continue to wait and wait until traffic dies down enough that their number comes up.
废料验证码
Third, while you don't want to bother with captchas, a captcha at the very end of the process, right before the transaction is completed, may not be a bad idea. At that point, people have committed to the sale, and are likely to go through with it even with the mild added annoyance. It prevents bots from completing the sale, which means that at a minimum all they can do is hammer your site to try to alert a human about the sale as quickly as possible. That doesn't solve the problem, but it does mean that the humans have a far, far better chance of obtaining sales than the bots do currently. It's not a solution, but it's an improvement.
以上的组合
实施基本的、慷慨的限制来阻止最滥用的机器人,同时考虑到单个公司IP背后的多个合法用户的潜力。截止数字将非常高——你引用了bot攻击你的网站10次/秒,即216万次/小时,这显然远远高于任何合法的使用量,即使是最大的公司网络或共享ip。
实现负载平衡队列,这样如果占用的服务器连接和带宽超过自己的份额,就会受到惩罚。这将惩罚共享公司池中的人,但不会阻止他们使用站点,而且他们的违规行为应该远没有您的装瓶者那么可怕,因此他们的惩罚应该不那么严重。
最后,如果您超过了每小时请求的某个阈值(这个阈值可能远远低于“自动断开连接”的截止值),那么就要求用户使用验证码进行验证。
这样,合法使用网站的用户每小时只有84个请求,即使他们非常兴奋,也不会注意到网站速度变慢了。然而,乔·波特发现自己陷入了两难境地。他可以:
Blow out his request quota with his current behavior and not be able to access the site at all, or
Request just enough to not blow the request quota, which gives him realtime information at lower traffic levels, but causes him to have massive delays between requests during high-traffic times, which severely compromises his ability to complete a sale before inventory is exhausted, or
Request more than the average user and end up getting stuck behind a captcha, or
Request no more than the average user, and thus have no advantage over the average user.
只有滥用的用户才会受到服务降级或复杂性增加的影响。合法用户不会注意到任何变化,除了他们更容易购买他们的垃圾包。
齿顶高
以远低于注册用户的速率限制未注册用户的请求。这样,机器人所有者就必须通过一个经过身份验证的帐户来运行机器人,以通过应该是相对严格的节流率。
然后,有创造力的装瓶者将注册多个用户id,并使用这些id来实现他们想要的查询率;您可以通过将给定时间段内来自同一IP的任何ID视为相同的ID,并接受共享节流来解决这个问题。
这使得装瓶商别无选择,只能运行一个机器人网络,每个IP一个机器人,每个机器人注册一个Woot账户。不幸的是,这实际上无法与大量未关联的合法用户区分开来。
您可以将此策略与上述一种或多种策略结合使用,目的是为没有滥用使用模式的注册用户提供最佳服务,同时根据他们的状态(匿名或已注册)以及由流量指标决定的滥用程度逐步惩罚其他用户,包括注册用户和未注册用户。
首先,不要试图用技术来打败技术。
你的问题:
网站的可用性
列出使网站令人兴奋和有趣的内容
由脚本导致的服务器负载。
你的目标:
保持网站运行的速度不被机器人减慢。
将道具卖给非脚本人。
不要让“正常”用户完成任何任务来证明他们是人类。
目标#1:保持网站运行的速度不被机器人减慢。
这其实很简单。让其他人托管页面。首页不是托管在服务器上,而是由Amazon S3 / Akamai托管页面。无论如何,页面的大部分都是“静态的”。每5分钟左右重新生成页面,以刷新更动态的项目。(如果你想的话,可以每1分钟重新生成一次)。但是现在这些机器人攻击的不是你的服务器,而是Akamai的CDN,它当然可以承担负载。
当然,RSS订阅也可以这样做。没有理由其他服务不能为你承担带宽/负载的冲击。在相关的说明中,所有的图像都由Akamai等提供。为什么要承担这个责任?
目标#2:将道具卖给非脚本人员
我同意其他人的意见,让脚本没有真正的优势。然而,编写脚本也是一个热情的客户的标志,所以你也不想成为一个*洞。
所以我会说,让他们购买,但让他们支付一个膨胀的金额(或者更好),只是放慢他们的速度,这样其他人就有机会了。
所以每当用户访问网站时,就会以29.99美元的价格提供这袋垃圾,并有一个计时器以随机速度降低或提高价格。有一个图像或其他指标,告诉人们如果他们有耐心,价格是否会下降。
用户有一个“立即购买”按钮,当他们看到价格/#商品是他们想要的时,他们就会点击这个按钮。
例子:
用户:
0秒$29.99(1件)图像
说:“等待一个更低的价格!”
7秒$31.99(1件)图像
说:“等待一个更低的价格!”
13秒$27.99(1项)图像
说:“我打赌你能做得更好!”
16秒1.99美元(0件物品
你会傻到付钱给我们吗
没有什么!”
21秒$4.99(两件物品
说:“越来越好了!”
24秒$4.99 (tres itemos
他说:“没有比这更好的了
箭!”
26秒$8.99(2项)图像
说:“我打赌你能做得更好!”
重复……
在一个逐渐收紧的周期中,正确的“$4.99 (tres itemos)”会显示出来
如果机器人点击刷新,循环就会重新开始。如果用户错过并选择了错误的道具/价格,你便需要决定是否让他们以该价格购买游戏。
例如,如果他们“过度消费”,他们为3件物品支付24.99美元,woot只会向他们收取4.99美元,然后在下次woot购买时提供20美元的优惠券。
目标#3:不要让“普通”用户完成任何任务来证明他们是人类。
你在这里犯了一个逻辑谬误。你假设任何图灵测试(http://en.wikipedia.org/wiki/Turing_test)都是恼人的。这不是真的!
以下是一些建议:
Create a game. The reward for playing the game is a $5 off coupon on the next order.
Pair up 2 random users and have them chat with each other. Each user is told to answer 2 questions to the other user : "Ask what color is the your hair ?" and "What are you going to do next weekend?" Some users get paired with a woot random sentence generator. Each user is then asked if the other user is a human. If a user says the woot random sentence generator is human then reply "No I am not and may be you are from Mars as well. Do you want to try again?"
Simple flash game that requires the user to maneuver through an obstacle course to get a discount coupon.
Ask what city they are in. The reverse geo-code the ip address to see if they are close to being correct.
Ask silly questions - "Do you think John McCain is a great president?" "Whose picture is on your driver's license?"
只问三次,因为你真正想做的是放慢脚本节奏。
我的想法(我还没有检查所有其他的,所以我不知道它是否新颖)
处理蜂群:
Convert the front-page matter for each day's stuff to be a flash/flex object.
Yes, some people will complain, but we're looking for the common case here, not the ideal.
You should also randomize the name of your flash objects, so they aren't in any predictable pattern of names.
Using Akamai or another CDN, deploy this flash object in advance to the outside world. Akamai produces what appears to be random URLs, so it makes it hard to predict.
When it is time for a new sale, you just have to change your URL locally to refer to the appropriate object at Akamai, and people will go fetch the flash object from them to discover if the deal is a BoC or not.
一天结束-你现在有Akamai处理你的午夜交通蜂群
处理购车事宜
Each of the flash objects you create can have lots and lots of content hidden inside - images, links, arbitrary ids, including 'bag of crap' in a thousand places. you should be able to obfuscate the flash as well.
When the flash object "goes live", people will start to attack it. But there are so many false positives that a simple string scan is useless - they'll have to simulate running the flash locally.
But the flash doesn't write text. It draws lines and shapes. Shapes in different colors, all connected to timers that make them appear and disappear at different times.
If you've seen the Colbert Report, you know how the intro has hundreds of words describing Colbert. Imagine something like that for your intro, which will always include Bag O Crap.
Now, imagine that the intro takes an arbitrary amount of time - sometimes a few seconds, sometimes as long as a minute or more (make it funny)
Meanwhile, "Bag O Crap" is constantly showing up, but again, clearly as part of the intro.
Finally, the actual deal of the day is revealed, with an active 'shimmer' effect that makes it difficult for any single snapshot of the canvas to reveal the actual product name. This is floating above an animated background that still says 'bag O crap' and is constantly in motion
again, all of this is handled with lines and shapes, not with text strings
最终的结果是——你的黑客被迫拍摄交易的大量图像快照,弄清楚如何分离所有的假阳性和识别实际交易。与此同时,人类只是看着它,由于眼睛疲劳和我们填补文本空白的能力,我们可以原原本本地阅读交易。
这不会永远有效,但会在一段时间内有效。
另一个想法是简单地限制人们购买中行,除非他们以前用该账户购买过东西,并且永远不让他们再购买中行。
我的解决方案是市场变革和技术变革的结合。
目前,销售垃圾促销袋部分的技术方面被处理为正常的woot销售。促销开始了,人们争相购买,所有的商品都卖光了。用于日常销售的相同统计图表都是用过的垃圾销售。
这里涉及到几个市场目标:
Get customers to visit the site once every day (impluse purchasing). The possiblility of a seeing a bag of crap sale is the reason/reward.
Network/viral/gossipy effect where a customer sees a bag of crap sale is on they will IM/EMail/Telephone their friends.
There is also what I'd call general "good will". Woot is a really cool place because it occasionally rewards its customers with amazing sales (bag of crap that included a flat panel tv)... AND its done in a fair "first comes first served" manner.
前两个似乎是最重要的。纯粹的访客数量会影响正常交易的销售速度(或销售一空)。传统上,新客户主要是通过口口相传来吸引的,让客户把自己的朋友推荐到woot.com是一种胜利。
所以…我的解决方案是将促销活动的递送方式改为更多的抽奖方式。
偶尔用户可以做一些有趣的事情,看看他们是否有资格得到一袋垃圾。有趣的内容可以是类似“punch The monkey”或Orbitz迷你看球游戏、棒球或曲棍球的愚蠢flash游戏。这里的目标是机器人无法编写脚本的游戏,因此需要相当谨慎。我们的目标也不仅仅是给游戏赢家一袋垃圾……但对所有游戏玩家来说。
The technical core of the game is that at the end of the game a request is made to a server that does an "instant lottery" to determine if the user has won a bag of crap sale opportunity. The server request will need to include something calculated by the game itself (roughly speaking "hash cash"... a complex, CPU cycle consuming, calculation, and hopefully one that is difficult to reproduce). This is to prevent a bot from repeatedly entering the lottery just be querying the lottery server/service.
游戏本身也会随着时间而改变。你可以为万圣节、圣诞节、情人节、复活节等制作特殊事件游戏。还有许多有趣的营销理念可以与woot的“wooiness”相匹配。
If the user wins they can purchase N bags of crap (in a time limited window)... but they can also send N friends a time limited invitation to purchase a bag of crap (good for 24 hours). This provides a super strong network effect... customers will definately tell their friends. Or you could also do it as "buy 1 give 1"... let customers buy up to a total of N but force every second one to be shipped to a friend. The key here is to make the network/gossip effect an full fledged part... help the customer tell the world about the wonderfulness of woot.
促销材料周围袋垃圾销售概念也将需要修改。一袋垃圾多快卖完的图表已经无关紧要了。比如每个月人们有多少次机会购买。有多少人告诉他们的朋友。材料应该微妙地强调这一点,每天去拜访是一个好主意。
你也可以宣传为什么一袋垃圾的销售正在改变。尤其是你免费雇佣了最烂的顾问。