当前位置: 首页 > article >正文

【中关村在线-注册/登录安全分析报告】

前言

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

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

一、 中关村在线PC 注册入口

简介:中关村在线(ZOL)创立于1999年,深耕科技垂直领域23年,致力于新消费势力生活科技商品第一导购平台 ,专业高质量内容的提供者。以用户第一为导向,帮用户买好产品,帮客户卖好产品为使命利用专业领先内容,帮助用户更好、更快的选购产品, 通过产品解析、产品点评、问答口碑、对接电商,简化路径、产品评测完善+ 种草导购推荐等环节,让用户全面了解每一款产品性能,帮助用户更精准、更快捷的选购科技产品。

在这里插入图片描述

二丶 安全分析:

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

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

1. 模拟器交互



	private static String INDEX_URL = "https://service.zol.com.cn/user/login.php?backurl=https%3A%2F%2Fwww.zol.com.cn%2F";

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

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

			// 2 获取图形验证码
			Thread.sleep(1 * 1000);
			String imgCode = null, imgUrl;
			byte[] imgByte = null;
			WebElement imgElement;
			for (int i = 0; i < 5; i++) {
				imgElement = driver.findElement(By.id("quickimgverifycode"));
				imgElement.click();
				Thread.sleep(1000);
				imgUrl = imgElement.getAttribute("src");
				imgByte = (imgUrl != null) ? GetImage.callJsByUrl(driver, imgUrl) : null;
				int len = (imgByte != null) ? imgByte.length : 0;
				imgCode = (len > 0) ? ddddOcr.getImgCode(imgByte) : null;
				boolean rcode = (imgCode != null && imgCode.length() >= 4) ? DigitFormat.isRcode(imgCode) : false;
				if (!rcode) {
					System.out.println("imgCode=" + imgCode + "->rcode=" + rcode);
					continue;
				}

				// 3 输入识别出来的图形验证码
				WebElement codeInputElement = driver.findElement(By.id("phoneloginpicverifycode"));
				codeInputElement.clear();
				codeInputElement.sendKeys(imgCode);
				// 4 获取验证码
				WebElement sendElement = driver.findElement(By.id("get-anicode"));
				sendElement.click();
				WebElement noticeElement = ChromeDriverManager.waitElement(driver, By.id("noticeTip"), 20);
				String errInfo = (noticeElement != null) ? noticeElement.getText() : null;
				if (errInfo != null) {
					if (errInfo.contains("操作过于频繁")) {
						retEntity.setMsg(errInfo);
						return retEntity;
					}
					System.out.println("imgCode=" + imgCode + "->errInfo=" + errInfo);
					continue;
				}
				break;
			}

			Thread.sleep(1500);
			WebElement sendElement = driver.findElement(By.id("get-anicode"));
			String gtInfo = sendElement.getText();
			retEntity.setMsg("[imgCode:" + imgCode + "]->" + gtInfo);

			if (gtInfo != null && gtInfo.contains("动态密码已发送")) {
				retEntity.setRet(0);
				ddddOcr.saveFile("Zol", imgCode, imgByte);
				return retEntity;
			} else {
				System.out.println("gtInfo=" + gtInfo);
				ddddOcr.saveFile("Zol/err/", imgCode, imgByte);
			}
			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. 测试返回结果:

在这里插入图片描述

三 丶测试报告 :

在这里插入图片描述

四丶结语

中关村在线(ZOL)创立于1999年,深耕科技垂直领域23年,致力于新消费势力生活科技商品第一导购平台 ,专业高质量内容的提供者。以用户第一为导向,帮用户买好产品,帮客户卖好产品为使命利用专业领先内容,帮助用户更好、更快的选购产品, 通过产品解析、产品点评、问答口碑、对接电商,简化路径、产品评测完善+ 种草导购推荐等环节,让用户全面了解每一款产品性能,帮助用户更精准、更快捷的选购科技产品。作为老牌的资深电脑硬件媒体, 技术实力也应该不错,但采用的还是老一代的图形验证码已经落伍了,测试结果就是有ip限制,ip限制的优点是实现简单有效,优点是可以拦截同一个ip的攻击,但负作用也很明显,比如移动网关同一个ip后面会有很多手机用户,存在误拦截的隐患, 并且只要用代理IP就可以绕过这个规则限制, 随便你怎么攻击都可以,这也有点太开放了, 短信验证码难道不要钱吗 ? 这对黑客来说肯定是好消息, 弄个简单的脚本就可以搞定, 一旦被国际黑客发起攻击,将会对老百姓形成骚扰,影响声誉。

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

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

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

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

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

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


http://www.kler.cn/news/326719.html

相关文章:

  • 基于单片机的多点温度测量系统
  • 在Ubuntu下通过Docker部署NAS服务器
  • 遇到慢SQL、SQL报错,应如何快速定位问题 | OceanBase优化实践
  • Flet介绍:平替PyQt的好用跨平台Python UI框架
  • sheng的学习笔记-logback
  • 实验OSPF路由协议(课内实验)
  • 运输层和应用层之间的接口和端口有什么关系
  • Android常用C++特性之std::optional
  • 7. 无线网络安全
  • Docker全家桶:Docker Compose项目部署
  • CICD Jenkins实现Pipline
  • sqli-labs时间盲注、布尔盲注脚本
  • 数据结构之链表(2),双向链表
  • 面试系列-携程暑期实习一面
  • C++ | Leetcode C++题解之第438题找到字符串中所有字母异位词
  • Python Web 应用中的 API 网关集成与优化
  • IText导出pdf不显示泰文
  • 438. 找到字符串中所有字母异位词
  • uniapp 知识点
  • 【前端样式】Sweetalert2简单用法
  • 如何使用ssm实现个人日常事务管理系统+vue
  • 金融教育宣传月 | 平安养老险百色中心支公司开展金融知识“消保县域行”宣传活动
  • 心理咨询预约管理系统(含源码+sql+视频导入教程)
  • web前端与koa框架node后端实现分片断点上传
  • xtu oj 六边形
  • 制造企业如何提升项目管理效率?惠科股份选择奥博思PowerProject项目管理系统
  • Windows环境Apache httpd 2.4 web服务器加载PHP8:Hello,world!
  • 【BurpSuite】访问控制漏洞和权限提升 | Access control vulnerabilities (3-6)
  • 一个静态ip可以提取出来多少ip
  • 新版pycharm如何导入自定义环境