國立清華大學 National Tsing Hua University 資訊安全實驗室 Information Security Lab 行動應用 App 資安漏洞檢測與惡意 App 檢測 孫宏民教授 資訊安全實驗室 國立清華大學資訊工程系
檢測技術 App 安全漏洞偵測 惡意軟體檢測 National Tsing Hua University - Information Security Laboratory 2
App 安全漏洞偵測 National Tsing Hua University - Information Security Laboratory 3
背景說明 2015 年 Android 手機出貨量為 10.6 億支, 占整體智慧型手機比重超過 8 成 (82.3%) Fortinet 所公布的 2015 全年網路威脅報告 指出, 約 96.5% 的行動惡意軟體鎖定 Android 平台 趨勢科技表示,2014 年 Android 惡意 App 數量為 400 萬個, 到 2015 年估計超過 800 萬個 手機資安客戶端軟體市場, 到 2017 年的市場規模估計為 29 億美金 National Tsing Hua University - Information Security Laboratory 4
行動支付維持雙位數成長動能 Gartner 表示, 2017 年全 球行動支付交易額將達 7214 億美元 (Gartner, 2013) 全球行動支付使用人數將 增加至 4 億 5000 萬人 (Gartner, 2013) National Tsing Hua University - Information Security Laboratory 5
網銀 APP 面臨到的資安威脅 韓國農協銀行 (NH Nonghyup Bank ) 網銀 APP, 遭 Android 的 Master Key 漏洞攻擊歹徒在第三方 App 程式下載網站上提供了一份惡意更新程式供人下載 此程式利用了 Android 的 Master Key 漏洞, 在 App 程式內插入了一個惡意檔案, 將它 木馬化 造成個人資料外洩, 還可能造成財務損失 National Tsing Hua University - Information Security Laboratory 6
銀行個資外洩遭處罰事件有前例可循 金管會接獲有關訊息後, 即要求玉山銀行 應立刻採行有效的改善措施 玉山銀行稽核單位 及其所聘外部獨立的 資安專家複核確認相關缺失均已完成改善 金管會也要求該行強化資本適足以因應作 業風險發生之衝擊 但網銀 APP 做好防範了嗎? 如 APP 有漏洞, 損失該由誰賠償? National Tsing Hua University - Information Security Laboratory 7
APP 安全漏洞 導致用戶個資外洩 竊取使用者隱私 如獲取智慧手機使用者的簡訊 通話記錄 通訊錄等敏感個人資訊 大多數普通用戶對此並不知情 用戶財產損失 支付類 App 的漏洞往往會給用戶帶來嚴重的財產損失 駭客通過破解支付類 App, 替換支付連結, 誘導使用者向駭客人頭帳戶付費, 或者直接竊取 App 帳號密碼, 盜取資金, 損害開發者及用戶利益 山寨盜版橫行 80% 的 APP 都有對應的山寨版本 National Tsing Hua University - Information Security Laboratory 8
傳統檢測面對的挑戰 自行購置源碼檢測工具 價格高昂, 對一般中小企業用戶不敷負擔需要成本低廉, 準確度高的掃描服務 人工源碼檢測服務 人工檢測費時費力, 若沒有安全漏洞資料庫當樣本, 所做出的錯誤檢測涵蓋率與準確率都會是問題傳統的資安專家 手機檢測專家需要 APP 漏洞專業背景, 快速檢測出安全弱點的服務 National Tsing Hua University - Information Security Laboratory 9
SECURITY HOLE EXAMPLES IN ANDROID APPS : 1. Facebook 2. WhatsApp 3. Evernote National Tsing Hua University - Information Security Laboratory 10
National Tsing Hua University - Information Security Laboratory 11
WhatsApp National Tsing Hua University - Information Security Laboratory 12
Evernote National Tsing Hua University - Information Security Laboratory 13
In Taiwan, a penalty of TWD$500-20,000 for leaking one user s privacy is a law now. National Tsing Hua University - Information Security Laboratory 14
BUT, MOST OF SECURITY EXPERTS ARE NOT FAMILIAR WITH MOBILE SECURITY. They are familiar with XSS (Cross-site scripting) CSRF (Cross-site request forgery) SQL Injection RCE (Remote Code Execution) in desktop. National Tsing Hua University - Information Security Laboratory 15
A well-known company is also not familiar with mobile security. 我們回報一個漏洞, 這家公司的 App 有超過千萬次下載量, 他們的第一線資安工程師這樣回 : National Tsing Hua University - Information Security Laboratory 16
In fact, Microsoft Security Response Center (MSRC) doesn t understand what mobile security holes are. Microsoft Security Response Center: If the user must install malware on their phone in order to encounter this issue, then Microsoft does not consider it a security vulnerability. In fact, Microsoft does not understand if an Android App doesn t suffer from security holes, a malware can not do anything due to the isolations of APPs. This is the security design by Android operation system. After two weeks, Microsoft fixed this security holes, notified us, and gave us acknowledgement. National Tsing Hua University - Information Security Laboratory 17
WE ANALYZE NOT ONLY NATIVE MOBILE APPLICATIONS,BUT ALSO WEB APPLICATIONS. National Tsing Hua University - Information Security Laboratory 18
We reported back to a bank in Taiwan about Struts2 RCE bug (Java Web Framework) 感謝信 from XX 銀行資訊處處長 National Tsing Hua University - Information Security Laboratory 19
Vulnerability in Facebook Bug Bounty Payment Website Acknowledgement and reward from Facebook National Tsing Hua University - Information Security Laboratory 20
技術內容 我們開發了全世界第一套自動化 APP 安全漏洞檢測系統 每天可分析 10000 支 APP 不須原始碼 (Source) National Tsing Hua University - Information Security Laboratory 21
How do we process the overall flow? 1. 開發者提交給我們 Android APK 2. 透過我們開發的靜態分析檢測系統找到潛在的安全漏洞 3. 我們透過逆向工程與動態分析來確認漏洞, 這包含了在不同的裝置上完整的手動測試來評估 App 的安全風險 4. 我們確認漏洞後將確認的漏洞 PoC 詳細說明 相關案例等製成最終報表 5. 開發者修補完漏洞後將已修補的 APK 再交由我們測試以確認漏洞已修復 National Tsing Hua University - Information Security Laboratory 22
快速 精準的檢測平台 5~15 秒給您一份專業級的 APP 安全檢測報告 程式碼安全漏洞 APP 安全等級 漏洞修補建議 專業級的資安顧問 National Tsing Hua University - Information Security Laboratory 23
技術內容 檢測行動裝置 App 是否存在安全漏洞 透過逆向工程來確認漏洞 將結果輸出成檢測報告, 內容包括 : 檢測程式碼安全漏洞 App 安全等級 漏洞修補建議 National Tsing Hua University - Information Security Laboratory 24
檢測項目 (OWASP Mobile 十大弱點風險 ) 弱伺服器端的控制 (Weak Server Side Controls) 不安全的資料儲存 (Insecure Data Storage) 傳輸層保護不足 (Insufficient Transport Layer Protection) 側通道資料洩漏 (Unintended Data Leakage) 粗糙的授權與認證 (Poor Authorization & Authentication) 加密失效 (Broken Cryptography) 客戶端注入 (Client Side Injection) 安全決策是經由不受信任的輸入 (Security Decisions via Untrusted Inputs) National Tsing Hua University - Information Security Laboratory 25
檢測項目 (Cont.) 不適當的會話處理 (Session Handling) 執行碼缺乏保護 (Lack of Binary Protection) Final List 2014 National Tsing Hua University - Information Security Laboratory 26
檢測工具 (Android) https://www.owasp.org/index.php/owasp_mobile_security_project#tab=m-tools National Tsing Hua University - Information Security Laboratory 27
檢測工具 (IOS) https://www.owasp.org/index.php/owasp_mobile_security_project#tab=m-tools National Tsing Hua University - Information Security Laboratory 28
在各家知名公司 APP 的發現 使用者的帳號密碼直接遭到竊取 使用其他服務的帳號密碼遭到竊取 使用者的 Access Token 被竊取 不需要帳號密碼就能盜用帳號 應用程式的 SQLite 資料庫被竊取 竄改 使用者的私人對話訊息遭到竊取 使用者的私人檔案可被任意 Apps 偷取 National Tsing Hua University - Information Security Laboratory 29
在各家知名公司 APP 的發現 (Cont.) 不必安裝惡意 Apps 下能在使用者不知情下發送付費簡訊 任一 Apps 在沒有 GPS 權限下取得使用者裝置的 GPS 位置 在未 root 下能直接存取 Apps 內所儲存的所有檔案 應用程式當掉 More and More. National Tsing Hua University - Information Security Laboratory 30
案例說明 銀行 App 帳號及密碼外洩漏洞 App 應用儲存的檔案可允許任意應用存取, 例如 : 瀏覽紀錄 Cookie 啟用 SDcard 訊息備份時, 任何一個有存取 SDCard 權限的 App 皆可讀取到訊息 National Tsing Hua University - Information Security Laboratory 31
解決多家知名廠商資安問題 公司 認可 漏洞 APP 數量 時間 Google Android Security Acknowledgement 5 2014 Facebook WhiteHat Security Acknowledgement 2 2014 Evernote Security Hall of Fame 1 2014 Alibaba( 阿里巴巴 ) Security Acknowledgement 8 2014/04 Microsoft Security Acknowledgement 2 2014/5,6 AT&T Security Hall of Fame 1 2014 Twitter Security Hall of Fame( 通過 HackerOne 平台 ) 1 2014 Sina Weibo Security Acknowledgement 3 2014/4 Yahoo 通過 HackerOne 平台 1 2014/5 Badoo Badoo 2 2014/5 Yandex Bug Bounty Hall of Fame 2 2014/6,7 Baidu( 百度 ) 通過 Wooyun 平台 1 2014/3 Sony Hall of Thanks 1 2014 ebay ebay Classifields branded WhiteHat 1 2014/5 Adobe Adobe Product Security Incident Response Team 1 2014/5 Huawei (System APP) Huawei Company 2 2014/8 Many Banks Demo PoC many 2014~2015 National Tsing Hua University - Information Security Laboratory 32
惡意軟體檢測 National Tsing Hua University - Information Security Laboratory 33
Beginning. It is difficult to judge an application is normal or malicious because both have the same permission rights. The following application in Google Play is a real case in April, 2014. A paid APP appeared in Google Play on April 2, 2014. It is an Anti-Virus APP, called Virus Shield, with cost USD$4. Within one week, it got the #1 paid application in Google Play with over 10,000 download. However, it is a fake APP with doing nothing. (It runs empty for a few minutes and reports back to the user that your mobile phone is safe.) National Tsing Hua University - Information Security Laboratory 34
National Tsing Hua University - Information Security Laboratory 35
背景說明 在過去, 最常用來檢測惡意軟體的方法是, 比對惡意程式特徵碼的特徵值就可以快速的判斷是某否為惡意軟體 現在, 越來越多惡意軟體開發者增進惡意軟體的強度, 特別是對於從未出現過的特徵碼已經無法被檢測出來 因此, 本技術主要是基於行為分析的方法來檢測, 透過收集執行時所作的真正行為 National Tsing Hua University - Information Security Laboratory 36
技術內容 預先處理 App 設定檔的資訊 在執行期, 蒐集並記錄 App 產生的行為 使用自動化觸擊觸發所有可能的行為 最後用機器學習的方法分析該 App 是否為惡意軟體 National Tsing Hua University - Information Security Laboratory 37
檢測項目 紀錄洩漏的資訊 洩漏方法, 像是手機的電話號碼 IMEI 碼 簡訊內容 GPS 位置等等 記錄所有連出去或是連進來的網路行為 記錄所有檔案的讀取 呼叫哪些加密 API 對於電話來電 簡訊都會有監控 National Tsing Hua University - Information Security Laboratory 38
檢測的軟體數量 檢測 1246 個惡意 App 和 818 個正常 App 其中惡意 App 包含了高達 49 個家族 使用不同機器學習方法準確率皆在 95% 以上 National Tsing Hua University - Information Security Laboratory 39
準確率比較 National Tsing Hua University - Information Security Laboratory 40