锁定老帖子 主题:使用谷歌的kaptcha验证码被破解了
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2011-05-23
matychen 写道 整中文的?
话说人人网的中文验证码才叫一绝啊,不知道有兄弟能不能搞到。 public class ChineseText extends Configurable implements TextProducer { public String getText() { int length = getConfig().getTextProducerCharLength(); char[] chars = getConfig().getTextProducerCharString(); String finalWord = "", firstWord = ""; String[] array = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; Random rand = new Random(); for (int i = 0; i < length; i++) { switch (rand.nextInt(3)) { case 1: firstWord = String.valueOf(chars[rand.nextInt(chars.length)]); break; case 2: int r1, r2, r3, r4; String strH, strL;// high&low r1 = rand.nextInt(3) + 11; // 前闭后开[11,14) if (r1 == 13) { r2 = rand.nextInt(7); } else { r2 = rand.nextInt(16); } r3 = rand.nextInt(6) + 10; if (r3 == 10) { r4 = rand.nextInt(15) + 1; } else if (r3 == 15) { r4 = rand.nextInt(15); } else { r4 = rand.nextInt(16); } strH = array[r1] + array[r2]; strL = array[r3] + array[r4]; byte[] bytes = new byte[2]; bytes[0] = (byte) (Integer.parseInt(strH, 16)); bytes[1] = (byte) (Integer.parseInt(strL, 16)); try { firstWord = new String(bytes, "GB2312"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } break; default: firstWord = String.valueOf(chars[rand.nextInt(chars.length)]); break; } finalWord += firstWord; } return finalWord; } <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <!-- 验证码 --> <bean id="captchaProducer" class="com.google.code.kaptcha.impl.DefaultKaptcha"> <property name="config"> <bean class="com.google.code.kaptcha.util.Config"> <constructor-arg> <props> <prop key="kaptcha.textproducer.font.color">blue</prop> <prop key="kaptcha.noise.color">blue</prop> <prop key="kaptcha.border">no</prop> <prop key="kaptcha.textproducer.char.space">4</prop> <prop key="kaptcha.textproducer.impl">com.web.ChineseText</prop> <prop key="kaptcha.textproducer.font.names">宋体,楷体,微软雅黑</prop> </props> </constructor-arg> </bean> </property> </bean> </beans> 谢谢兄弟,我也是用的这个,貌似以前的开发人员没有加一些参数设置,我是参与维和的 |
|
返回顶楼 | |
发表时间:2011-05-23
dingzhaoxu 写道 1、验证码使用问问题填答案的方式,比如验证码为一个简单的数学运算,让用户填写结果等;
2、使用动态图片作为验证码,验证码内容是浮动的; 其实最好的解决方案是用户操作简单,而且不能被暴力破解 |
|
返回顶楼 | |
发表时间:2011-05-23
再加上个背景干扰就难被识别了,再不行就直接上中文加大采集比对难度。。。
|
|
返回顶楼 | |
发表时间:2011-05-23
图片的对比度太高了,基于图片灰度提取的算法很容易破解lz的图片。
还是加上简单运算规则的验证吧 |
|
返回顶楼 | |
发表时间:2011-05-23
其实不一定是识别,我们学校的选课系统验证码也可以破解,因为验证之后并没有销毁 SESSION ,所以只要加载一次验证码图片,一份验证码就可以多次使用……只要不让图片重复加载
|
|
返回顶楼 | |
发表时间:2011-05-23
建议还是中文吧,简单实惠。
比字母和数字的性价比高多了。 |
|
返回顶楼 | |
发表时间:2011-05-23
更改字体颜色: 这个更不行,彩色提供了更多的信息,更容易破解。
问题答案式的: 这个人家可以做一个题库来破解。 简单数学运算: 这个也没意义,只要能解析出中间的运算符,电脑算的比人准。 现在手写体都能识别出来,除了增加噪音也没什么好办法了。 |
|
返回顶楼 | |
发表时间:2011-05-23
chunquedong 写道 更改字体颜色: 这个更不行,彩色提供了更多的信息,更容易破解。
问题答案式的: 这个人家可以做一个题库来破解。 简单数学运算: 这个也没意义,只要能解析出中间的运算符,电脑算的比人准。 现在手写体都能识别出来,除了增加噪音也没什么好办法了。 增加语音识别,不是很优雅的做法,会增加注册的复杂度,导致流量下降吧 |
|
返回顶楼 | |
发表时间:2011-05-23
最后修改:2011-05-23
kfyfly 写道 chunquedong 写道 更改字体颜色: 这个更不行,彩色提供了更多的信息,更容易破解。
问题答案式的: 这个人家可以做一个题库来破解。 简单数学运算: 这个也没意义,只要能解析出中间的运算符,电脑算的比人准。 现在手写体都能识别出来,除了增加噪音也没什么好办法了。 增加语音识别,不是很优雅的做法,会增加注册的复杂度,导致流量下降吧 语音识别?晕死,我觉得现在google gmail那个验证码就够我烦的了。注册一下还要搞那么麻烦,而且经常看不清上面写的是什么字。 太麻烦的东西,会直接导致用户放弃使用你们的产品。 |
|
返回顶楼 | |
发表时间:2011-05-23
怎么搞都一样,人家有一群人在打码。
|
|
返回顶楼 | |