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
510
Other Decks in Programming
See All in Programming
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
190
JRuby: Past, Present, and Future
headius
0
230
The Rails Doctrine Decade
koic
2
560
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
250
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
140
Kubernetes祭り #2 OP/ED
bells17
0
110
sbt 2.0: takeoff
eed3si9n
0
150
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
400
Agents on Rails - Rails at Scale 2026
irinanazarova
0
530
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
1
280
Featured
See All Featured
Balancing Empowerment & Direction
lara
6
1.3k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
WCS-LA-2024
lcolladotor
0
880
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Art, The Web, and Tiny UX
lynnandtonic
304
22k
sira's awesome portfolio website redesign presentation
elsirapls
0
450
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Done Done
chrislema
187
17k
KATA
mclloyd
PRO
35
16k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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