停止scripters每秒钟砰的一次您的网站数百次

[更新]我已经接受了答案,因为lc因为经过深思熟虑的答案而值得赏金,但不幸的是,我相信我们陷入了我们最原始的最坏的情况: CAPTCHA大家在购买废话的尝试 。 简单的解释:caching/networking农场使我们无法实际跟踪命中,任何解决方法(发送非caching的Web信标,写入统一的表格等)都会使网站的速度比机器人的速度慢。 思科等硬件可能有一些昂贵的硬件,可以帮助高层次,但如果CAPTCHAING每个人都是另一种select,则很难certificate成本合理。 我将在后面尝试做一个更全面的解释,以及为未来的search者进行清理(尽pipe其他人欢迎尝试,因为它是社区wiki)。

我已经给这个问题增加了奖励,并试图解释为什么现在的答案不符合我们的需要。 首先,感谢大家对此的思考,让这个集体智慧帮助解决看似不可能的问题,真是太神奇了。

我会比以前更清楚一点:这是关于woot.com上的包装袋的销售情况。 我是Woot Workshop的子公司Woot Workshop的总裁,Woot的子公司是做devise的,写产品说明,播客,博客post,并且讨论论坛。 我在css / html世界工作,对开发者世界的其他部分只有很less的了解。 我和开发人员密切合作,并在这里讨论了所有的答案(以及其他许多想法)。

网站的可用性是我工作的重要组成部分,使网站令人兴奋和有趣的是其余的大部分。 这就是以下三个目标的来源。 CAPTCHA危害可用性,机器人窃取我们废物销售的乐趣和兴奋。


为了设置这个场景,僵尸工具正在为我们的Random Crap销售第二个屏幕抓取(和/或扫描我们的rss)数十次。 当他们看到这一点时,它触发了login程序的第二阶段,点击我想要的一个,填写表格,并购买垃圾。


在当前(2/6/2009)的投票顺序中:

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

在Woot上,匿名(未logging)的用户可以查看我们的主页。 换句话说,砰击机器人可以是非authentication的(除IP地址以外基本上不可追踪)。 所以我们回到扫描IP地址,这在a)在这个云计算networking僵尸和spambot僵尸的时代是相当无用的,b)由于来自一个IP地址的企业数量太多而无法获得无辜者(更不用提非静态的IP ISP和潜在的性能命中试图跟踪这一点)。

哦,有人打电话给我们将是最糟糕的情况。 我们可以让他们打电话给你吗?

BradC Ned Batchelder的方法看起来很酷,但他们的devise非常稳固,可以击败为网站build立的机器人。 我们的问题是机器人是专门打败我们的网站。 这些方法中的一些可能会工作很短的时间,直到脚本发展到他们的机器人忽略蜜jar,屏幕附近的标签名称,而不是formsids,并使用JavaScript的浏览器控制。

lc再次 “除非,炒作是你的营销计划的一部分。” 是的,它绝对是。 当物品出现的时候,以及如果你设法得到一个令人兴奋的惊喜,可能与你最终得到的废话一样多或者更重要。 任何消除先到先得的方法都不利于“赢得”废话的兴奋。

novatrust而我,一个,欢迎我们新的机器人霸主。 实际上,我们提供rss提要,以允许第三方应用程序扫描我们的网站的产品信息,但不提前主网站的HTML。 如果我正确地解释,你的解决scheme通过完全牺牲目标1来确实有助于目标2(性能问题),而只是放弃了机器人将会购买大部分垃圾的事实。 我赞成你的回答,因为你的最后一段悲观主义对我来说是准确的。 这里似乎没有银弹。

其余的回复通常依赖于IP跟踪,而这又似乎对僵尸networking/僵尸/云计算networking没有任何用处,也不利于(来自同一IP目的地的许多无辜者)。

任何其他方法/想法? 我的开发人员总是说“让我们做CAPTCHA”,但我仍然希望有一些不那么干扰的方法,让所有真正的人想要我们的废话。


END UPDATE,以下是原来的问题:

假设你正在销售价值很高的便宜的东西,而且你的数量非常有限。 没有人知道你什么时候可以卖这个物品。 超过一百万人经常来看你卖的东西。

你最终会用脚本,机器人和黑客试图通过编程的方式找出你销售物品的时间,并确保他们是第一个购买它的人。 这有两个原因:

  1. 你的网站被非人类抨击,每个人都放慢速度。

  2. 脚本员最终“赢”了产品,导致常客感到被欺骗。

一个看似明显的解决scheme是在下订单前为用户创build一些环节,但至less有三个问题:

一世。 用户体验很糟糕,因为他们必须破译CAPTCHA,挑出猫,或者做math问题。

II。 如果感觉到的收益足够高,人群也足够大的话,一些小组就会绕过任何调整,导致军备竞赛。 (特别是这个更简单的调整是……隐藏“评论”表单,重新排列表单元素,错误地标记它们,隐藏的“gotcha”文本全部工作一次,然后需要改变,以争取所有的针对此特定表单的人员。)

III。 即使脚本编写人员不能“解决”你的调整,但最终也不能阻止他们closures你的首页,然后发出警报,让脚本编写人员填写订单。 鉴于他们从解决[a]中获得优势,他们仍然可能赢得胜利,因为他们将成为第一批到达订单页面的人。 此外,1.仍然发生,导致服务器错误,并降低了每个人的performance。

另一个解决scheme是监视IP经常打,阻止他们从防火墙,否则阻止他们订购。 这可以解决2.并阻止[b],但扫描IPs的性能受到严重影响,并且可能导致更多的问题,如脚本编写者自己造成的问题。 此外,云networking和spambot僵尸的存在使IP检查相当无用。

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


我有一些解决scheme的最终目标:

  1. 将该项目出售给非脚本人员。

  2. 保持网站运行速度不被机器人放慢。

  3. 不要为了certificate自己是人类而忙于“正常”的用户完成任何任务。

CAPTCHA如何实现像SO一样的操作?

如果您正常使用该网站,则可能永远无法看到该网站。 如果您碰巧经常重新载入相同的页面,请过快地发表相应的评论,或者触发警报的其他内容,让他们certificate他们是人。 在你的情况下,这可能是不断重新加载同一页面,迅速在页面上的每一个链接之后,或填写订单的速度太快,不能成为人。

如果他们连续两次(如2或3)检查失败,则给该IP一个超时或其他类似的措施。 然后在超时结束时,将它们转储回检查。


由于您有未注册的用户访问该网站,因此您只有IP才能继续。 如果您愿意,您可以向每个浏览器发出会话并进行跟踪。 当然,如果连续(重新)创build连续的会话(如果bot继续删除cookie),就要进行人工检查。

对于太多无辜的人来说,你可以在人工检查页面上提出一个免责声明:“如果有太多的匿名用户在同一地点观看我们的网站,也可能会出现这个页面,我们鼓励你注册或login以避免这个。” (适当调整措辞。)

此外,X人从一个IP同时加载同一页面的几率是多less? 如果他们高,也许你需要一个不同的触发机制,为您的机器人警报。


编辑:另一个select是,如果他们失败了太多次,并且你对产品的需求有信心,阻止他们,让他们亲自打电话给你删除块。

有人打电话看起来好像是一个天秤,但确保电脑后面有一个人 。 关键是要让这个块只适用于一个几乎不会发生的情况,除非它是一个机器人(例如连续多次检查失败)。 然后它强制人类互动 – 拿起电话。

在回应他们给我打电话的评论时,显然是在这里折衷。 你是否足够担心确保你的用户是人类接受几个电话,当他们出售? 如果我非常关心一个产品能够吸引用户,那么我将不得不作出这个决定,也许在这个过程中牺牲一小部分时间。

由于您似乎决定不让僵尸网站占上风/砰击您的网站,我相信这款手机可能是一个不错的select。 由于我没有从您的产品中获利,所以我没有兴趣收到这些电话。 如果你分享一些利润,我可能会感兴趣。 因为这是你的产品,所以你必须决定你有多less照顾和相应的执行。


其他方式释放块只是没有那么有效:超时(但他们会再次冲击你的网站后,冲洗 – 重复),长时间的超时(如果它真的是一个人试图购买你的产品,他们会是SOL,因没有支票而受到惩罚),电子邮件(很容易通过机器人),传真(相同),或蜗牛邮件(花费太长时间)。

当然,你可以在每次IP超时期间增加每个IP超时时间。 只要确保你不会无意中惩罚真正的人类。

你需要想办法让机器人购买大量价格过高的东西:12毫米翼果:20美元。 在脚本作者决定玩游戏之前,看看有多less个僵尸软件可以收起来。

利用利润购买更多的服务器并支付带宽。

我的解决scheme是通过延迟大约10分钟的漫游器和脚本,使屏幕抓取变得毫无价值。

以下是我如何做到这一点:

  • logging并识别任何重复的击球手。

每次点击都不需要logging每个IP地址。 只有每20个点击中就有一个跟踪。 重复的罪犯仍然会出现在一个随机的偶尔跟踪。

  • 从大约10分钟之前保留您的页面caching。

  • 当重复击球员/机器人命中您的网站,给他们10分钟旧的caching页面。

他们不会立即知道他们正在得到一个旧的网站。 他们可以把它和所有东西都刮掉,但是他们不会再赢得任何比赛,因为“真正的人”会有10分钟的先发。

优点:

  • 用户没有麻烦或问题(如CAPTCHA)。
  • 在服务器端完全实现。 (不依赖Javascript / Flash)
  • 提供较旧的caching页面应该比实况页面less性能密集。 这样可以减less服务器上的负载!

缺点

  • 需要跟踪一些IP地址
  • 需要保持和维护旧页面的caching。

你怎么看?

看看巴德尔德在这里的这篇文章 。 他的文章是关于阻止垃圾邮件,但同样的技术可以很容易地适用于您的网站。

我们可以通过让他们难以取得成功的职位,或者让他们无意识地认定自己是机器人来阻止机器人,而不是让机器人停下来。 这消除了人们的负担,并使评论表格没有可见的反垃圾邮件措施。

这项技术是我如何防止此网站上的垃圾邮件。 有用。 这里描述的方法根本不看内容。

其他一些想法:

  • 创build一个官方的自动通知机制(RSS提要?推特?),人们可以订阅你的产品上市销售。 这减less了人们制作脚本的需要
  • 新产品上架之前更改您的混淆技术。 所以,即使脚本编写者能够升级军备竞赛,他们总是会落后一天。

编辑:要完全清楚,奈德上面的文章描述了防止自动购买物品的方法,防止BOT通过表单提交订单。 他的技术不会有助于防止漫游器屏幕抓取主页,以确定什么时候红萝卜Bandoleer出现出售。 我不确定防止这是真的可能。

关于你对Ned策略的有效性的评论:是的,他讨论了蜜jar,但我不认为这是他最强的策略。 他对SPINNER的讨论是我提到他的文章的原因。 对不起,我没有在我原来的文章中说得更清楚:

微调器是一个隐藏的领域,用于一些事情:它汇集了一些值,防止篡改和重播,并用于模糊字段名称。 微调是一个MD5的散列:

  • 时间戳,
  • 客户的IP地址,
  • 要评论的博客条目的条目ID和
  • 一个秘密。

以下是您可以在WOOT.com上实现的方法:

每次新产品发售时,更改用作散列一部分的“秘密”值。 这意味着如果有人打算devise一个BOT来自动购买物品, 那只有在下一个物品出售时才能使用

即使有人能够快速重新构build自己的机器人,所有其他的实际用户也将已经购买了中国银行,并且解决了您的问题!

他讨论的另一个策略是不时地改变蜜jar技术(当一个新产品上市时,改变它):

  • 使用CSS类(当然是随机的)来设置字段或包含的元素显示:无。
  • 将字段颜色与页面的背景相同(或非常相似)。
  • 使用定位将字段移出页面的可见区域。
  • 使元素太小,以显示包含的蜜jar字段。
  • 离开字段可见,但使用定位覆盖一个模糊的元素。
  • 使用Javascript来实现任何这些变化,需要一个机器人有一个完整的JavaScript引擎。
  • 像其他领域一样,让蜜jar显示出来,但是告诉人们不要input任何东西。

我想我的总体思路是在每个新产品上市时改变形态devise。 或者至less在新的中国银行上市时进行更改。

这是几次/月?

如果你接受这个答案,你会在下一个答案时提醒我吗? 🙂

问:你会如何阻止脚本员每秒钟砰地关上你的站点数百次?
A:你没有。 外部代理没有办法阻止这种行为。

你可以使用大量的技术来分析传入的请求,并试探性地试图确定谁是和不是人类……但它会失败。 最终,如果不立即。

唯一可行的长期解决scheme是改变游戏,以使该网站不是僵尸程序友好的,或者对脚本编写者不太有吸引力。

你如何做到这一点? 那么,这是一个不同的问题! 😉

好的,上面给出了一些选项(并拒绝了)。 我对你的网站并不熟悉,只看过一次,但是由于人们可以阅读图像中的文字,而且机器人不能轻易地做到这一点,所以把公告变成图像。 不是一个validation码 ,只是一个图像 –

  • 生成图像(当然caching),当页面被请求
  • 保持图像源名称相同,这样就不会把游戏带走
  • 大多数情况下,图像将具有普通文本,并被alignment以显示为内联HTML页面的一部分
  • 当游戏处于“开启”状态时,图像将变为公告文本
  • 公告文本显示必须手动input以获得奖品的url和/或代码。 如果你喜欢CAPTCHA的代码,但可能没有必要。
  • 为了额外的安全性,代码可以是专门为请求/ IP /代理生成的一次性令牌,以便重复的请求生成不同的代码。 或者,如果按需生成太重要,则可以预先生成一堆随机代码(一次性键盘)。

运行真正的人回应这个testing,并忽略('哎呀,一个错误发生,对不起,请再试一次)回应快于(说)这个时候的一半。 这个事件也会引发开发者至less有一个机器人已经知道了代码/游戏,所以现在是时候改变代码/游戏了。

无论如何,即使没有机器人触发它,也要定期改变游戏,只是为了浪费脚本的时间。 最终,脚本编写者应该厌倦这个游戏并去其他地方…我们希望;-)

最后一个build议是:当你的主页请求进来时, 把它放在一个队列中,并在一个单独的进程中响应请求(你可能需要破解/扩展Web服务器来做到这一点,但它可能会值得)。 如果第一个请求在队列中时,来自同一个IP /代理的另一个请求进入,则忽略它。 这应该会自动减轻机器人的负担。

编辑:另一个select,除了使用图像,是使用JavaScript填写买/不买的文本; 机器人很less解释JavaScript,所以他们不会看到它

我不知道这是多么可行:…进攻。

找出机器人正在扫描的数据。 为他们提供他们正在寻找的数据,当你不卖废话。 这样做的方式不会打扰或混淆人类用户。 当机器人触发第二阶段时,他们将login并填写表格购买$ 100 roombas而不是BOC。 当然,这是假设机器人不是特别强壮。

另一个想法是在袋装销售期间随机降价。 当你明确表示它只值20美元时,谁会买150美元的随机袋子? 没有人,但过分热心的机器人。 但是9分钟之后,它是35美元…… 17分钟后,它是9美元。 pipe他呢。

当然,僵尸的国王将能够作出反应。 关键是让他们的错误变得非常昂贵(并且让他们付钱给你打)。

所有这一切都假设你想要剥夺一些机器人领主,这可能不是100%可取的。

所以这个问题看起来确实是这样的:机器人需要他们的“包装袋”,因为它具有很高的价格感知价值。 你有时会提供这个物品,机器人潜伏着,等着看它是否可用,然后他们购买物品。

由于看起来僵尸所有者正在赚取利润​​(或者有可能获利),所以诀窍就是通过鼓励他们购买这些垃圾来让他们无利可图。

首先, 总是提供“袋子或废物”。

其次,确保垃圾通常是废话。

第三,经常旋转废话。

简单,不是?

你需要一个永久的“为什么我们的废话有时候废话?” 链接旁边的提议向人类解释发生了什么事情。

当机器人发现有垃圾,垃圾被自动购买时,收件人将非常不高兴,因为他们已经为一个破牙签付了10美元。 然后是一个空的垃圾袋。 然后从你的鞋子底部一些污垢。

如果他们在相对较短的时间内购买了足够多的垃圾(而且你在这个地方有大量的免责声明来解释你为什么要这样做),那么他们将会在你的“袋'废物'。 即使人为干预(检查确保垃圾不是垃圾),如果你经常旋转废话,也会失败。 哎呀,也许机器人会注意到,而不是买太多时间在旋转的东西,但这意味着人类将购买不废话。

哎哟,你的老顾客可能会很有趣,你可以把它变成一个巨大的营销胜利。 开始张贴多less“废话”鲤鱼正在出售。 人们会回来看看机器人被咬了多难。

更新:我希望你可能会提前几个电话与人抱怨。 我不认为你可以完全停止。 但是,如果杀死机器人,您可以随时停止并稍后重新启动。

  1. 将该项目出售给非脚本人员。

  2. 保持网站运行速度不被机器人放慢。

  3. 不要为了certificate自己是人类而忙于“正常”的用户完成任何任务。

你可能不想听到这个,但#1和#3是互斥的。

在互联网上,没有人知道你是一只狗

那么,没有人知道你是一个机器人。 没有任何程序性的方法可以告诉在连接的另一端是否有人类,而不需要人去做某件事情。 防止脚本/僵尸程序在networking上做东西是CAPTCHA发明的原因。 这不是这样的一个新的问题,没有看到很多的努力。 如果有更好的方法来做到这一点,那么一个不会让真正的用户感到一个CAPTCHA所做的麻烦,每个人都已经在使用它了。

我认为你需要面对的一个事实是,如果你想让你的订单页上的僵尸程序,一个好的CAPTCHA是唯一的方法来做到这一点。 如果你的随机垃圾的需求量足够高,人们愿意花费这么长的时间才能得到它,那么合法用户不会被一个CAPTCHA推迟。

Woot用来对付这个问题的方法正在改变游戏 – 从字面上看。 当他们提出一个非常令人满意的出售物品时,他们会让用户玩电子游戏来订购。

这不仅可以成功地对付机器人(他们可以轻松地对游戏进行微小的改动,以避免自动玩家,甚至为每次出售提供新的游戏),但它也给用户一个“赢”的期望项目的印象,而放缓订购过程。

它仍然很快卖出,但我认为解决scheme是好的 – 重新评估问题,改变参数导致成功的战略,严格的技术解决scheme根本不存在。


您的整个商业模式都是基于“先到先得”。 你不能做广播电台所做的事情(他们不再使第一个来电者成为赢家,他们让第5或第20或第13个来电者成为赢家) – 它不符合你的主要特点。

不,在没有改变真实用户订购体验的情况下,没有办法做到这一点。

假设你实施所有这些策略。 如果我认为这很重要,我只需要100个人与我一起工作,我们将构build软件在我们的100台独立的计算机上工作,并且每秒击中您的站点20次(每个用户/ cookie /帐户/ IP地址)。

你有两个阶段:

  1. 看着首页
  2. 订购

你不能把validation码阻止#1 – 这将失去真正的客户(“什么?每次我想要看到最新的woot?!?都必须解开validation码”)。

所以我的小团队一起看,一起计时,所以我们每秒钟收到大约20次检查,谁先看到这个改变,谁先(自动)提醒所有人,谁又会加载头版,跟随订单链接,执行交易这也可能会自动发生,除非你实施validation码,并更改每个wootoff / boc)。

你可以在#2前面添加一个validation码,而当你不喜欢这样做的时候,这可能是确保即使机器人观看头版的唯一方法,真正的用户正在获得产品。

但是即使有了validation码,我的小乐队仍然有很大的先发优势,而且我们也不可能说我们不是人类。 如果你开始计时我们的访问,我们只是添加一些抖动。 我们可以随机select哪台电脑刷新,所以访问顺序不断变化,但仍然像人一样。

首先,摆脱简单的机器人

你需要有一个自适应的防火墙来监视请求,如果有人正在做这个明显的愚蠢的事情 – 在相同的IP上每秒刷新一次以上,然后使用策略减慢它们(丢弃数据包,发回拒绝或500错误等)。

这应该会显着降低您的stream量,并改变机器人用户使用的策略。

其次,让服务器非常快速。

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

我认为你需要的是从下到上的完全自定义的解决scheme。

你不需要搞乱TCP / IP协议栈,但是你可能需要开发一个非常非常快速的定制服务器,这个定制服务器的目的是为了关联用户连接并对各种攻击作出适当的反应。

Apache,lighthttpd等都非常灵活,但是你运行一个单一的目的网站,你真的需要能够做比现有的服务器能够做的更多(无论是在处理stream量,并在适当的打击机器人)。

通过在自定义服务器上提供一个基本上静态的网页(每隔30秒更新一次),您不仅可以处理请求和stream量的10倍(因为服务器除了获取请求之外没有其他任何操作)从内存到TCP / IP缓冲区的页面),但是它也可以让你访问可能帮助你减慢机器人速度的指标。 例如,通过关联IP地址,您可以简单地阻止每个IP每秒多个连接。 人类不能比这更快,即使是使用相同NAT的IP地址的人也不会经常被阻塞。 你想要做一个缓慢的块 – 在正式结束会议之前,把连接放置一整秒。 这可以进入防火墙给长期的块,特别是令人震惊的罪犯。

但实际情况是,无论你做什么,当bot是由一个人为一个目的定制的时候,没有办法告诉人类除了机器人之外。 机器人只是人的代理。

结论

在一天结束的时候,你不能把人和计算机分开来看首页。 您可以在订购步骤中停止漫游器,但僵尸程序用户仍然具有先发优势,并且仍然有巨大的负载来pipe理。

你可以为简单的机器人添加块,这将提高酒吧和更less的人打扰。 这可能够了。

但是,如果不改变你的基本模型,你是不走运的。 你可以做的最好的事情就是照顾简单的案例,让服务器如此之快以至于普通用户不会注意到,并且出售很多项目,即使你有几百万机器人,许多普通用户也会得到他们。

您可以考虑设置一个蜜jar,并将用户帐户标记为僵尸工具用户,但是这会对社区产生巨大的负面影响。

每当我想到一个“好的,那么做什么……”我总是可以用一个合适的机器人策略来对付它。

即使您将首页设置为validation码(“此项目的订购button是蓝色的,在此页面的某处出现粉红色的闪光点”),僵尸工具只会打开页面上的所有链接,并使用任何一个回到一个订购页面。 这是没有办法赢得这一点。

让服务器快一点,在订购页面中放入一个reCaptcha(我发现的唯一一个不容易被愚弄,但对于你的应用程序来说可能太慢了),并考虑稍微改变模型的方法普通用户和机器人用户一样有机会。

-亚当

免责声明:这个答案完全是非编程相关的。 但是,它确实会首先尝试攻击脚本的原因。

另一个想法是,如果你真的有一个有限的数量出售,为什么不把它从一个先到先得的方法改变? 当然,除非宣传是你营销计划的一部分。

还有很多其他的select,我相信别人可以想到一些不同的:

  • sorting队列(预订系统) – 某些脚本可能仍然会在队列的前端,但是手动input信息可能会更快。

  • 一个抽奖制度(试图订购一个人的每个人都进入到系统中) – 这样,使用脚本的人就和没有使用脚本的人一样。

  • 急于优先排队 – 如果真的有很高的感知价值,人们可能愿意多付钱。 实行一个sorting队列,但允许人们支付更多的更高的排队。

  • 拍卖(这张照片给大卫·施米特,评论是我自己的) – 人们仍然可以在最后一刻使用脚本来狙击,但这不仅会改变价格结构,人们也期望与其他人抗衡。 您也可以在特定的时间段内限制出价次数,让人们提前拨打授权码等等。

无论纳粹认为他们的交stream如何安全,盟友往往会破坏他们的信息。 无论您如何阻止漫游器使用您的站点,僵尸程序的所有者都可以解决这个问题。 对不起,如果这使得你纳粹:-)

我认为需要不同的思维方式

  • 不要试图阻止漫游器使用您的网站
  • 不要马上解决这个问题,打长游戏

深入了解你的网站的客户是人还是机器人无关紧要,两者都只是付钱的客户; 但其中一个有不公平的优势。 一些没有太多社交生活(隐士)的用户可能会像您的网站的其他用户一样烦人。

logging您发布优惠的时间以及帐户select购买优惠的时间。

这给你一个客户如何快速购买东西的logging。

改变您发布优惠的时间。

例如,有一个3小时的窗口从一天的某个模糊的时间(午夜?)开始。只有机器人和隐士会不断刷新页面3个小时,以便在几秒钟内获得一个订单。 从不改变基准时间,只有窗口的大小。

随着时间的推移,一张照片将出现。

01:你可以看到哪些帐户经常在他们上线的几秒钟内购买产品。 build议他们可能是机器人。

02:你也可以看看提供的时间窗口,如果窗口是1小时,那么一些早期的买家将成为人类。 一个人很less会刷新4个小时。 如果发布/购买之间的stream逝时间非常一致,无论窗口持续时间是多less,那么这是一个机器人。 如果小窗户的发布/购买时间缩短,而且窗户变长,那么这就是隐士!

现在,不要停止使用您的网站的机器人,你有足够的信息告诉你哪些帐户肯定是机器人使用,哪些帐户可能被隐士使用。 你对这些信息的处理是由你自己决定的,但你一定可以用它来使你的网站对有生命的人更加公平。

我认为禁止僵尸账户是毫无意义的,这就好像给希特勒打电话一样,并说“感谢你的U艇的位置!” 不知何故,您需要以帐户所有者无法实现的方式使用这些信息。 让我们看看我能不能做任何事情…..

处理队列中的订单:

当客户下订单时,他们会立即收到一封确认电子邮件,通知他们他们的订单被放入队列中,并在处理完成后通知他们。 我经常在亚马逊的订单/派送上遇到这种情况,根本不打扰我,我不介意在几天后收到一封电子邮件,告诉我我的订单已经发出,只要我立即收到一封电子邮件告诉我亚马逊知道我想要这本书。 在你的情况下,这将是一封电子邮件

  1. 您的订单已被放置并排队。
  2. 您的订单已处理。
  3. 您的订单已派出。

用户认为他们在一个公平的队列中。 每1小时处理你的队列,以便正常的用户也经历一个队列,以免引起怀疑。 只有在“平均人订购时间+ x小时”之后,才能处理来自机器人和隐士账户的订单。 有效地减less机器人对人类。

我说使用API​​公开价格信息。 这是不直观的解决scheme,但它确实有助于您控制情况。 为API添加一些限制,使其function略低于网站。

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

有代理和僵尸networking来打败IP检查。 有captcha阅读脚本是非常好的。 甚至有印度工人团队以较低的价格击败validation码。 任何你可以想出的解决scheme都可以被合理地击败。 即使是Ned Batchelder的解决scheme,也可以通过使用WebBrowser控件或其他模拟浏览器与僵尸networking或代理列表相结合来实现。

目前我们正在使用来自F5的最新一代BigIP负载均衡器来执行此操作。 BigIP拥有先进的stream量pipe理function,可以根据频率和使用模式来识别垃圾邮件和漫游器,甚至可以从单一IP背后的一组来源中识别。 然后,可以对这些内容进行限制,为其提供替代内容,或者只是用标头或Cookie标记它们,以便在应用程序代码中标识它们。

如何引入需要人际交往的延迟,就像是一种“CAPTCHA游戏”。 例如,它可能是一个小型的Flash游戏,在30秒内,他们必须爆破方格的球,避免爆裂坚实的球(避免色盲问题!)。 游戏将被赋予一个随机数字种子,游戏传回服务器的内容将是点击点的坐标和时间戳以及使用的种子。

在服务器上,你使用那个种子来模拟游戏机制,看看这些点击是否真的会爆炸。 如果他们这样做的话,他们不仅是人,而且还花了30秒钟来validation自己。 给他们一个会话ID。

你让该会话ID做它喜欢的事情,但是如果请求过多,他们不能继续而不能再次播放。

首先,让我回顾一下我们需要在这里做什么。 我意识到我只是解释了原来的问题,但重要的是我们能够百分之百地获得这个结果,因为有很多很棒的build议可以得到2或3的正确答案,但是正如我将要演示的那样,多方面的方法来覆盖所有的要求。

要求1:摆脱“僵尸砰击”:

你的头版快速“砰”的一声,正在损害你的网站的性能,而且是这个问题的核心。 “砰”的来自两个单一的IP机器人,据说也来自僵尸networking。 我们想摆脱两者。

要求2:不要乱用用户体验:

我们可以通过执行一个令人讨厌的validation程序,比如打电话给一个人类操作员,解决一堆CAPTCHA或类似的问题,来很好地修复机器人的情况,但这就像是迫使每个无辜的飞机乘客跳过疯狂的安全环,抓住最愚蠢的恐怖分子。 等等 – 我们真的这样做了。 但是,让我们看看我们是不是可以在woot.com上做到这一点。

要求3:避免“军备竞赛”:

如你所说,你不想陷入垃圾邮件的军备竞赛。 所以你不能使用像隐藏或混乱的表单域,math问题等简单的调整,因为它们本质上是隐蔽的措施,可以自动检测和规避。

要求4:阻止“警报”机器人:

这可能是您的要求中最困难的。 即使我们能够提出有效的人工validation挑战,机器人仍然可以对您的首页进行投票,并在有新的提议时提醒编剧。 我们也想让这些机器人不可行。 这是第一个要求的一个更强的版本,因为不仅机器人不能发出破坏性能的快速请求 – 他们甚至不能发出足够多的重复请求来及时发送“警报”给编剧报价。


好的,如果我们能满足所有四个要求 首先,正如我所提到的,没有任何一项措施可以做到这一点。 你将不得不结合一些技巧来实现它,你将不得不吞下两个烦恼:

  1. less数用户将需要跳过篮球
  2. less数用户将无法获得特别优惠

我意识到这些是令人讨厌的,但是如果我们能把这个“小”号码变得足够小的话 ,我希望你们会认同这些积极的东西大于消极的东西。

第一项措施:基于用户的限制:

这一个是不用花的,我相信你已经做到了。 如果一个用户login,并保持每秒600次刷新(或某物),你停止响应,并告诉他冷却它。 事实上,你可能比这个更快地扼杀他的要求,但是你明白了。 这样,只要开始轮询您的网站,login的bot就会被禁止/限制。 这是简单的部分。 未经authentication的机器人是我们真正的问题,对他们来说也是如此:

第二项措施:几乎所有人都提出了某种forms的IP节stream措施:

无论如何,你将不得不做一些基于IP的节stream来阻止“僵局”。 因为允许未经身份validation的(未login的)访问者获得特别优惠似乎很重要,所以您最初只能使用IP,尽pipe它们并不完美,但它们确实对单IP机器人有效。 僵尸networking是一个不同的野兽,但我会回到那些。 现在,我们会做一些简单的节stream来打败快速的单IP机器人。

如果在所有其他处理之前运行IP检查,则使用代理服务器进行限制逻辑,并将IP存储在memcached查找优化的树结构中,这样性能影响可以忽略不计。

第三项措施:使用caching响应隐藏油门:

随着快速的单IP机器人节stream,我们仍然必须解决慢IP单机器人,即。 机器人,特别是调整“飞行在雷达之下”的间隔请求稍微进一步分开比节stream阻止。

要立即渲染缓慢的单IP机器人无用,只需使用abelenkybuild议的策略即可:将长达10分钟的caching页面发送到过去24小时内(或多个)发现的所有IP地址。 这样,每个IP每天/每小时/周(取决于你select的时间段)有一个'机会',并且对于正在进行“重新加载”的实际用户将不会有明显的烦恼,除非他们不赢报价。

这个措施的好处在于,只要它们不是来自僵尸networking, 也可以阻止“警报机器人”。

(我知道如果真正的用户被允许一遍又一遍地刷新,你可能会更喜欢它,但是没有validation码或类似的东西,没有办法告诉来自请求发送垃圾邮件的机器人的更新垃圾邮件的人)

第四招:reCAPTCHA:

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.

Fifth measure: Decoy crap:

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.

Sixth measure: Botnet Throttling:

[删除]

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. 它不。 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.

So there you have it : My sixth measure is naught. 没有。 Zip. Unless the botnet is small and/or fast enough to get caught in the usual IP throttle, I don't see any effective measure against botnets that doesn't involve explicit human-verification such as CAPTHAs. I'm sorry, but I think combining the above five measures is your best bet. And you could probably do just fine with just abelenky's 10-minute-caching trick alone.

There are a few other / better solutions already posted, but for completeness, I figured I'd mention this:

If your main concern is performance degradation, and you're looking at true hammering , then you're actually dealing with a DoS attack, and you should probably try to handle it accordingly. One common approach is to simply drop packets from an IP in the firewall after a number of connections per second/minute/etc. For example, the standard Linux firewall, iptables, has a standard operation matching function 'hashlimit', which could be used to correlate connection requests per time unit to an IP-address.

Although, this question would probably be more apt for the next SO-derivate mentioned on the last SO-podcast, it hasn't launched yet, so I guess it's ok to answer 🙂

编辑:
As pointed out by novatrust, there are still ISPs actually NOT assigning IPs to their customers, so effectively, a script-customer of such an ISP would disable all-customers from that ISP.

Write a reverse-proxy on an apache server in front of your application which implements a Tarpit (Wikipedia Article) to punish bots. It would simply manage a list of IP addresses that connected in the last few seconds. You detect a burst of requests from a single IP address and then exponentially delay those requests before responding.

Of course, multiple humans can come from the same IP address if they're on a NAT'd network connection but it's unlikely that a human would mind your response time going for 2mS to 4mS (or even 400mS) whereas a bot will be hampered by the increasing delay pretty quickly.

  1. Provide an RSS feed so they don't eat up your bandwidth.
  2. 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?
  3. Give everyone 1 minute to put their name in for the drawing and then randomly select people. I think this is the fairest way.
  4. 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.

First of all, by definition, it is impossible to support stateless, ie truly anonymous, transactions while also being able to separate the bots from legitimate users.

If we can accept a premise that we can impose some cost on a brand-spanking-new woot visitor on his first page hit(s), I think I have a possible solution. For lack of a better name, I'm going to loosely call this solution "A visit to the DMV."

Let's say that there's a car dealership that offers a different new car each day, and that on some days, you can buy an exotic sports car for $5 each (limit 3), plus a $5 destination charge.

The catch is, the dealership requires you to visit the dealership and show a valid driver's license before you're allowed in through the door to see what car is on sale. Moreover, you must have said valid driver's license in order to make the purchase.

So, the first-time visitor (let's call him Bob) to this car dealer is refused entry, and is referred to the DMV office (which is conveniently located right next door) to obtain a driver's license.

Other visitors with a valid driver's license is allowed in, after showing his driver's license. A person who makes a nuisance of himself by loitering around all day, pestering the salesmen, grabbing brochures, and emptying the complimentary coffee and cookies will eventually be turned away.

Now, back to Bob without the license — all he has to do is endure the visit to the DMV once. After that, he can visit the dealership and buy cars anytime he likes, unless he accidentally left his wallet at home, or his license is otherwised destroyed or revoked.

The driver's license in this world is nearly impossible to forge.

The visit to the DMV involves first getting the application form at the "Start Here" queue. Bob has to take the completed application to window #1, where the first of many surly civil servants will take his application, process it, and if everything is in order, stamp the application for the window and send him to the next window. And so, Bob goes from windows to window, waiting for each step of his application to go through, until he finally gets to the end and receives his drivere's license.

There's no point in trying to "short circuit" the DMV. If the forms are not filled out correctly in triplicate, or any wrong answers given at any window, the application is torn up, and the hapless customer is sent back to the start.

Interestingly, no matter how full or empty the office is, it takes about the same amount of time to get serviced at each successive window. Even when you're the only person in line, it seems that the personnel likes to make you wait a minute behind the yellow line before uttering, "Next!"

Things aren't quite so terrible at the DMV, however. While all the waiting and processing to get the license is going on, you can watch a very entertaining and informative infomercial for the car dealership while you're in the DMV lobby. In fact, the infomerical runs just long enough to cover the amount of time you spend getting your license.

The slightly more technical explanation:

As I said at the very top, it becomes necessary to have some statefulness on the client-server relationship which allows you to separate humans from bots. You want to do it in a way that doesn't overly penalize the anonymous (non-authenticated) human visitor.

This approach probably requires an AJAX-y client-side processing. A brand-spanking-new visitor to woot is given the "Welcome New User!" page full of text and graphics which (by appropriate server-side throttling) takes a few seconds to load completely. While this is happening (and the visitor is presumably busy reading the welcome page(s)), his identifying token is slowly being assembled.

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 (ie, 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.

At the end of this process, the visitor has a token which allows him to go to the product description page and, in turn, go to the purchasing page. The token is a unique ID to each visitor, and can be used to throttle his activities.

On the server side, you only accept page views from clients that have a valid token. Or, if it's important that everyone can ultimately see the page, put a time penalty on requests that is missing a valid token.

Now, for this to be relatiely benign to the legitimate human visitor,t make the token issuing process happen relatively non-intrusively in the background. Hence the need for the welcome page with entertaining copy and graphics that is deliberately slowed down slightly.

This approach forces a throttle-down of bots to either use an existing token, or take the minimum setup time to get a new token. Of course, this doesn't help as much against sophisticated attacks using a distributed network of faux visitors.

You can't totally prevent bots, even with a captcha. However you can make it a pain to write and maintain a bot and therefore reduce the number. Particularly by forcing them to update their bots daily you'll be causing most to lose interest.

Here are a some ideas to make it harder to write bots:

  • Require running a javascript function. Javascript makes it much more of a pain to write a bot. Maybe require a captcha if they aren't running javascript to still allow actual non-javascript users (minimal).

  • Time the keystrokes when typing into the form (again via javascript). If it's not human-like then reject it. It's a pain to mimic human typing in a bot.

  • Write your code to update your field ID's daily with a new random value. This will force them to update their bot daily which is a pain.

  • Write your code to re-order your fields on a daily basis (obviously in some way that's not random to your users). If they're relying on the field order, this will trip them up and again force daily maintenance to their bot code.

  • You could go even further and use Flash content. Flash is totally a pain to write a bot against.

Generally if you start taking a mindset of not preventing them, but making it more work for them, you can probably achieve the goal you're looking for.

Stick a 5 minute delay on all product announcements for unregistered users. Casual users won't really notice this and noncasual users will be registered anyhow.

I'm not seeing the great burden that you claim from checking incoming IPs. On the contrary, I've done a project for one of my clients which analyzes the HTTP access logs every five minutes (it could have been real-time, but he didn't want that for some reason that I never fully understood) and creates firewall rules to block connections from any IP addresses that generate an excessive number of requests unless the address can be confirmed as belonging to a legitimate search engine (google, yahoo, etc.).

This client runs a web hosting service and is running this application on three servers which handle a total of 800-900 domains. Peak activity is in the thousand-hits-per-second range and there has never been a performance issue – firewalls are very efficient at dropping packets from blacklisted addresses.

And, yes, DDOS technology definitely does exist which would defeat this scheme, but he's not seeing that happen in the real world. On the contrary, he says it's vastly reduced the load on his servers.

My approach would be to focus on non-technological solutions (otherwise you're entering an arms race you'll lose, or at least spend a great deal of time and money on). I'd focus on the billing/shipment parts – you can find bots by either finding multiple deliveries to same address or by multiple charges to a single payment method. You can even do this across items over several weeks, so if a user got a previous item (by responding really really fast) he may be assigned some sort of "handicap" this time around.

This would also have a side effect (beneficial, I would think, but I could be wrong marketing-wise for your case) of perhaps widening the circle of people who get lucky and get to purchase woot.

Most purely technical solutions have already been offered. I'll therefore suggest another view of the problem.

As I understand it, the bots are set up by people genuinely trying to buy the bags you're selling. The problem is –

  1. Other people, who don't operate bots, deserve a chance to buy, and you're offering a limited amount of bags.
  2. You want to attract humans to your site and just sell the bags.

Instead of trying to avoid the bots, you can enable potential bag-buyers to subscribe to an email, or even SMS update, to get notified when a sell will take place. You can even give them a minute or two head start (a special URL where the sell starts, randomly generated, and sent with the mail/SMS).

When these buyers go to buy they're in you're site, you can show them whatever you want in side banners or whatever. Those running the bots will prefer to simply register to your notification service.

The bots runners might still run bots on your notification to finish the buy faster. Some solutions to that can be offering a one-click buy.

By the way, you mentioned your users are not registered, but it sounds like those buying these bags are not random buyers, but people who look forward to these sales. As such, they might be willing to register to get an advantage in trying to "win" a bag.

In essence what I'm suggesting is try and look at the problem as a social one, rather than a technical one.

Asaf

Time-block user agents that make so-many requests per minute. Eg if you've got somebody requesting a page exactly every 5 seconds for 10 minutes, they're probably not a user… But it could be tricky to get this right.

If they trigger an alert, redirect every request to a static page with as little DB-IO as possible with a message letting them know they'll be allowed back on in X minutes.

It's important to add that you should probably only apply this on requests for pages and ignore all the requests for media (js, images, etc).

Preventing DoS would defeat #2 of @davebug's goals he outlined above, "Keep the site at a speed not slowed by bots" but wouldn't necessary solve #1, "Sell the item to non-scripting humans"

I'm sure a scripter could write something to skate just under the excessive limit that would still be faster than a human could go through the ordering forms.

All right so the spammers are out competing regular people to win the "bog of crap" auction? Why not make the next auction be a literal "bag of crap"? The spammers get to pay good money for a bag full of doggy do, and we all laugh at them.

The important thing here is to change the system to remove load from your server, prevent bots from winning the bag of crap WITHOUT letting the botlords know you are gaming them or they will revise their strategy. I don't think there is any way to do this without some processing at your end.

So you record hits on your home page. Whenever someone hits the page that connection is compared to its last hit, and if it was too quick then it is sent a version of the page without the offer. This can be done by some sort of load balancing mechanism that sends bots (the hits that are too fast) to a server that simply serves cached versions of your home page; real people get sent to the good server. This takes the load off the main server and makes the bots think that they are still being served the pages correctly.

Even better if the offer can be declined in some way. Then you can still make the offers on the faux server but when the bot fills out the form say "Sorry, you weren't quick enough" 🙂 Then they will definitely think they are still in the game.

How do you know there are scripters placing orders?

The crux of your problem is that you can't separate the scripters from the legitimate users and therefore can't block them, so how is it that you know there are scripters at all?

If you have a way to answer this question, then you have a set of characteristics you can use to filter the scripters.

Let's turn the problem on its head – you have bots buying stuff that you want real people to buy, how about making a real chance that the bots will buy stuff that you don't want the real people to buy.

Have a random chance for some non displayed html that the scraping bots will think is the real situation, but real people won't see (and don't forget that real people includes the blind, so consider screen readers etc as well), and this travels through to purchase something exorbitantly expensive (or doesn't make the actual purchase, but gets payment details for you to put on a banlist).

Even if the bots switch to 'alert the user' rather than 'make the purchase', if you can get enough false alarms, you may be able to make it sufficiently worthless for people (maybe not everyone, but some reduction in the scamming is better than none at all) not to bother.