wordpress添加搜索插件北京seo顧問服務
前言
由于網(wǎng)站注冊入口容易被黑客攻擊,存在如下安全問題:
- 暴力破解密碼,造成用戶信息泄露
- 短信盜刷的安全問題,影響業(yè)務及導致用戶投訴
- 帶來經(jīng)濟損失,尤其是后付費客戶,風險巨大,造成虧損無底洞
所以大部分網(wǎng)站及App 都采取圖形驗證碼或滑動驗證碼等交互解決方案, 但在機器學習能力提高的當下,連百度這樣的大廠都遭受攻擊導致點名批評, 圖形驗證及交互驗證方式的安全性到底如何? 請看具體分析
一、 萬興科技 PC 注冊入口
簡介: AIGC軟件A股上市公司萬興科技(300624.SZ),全球領先的新生代數(shù)字創(chuàng)意賦能者,致力于成為全世界范圍內(nèi)有特色、有影響力的百年軟件老店。
公司以“讓世界更有創(chuàng)意”為使命,面向全球海量新生代用戶提供簡單高效的數(shù)字創(chuàng)意軟件、潮流時尚的創(chuàng)意資源和豐富多元的生態(tài)化服務,賦能人們在數(shù)字時代與眾不同地進行創(chuàng)意表達,幫助每一個新生代創(chuàng)作者將頭腦中的靈感變?yōu)榭梢姷默F(xiàn)實。萬興科技也是中國政府認定的“國家規(guī)劃布局內(nèi)重點軟件企業(yè)”,躋身“德勤高科技高成長亞太區(qū)500強”、“福布斯中國最具發(fā)展?jié)摿ζ髽I(yè)”等榮譽榜。
當前,萬興科技深耕數(shù)字創(chuàng)意軟件領域,并面向AIGC時代深度布局,旗下已推出萬興喵影、萬興播爆、萬興錄演、萬興優(yōu)轉等視頻創(chuàng)意軟件,SelfyzAI、Pixpic、FaceHub、AniEraser等圖片創(chuàng)意軟件,億圖圖示、億圖腦圖、墨刀等繪圖創(chuàng)意軟件,以及萬興PDF等文檔創(chuàng)意軟件,并推出萬興天幕音視頻多媒體大模型等夯實AIGC底座。公司正以前瞻的視野推進全球化布局,在深圳設立研發(fā)總部,并在長沙、北京、杭州、鄭州、溫哥華、東京等地設立運營中心,業(yè)務范圍遍及全球200多個國家和地區(qū),全球累計用戶逾15億。
二丶 安全分析:
采用傳統(tǒng)的圖形驗證碼方式,具體為4個數(shù)字英文,ocr 識別率在 95% 以上。
?
測試方法:
采用模擬器+OCR識別
1. 模擬器交互
private final String INDEX_URL = "https://accounts.wondershare.cn/web/login_cn";@Overridepublic RetEntity send(WebDriver driver, String areaCode, String phone) {try {RetEntity retEntity = new RetEntity();driver.get(INDEX_URL);// tabThread.sleep(1000);WebElement tabElement = driver.findElement(By.id("tab-verify-code"));tabElement.click();// 輸入手機號Thread.sleep(500);WebElement phoneElemet = driver.findElement(By.name("mobile"));phoneElemet.sendKeys(phone);// agreeWebElement agreeElement = ChromeDriverManager.waitElement(driver, By.id("shakeDiv"), 1);if (agreeElement != null) {WebElement useElement = driver.findElements(By.tagName("use")).get(1);useElement.click();}// 點擊發(fā)送驗證碼按鈕Thread.sleep(500);WebElement sendElemet = driver.findElement(By.xpath("//div/span[contains(text(),'發(fā)送驗證碼')]"));if (sendElemet != null) {sendElemet.click();}StringBuffer sbMsg = new StringBuffer();int ret = isSend(driver, sbMsg);if (ret != 1) {retEntity.setMsg(sbMsg.toString());return retEntity;}String imgCode = null, imgSrc;byte[] imgByte = null;WebElement captchaElement = ChromeDriverManager.waitElement(driver, By.xpath("//div[@class='recapcha-dialog']"), 10);WebElement imgElement;// 2 獲取圖形驗證碼for (int i = 0; i < 3; i++) {imgElement = driver.findElement(By.xpath("//div[@class='divIdentifyingCode']/img"));if (imgElement == null) {break;}imgSrc = imgElement.getAttribute("src");imgByte = (imgSrc != null) ? GetImage.imgStrToByte(imgSrc) : 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;}driver.findElement(By.className("change-one")).click();Thread.sleep(1 * 1000);}if (imgCode == null || imgCode.length() < 1) {System.out.println("imgCode=" + imgCode);return retEntity;}// 3 輸入識別出來的圖形驗證碼WebElement codeInElement = captchaElement.findElement(By.tagName("input"));codeInElement.sendKeys(imgCode);WebElement confirmElement = captchaElement.findElement(By.xpath("//span[contains(text(),'確定 ')]"));confirmElement.click();Thread.sleep(1000);ret = isSend(driver, sbMsg);retEntity.setMsg(sbMsg.toString());if (ret == 0) {retEntity.setRet(0);ddddOcr.saveFile(this.getClass().getSimpleName(), 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. 測試返回結果:
三 丶測試報告 :
四丶結語
AIGC軟件A股上市公司萬興科技(300624.SZ),全球領先的新生代數(shù)字創(chuàng)意賦能者,致力于成為全世界范圍內(nèi)有特色、有影響力的百年軟件老店。萬興科技深耕數(shù)字創(chuàng)意軟件領域,并面向AIGC時代深度布局,旗下已推出萬興喵影、萬興播爆、萬興錄演、萬興優(yōu)轉等視頻創(chuàng)意軟件,SelfyzAI、Pixpic、FaceHub、AniEraser等圖片創(chuàng)意軟件,億圖圖示、億圖腦圖、墨刀等繪圖創(chuàng)意軟件,以及萬興PDF等文檔創(chuàng)意軟件。作為新生代數(shù)字創(chuàng)意上市公司, 技術實力也應該不錯,但采用的還是老一代的圖形驗證碼已經(jīng)落伍了, 用戶體驗一般,容易被破解, 一旦被國際黑客發(fā)起攻擊,將會對老百姓形成騷擾,影響聲譽。
很多人在短信服務剛開始建設的階段,可能不會在安全方面考慮太多,理由有很多。
比如:“ 需求這么趕,當然是先實現(xiàn)功能啊 ”,“ 業(yè)務量很小啦,系統(tǒng)就這么點人用,不怕的 ” , “ 我們怎么會被盯上呢,不可能的 ”等等。有一些理由雖然有道理,但是該來的總是會來的。前期欠下來的債,總是要還的。越早還,問題就越小,損失就越低。
所以大家在安全方面還是要重視。(血淋淋的栗子!)#安全短信#
戳這里→康康你手機號在過多少網(wǎng)站注冊過!!!
谷歌圖形驗證碼在AI 面前已經(jīng)形同虛設,所以谷歌宣布退出驗證碼服務, 那么當所有的圖形驗證碼都被破解時,大家又該如何做好防御呢?
>>相關閱讀
《騰訊防水墻滑動拼圖驗證碼》
《百度旋轉圖片驗證碼》
《網(wǎng)易易盾滑動拼圖驗證碼》
《頂象區(qū)域面積點選驗證碼》
《頂象滑動拼圖驗證碼》
《極驗滑動拼圖驗證碼》
《使用深度學習來破解 captcha 驗證碼》
《驗證碼終結者-基于CNN+BLSTM+CTC的訓練部署套件》