什么是好的隐形验证码?

发布于 2024-07-24 02:47:50 字数 1436 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

往日情怀 2024-07-31 02:47:50

添加一个新的输入字段,将其标记为“请留空”,使用 CSS 隐藏它,如果该字段已填写,则忽略该帖子。像这样:

<style type='text/css'>
#other_email_label, #other_email {
    display: none;
}
</style>
...
<form action='mail'>
<label id='other_email_label' for='other_email'>Please leave blank:</label>
<input type='text' name='other_email' id='other_email'>
...
</form>

所以人们不会看到该字段(除非他们将 CSS 变成关闭,在这种情况下,他们会看到标签并将其留空),但垃圾邮件机器人会填写它。填充该字段的任何帖子都必须来自垃圾邮件机器人。

Add a new input field, label it "Please leave blank", hide it using CSS, and ignore the post if that field is filled in. Something like this:

<style type='text/css'>
#other_email_label, #other_email {
    display: none;
}
</style>
...
<form action='mail'>
<label id='other_email_label' for='other_email'>Please leave blank:</label>
<input type='text' name='other_email' id='other_email'>
...
</form>

So a human being won't see that field (unless they have CSS turned off, in which case they'll see the label and leave it blank) but a spam robot will fill it in. Any post with that field populated must be from a spam robot.

等数载,海棠开 2024-07-31 02:47:50

这里由 Phil Haack 编写的一个简单的数学验证码。 它甚至可以在禁用 JavaScript 的情况下工作。

用他自己的话说:

它的工作方式是渲染
一些 javascript 来执行真正的
简单计算并写出
使用隐藏文本字段回答
JavaScript。 当用户提交
表单,我们从以下位置获取提交的值
隐藏的表单字段,将其与
秘密盐值,然后散列
整个事情在一起。 然后我们比较
这个值与哈希值
预期答案,存储在
隐藏表单字段采用 Base64 编码。 如果
javascript被禁用,然后我们渲染
将问题作为文本与
可见的文本字段,从而为用户提供
通过非 JavaScript 读取您的网站
浏览器有机会发表评论。

Here's a simple math captcha by Phil Haack. It even works with javascript disabled.

In his own words:

The way it works is that it renders
some javascript to perform a really
simple calculation and write the
answer into a hidden text field using
javascript. When the user submits the
form, we take the submitted value from
the hidden form field, combine it with
a secret salt value, and then hash the
whole thing together. We then compare
this value with the hash of the
expected answer, which is stored in a
hidden form field base64 encoded. If
javascript is disabled, then we render
out the question as text alongside a
visible text field, thus giving users
reading your site via non-javascript
browsers a chance to comment.

柳若烟 2024-07-31 02:47:50

我使用了 Display:None 文本框的技术,并拒绝任何填写该文本框的提交,并且运气很好。

I've used the technique of a Display:None text box, and rejecting any submission that fills it in and had pretty good luck with that.

岛歌少女 2024-07-31 02:47:50

谷歌正在推出“隐形 ReCAPTCHA”(https://www .google.com/recaptcha/intro/comingsoon/invisible.html),我的网站已列入白名单。 目前正在实施它,但是文档还没有那么详细......:)

For what it's worth Google is rolling out 'Invisible ReCAPTCHA' (https://www.google.com/recaptcha/intro/comingsoon/invisible.html), I already got whitelisted with my site. At the moment implementing it, however the docs aren't that elaborated...:)

十雾 2024-07-31 02:47:50

MTCaptcha 是一种 reCaptcha 替代验证码服务,支持隐形验证码,类似于最近推出的 reCaptcha V3,其中大多数人看不到它用户,但如果认为流量有风险,则会显示验证码。

MTCaptcha is a reCaptcha alternative captcha service that supports invisible captchas similar to the recently launched reCaptcha V3, where its invisible to most users but shows a captcha if it feels the traffic is risky.

浮生未歇 2024-07-31 02:47:50

如果你的意思是 - 使用人类看不到的验证码作为人类验证测试 - 我认为这是不可能的。

这样忽略验证码的机器人就会冒充真人! 看起来像是一个天真的垃圾邮件机器人的陷阱。

如果您希望受验证码保护的网站能够与没有 javascript 的客户端一起使用 - 那么您应该将其硬编码为 html。

此外,如果您可以可靠地识别受信任的用户(通过判断调用或通过检测某些使用模式) - 您可以让他们在没有验证码的情况下发布到您的网站。

If you mean - use captcha that a human can't see as a human validation test - i think it's impossible.

This way a robot ignoring the captcha will pass for a real person! Seems like a trap for a naive spam robot.

If you want your captcha-protected site to work with clients that have no javascript - then you should hardcode it into html.

Also, if you can reliably identify trusted users (either by judgment call or by detecting some usage pattern) - you can let them post to your site without captcha.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文