-1

我有一个使用验证码的网站。 http://blog.lukeblackamore.com/2009/10/sexy-captcha-new-drag-and-drop-captcha.html 但问题是它可以通过以下方式使用Javascript注入轻松破解:

var res=document.querySelector(".targetWrapper .target").style["background-    position"].match(/\d+/);
[].map.call(document.querySelectorAll(".draggable"),function(a){
if(a.style["background-position"].match(/\d+/)[0]==res){
return document.querySelector(".captchaAnswer").value=a.id
}
});

我怎样才能防止这种情况?

4

1 回答 1

3

最简单的解决方案是使用没有已知安全漏洞的验证码。我推荐谷歌的reCAPTCHA

于 2012-08-05T04:34:01.353 回答