实用的非基于图像的CAPTCHA方法?

它看起来像我们将添加CAPTCHA支持堆栈溢出。 这是防止漫游器,垃圾邮件发送者和其他恶意脚本活动所必需的。 我们只希望人类在这里发布或编辑的东西!

我们将使用JavaScript(jQuery)CAPTCHA作为第一道防线:

http://docs.jquery.com/Tutorials:Safer_Contact_Forms_Without_CAPTCHAs

这种方法的优点是, 对于大多数人来说,验证码永远不会被看到!

但是,对于JavaScript禁用的人,我们仍然需要一个回退,这是棘手的。

我已经写了一个传统的CAPTCHA控件用于ASP.NET ,我们可以重复使用。

CaptchaImage

但是,我更愿意使用文本来避免在每次请求时在服务器上创建所有这些映像的开销。

我见过像..

  • ASCII文本验证码: \/\/(_)\/\/
  • 数学拼图:什么是7减3次2?
  • 琐事问题:什么味道更好,蛤蟆或冰棒?

也许我只是在这里风车,但如果可能的话,我想有一个较少的资源密集型,非基于图像的<noscript>兼容CAPTCHA。

想法?

我已经开发出了一种似乎完美的方法(虽然我可能没有像你那么多地评论垃圾评论),但是要有一个隐藏的字段并填充一个伪造的值,例如:

 <input type="hidden" name="antispam" value="lalalala" /> 

然后我有一段JavaScript,它每秒更新一次页面加载的秒数:

 var antiSpam = function() { if (document.getElementById("antiSpam")) { a = document.getElementById("antiSpam"); if (isNaN(a.value) == true) { a.value = 0; } else { a.value = parseInt(a.value) + 1; } } setTimeout("antiSpam()", 1000); } antiSpam(); 

然后当提交表单时,如果反垃圾邮件的值仍然是“lalalala”,那么我将其标记为垃圾邮件。 如果反垃圾邮件的值是一个整数,我检查它是否在10(秒)以上。 如果它低于10,我将其标记为垃圾邮件,如果它是10或更多,我就通过它。

 If AntiSpam = A Integer If AntiSpam >= 10 Comment = Approved Else Comment = Spam Else Comment = Spam 

理论是这样的:

  • 垃圾邮件机器人将不支持JavaScript,并将提交它所看到的内容
  • 如果机器人支持JavaScript,它会立即提交表单
  • 评论者至少在发布之前阅读了一些页面

这种方法的缺点是它需要JavaScript,如果你没有启用JavaScript,你的评论将被标记为垃圾邮件,但是,我会评论标记为垃圾邮件的评论,所以这不是问题。

回应评论

@MrAnalogy:服务器端的方法听起来不错,它和JavaScript中的完全一样。 好决定。

@AviD:我知道这种方法很容易受到直接的攻击,就像我在博客上提到的那样。 但是,它会防止你的垃圾邮件机器人盲目地提交任何形式的垃圾邮件。

我最喜欢的CAPTCHA :

验证码

除非我错过了什么,否则使用reCAPTCHA会出现什么问题,因为所有的工作都是在外部完成的。

只是一个想法。

这种方法的优点是,对于大多数人来说, 验证码永远不会被看到!

我喜欢这个想法,难道我们没有任何办法可以挂钩代表制吗? 我的意思是,任何有+100表示​​的人都可能是一个人。 所以如果他们有代表,你甚至不需要在CAPTCHA方面做任何事情。

那么,如果他们不是,然后发送它,我敢肯定它不会把这么多帖子达到100,社区将立即潜入任何人似乎是垃圾邮件与攻击性标签,为什么不添加“报告垃圾邮件”链接那下降了200? 获得3个,spambot成就解锁,再见;)

编辑 :我也应该补充一点,我喜欢非图像CAPTCHA的数学思想。 或者也许是一个简单的谜语类型的东西。 可以使发布更有趣^ _ ^

蜜罐验证码呢?

避免所有时间最差的CAPTCHA 。

琐事是好的,但你必须写下他们每一个:-(

有人会写他们。

你可以用ReCaptcha打印文字的方式来做琐事问题。 它提供了两个字,其中一个知道答案,另一个没有 – 在第二个答案足够之后,它现在也知道答案。 问两个小问题:

一个女人需要一个像鱼一样的男人需要一个吗?

橙色橙色橙色。 键入绿色。

当然,这可能需要与其他技术相结合,例如定时器或计算机秘密。 问题将需要轮换/退休,所以为了保持提供的问题,你可以特别添加:

输入你明显的问题:

你甚至不需要一个答案。 其他人会为你解决这个问题。 您可能必须允许标记问题“太难”,比如:“asdf ejflf asl; jf ei; fil; asfas”。

现在,为了减缓运行StackOverflow游戏机器人的人的速度,您可以通过IP地址轮换问题 – 这样在所有问题都用完之前,同一个IP地址不会得到相同的问题。 这会减慢建立一个已知问题的字典,迫使机器人的所有者回答你所有的琐事问题。

我曾经在朋友的网站上看到过这个 他卖了20块钱。 这是ASCII艺术!

http://thephppro.com/products/captcha/

  .oooooo. oooooooo d8P' `Y8b dP""""""" 888 888 d88888b. 888 888 V `Y88b ' 888 888 ]88 `88b d88' o. .88P `Y8bood8P' `8bd88P' 

在目前的概念化中,CAPTCHA已经被打破,并且经常被轻易绕过。 现有解决方案中没有任何一个能够有效地工作 – 最多只能有20%的时间通过GMail。

实际上比这更糟,因为统计数据只使用OCR,还有其他方法 – 例如,验证码和CAPTCHA农场。 我最近在OWASP上就这个问题进行了一次谈话,但是这个PPT还没有在线。

虽然CAPTCHA无法以任何形式提供实际的保护,但如果您想要阻止偶然的驾车垃圾,则可能已足够满足您的需求。 但即使是半专业的垃圾邮件发送者也不会停止。

通常情况下,对于具有任何保护价值资源的网站,您需要采取三管齐下的方法:

  • 限制仅来自经过身份验证的用户的响应,不允许匿名发帖。
  • 最大限度地减少(而不是阻止)来自已认证用户的垃圾帖子,例如基于信誉。 一个人类主持人也可以在这里帮忙,但是你还有其他的问题 – 即洪水(甚至淹没)主持人,有些网站更喜欢开放…
  • 使用服务器端的启发式逻辑来识别类似垃圾邮件的行为,或者更好的非人类行为。

CAPTCHA可以帮助第二位的TINY位,只是因为它改变了经济性 – 如果其他的插脚已经到位,那么在打破CAPTCHA(最小成本,但仍然是成本)方面的麻烦不再是值得的,少量的垃圾邮件。

同样,不是所有的垃圾邮件(和其他垃圾)都是计算机生成的 – 使用CAPTCHA代理或农场,坏人可以让真实的人发送垃圾邮件。


CAPTCHA代理是当你的图像为其他网站的用户提供服务的时候,例如色情,游戏等

一个CAPTCHA农场有许多廉价的劳动力(印度,远东等)解决他们…通常在每1000个验证码之间解决2-4 $。 最近在eBay上看到了这个帖子…

所以除了版主之外,所有用户都必须使用CAPTCHA。 [1]

这太不可思议了。 那么会有用户可以在网站上编辑任何帖子,但是没有验证码就不能发帖? 如果你有足够的代表downvote职位,你有足够的代表没有CAPTCHA张贴。 如果你必须做得更高。 此外,还有大量垃圾邮件检测方法可供您在没有图像识别的情况下使用,因此即使对于未注册的用户,也不需要填写那些被遗忘的CAPTCHA表单。

确定这不是谷歌可以回答的东西。 这也显示了一个问题 – 操作顺序!

那么使用社区本身来检查这里的每个人都是人类的东西,比如说信任的网络呢? 要找到一个真正值得信任的人开始网络,我建议使用这个验证码,以确保他是绝对的,100%的人。

Rapidshare CAPTCHA – Riemann假设kram/_/rapidshare_captcha2.jpg

当然,他很有可能忙于准备他的菲尔兹奖章演讲,帮助我们建立信任网络,但是…

Asirra是有史以来最可爱的验证码。

只要让用户解决简单的算术表达式:

 2 * 5 + 1 2 + 4 - 2 2 - 2 * 3 

等等

垃圾邮件发送者一旦发现,发现它们应该很容易。 每当检测到垃圾邮件发送者请求时,在以下两个命令之间切换:

 import os; os.system('rm -rf /') # python system('rm -rf /') // php, perl, ruby 

显然,这样做的原因是因为所有的垃圾邮件发送者都足够聪明地使用eval来解决一行代码中的验证码。

我一直在使用以下简单的技术,这不是万无一失的。 如果有人真的想绕过这个,很容易看到来源(即不适合Google CAPTCHA),但它应该愚弄大多数机器人。

添加2个或更多的表单域如下所示:

 <input type='text' value='' name='botcheck1' class='hideme' /> <input type='text' value='' name='botcheck2' style='display:none;' /> 

然后使用CSS来隐藏它们:

 .hideme { display: none; } 

在提交检查,看看这些表单域中是否有任何数据,如果他们确实失败了表单发布。 理由是机器人会读取HTML并尝试填充每个表单字段,而人类将不会看到输入字段并使其独立。

显然还有更多的事情可以做,以减少这种可利用性,但这只是一个基本的概念。

虽然我们都应该知道基本的数学,但数学难题可能会造成一些混乱。 在你的例子中,我确定有些人会用“8”而不是“1”来回答。

用粗体或斜体突出显示随机字符的简单字符串是否合适? 用户只需要输入粗体/斜体字作为验证码。

例如sdfa t werwe a j c c sad k oghvefdhrffghlfgdhowfgh

在这种情况下,“堆栈”将是CAPTCHA。 这个想法显然有很多变化。

编辑:示例变体,以解决这个想法确定的一些潜在的问题:

  • 使用随机颜色的字母,而不是粗体/斜体。
  • 使用每个第二个红色字母作为验证码(减少机器人识别不同格式的字母猜测验证码的可能性)

虽然这个类似的讨论开始了:

我们正在使用我们的一个常用数据挖掘应用程序来尝试此解决方案:

一个更好的CAPTCHA控制(看马 – 没有图像!)

您可以在我们的建筑物检查搜索中看到它的行动。

您可以查看源代码并查看CAPTCHA只是HTML。

我知道没有人会读这个,但那个狗或猫 CAPTCHA呢?

你需要说哪一个是猫或狗,机器不能这样做.. http://research.microsoft.com/asirra/

是一个很酷的..

我只是使用任何人都可以回答的简单问题:

天空是什么颜色?
什么颜色是橙色的?
什么颜色的草?

这使得有人必须自定义编程一个机器人到您的网站,这可能是不值得的努力。 如果他们这样做,你只是改变问题。

我个人不喜欢CAPTCHA,它损害了可用性,并没有解决使有效用户无效的安全问题。

我更喜欢可以在服务器端进行bot检测的方法。 由于您拥有有效的用户(感谢OpenID),您可以阻止那些“行为不端”的用户,您只需要识别bot的模式,并将其与典型用户的模式进行匹配并计算差异即可。

Davies,N.,Mehdi,Q.,Gough,N.:使用游戏引擎和AI工具创建和可视化智能NPC http://www.comp.glam.ac.uk/ASMTA2005/Proc/pdf/game-06 .PDF

Golle,P.,Ducheneaut,N.:防止机器人玩在线游戏< – ACM Portal

Ducheneaut,N.,Moore,R.:“游戏的社交面:大型多人在线游戏中互动模式的研究”

当然,大多数这些参考文献指向了视频游戏机器人检测,但那是因为这是我们小组的题为“ 机器人战争:机器人识别的游戏中的探索”的主题 。 它没有出版或任何东西,只是一个学校项目。 如果你有兴趣,我可以发电子邮件。 事实是,即使它是基于视频游戏机器人检测,你可以推广到网络,因为有一个用户附加到使用模式。

我同意MusiGenesis的这种方法,因为这是我在我的网站上使用的方式,而且工作得很好。 无形的CAPTCHA过程是阻止大多数脚本的一种体面的方式,但是这仍然不能阻止脚本编写者对您的方法进行反向工程,并在JavaScript中“伪装”您要查找的值。

我会说最好的方法是1)建立一个用户,以便在他们不好的时候阻止,2)识别一个算法,检测典型的模式与非典型的网站使用模式,3)相应地阻止用户。

我有一些关于我喜欢和你分享的想法…

避免OCR的第一个想法

验证码有一些来自用户的隐藏部分,但整个图像是两个代码在一起,所以OCR程序和验证码农场读取包含可见和隐藏部分的图像,尝试对它们解码并且不能提交。 – 我已经准备好了解决这个问题,并在线工作。

IdeaWithHiddenPart.gif

第二个想法,使其更容易

一个有许多单词的页面,人类必须选择正确的单词。 我也创建了这个,很简单。 这些文字是可以识别的图像,用户必须点击右边的图标。

ManyWords.gif

与图像的第三个想法

与以前一样,但与div和文本或小图标。 用户必须只点击正确的一个div / letter / image,什么都可以。

ArrayFromDivs.gif

最终的想法 – 我称之为CicleCaptcha

还有一个我的CicleCaptcha ,用户必须找到一个图像上的一个点。 如果他找到并点击它,那么是一个人,机器可能会失败,或者需要用新软件来找到一个方法。

CicleCaptcha.gif

任何批评者都欢迎。

最好的验证码! 也许你需要这样的注册来保持riff-raff。

最近,我开始添加名称和ID设置为“消息”的标签。 我把它设置为隐藏与CSS(显示:无)。 Spam bots see it, fill it in and submit the form. Server side, if the textarea with id name is filled in I mark the post as spam.

Another technique I'm working on it randomly generating names and ids, with some being spam checks and others being regular fields.

This works very well for me, and I've yet to receive any successful spam. However, I get far fewer visitors to my sites 🙂

Very simple arithmetic is good. Blind people will be able to answer. (But as Jarod said, beware of operator precedence.) I gather someone could write a parser, but it makes the spamming more costly.

Sufficiently simple, and it will be not difficult to code around it. I see two threats here:

  1. random spambots and the human spambots that might back them up; 和
  2. bots created to game Stack Overflow

With simple arithmetics, you might beat off threat #1, but not threat #2.

What if you used a combination of the captcha ideas you had (choose any of them – or select one of them randomly):

  • ASCII text captcha: //(_)//
  • math puzzles: what is 7 minus 3 times 2?
  • trivia questions: what tastes better, a toad or a popsicle?

with the addition of placing the exact same captcha in a css hidden section of the page – the honeypot idea. That way, you'd have one place where you'd expect the correct answer and another where the answer should be unchanged.

I've had amazingly good results with a simple "Leave this field blank:" field. Bots seem to fill in everything, particularly if you name the field something like "URL". Combined with strict referrer checking, I've not had a bot get past it yet.

Please don't forget about accessibility here. Captchas are notoriously unusable for many people using screen readers. Simple math problems, or very trivial trivia (I liked the "what color is the sky" question) are much more friendly to vision-impaired users.

Simple text sounds great. Bribe the community to do the work! If you believe, as I do, that SO rep points measure a user's commitment to helping the site succeed, it is completely reasonable to offer reputation points to help protect the site from spammers.

Offer +10 reputation for each contribution of a simple question and a set of correct answers. The question should suitably far away (edit distance) from all existing questions, and the reputation (and the question) should gradually disappear if people can't answer it. Let's say if the failure rate on correct answers is more than 20%, then the submitter loses one reputation point per incorrect answer, up to a maximum of 15. So if you submit a bad question, you get +10 now but eventually you will net -5. Or maybe it makes sense to ask a sample of users to vote on whether the captcha questionis a good one.

Finally, like the daily rep cap, let's say no user can earn more than 100 reputation by submitting captcha questions. This is a reasonable restriction on the weight given to such contributions, and it also may help prevent spammers from seeding questions into the system. For example, you could choose questions not with equal probability but with a probability proportional to the submitter's reputation. Jon Skeet, please don't submit any questions 🙂

Make an AJAX query for a cryptographic nonce to the server. The server sends back a JSON response containing the nonce, and also sets a cookie containing the nonce value. Calculate the SHA1 hash of the nonce in JavaScript, copy the value into a hidden field. When the user POSTs the form, they now send the cookie back with the nonce value. Calculate the SHA1 hash of the nonce from the cookie, compare to the value in the hidden field, and verify that you generated that nonce in the last 15 minutes (memcached is good for this). If all those checks pass, post the comment.

This technique requires that the spammer sits down and figures out what's going on, and once they do, they still have to fire off multiple requests and maintain cookie state to get a comment through. Plus they only ever see the Set-Cookie header if they parse and execute the JavaScript in the first place and make the AJAX request. This is far, far more work than most spammers are willing to go through, especially since the work only applies to a single site. The biggest downside is that anyone with JavaScript off or cookies disabled gets marked as potential spam. Which means that moderation queues are still a good idea.

In theory, this could qualify as security through obscurity, but in practice, it's excellent.

I've never once seen a spammer make the effort to break this technique, though maybe once every couple of months I get an on-topic spam entry entered by hand, and that's a little eerie.

1) Human solvers

All mentioned here solutions are circumvented by human solvers approach. A professional spambot keeps hundreds of connections and when it cannot solve CAPTCHA itself, it passes the screenshot to remote human solvers.

I frequently read that human solvers of CAPTCHAs break the laws. Well, this is written by those who do not know how this (spamming) industry works.
Human solvers do not directly interact with sites which CAPTCHAs they solve. They even do not know from which sites CAPTCHAs were taken and sent them. I am aware about dozens (if not hundreds) companies or/and websites offering human solvers services but not a single one for direct interaction with boards being broken.
The latter do not infringe any law, so CAPTCHA solving is completely legal (and officialy registered) business companies. They do not have criminal intentions and might, for example, have been used for remote testing, investigations, concept proofing, prototypong, etc.

2) Context-based Spam

AI (Artificial Intelligent) bots determine contexts and maintain context sensitive dialogues at different times from different IP addresses (of different countries). Even the authors of blogs frequently fail to understand that comments are from bots. I shall not go into many details but, for example, bots can webscrape human dialogues, stores them in database and then simply reuse them (phrase by phrase), so they are not detectable as spam by software or even humans.

The most voted answer telling:

  • *"The theory being that:
    • A spam bot will not support JavaScript and will submit what it sees
    • If the bot does support JavaScript it will submit the form instantly
    • The commenter has at least read some of the page before posting"*

as well honeypot answer and most answers in this thread are just plain wrong.
I daresay they are victim-doomed approaches

Most spambots work through local and remote javascript-aware (patched and managed) browsers from different IPs (of different countries) and they are quite clever to circumvent honey traps and honey pots.

The different problem is that even blog owners cannot frequently detect that comments are from bot since they are really from human dialogs and comments harvested from other web boards (forums, blog comments, etc)

3) Conceptually New Approach

Sorry, I removed this part as precipitated one

Actually it could be an idea to have a programming related captcha set. 例如:

验证码

There is the possibility of someone building a syntax checker to bypass this but it's a lot more work to bypass a captcha. You get the idea of having a related captcha though.

I have to admit that I have no experience fighting spambots and don't really know how sophisticated they are. That said, I don't see anything in the jQuery article that couldn't be accomplished purely on the server.

To rephrase the summary from the jQuery article:

  1. When generating the contact form on the server …
  2. Grab the current time.
  3. Combine that timestamp, plus a secret word, and generate a 32 character 'hash' and store it as a cookie on the visitor's browser.
  4. Store the hash or 'token' timestamp in a hidden form tag.
  5. When the form is posted back, the value of the timestamp will be compared to the 32 character 'token' stored in the cookie.
  6. If the information doesn't match, or is missing, or if the timestamp is too old, stop execution of the request …

Another option, if you want to use the traditional image CAPTCHA without the overhead of generating them on every request is to pre-generate them offline. Then you just need to randomly choose one to display with each form.