Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
你的APP安全嗎
Search
羊小咩
September 22, 2019
Programming
58
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
你的APP安全嗎
羊小咩@iPlayground2019
羊小咩
September 22, 2019
More Decks by 羊小咩
See All by 羊小咩
使用openCV做影像辨識 @ iplayground
lamb_mei
1
500
Other Decks in Programming
See All in Programming
Building an Out-of-Order CPU
latte72
1
770
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
140
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
200
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
190
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
1
150
What We Talk About When We Talk About XP
m_seki
2
610
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
140
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
180
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
450
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
160
スマート反転とウェブアクセシビリティ
camiha
0
200
新卒PdEのリアル
ryu1013
1
490
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
350
Between Models and Reality
mayunak
4
450
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Paper Plane
katiecoart
PRO
3
53k
Agile that works and the tools we love
rasmusluckow
331
22k
Exploring anti-patterns in Rails
aemeredith
3
500
Deep Space Network (abreviated)
tonyrice
0
300
Transcript
你的 App 安全嗎? 羊小咩@iPlayground
Blog : lamb-mei.com 羊小咩 E-mail :
[email protected]
FB : https://www.facebook.com/lamb.mei
GitHub:https://github.com/lamb-mei/ -BNC.FJ
"HFOEB • 緣由 • 有做到這三點嗎 • 駭客/攻擊者⼿手法 • 如何防⽌止和使⽤用技術 •
MAS ⾏行行動資安檢測
緣由
ㄒ 嗨,您好!我這是資安實 驗室 嗨 請問有什什麼事嗎?
其實也沒什什麼特別啦 ……………….. 要通知貴司,我們發現App 儲 存帳號沒有隱碼,因此會po 在我們FB喔 ,啾咪
有做到這三點嗎? • 連線採⽤用https • 資料檔案加密 • 傳輸訊息時押碼
駭客/攻擊者⼿手法 • 中間⼈人攻擊 / 嗅探器 • 取得未加密檔案/⽂文件 • 記憶體編輯 •
動態程式碼注入攻擊 • 反組譯 ClassDump
Burp Suite Fiddler Charles GUI Debug Proxy
IPA 解壓縮 •圖片 •plist⽂文件 •靜態wap⾴頁 •.bundle
取得AppStore IPA ⼩小技巧 Apple Configurator 2 Apple Configurator 2 在管理理⼿手機
App 時 會暫時把 ipa 暫存在電腦上 ~/Library/Group Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/ MobileApps/
iTools / iFunBox 查 App 沙盒⽬目錄 /private/var/mobile/Containers/Data/Application/E62249F1....E103A21/ 圖片、plist⽂文件、靜態wap⾴頁、.bundle 等 sqlite、plist
、RealM、產⽣生檔案或圖片
取得 UserDefault 檔案 Userdefault、Cookie、快取網⾴頁
使⽤用 IDA 或 Hopper 還原偽代碼
Flex是⼀一款iOS APP修改程式外掛,可以鎖定 function 回傳值 ,或編輯UI 最棒的是以下載別⼈人寫好的腳本
class dump 回傳值鎖定 下載腳本 Flex
https://www.slideshare.net/GaryNil/ios-iplayground-2018?fbclid=IwAR3igWfOEXjk5RNFjBdEXaRQREztnUnbDO_8GKTTOdv4Pkkzbpz_Xef-FEs 其他⼤大神分享
如何防範
⾸首先要先定義 防⽌止OO發⽣生 中間⼈人? 使⽤用者破解?
網路路通訊安全 • 訊息隱密性(Confidentiality) • 訊息完整性(Integrity) • 訊息來來源辨識性(Authentication) • 訊息不可重複性(Non-duplication) •
訊息不可否認性(Non-repudiation) 指訊息不會遭截取、窺竊⽽而洩漏資料內容致損害其秘密性 指訊息內容不會遭篡改⽽而造成資料不正確,即訊息如遭篡改時,該筆訊息無效 指傳送⽅方無法冒名傳送資料,資料進⾏行行數位簽章 指訊息內容不得重複,應採⽤用序號、⼀一次性亂數、時間戳記 指無法否認其傳送或接收訊息⾏行行為 電⼦子⽀支付專法 訊息防護措施
網路路通訊安全 • 訊息隱密性(Confidentiality) • 訊息完整性(Integrity) • 訊息來來源辨識性(Authentication) • 訊息不可重複性(Non-duplication) •
訊息不可否認性(Non-repudiation) 指訊息不會遭截取、窺竊⽽而洩漏資料內容致損害其秘密性 指訊息內容不會遭篡改⽽而造成資料不正確,即訊息如遭篡改時,該筆訊息無效 指傳送⽅方無法冒名傳送資料,資料進⾏行行數位簽章 指訊息內容不得重複,應採⽤用序號、⼀一次性亂數、時間戳記 指無法否認其傳送或接收訊息⾏行行為
資 料 加 密
• RSA加密演算法 • 橢圓曲線密碼學ECC (Elliptic Curve Cryptography) 密碼學 Cryptography 對稱式加密
(Symmetric Encryption) 非對稱式加密 (Asymmetric Encryption) • 進階加密演算法AES • 三重資料加密演算法3DES (Advanced Encryption Standard) (Triple Data Encryption Standard)
雜湊 Hash • 雜湊不是加密 • 雜湊無法還原 • 產⽣生出來來長度固定 • 只差⼀一bit產出也完全不同
Algorithm • md5 • sha • sah0 • sha1 • sha256 • sha512 • 校驗碼(Checksum) • 產⽣生不可還原資料
訊息鑑別碼 ⾦金金鑰雜湊訊息鑑別碼(Keyed-hash message authentication code) ⼜又稱雜湊訊息鑑別碼 (Hash-based message authentication code)
,縮寫為HMAC) Message authentication code (MAC)
https://github.com/TakeScoop/SwiftyRSA https://github.com/krzyzanowskim/CryptoSwift Swift cryptographic algorithms library pod ‘SwiftyRSA' pod 'CryptoSwift'
憑證綁定 Certificate Pinning 正常進⾏行行 https 連線狀狀況
憑證綁定 Certificate Pinning 被中間⼈人攻擊的連線
憑證綁定 Certificate Pinning 在 App 嵌入 SSL 公鑰,進⾏行行驗證 缺點:要注意公鑰過期,或server 更更換⾦金金鑰
憑證綁定 Certificate Pinning
混淆 Obfuscation 字串串混淆
混淆 Obfuscation 字串串混淆後原始碼
混淆 Obfuscation 字串串混淆後 反編譯
混淆 Obfuscation 程式碼混淆 CodeObfuscation
混淆 Obfuscation OLLVM (Obfuscator-LLVM) https://github.com/heroims/obfuscator • 控制流程扁平化 • 指令替换 •
虚假控制流程 if-else語法,轉成do-while語法 標準⼆二元運算符(+ , – , & , | 和^) 多⼀一堆垃圾程式碼 程式碼邏輯混淆
混淆 Obfuscation • 控制流扁平化
混淆 Obfuscation • 指令替换
Recap 中間⼈人攻擊 嗅探器 訊息完整性(訊息鑑別碼) 訊息隱密性(加密) 防⽌止竄改送出資料 憑證綁定 訊息隱密性(加密) 取得SQLite /
RealM 或其他資源檔案 檔案加密
Recap 程式碼混淆 程式碼邏輯混淆 反組譯 ClassDump 記憶體修改 動態注入程式碼 環境偵測 JB檢驗 字串串混淆
保護⾦金金鑰 Keychain
MAS⾏行行動資安聯聯盟 Mobile Application Security Alliance https://www.mas.org.tw/ ⾏行行動資安檢測 收保護費 ⺠民國107年年「經濟部⼯工業局」委託「財團法⼈人資訊⼯工業策進會」並協同「中華⺠民國資訊安全學 會」為執⾏行行單位,修訂「⾏行行動應⽤用App基本資安檢測基準」、「⾏行行動應⽤用App基本資安規範」及
「⾏行行動應⽤用App基本資安⾃自主檢測推動制度」
•甲類:無需使用者身分鑑別 •乙類:需使用者身分鑑別 •丙類:含有交易行為 訂定各類別之安全要求範圍,分為三類 ⾏行行動資安檢測
⾏行行動資安檢測項⽬目 資安檢測⼩小幫⼿手:https://www.im.taichung.gov.tw/ash/Appsecurehelper.html ⾏行行動應⽤用App基本資安檢測基準V3.0 (最新版): https://www.mas.org.tw/spaw2/uploads/files/02_1_V3.0_1070803.pdf
⾏行行動資安檢測 證書
⽺羊⼩小咩@iPlayground https://www.facebook.com/lamb.mei Thank You Watching! For