首页 > 其他分享 >【12321骚扰电话举报受理中心-短信验证安全分析报告】

【12321骚扰电话举报受理中心-短信验证安全分析报告】

时间:2024-07-04 21:30:56浏览次数:18  
标签:短信 String driver 验证码 con 12321 骚扰电话 null out

前言

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

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

一、 12321骚扰电话举报受理中心-PC举报入口

简介:12321网络不良与垃圾信息举报受理中心(以下简称"12321受理中心")为中国互联网协会受工业和信息化部委托设立的投诉受理机构。负责协助工业和信息化部承担关于互联网、移动电话网、固定电话网等各种形式信息通信网络及电信业务中不良与垃圾信息的投诉受理、线索转办及信息统计等工作。

在这里插入图片描述

二丶 安全分析:

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

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

1. 模拟器交互


public RetEntity send(WebDriver driver, String areaCode, String phone) {
		RetEntity retEntity = new RetEntity();
		try {
			driver.get(INDEX_URL);
			String windowHandle = driver.getWindowHandle();
			// 切换到随机码登录
			driver.findElement(By.xpath("//a[@href='/notifyHomePhone']")).click();
			Thread.sleep(1 * 1000);
			driver.close();
			Set<String> windowHandles = driver.getWindowHandles();
			for (String key : windowHandles) {
				if (!key.equals(windowHandle)) {
					driver.switchTo().window(key);
				}
			}
			String js = "pageSubmit();";
			((JavascriptExecutor) driver).executeScript(js);
			Thread.sleep(1 * 1000);
			// 1 输入手机号
			WebElement phoneElemet = driver.findElement(By.id("phone"));
			phoneElemet.sendKeys(phone);
			byte[] imgByte = GetImage.callJsById(driver, "code");
			int len = (imgByte != null) ? imgByte.length : 0;
			String imgCode = (len > 0) ? ddddOcr.getImgCode(imgByte) : null;
			System.out.println("len=" + len + ",imgCode=" + imgCode);
			// 2 输入图形验证码
			driver.findElement(By.id("w_code")).sendKeys(imgCode);

			WebElement getCodeElement = driver.findElement(By.xpath("//a[contains(text(),'获取短信验证码')]"));
			getCodeElement.click();
			Thread.sleep(1 * 1000);
			boolean isAlert = this.isAlert(driver);
			if (isAlert) {
				return retEntity;
			}
			WebElement gtElement = ChromeDriverManager.waitElement(driver, By.id("Time"), 1);
			String msg = gtElement != null ? gtElement.getText() : null;
			retEntity.setMsg(msg);
			if (msg != null && msg.contains("重新获取")) {
				ddddOcr.saveFile("One2321", imgCode, imgByte);
				retEntity.setRet(0);
			}
		} catch (Exception e) {
			System.out.println(e.toString());
			retEntity.setRet(-1);
			retEntity.setMsg(e.toString());
		} finally {
			driver.manage().deleteAllCookies();
		}
		return retEntity;
	}
	

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. 测试返回结果:

在这里插入图片描述

三 丶测试报告 :

在这里插入图片描述

四丶结语

12321骚扰电话举报受理中心,作为工信部下属的电信业务管理机构, 采用的还是老一代的图形验证码已经落伍了, 用户体验一般,容易被破解, 本身就是受理用户被骚扰的业务, 如果12321本身被黑客攻击, 造成短信大面积骚扰用户,将会对老百姓形成骚扰,影响声誉。

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

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

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

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

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

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

标签:短信,String,driver,验证码,con,12321,骚扰电话,null,out
From: https://blog.csdn.net/weixin_44549063/article/details/140186036

相关文章

  • iMessage蓝号检测,苹果iMessages短信,iMessages群发,iMessages推信,完美实现总结 - 电
    一、PC电脑版苹果系统(MacOS)上实现imessages群发总结为以下几种方式:/*MacOS苹果系统,正常情况下,只能安装到苹果公司自己出品的Mac电脑,俗称白苹果,不能安装到各种组装机或者其他品牌的品牌机上,黑苹果的的原理,就是通过一些“破解补丁”工具欺骗macOS系统,让苹果系统认为你的电......
  • 开发自动发送国际短信的工具需要用到哪些源代码?
    在当今数字化、全球化的时代,国际短信作为一种高效、便捷的沟通方式,在各个领域发挥着越来越重要的作用。开发一款能够自动发送国际短信的工具,不仅能够帮助企业实现精准营销、客户服务,还能为个人提供便捷的跨国交流方式。本文将围绕“开发自动发送国际短信的工具需要用到哪些源......
  • 短信接口平台的核心功能有哪些?如何使用?
    短信接口平台怎么有效集成?选择短信接口平台的技巧?短信接口平台作为一种重要的通信工具,广泛应用于各种企业和组织。通过短信接口平台,企业能够高效、便捷地与客户进行互动和沟通。AoKSend将详细介绍短信接口平台的核心功能。短信接口平台:发送接收企业可以通过短信接口平台向......
  • 适用于 Android 的 几种短信恢复应用程序
    Android设备上的短信丢失可能由于多种原因而丢失,例如意外删除、恢复出厂设置、系统崩溃或病毒攻击。是否有应用程序可以恢复Android上已删除的短信?幸运的是,有几款短信恢复应用程序可以扫描您的Android手机并从内存或SIM卡中检索已删除的短信。然而,并非所有短信恢复应用......
  • 后端开发Spring框架之消息 消息队列案例--订单短信通知
    消息队列案例首先我们书写一个业务层接口定义的是发送消息短信消息处理packagecom.bigdata1421.message.service;publicinterfaceOrderService{voidorder(Stringid);}创建业务层的实现类并且我们要重写方法这里就是打印日志将消息打印在控制台再写......
  • QShop商城-短信通知配置
    QShop商城-短信通知配置本系统短信通知配置可选阿里云/腾讯云,二者二选一即可.阿里云短信一、登录阿里云短信平台阿里云短信平台管理地址:https://dysms.console.aliyun.com/dysms.html 二、账户ID和秘钥(AccessKeyId和AccessKeySecret)在阿里云控制台,右上角头像,菜单中选......
  • 华为云短信服务教你用C++实现Smgp协议
    本文分享自华为云社区《华为云短信服务教你用C++实现Smgp协议》,作者:张俭。引言&协议概述中国联合网络通信有限公司短消息网关系统接口协议(SGIP)是中国网通为实现短信业务而制定的一种通信协议,全称叫做ShortMessageGatewayInterfaceProtocol,用于在短消息网关(SMG)和服务提供商(SP......
  • 短信接口封装
    腾讯云短信封装发送短信#-*-coding:utf-8-*-fromtencentcloud.commonimportcredentialfromtencentcloud.common.exception.tencent_cloud_sdk_exceptionimportTencentCloudSDKExceptionfromtencentcloud.sms.v20210111importsms_client,modelsfromtencentclo......
  • SMS - 基于阿里云实现手机短信验证码登录(无需备案,非测试)
    目录SMS环境调试从阿里云云市场中购买第三方短信服务调试短信验证码功能实战开发 封装组件对外接口调用演示SMS环境调试从阿里云云市场中购买第三方短信服务a)进入阿里云首页,然后从云市场中找到“短信” (一定要从云市场去找短信服务,否则需要企业证明,备案) ......
  • 如何在 iPhone 上恢复已删除的短信
    本文介绍如何检索已删除的短信和iMessage以及恢复丢失的消息。说明适用于iOS17及更高版本。如何在iOS17及更高版本中恢复文本恢复已删除短信的最简单方法是使用iOS17。从删除短信到恢复它有30到40天的时间。在“信息”的对话屏幕中,选择“过滤器”。如果您没......