前言
由于网站注册入口容易被机器执行自动化程序攻击,存在如下风险:
- 暴力破解密码,造成用户信息泄露,不符合国家等级保护的要求。
- 短信盗刷带来的拒绝服务风险 ,造成用户无法登陆、注册,大量收到垃圾短信的用户投诉导致短信通道被关停。
- 带来经济损失,尤其是后付费客户,需要承担短信盗刷造成的大额短信费 ,造成亏损无底洞。

所以大部分网站及App 都采取图形验证码或滑动验证码等交互解决方案, 但在机器学习能力提高的当下,连百度这样的大厂都遭受攻击导致点名批评, 图形验证及交互验证方式的安全性到底如何? 请看具体分析
一、 AI智能的发展给行为验证带来威胁
验证码本质上自带一层答案的语义,这原本是天然的区分人和自动程序的地方,但在今日却未必,由于AI智能及CHATGPT等大模型的发展,机器要识别也变得更加容易。
1、 目标识别框架
黑产破解者为了降低攻击成本、提高破解效率,通常会利用收集的大量验证码图片样本,打码标注、构建模型网络、训练模型、测试模型,从而得到一个可持续识别图片答案的识别。目前,黑产针对验证码图片的破解最常用的主要是分类模型和相似模型。
2、 批量下载存储验证图片,共需要大数万张图片。
3、 黑产训练出一个高准确度的识别模型后,后续破解验证码时,通过识别模型就能直接获取答案坐标。
4、 借力大模型进行升级
俗话说:道高一尺,魔高一丈,在chatgpt大模型发展的今天,行为验证的方式无论怎么变花样,被破解只是时间而已,被伤害的反而是真实用户。

二、 进度猫 PC 注册入口
简介:西安安讯软件科技有限公司(AnXunSoftWare Technology Co., Ltd.),致力于互联网应用软件产品的研发及相关产品的客户定制服务,打造互联网行业信息化服务领域的专业品牌。
公司凭借现代化的企业管理手段和优秀年轻的产品团队,利用成熟的软件产品和技术,为政府、集团及大中型企事业单位用户提供信息化软件开发与实施服务、客户关系管理软件(千百客CRM)、项目管理软件(进度猫)、协同办公(千百客OA)、生产制造软件(ERP)、电子商务(E-COMMERCE)、商业数据分析/人工智能领域的信息化解决方案,我们以诚信,优质的服务赢得了客户的青睐。


三 丶测试报告 :

四丶 安全分析:
采用传统的图形验证码方式,具体为4个数字英文,ocr 识别率在 95% 以上。
测试方法:
采用模拟器+OCR识别
1. 模拟器交互
private static String INDEX_URL ="https://www.jindumao.com/index/login/findpasstel.html";
@Override
public RetEntity send(WebDriver driver, String areaCode, String phone){
RetEntity retEntity = new RetEntity();
try {
driver.get(INDEX_URL);
Thread.sleep(1 * 1000);
// 1 输入手机号
WebElement phoneElemet = ChromeDriverManager.waitElement(driver, By.id("useraccount"), 1);
phoneElemet.sendKeys(phone);
Thread.sleep(1 * 1000);
// 2 获取图形验证码
WebElement getCodeElement = null, imgElement, imgInputElement;
String imgCode = null, gtInfo = null;
byte[] imgByte = null;for(int i =0; i <5; i++){
imgElement = driver.findElement(By.id("codeImg"));
imgByte = GetImage.callJsById(driver, "codeImg");
int len =(imgByte != null) ? imgByte.length :0;
imgCode =(len >0) ? ddddOcr.getImgCode(imgByte): null;if(imgCode == null || imgCode.length()<1){
System.out.println("len=" + len + ",imgCode=" + imgCode);return retEntity;}
// 3 输入识别出来的图形验证码
imgInputElement = driver.findElement(By.id("imgcode"));
imgInputElement.clear();
imgInputElement.sendKeys(imgCode);
// 4 点击获取验证码
Thread.sleep(1 * 1000);
getCodeElement = driver.findElement(By.className("register_yan_btn"));
getCodeElement.click();
Thread.sleep(1 * 1000);
gtInfo = getCodeElement.getAttribute("value");if(gtInfo != null && gtInfo.contains("重新发送")){break;}
imgElement.click();
Thread.sleep(1 * 1000);}
retEntity.setMsg("[" + imgCode + "->" + gtInfo + "]");
boolean isSend =(gtInfo != null && gtInfo.contains("重新发送"));if(!isSend){return retEntity;}
ddddOcr.saveFile(this.getClass().getSimpleName(), imgCode, imgByte);
retEntity.setRet(0);return retEntity;} catch (Exception e){
System.out.println(e.toString());
retEntity.setMsg(e.toString());} finally {
driver.manage().deleteAllCookies();}return retEntity;}
2. 获取图形验证码
public static byte[] callJsById(WebDriver driver, String id){return callJsById(driver, id, null);}
public static byte[] callJsById(WebDriver driver, String id, StringBuffer base64){
String js ="let c = document.createElement('canvas');let ctx = c.getContext('2d');";
js +="let img = document.getElementById('" + id + "'); /*找到图片*/ ";
js +="c.height=img.naturalHeight;c.width=img.naturalWidth;";
js +="ctx.drawImage(img, 0, 0,img.naturalWidth, img.naturalHeight);";
js +="let base64String = c.toDataURL();return base64String;";
String src =((JavascriptExecutor) driver).executeScript(js).toString();
String base64Str = src.substring(src.indexOf(",") + 1);if(base64 != null){
base64.append(base64Str);}
byte[] vBytes =(base64Str != null) ? imgStrToByte(base64Str): null;return vBytes;}
3.图形验证码识别(Ddddocr)
public String getImgCode(byte[] bigImage){
try {if(ddddUrl == null){
System.out.println("ddddUrl=" + ddddUrl);return null;}
long time=(new Date()).getTime();
HttpURLConnection con = null;
String boundary ="----------" + String.valueOf(time);
String boundarybytesString ="\r\n--" + boundary + "\r\n";
OutputStream out = null;
URL u = new URL(ddddUrl);
con =(HttpURLConnection) u.openConnection();
con.setRequestMethod("POST");
con.setConnectTimeout(10000);
con.setReadTimeout(10000);
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(true);
con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
out = con.getOutputStream();if(bigImage != null && bigImage.length >0){
out.write(boundarybytesString.getBytes("UTF-8"));
String paramString ="Content-Disposition: form-data; name=\"image\"; filename=\"" + "bigNxt.gif" + "\"\r\n";
paramString +="Content-Type: application/octet-stream\r\n\r\n";
out.write(paramString.getBytes("UTF-8"));
out.write(bigImage);}
String tailer ="\r\n--" + boundary + "--\r\n";
out.write(tailer.getBytes("UTF-8"));
out.flush();
out.close();
StringBuffer buffer = new StringBuffer();
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
String temp;while((temp = br.readLine())!= null){
buffer.append(temp);}
String ret = buffer.toString();if(ret.length()<1){
System.out.println("ddddUrl=" + ddddUrl + " ret=" + buffer.toString());}return buffer.toString();} catch (Throwable e){
logger.error("ddddUrl=" + ddddUrl + ",e=" + e.toString());return null;}}
public void saveFile(String factory, String imgCode, byte[] imgByte){
try {
String basePath = ConstTable.codePath + factory + "/";
File ocrFile = new File(basePath + imgCode + ".png");
FileUtils.writeByteArrayToFile(ocrFile, imgByte);} catch (Exception e){
logger.error("saveFile() " + e.toString());}}
4. 图形OCR识别结果:

5. 测试返回结果:

五 丶结语
西安安讯软件科技有限公司(AnXunSoftWare Technology Co., Ltd.),致力于互联网应用软件产品的研发及相关产品的客户定制服务,打造互联网行业信息化服务领域的专业品牌。
公司凭借现代化的企业管理手段和优秀年轻的产品团队,利用成熟的软件产品和技术,为政府、集团及大中型企事业单位用户提供信息化软件开发与实施服务、客户关系管理软件(千百客CRM)、项目管理软件(进度猫)、协同办公(千百客OA)、生产制造软件(ERP)、电子商务(E-COMMERCE)、商业数据分析/人工智能领域的信息化解决方案,我们以诚信,优质的服务赢得了客户的青睐。作为CRM软件开发厂商, 技术实力也应该不错,但采用的还是老一代的图形验证码已经落伍了, 用户体验一般,容易被破解, 一旦被国际黑客发起攻击,将会对老百姓形成骚扰,影响声誉。
很多人在短信服务刚开始建设的阶段,可能不会在安全方面考虑太多,理由有很多。
比如:“ 需求这么赶,当然是先实现功能啊 ”,“ 业务量很小啦,系统就这么点人用,不怕的 ” , “ 我们怎么会被盯上呢,不可能的 ”等等。有一些理由虽然有道理,但是该来的总是会来的。前期欠下来的债,总是要还的。越早还,问题就越小,损失就越低。
所以大家在安全方面还是要重视。(血淋淋的栗子!)#安全短信#
戳这里→康康你手机号在过多少网站注册过!!!
谷歌图形验证码在AI 面前已经形同虚设,所以谷歌宣布退出验证码服务, 那么当所有的图形验证码都被破解时,大家又该如何做好防御呢?
>>相关阅读
《腾讯防水墙滑动拼图验证码》
《百度旋转图片验证码》
《网易易盾滑动拼图验证码》
《顶象区域面积点选验证码》
《顶象滑动拼图验证码》
《极验滑动拼图验证码》
《使用深度学习来破解 captcha 验证码》
《验证码终结者-基于CNN+BLSTM+CTC的训练部署套件》
版权归原作者 newxtc 所有, 如有侵权,请联系我们删除。