OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

OWASP Mobile Security Testing Guide 1.2

MSTG 是移动应用安全测试和逆向工程的综合手册。它描述了用于验证OWASP 移动应用程序验证标准 (MASVS) 中列出的控件的技术流程。您还可以在 Gitbook 上阅读MSTG或将其下载为电子书

OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

MSTG 和 MASVS 被许多公司、标准和各种组织采用。想了解更多?查看我们的用户文档,其中列出了一些采用者

OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

注意事项

全英文版本,视力不佳者慎下

MSTG手册目录

全文共213948个字
共计742页

OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2
OWASP Mobile Security Testing Guide 1.2

1	Foreword
2	Frontispiece
2.1	About the OWASP Mobile Security Testing Guide
2.2	Disclaimer
2.3	Copyright and License
2.4	ISBN
2.5	Acknowledgments
2.5.1	Authors
2.5.1.1	Bernhard Mueller
2.5.1.2	Sven Schleier
2.5.1.3	Jeroen Willemsen
2.5.1.4	Carlos Holguera
2.5.2	Co-Authors
2.5.2.1	Romuald Szkudlarek
2.5.2.2	Jeroen Beckers
2.5.2.3	Vikas Gupta
2.5.3	Top Contributors
2.5.4	Contributors
2.5.5	Mini Contributors
2.5.6	Reviewers
2.5.7	Editors
2.5.8	Donators
2.5.9	God Mode Donators
2.5.9.1	Honorable Benefactor
2.5.9.2	Good Samaritan Benefactor
2.5.9.3	Other Donators
2.5.10	Older Versions
2.5.10.1	OWASP MSTG “Beta 2” (Google Doc)
2.5.10.2	OWASP MSTG “Beta 1” (Google Doc)
3	Overview
3.1	Introduction to the OWASP Mobile Security Testing Guide
3.1.1	Key Areas in Mobile Application Security
3.1.1.1	Local Data Storage
3.1.1.2	Communication with Trusted Endpoints
3.1.1.3	Authentication and Authorization
3.1.1.4	Interaction with the Mobile Platform
3.1.1.5	Code Quality and Exploit Mitigation
3.1.1.6	Anti-Tampering and Anti-Reversing
3.2	The OWASP Mobile AppSec Verification Standard
3.3	Navigating the Mobile Security Testing Guide
4	Mobile App Taxonomy
4.1	Native App
4.2	Web App
4.3	Hybrid App
4.4	Progressive Web App
4.5	What’s Covered in the Mobile Testing Guide
5	Mobile App Security Testing
5.1	Principles of Testing
5.1.1	White-box Testing versus Black-box Testing
5.1.2	Vulnerability Analysis
5.1.3	Static versus Dynamic Analysis
5.1.4	Static Analysis
5.1.4.1	Manual Code Review
5.1.4.2	Automated Source Code Analysis
5.1.5	Dynamic Analysis
5.1.6	Avoiding False Positives
5.1.6.1	Automated Scanning Tools
5.1.6.2	Clipboard
5.1.7	Penetration Testing (a.k.a. Pentesting)
5.1.7.1	Preparation
5.1.7.1.1	Coordinating with the Client
5.1.7.1.2	Identifying Sensitive Data
5.1.7.1.3	Intelligence Gathering
5.1.7.1.4	Environmental Information
5.1.7.1.5	Architectural Information
5.1.7.2	Mapping the Application
5.1.7.3	Exploitation
5.1.8	Reporting
5.2	Security Testing and the SDLC
5.2.1	Security Testing during the Software Development Life Cycle
5.2.2	SDLC Overview
5.2.2.1	General Description of SDLC
5.2.2.2	Defining a Test Strategy
5.2.3	Security Testing in Waterfall
5.2.3.1	What Waterfall Is and How Testing Activities Are Arranged
5.2.4	Security Testing for Agile/DevOps and DevSecOps
5.2.4.1	What Agile and DevSecOps Are and How Testing Activities Are Arranged
5.2.4.1.1	Overview
5.2.4.1.2	Infrastructure as Code
5.2.4.1.3	Deployment
5.2.4.1.4	Security
5.3	References
5.3.1	OWASP MASVS
6	Mobile App Tampering and Reverse Engineering
6.1	Why You Need It
6.2	Basic Tampering Techniques
6.2.1	Binary Patching
6.2.2	Code Injection
6.3	Static and Dynamic Binary Analysis
6.3.1	Using Disassemblers and Decompilers
6.3.2	Debugging and Tracing
6.4	Advanced Techniques
6.4.1	Dynamic Binary Instrumentation
6.4.2	Emulation-based Dynamic Analysis
6.4.3	Custom Tooling with Reverse Engineering Frameworks
6.4.3.1	Example: Program Analysis with Symbolic/Concolic Execution
6.5	References
7	Mobile App Authentication Architectures
7.1	General Guidelines on Testing Authentication
7.1.1	Stateful vs. Stateless Authentication
7.1.2	Supplementary Authentication
7.2	Verifying that Appropriate Authentication is in Place (MSTG-ARCH-2 and MSTG-AUTH-1)
7.3	Testing Best Practices for Passwords (MSTG-AUTH-5 and MSTG-AUTH-6)
7.3.1	Static Analysis
7.3.1.1	zxcvbn
7.3.2	Have I Been Pwned: PwnedPasswords
7.3.2.1	Login Throttling
7.3.3	Dynamic Testing (MSTG-AUTH-6)
7.4	Testing Stateful Session Management (MSTG-AUTH-2)
7.4.1	Session Management Best Practices
7.5	Testing Session Timeout (MSTG-AUTH-7)
7.5.1	Static Analysis
7.5.2	Dynamic Analysis
7.6	Testing User Logout (MSTG-AUTH-4)
7.6.1	Static Analysis
7.6.2	Dynamic Analysis
7.7	Testing Two-Factor Authentication and Step-up Authentication (MSTG-AUTH-9 and MSTG-AUTH-10)
7.7.1	Dangers of SMS-OTP
7.7.2	Transaction Signing with Push Notifications and PKI
7.7.3	Static Analysis
7.7.4	Dynamic Testing
7.8	Testing Stateless (Token-Based) Authentication (MSTG-AUTH-3)
7.8.1	Static Analysis
7.8.1.1	Enforcing the Hashing Algorithm
7.8.1.2	Token Expiration
7.8.2	Dynamic Analysis
7.9	Testing OAuth 2.0 Flows (MSTG-AUTH-1 and MSTG-AUTH-3)
7.9.1	OAUTH 2.0 Best Practices
7.9.1.1	External User Agent vs. Embedded User Agent
7.9.2	Other OAuth2 Best Practices
7.10	Testing Login Activity and Device Blocking (MSTG-AUTH-11)
7.11	References
7.11.1	OWASP MASVS
7.11.1.1	SMS-OTP Research
8	Mobile App Network Communication
8.1	Intercepting HTTP(S) Traffic
8.2	Burp plugins to Process Non-HTTP Traffic
8.3	Intercepting Traffic on the Network Layer
8.3.1	Simulating a Man-in-the-Middle Attack with bettercap
8.3.1.1	Network Setup
8.3.1.2	MITM Attack
8.3.2	Simulating a Man-in-the-Middle Attack with an access point
8.3.2.1	Network Setup
8.3.2.2	Installation
8.3.2.3	Configuration
8.3.2.4	MITM Attack
8.3.3	Network Analyzer Tool
8.3.4	Setting a Proxy Through Runtime Instrumentation
8.3.5	Example - Dealing with Xamarin
8.3.5.1	CA Certificates
8.3.5.2	Intercepting Traffic
8.4	Verifying Data Encryption on the Network (MSTG-NETWORK-1 and MSTG-NETWORK-2)
8.4.1	Overview
8.4.1.1	Recommended TLS Settings
8.4.1.1.1	Cipher Suites Terminology
8.4.2	Static Analysis
8.4.3	Dynamic Analysis
8.5	Making Sure that Critical Operations Use Secure Communication Channels (MSTG-NETWORK-5)
8.5.1	Overview
8.5.2	Static Analysis
8.5.3	Dynamic Analysis
8.6	References
8.6.1	OWASP MASVS
8.6.2	Android
8.6.3	iOS
8.6.4	IANA Transport Layer Security (TLS) Parameters
8.6.5	OWASP TLS Cipher String Cheat Sheet
8.6.6	SIM Swapping attacks
8.6.7	NIST
8.6.8	SIM Swap Fraud
8.6.9	IETF
9	Mobile App Cryptography
9.1	Key Concepts
9.2	Identifying Insecure and/or Deprecated Cryptographic Algorithms (MSTG-CRYPTO-4)
9.3	Common Configuration Issues (MSTG-CRYPTO-1, MSTG-CRYPTO-2 and MSTG-CRYPTO-3)
9.3.1	Insufficient Key Length
9.3.2	Symmetric Encryption with Hard-Coded Cryptographic Keys
9.3.3	Weak Key Generation Functions
9.3.4	Weak Random Number Generators
9.3.5	Custom Implementations of Cryptography
9.3.6	Inadequate AES Configuration
9.3.6.1	Weak Block Cipher Mode
9.3.6.2	Predictable Initialization Vector
9.3.6.3	Initialization Vectors in stateful operation modes
9.3.7	Padding Oracle Attacks due to Weaker Padding or Block Operation Implementations
9.3.8	Protecting Keys in Memory
9.3.9	Protecting keys in Transport
9.4	Cryptographic APIs on Android and iOS
9.5	Cryptographic policy
9.5.1	References
9.5.1.1	Cryptography References
9.5.1.2	OWASP MASVS
10	Mobile App Code Quality
10.1	Injection Flaws (MSTG-ARCH-2 and MSTG-PLATFORM-2)
10.1.1	SQL Injection
10.1.2	XML Injection
10.1.3	Injection Attack Vectors
10.2	Cross-Site Scripting Flaws (MSTG-PLATFORM-2)
10.2.1	Static Analysis
10.2.2	Dynamic Analysis
10.3	Memory Corruption Bugs (MSTG-CODE-8)
10.3.1	Buffer and Integer Overflows
10.3.2	Static Analysis
10.3.3	Dynamic Analysis
10.4	References
10.4.1	OWASP MASVS
10.4.2	XSS via start ContentActivity
11	Mobile App User Interaction
11.1	Testing User Education (MSTG-STORAGE-12)
11.1.1	Informing users on their private information
11.1.2	Informing the user on the best security practices
11.1.3	Access to Device Data
11.1.4	Other Information You Have to Share (OSS Information)
11.2	References
11.2.1	OWASP MASVS
11.2.2	Example for open source license mentioning
11.2.3	Website to Help with Understanding Licenses
11.2.4	Guidance on Permission Requesting
12	Android Platform Overview
12.1	Android Architecture
12.2	Android Security: Defense-in-Depth Approach
12.2.1	System-wide security
12.2.1.1	Device encryption
12.2.1.2	Trusted Execution Environment (TEE)
12.2.1.3	Verified Boot
12.2.2	Software Isolation
12.2.2.1	Android Users and Groups
12.2.2.2	SELinux
12.2.2.3	Permissions
12.2.3	Network security
12.2.3.1	TLS by Default
12.2.3.2	DNS over TLS
12.2.4	Anti-exploitation
12.2.4.1	ASLR, KASLR, PIE and DEP
12.2.4.2	SECCOMP Filter
12.3	Android Application Structure
12.3.1	Communication with the Operating System
12.3.2	The App Sandbox
12.3.2.1	Linux User Management
12.3.2.2	Zygote
12.3.2.3	App Lifecycle
12.3.3	App Bundles
12.3.4	Android Manifest
12.3.5	App Components
12.3.5.1	Activities
12.3.5.2	Fragments
12.3.5.3	Content Providers
12.3.5.4	Services
12.3.6	Inter-Process Communication
12.3.6.1	Intents
12.3.6.2	Broadcast Receivers
12.3.6.3	Implicit Broadcast Receiver Limitation
12.4	Android Application Publishing
12.4.1	Signing Process
12.4.2	APK Signing Schemes
12.4.2.1	JAR Signing (v1 Scheme)
12.4.2.2	APK Signature Scheme (v2 Scheme)
12.4.2.3	APK Signature Scheme (v3 Scheme)
12.4.2.4	Creating Your Certificate
12.4.2.5	Signing an Application
12.4.2.5.1	Zipalign
12.4.3	Publishing Process
12.5	Android Application Attack Surface
13	Android Basic Security Testing
13.1	Android Testing Setup
13.1.1	Host Device
13.1.2	Testing Device
13.1.2.1	Testing on a Real Device
13.1.2.2	Testing on an Emulator
13.1.2.3	Getting Privileged Access
13.1.2.3.1	Which Mobiles Can Be Rooted
13.1.2.3.2	Rooting with Magisk
13.1.2.3.3	Root Detection
13.2	Basic Testing Operations
13.2.1	Accessing the Device Shell
13.2.1.1	Remote Shell
13.2.1.1.1	Connect to Multiple Devices
13.2.1.1.2	Connect to a Device over Wi-Fi
13.2.1.1.3	Connect to a Device via SSH
13.2.1.2	On-device Shell App
13.2.2	Host-Device Data Transfer
13.2.2.1	Using adb
13.2.2.2	Using Android Studio Device File Explorer
13.2.2.3	Using objection
13.2.2.4	Using Termux
13.2.3	Obtaining and Extracting Apps
13.2.3.1	Alternative App Stores
13.2.3.2	Using gplaycli
13.2.3.3	Extracting the App Package from the Device
13.2.4	Installing Apps
13.2.5	Information Gathering
13.2.5.1	Listing Installed Apps
13.2.5.2	Exploring the App Package
13.2.5.2.1	The Android Manifest
13.2.5.2.2	App Binary
13.2.5.2.3	Native Libraries
13.2.5.2.4	Other App Resources
13.2.5.3	Accessing App Data Directories
13.2.5.4	Monitoring System Logs
13.3	Setting up a Network Testing Environment
13.3.1	Basic Network Monitoring/Sniffing
13.3.1.1	Firebase/Google Cloud Messaging (FCM/GCM)
13.3.1.1.1	Preparation of Test Setup
13.3.1.1.2	HTTP
13.3.1.1.3	XMPP
13.3.1.1.4	Intercepting the Requests
13.3.1.1.5	End-to-End Encryption for Push Notifications
13.3.2	Setting Up an Interception Proxy
13.3.2.1	Interception Proxy for a Virtual Device
13.3.2.1.1	Setting Up a Web Proxy on an Android Virtual Device (AVD)
13.3.2.1.2	Installing a CA Certificate on the Virtual Device
13.3.2.2	Interception Proxy for a Physical Device
13.3.2.3	Bypassing the Network Security Configuration
13.3.2.3.1	Adding the User Certificates to the Network Security Configuration
13.3.2.3.2	Adding the Proxy’s certificate among system trusted CAs using Magisk
13.3.2.3.3	Manually adding the Proxy’s certificate among system trusted CAs
13.3.3	Potential Obstacles
13.3.3.1	Client Isolation in Wireless Networks
13.3.3.2	Non-Proxy Aware Apps
13.3.3.2.1	iptables
13.3.3.2.2	bettercap
13.3.3.3	Proxy Detection
13.3.3.4	Certificate Pinning
13.4	References
14	Android Tampering and Reverse Engineering
14.1	Reverse Engineering
14.1.1	Disassembling and Decompiling
14.1.1.1	Decompiling Java Code
14.1.1.2	Disassembling Native Code
14.1.1.2.1	radare2
14.1.1.2.2	IDA Pro
14.2	Static Analysis
14.2.1	Basic Information Gathering
14.2.1.1	Retrieving Strings
14.2.1.1.1	Java and Kotlin Bytecode
14.2.1.1.2	Native Code
14.2.1.2	Cross References
14.2.1.2.1	Java and Kotlin
14.2.1.2.2	Native Code
14.2.1.3	API Usage
14.2.1.4	Network Communication
14.2.2	Manual (Reversed) Code Review
14.2.2.1	Reviewing Decompiled Java Code
14.2.2.2	Reviewing Disassembled Native Code
14.2.2.2.1	radare2
14.2.2.2.2	IDA Pro
14.2.2.2.3	Ghidra
14.2.3	Automated Static Analysis
14.3	Dynamic Analysis
14.3.1	Dynamic Analysis on Non-Rooted Devices
14.3.2	Basic Information Gathering
14.3.2.1	Open Files
14.3.2.2	Open Connections
14.3.2.3	Loaded Native Libraries
14.3.2.4	Sandbox Inspection
14.3.3	Debugging
14.3.3.1	Debugging Release Apps
14.3.3.2	Debugging with jdb
14.3.3.3	Debugging with an IDE
14.3.3.4	Debugging Native Code
14.3.4	Tracing
14.3.4.1	Execution Tracing
14.3.4.1.1	Tracing System Calls
14.3.4.1.2	Ftrace
14.3.4.1.3	KProbes
14.3.4.2	Method Tracing
14.3.4.3	Native Code Tracing
14.3.4.4	JNI Tracing
14.3.5	Emulation-based Analysis
14.3.6	Binary Analysis
14.3.6.1	Symbolic Execution
14.4	Tampering and Runtime Instrumentation
14.4.1	Patching, Repackaging, and Re-Signing
14.4.1.1	Patching Example: Disabling Certificate Pinning
14.4.1.2	Patching Example: Making an App Debuggable
14.4.1.3	Repackaging
14.4.1.4	Re-Signing
14.4.1.5	The “Wait For Debugger” Feature
14.4.1.6	Patching React Native applications
14.4.1.7	Library Injection
14.4.1.7.1	Patching the Application’s Smali Code
14.4.1.7.2	Patching Application’s Native Library
14.4.1.7.3	Preloading Symbols
14.4.2	Dynamic Instrumentation
14.4.2.1	Information Gathering
14.4.2.1.1	Getting Loaded Classes and their Methods
14.4.2.1.2	Getting Loaded Libraries
14.4.2.2	Method Hooking
14.4.2.2.1	Xposed
14.4.2.2.2	Frida
14.4.2.3	Process Exploration
14.4.2.3.1	Memory Maps and Inspection
14.4.2.3.2	In-Memory Search
14.4.2.3.3	Memory Dump
14.4.2.3.4	Runtime Reverse Engineering
14.5	Customizing Android for Reverse Engineering
14.5.1	Customizing the RAMDisk
14.5.2	Customizing the Android Kernel
14.5.3	Booting the Custom Environment
14.5.4	System Call Hooking with Kernel Modules
14.5.4.1	Example: File Hiding
14.6	References
15	Android Data Storage
15.1	Theory Overview
15.2	Data Storage Methods Overview
15.2.1	Shared Preferences
15.2.2	Databases
15.2.2.1	SQLite Database (Unencrypted)
15.2.2.2	SQLite Databases (Encrypted)
15.2.2.3	Firebase Real-time Databases
15.2.2.4	Realm Databases
15.2.3	Internal Storage
15.2.4	External Storage
15.2.5	KeyStore
15.2.5.1	Hardware-backed Android KeyStore
15.2.5.2	Key Attestation
15.2.5.3	Secure Key Import into Keystore
15.2.5.4	Older KeyStore Implementations
15.2.5.5	KeyChain
15.2.5.6	Storing a Key - example
15.2.5.7	Third Party libraries
15.2.6	Logs
15.2.7	Backups
15.2.8	Process Memory
15.3	Testing Local Storage for Sensitive Data (MSTG-STORAGE-1 and MSTG-STORAGE-2)
15.3.1	Overview
15.3.2	Static Analysis
15.3.3	Dynamic Analysis
15.4	Testing Local Storage for Input Validation (MSTG-PLATFORM-2)
15.4.1	Overview
15.4.2	Static analysis
15.4.2.1	Using Shared Preferences
15.4.2.2	Using Other Storage Mechanisms
15.5	Testing Logs for Sensitive Data (MSTG-STORAGE-3)
15.5.1	Overview
15.5.2	Static Analysis
15.5.3	Dynamic Analysis
15.6	Determining Whether Sensitive Data Is Shared with Third Parties (MSTG-STORAGE-4)
15.6.1	Overview
15.6.2	Third-party Services Embedded in the App
15.6.3	App Notifications
15.6.4	Static Analysis
15.6.4.1	Third-party Services Embedded in the App
15.6.4.2	App Notifications
15.6.5	Dynamic Analysis
15.6.5.1	Third-party Services Embedded in the App
15.6.5.2	App Notifications
15.7	Determining Whether the Keyboard Cache Is Disabled for Text Input Fields (MSTG-STORAGE-5)
15.7.1	Overview
15.7.2	Static Analysis
15.7.3	Dynamic Analysis
15.8	Determining Whether Sensitive Stored Data Has Been Exposed via IPC Mechanisms (MSTG-STORAGE-6)
15.8.1	Overview
15.8.2	Static Analysis
15.8.2.1	Inspect the Android Manifest
15.8.2.2	Inspect the source code
15.8.3	Dynamic Analysis
15.8.3.1	Testing Content Providers
15.8.3.2	SQL Injection in Content Providers
15.8.3.3	File System Based Content Providers
15.9	Checking for Sensitive Data Disclosure Through the User Interface (MSTG-STORAGE-7)
15.9.1	Overview
15.9.2	Static Analysis
15.9.2.1	Text Fields
15.9.2.2	App Notifications
15.9.3	Dynamic Analysis
15.9.3.1	Text Fields
15.9.3.2	App Notifications
15.10	Testing Backups for Sensitive Data (MSTG-STORAGE-8)
15.10.1	Overview
15.10.2	Static Analysis
15.10.2.1	Local
15.10.2.2	Cloud
15.10.3	Dynamic Analysis
15.11	Finding Sensitive Information in Auto-Generated Screenshots (MSTG-STORAGE-9)
15.11.1	Overview
15.11.2	Static Analysis
15.11.3	Dynamic Analysis
15.12	Checking Memory for Sensitive Data (MSTG-STORAGE-10)
15.12.1	Overview
15.12.2	Static Analysis
15.12.3	Dynamic Analysis
15.12.3.1	Retrieving and Analyzing a Memory Dump
15.12.3.2	Runtime Memory Analysis
15.12.3.3	Explicitly Dumping and Analyzing the Java Heap
15.13	Testing the Device-Access-Security Policy (MSTG-STORAGE-11)
15.13.1	Overview
15.13.2	Static Analysis
15.13.3	Dynamic Analysis
15.14	References
15.14.1	OWASP MASVS
15.14.2	Libraries
16	Android Cryptographic APIs
16.1	Recommendations
16.1.1	Security provider
16.1.1.1	Updating security provider
16.1.1.2	Older Android versions
16.1.2	Key Generation
16.1.3	Random number generation
16.2	Testing Symmetric Cryptography (MSTG-CRYPTO-1)
16.2.1	Overview
16.2.2	Static Analysis
16.2.3	Dynamic Analysis
16.3	Testing the Configuration of Cryptographic Standard Algorithms (MSTG-CRYPTO-2, MSTG-CRYPTO-3 and MSTG-CRYPTO-4)
16.3.1	Overview
16.3.2	Static Analysis
16.3.3	Dynamic Analysis
16.4	Testing the Purposes of Keys (MSTG-CRYPTO-5)
16.4.1	Overview
16.4.2	Static Analysis
16.4.3	Dynamic Analysis
16.5	Testing Random Number Generation (MSTG-CRYPTO-6)
16.5.1	Overview
16.5.2	Static Analysis
16.5.3	Dynamic Analysis
16.6	References
16.6.1	Cryptography references
16.6.2	SecureRandom references
16.6.3	Testing Key Management references
16.6.4	Key Attestation References
16.6.4.1	OWASP MASVS
17	Android Local Authentication
17.1	Testing Confirm Credentials (MSTG-AUTH-1 and MSTG-STORAGE-11)
17.1.1	Overview
17.1.2	Static Analysis
17.1.3	Dynamic Analysis
17.2	Testing Biometric Authentication (MSTG-AUTH-8)
17.2.1	Overview
17.2.1.1	FingerprintManager (deprecated in Android 9 (API level 28))
17.2.2	Static Analysis
17.2.2.1	Biometric Library
17.2.2.2	FingerprintManager
17.2.2.3	Additional Security Features
17.2.2.4	Third party SDKs
17.2.3	Dynamic Analysis
17.3	References
17.3.1	OWASP MASVS
17.3.2	Request App Permissions
18	Android Network APIs
18.1	Testing Endpoint Identify Verification (MSTG-NETWORK-3)
18.1.1	Static Analysis
18.1.1.1	Verifying the Server Certificate
18.1.1.2	WebView Server Certificate Verification
18.1.1.3	Apache Cordova Certificate Verification
18.1.1.4	Hostname Verification
18.1.2	Dynamic Analysis
18.2	Testing Custom Certificate Stores and Certificate Pinning (MSTG-NETWORK-4)
18.2.1	Overview
18.2.1.1	When the Pin Fails
18.2.2	Static Analysis
18.2.2.1	Network Security Configuration
18.2.2.2	TrustManager
18.2.2.3	Network Libraries and WebViews
18.2.2.4	Xamarin Applications
18.2.2.5	Cordova Applications
18.2.3	Dynamic Analysis
18.2.3.1	Bypassing Certificate Pinning
18.2.3.1.1	Bypass Custom Certificate Pinning Statically
18.2.3.1.2	Bypass Custom Certificate Pinning Dynamically
18.3	Testing the Network Security Configuration Settings (MSTG-NETWORK-4)
18.3.1	Overview
18.3.1.1	Trust Anchors
18.3.2	Static Analysis
18.3.3	Dynamic Analysis
18.4	Testing the Security Provider (MSTG-NETWORK-6)
18.4.1	Overview
18.4.2	Static Analysis
18.4.3	Dynamic Analysis
18.4.4	References
18.4.4.1	OWASP MASVS
18.4.4.2	Android Developer Documentation
18.4.4.3	Xamarin Certificate Pinning
18.4.4.4	Cordova Certificate Pinning
19	Android Platform APIs
19.1	Testing App Permissions (MSTG-PLATFORM-1)
19.1.1	Overview
19.1.1.1	Android 8.0 (API level 26) Changes
19.1.1.2	Android 9 (API Level 28) Changes
19.1.1.3	Android 10 Changes (Beta)
19.1.2	Activity Permission Enforcement
19.1.3	Service Permission Enforcement
19.1.4	Broadcast Permission Enforcement
19.1.5	Content Provider Permission Enforcement
19.1.6	Content Provider URI Permissions
19.1.7	Documentation for URI Permissions
19.1.7.1	Custom Permissions
19.1.8	Static Analysis
19.1.8.1	Android Permissions
19.1.8.2	Custom Permissions
19.1.9	Requesting Permissions
19.1.10	Handling Responses to Permission Requests
19.1.11	Permission Analysis
19.1.12	Dynamic Analysis
19.2	Testing for Injection Flaws (MSTG-PLATFORM-2)
19.2.1	Overview
19.2.2	Dynamic Analysis
19.3	Testing for Fragment Injection (MSTG-PLATFORM-2)
19.3.1	Overview
19.3.2	Static Analysis
19.3.3	Example of Vulnerable App and Exploitation
19.4	Testing for URL Loading in WebViews (MSTG-PLATFORM-2)
19.4.1	Overview
19.4.1.1	SafeBrowsing API
19.4.1.2	Virus Total API
19.4.2	Static Analysis
19.4.3	Dynamic Analysis
19.5	Testing Custom URL Schemes (MSTG-PLATFORM-3)
19.5.1	Overview
19.5.2	Static Analysis
19.5.3	Dynamic Analysis
19.6	Testing for Insecure Configuration of Instant Apps (MSTG-ARCH-1, MSTG-ARCH-7)
19.6.1	Overview
19.6.2	Static Analysis
19.6.3	Dynamic Analysis
19.7	Testing for Sensitive Functionality Exposure Through IPC (MSTG-PLATFORM-4)
19.7.1	Overview
19.7.2	Static Analysis
19.7.3	Activities
19.7.3.1	Inspect the AndroidManifest
19.7.3.2	Inspect the source code
19.7.4	Services
19.7.4.1	Inspect the AndroidManifest
19.7.4.2	Inspect the source code
19.7.4.3	Broadcast Receivers
19.7.4.4	Inspect the AndroidManifest
19.7.4.5	Inspect the source code
19.7.5	Dynamic Analysis
19.7.5.1	Content Providers
19.7.5.2	Activities
19.7.5.3	Services
19.7.5.4	Broadcast Receivers
19.7.5.4.1	Sniffing Intents
19.8	Testing JavaScript Execution in WebViews (MSTG-PLATFORM-5)
19.8.1	Overview
19.8.2	Static Analysis
19.8.3	Dynamic Analysis
19.9	Testing WebView Protocol Handlers (MSTG-PLATFORM-6)
19.9.1	Overview
19.9.2	Static Analysis
19.9.3	Dynamic Analysis
19.10	Determining Whether Java Objects Are Exposed Through WebViews (MSTG-PLATFORM-7)
19.10.1	Overview
19.10.2	Static Analysis
19.10.3	Dynamic Analysis
19.11	Testing Object Persistence (MSTG-PLATFORM-8)
19.11.1	Overview
19.11.1.1	Object Serialization
19.11.1.2	JSON
19.11.1.3	XML
19.11.1.4	ORM
19.11.1.5	Parcelable
19.11.1.6	Protocol Buffers
19.11.2	Static Analysis
19.11.2.1	Object Serialization
19.11.2.2	JSON
19.11.2.3	ORM
19.11.2.4	Parcelable
19.11.3	Dynamic Analysis
19.12	Testing for Overlay Attacks (MSTG-PLATFORM-9)
19.12.1	Overview
19.12.2	Static Analysis
19.12.3	Dynamic Analysis
19.13	Testing enforced updating (MSTG-ARCH-9)
19.13.1	Static analysis
19.13.2	Dynamic analysis
19.14	References
19.14.1	Android App Bundles and updates
19.14.2	Android Fragment Injection
19.14.3	Android Permissions Documentation
19.14.4	Android Bundles and Instant Apps
19.14.5	Android permissions changes in Android 8
19.14.6	Android WebViews and SafeBrowsing
19.14.7	Android Custom URL Schemes
19.14.8	Android App Notifications
19.14.9	OWASP MASVS
20	Android Code Quality and Build Settings
20.1	Making Sure That the App is Properly Signed (MSTG-CODE-1)
20.1.1	Overview
20.1.2	Static Analysis
20.1.3	Dynamic Analysis
20.2	Testing Whether the App is Debuggable (MSTG-CODE-2)
20.2.1	Overview
20.2.2	Static Analysis
20.2.3	Dynamic Analysis
20.3	Testing for Debugging Symbols (MSTG-CODE-3)
20.3.1	Overview
20.3.2	Static Analysis
20.3.3	Dynamic Analysis
20.4	Testing for Debugging Code and Verbose Error Logging (MSTG-CODE-4)
20.4.1	Overview
20.4.2	Static Analysis
20.4.3	Dynamic Analysis
20.5	Checking for Weaknesses in Third Party Libraries (MSTG-CODE-5)
20.5.1	Overview
20.5.2	Static Analysis
20.5.2.1	Detecting vulnerabilities of third party libraries
20.5.2.2	Detecting the Licenses Used by the Libraries of the Application
20.5.3	Dynamic Analysis
20.6	Testing Exception Handling (MSTG-CODE-6 and MSTG-CODE-7)
20.6.1	Overview
20.6.2	Static Analysis
20.6.3	Dynamic Analysis
20.7	Memory Corruption Bugs (MSTG-CODE-8)
20.7.1	Static Analysis
20.7.2	Dynamic Analysis
20.8	Make Sure That Free Security Features Are Activated (MSTG-CODE-9)
20.8.1	Overview
20.8.2	Static Analysis
20.8.3	Dynamic Analysis
20.9	References
20.9.1	OWASP MASVS
20.9.2	Memory Analysis References
20.9.3	Android Documentation
21	Android Anti-Reversing Defenses
21.1	Testing Root Detection (MSTG-RESILIENCE-1)
21.1.1	Overview
21.1.2	Common Root Detection Methods
21.1.2.1	SafetyNet
21.1.2.1.1	ctsProfileMatch Vs basicIntegrity
21.1.2.1.2	Recommendations when using SafetyNetApi.attest
21.1.2.2	Programmatic Detection
21.1.2.2.1	File existence checks
21.1.2.2.2	Executing su and other commands
21.1.2.2.3	Checking running processes
21.1.2.2.4	Checking installed app packages
21.1.2.2.5	Checking for writable partitions and system directories
21.1.2.2.6	Checking for custom Android builds
21.1.2.3	Bypassing Root Detection
21.1.3	Effectiveness Assessment
21.2	Testing Anti-Debugging Detection (MSTG-RESILIENCE-2)
21.2.1	Overview
21.2.2	JDWP Anti-Debugging
21.2.2.1	Checking the Debuggable Flag in ApplicationInfo
21.2.2.2	isDebuggerConnected
21.2.2.3	Timer Checks
21.2.2.4	Messing with JDWP-Related Data Structures
21.2.3	Traditional Anti-Debugging
21.2.3.1	Checking TracerPid
21.2.3.2	Using Fork and ptrace
21.2.4	Bypassing Debugger Detection
21.2.4.1	Bypassing Example: UnCrackable App for Android Level 2
21.2.5	Effectiveness Assessment
21.3	Testing File Integrity Checks (MSTG-RESILIENCE-3)
21.3.1	Overview
21.3.1.1	Sample Implementation - Application Source Code
21.3.1.2	Sample Implementation - Storage
21.3.1.3	Bypassing File Integrity Checks
21.3.1.3.1	Bypassing the application-source integrity checks
21.3.1.3.2	Bypassing the storage integrity checks
21.3.2	Effectiveness Assessment
21.3.2.1	For application-source integrity checks
21.3.2.2	For storage integrity checks
21.4	Testing Reverse Engineering Tools Detection (MSTG-RESILIENCE-4)
21.4.1	Overview
21.4.2	Detection Methods
21.4.3	Effectiveness Assessment
21.5	Testing Emulator Detection (MSTG-RESILIENCE-5)
21.5.1	Overview
21.5.2	Emulator Detection Examples
21.5.3	Bypassing Emulator Detection
21.5.4	Effectiveness Assessment
21.6	Testing Runtime Integrity Checks (MSTG-RESILIENCE-6)
21.6.1	Overview
21.6.1.1	Runtime Integrity Check Examples
21.6.1.1.1	Detecting tampering with the Java Runtime**
21.6.1.1.2	Detecting Native Hooks
21.6.2	Bypass and Effectiveness Assessment
21.7	Testing Obfuscation (MSTG-RESILIENCE-9)
21.7.1	Overview
21.7.2	Effectiveness Assessment
21.8	Testing Device Binding (MSTG-RESILIENCE-10)
21.8.1	Overview
21.8.2	Static Analysis
21.8.3	Dynamic Analysis
21.8.3.1	Dynamic Analysis with an Emulator
21.8.3.2	Google Instance ID
21.8.3.3	IMEI & Serial
21.8.3.4	SSAID
21.8.4	Effectiveness Assessment
21.8.4.1	Using an Emulator
21.8.4.2	Using two different rooted devices
21.9	References
21.9.1	OWASP MASVS
21.9.2	SafetyNet Attestation
22	iOS Platform Overview
22.1	iOS Security Architecture
22.1.1	Hardware Security
22.1.2	Secure Boot
22.1.3	Code Signing
22.1.4	Encryption and Data Protection
22.1.5	Sandbox
22.1.6	General Exploit Mitigations
22.2	Software Development on iOS
22.3	Apps on iOS
22.3.1	IPA Payloads - A Closer Look
22.3.2	App Permissions
22.4	iOS Application Attack surface
23	iOS Basic Security Testing
23.1	iOS Testing Setup
23.1.1	Host Device
23.1.2	Testing Device
23.1.2.1	Getting the UDID of an iOS device
23.1.2.2	Testing on a real device (Jailbroken)
23.1.2.3	Testing on the iOS Simulator
23.1.2.4	Testing on an Emulator
23.1.2.5	Getting Privileged Access
23.1.2.5.1	Benefits of Jailbreaking
23.1.2.5.2	Jailbreak Types
23.1.2.5.3	Caveats and Considerations
23.1.2.5.4	Which Jailbreaking Tool to Use
23.2	Basic Testing Operations
23.2.1	Accessing the Device Shell
23.2.1.1	Remote Shell
23.2.1.1.1	Connect to a Device via SSH over USB
23.2.1.2	On-device Shell App
23.2.2	Host-Device Data Transfer
23.2.2.1	Copying App Data Files via SSH and SCP
23.2.2.2	Passionfruit
23.2.2.3	Objection
23.2.3	Obtaining and Extracting Apps
23.2.3.1	Getting the IPA File from an OTA Distribution Link
23.2.3.2	Acquiring the App Binary
23.2.3.2.1	Using Clutch
23.2.3.2.2	Using Frida-ios-dump
23.2.4	Installing Apps
23.2.4.1	Cydia Impactor
23.2.4.2	libimobiledevice
23.2.4.3	ipainstaller
23.2.4.4	ios-deploy
23.2.4.5	Xcode
23.2.4.6	Allow Application Installation on a Non-iPad Device
23.2.5	Information Gathering
23.2.5.1	Listing Installed Apps
23.2.5.2	Exploring the App Package
23.2.5.2.1	The Info.plist File
23.2.5.2.2	App Binary
23.2.5.2.3	Native Libraries
23.2.5.2.4	Other App Resources
23.2.5.3	Accessing App Data Directories
23.2.5.4	Monitoring System Logs
23.2.5.5	Dumping KeyChain Data
23.2.5.5.1	Objection (Jailbroken / non-Jailbroken)
23.2.5.5.2	Passionfruit (Jailbroken / non-Jailbroken)
23.2.5.5.3	Keychain-dumper (Jailbroken)
23.3	Setting Up a Network Testing Environment
23.3.1	Basic Network Monitoring/Sniffing
23.3.2	Setting up an Interception Proxy
23.3.2.1	Using Burp via USB on a Jailbroken Device
23.3.3	Certificate Pinning
23.4	References
24	iOS Tampering and Reverse Engineering
24.1	Reverse Engineering
24.1.1	Disassembling and Decompiling
24.1.1.1	Disassembling With IDA Pro
24.2	Static Analysis
24.2.1	Basic Information Gathering
24.2.1.1	Application Binary
24.2.1.2	Retrieving Strings
24.2.1.3	Cross References
24.2.1.4	API Usage
24.2.1.5	Network Communication
24.2.2	Manual (Reversed) Code Review
24.2.2.1	Reviewing Disassembled Objective-C and Swift Code
24.2.2.1.1	Objective-C
24.2.2.2	Reviewing Disassembled Native Code
24.2.3	Automated Static Analysis
24.3	Dynamic Analysis
24.3.1	Dynamic Analysis on Non-Jailbroken Devices
24.3.1.1	Automated Repackaging with Objection
24.3.1.2	Manual Repackaging
24.3.1.3	Getting a Developer Provisioning Profile and Certificate
24.3.2	Basic Information Gathering
24.3.2.1	Open Files
24.3.2.2	Open Connections
24.3.2.3	Sandbox Inspection
24.3.3	Debugging
24.3.3.1	Debugging with LLDB
24.3.3.2	Debugging Release Apps
24.3.4	Tracing
24.3.4.1	Method Tracing
24.3.4.2	Native Libraries Tracing
24.3.5	Emulation-based Analysis
24.3.5.1	iOS Simulator
24.3.5.2	Corellium
24.4	Binary Analysis
24.4.1	Unicorn
24.4.2	Angr
24.5	Tampering and Runtime Instrumentation
24.5.1	Patching, Repackaging, and Re-Signing
24.5.1.1	Patching Example: Installing Frida Gadget
24.5.1.2	Repackaging and Re-Signing
24.5.1.3	Patching React Native applications
24.5.2	Dynamic Instrumentation
24.5.2.1	Information Gathering
24.5.2.2	Getting Loaded Classes and their Methods
24.5.2.3	Getting Loaded Libraries
24.5.2.4	Method Hooking
24.5.2.4.1	Frida
24.5.2.5	Process Exploration
24.5.2.5.1	Memory Maps and Inspection
24.5.2.5.2	In-Memory Search
24.5.2.5.3	Memory Dump
24.5.2.5.4	Runtime Reverse Engineering
24.6	References
25	iOS Data Storage
25.1	Testing Local Data Storage (MSTG-STORAGE-1 and MSTG-STORAGE-2)
25.1.1	Data Protection API
25.1.1.1	The Keychain
25.1.1.1.1	Keychain Data Persistence
25.1.2	Static Analysis
25.1.2.1	NSUserDefaults
25.1.2.2	File system
25.1.2.3	CoreData
25.1.2.4	SQLite Databases
25.1.2.5	Firebase Real-time Databases
25.1.2.6	Realm databases
25.1.2.7	Couchbase Lite Databases
25.1.2.8	YapDatabase
25.1.3	Dynamic Analysis
25.1.3.1	Dynamic Analysis with Xcode and iOS simulator
25.1.3.2	Dynamic Analysis with Objection
25.1.3.2.1	Reading the Keychain
25.1.3.2.2	Searching for Binary Cookies
25.1.3.2.3	Searching for Property List Files
25.1.3.2.4	Searching for SQLite Databases
25.1.3.2.5	Searching for Cache Databases
25.1.3.2.5.1	Recommendations
25.2	Checking Logs for Sensitive Data (MSTG-STORAGE-3)
25.2.1	Static Analysis
25.2.2	Dynamic Analysis
25.3	Determining Whether Sensitive Data Is Shared with Third Parties (MSTG-STORAGE-4)
25.3.1	Overview
25.3.2	Static Analysis
25.3.3	Dynamic Analysis
25.4	Finding Sensitive Data in the Keyboard Cache (MSTG-STORAGE-5)
25.4.1	Static Analysis
25.4.2	Dynamic Analysis
25.5	Determining Whether Sensitive Data Is Exposed via IPC Mechanisms (MSTG-STORAGE-6)
25.5.1	Overview
25.5.2	Static Analysis
25.5.2.1	XPC Services
25.5.2.2	Mach Ports
25.5.2.3	NSFileCoordinator
25.5.3	Dynamic Analysis
25.6	Checking for Sensitive Data Disclosed Through the User Interface (MSTG-STORAGE-7)
25.6.1	Overview
25.6.2	Static Analysis
25.6.3	Dynamic Analysis
25.7	Testing Backups for Sensitive Data (MSTG-STORAGE-8)
25.7.1	Overview
25.7.1.1	How the Keychain Is Backed Up
25.7.1.2	Static Analysis
25.7.2	Dynamic Analysis
25.7.2.1	Proof of Concept: Removing UI Lock with Tampered Backup
25.8	Testing Auto-Generated Screenshots for Sensitive Information (MSTG-STORAGE-9)
25.8.1	Overview
25.8.2	Static Analysis
25.8.3	Dynamic Analysis
25.9	Testing Memory for Sensitive Data (MSTG-STORAGE-10)
25.9.1	Overview
25.9.2	Static Analysis
25.9.3	Dynamic Analysis
25.9.3.1	Retrieving and Analyzing a Memory Dump
25.9.3.2	Runtime Memory Analysis
25.10	References
25.10.1	OWASP MASVS
26	iOS Cryptographic APIs
26.1	Verifying the Configuration of Cryptographic Standard Algorithms (MSTG-CRYPTO-2 and MSTG-CRYPTO-3)
26.1.1	Overview
26.1.1.1	CryptoKit
26.1.1.2	CommonCrypto, SecKeyEncrypt and Wrapper libraries
26.1.1.3	Third party libraries
26.1.2	Static Analysis
26.1.2.1	CommonCryptor
26.1.2.2	Third party libraries
26.2	Testing Key Management (MSTG-CRYPTO-1 and MSTG-CRYPTO-5)
26.2.1	Overview
26.2.2	Static Analysis
26.2.3	Dynamic Analysis
26.3	Testing Random Number Generation (MSTG-CRYPTO-6)
26.3.1	Overview
26.3.2	Static Analysis
26.3.3	Dynamic Analysis
26.4	References
26.4.1	OWASP MASVS
26.4.2	General Security Documentation
26.4.3	Configuration of Cryptographic algorithms
26.4.4	Random Number Documentation
26.4.5	Key Management
27	iOS Local Authentication
27.1	Testing Local Authentication (MSTG-AUTH-8 and MSTG-STORAGE-11)
27.1.1	Local Authentication Framework
27.1.2	Using Keychain Services for Local Authentication
27.1.2.1	Swift
27.1.2.2	Objective-C
27.1.2.3	Swift
27.1.2.4	Objective-C
27.1.3	Static Analysis
27.1.4	Dynamic Analysis
27.2	Note regarding temporariness of keys in the Keychain
27.3	References
27.3.1	OWASP MASVS
28	iOS Network APIs
28.1	Network Framework
28.2	URLSession
28.3	App Transport Security (MSTG-NETWORK-2)
28.3.1	Overview
28.3.1.1	ATS Exceptions
28.3.2	Analyzing the ATS Configuration
28.3.3	Recommendations for usage of ATS
28.4	Testing Custom Certificate Stores and Certificate Pinning (MSTG-NETWORK-3 and MSTG-NETWORK-4)
28.4.1	Overview
28.4.1.1	When the Pin Fails
28.4.2	Static Analysis
28.4.3	Dynamic Analysis
28.4.3.1	Server certificate validation
28.4.3.2	Client certificate validation
28.4.3.3	Bypassing Certificate Pinning
28.4.4	References
28.4.4.1	OWASP MASVS
28.4.4.2	Nscurl
29	iOS Platform APIs
29.1	Testing App Permissions (MSTG-PLATFORM-1)
29.1.1	Overview
29.1.1.1	Device Capabilities
29.1.1.2	Entitlements
29.1.2	Static Analysis
29.1.2.1	Purpose Strings in the Info.plist File
29.1.2.2	Code Signing Entitlements File
29.1.2.3	Embedded Provisioning Profile File
29.1.2.4	Entitlements Embedded in the Compiled App Binary
29.1.2.4.1	Extracting the Entitlements Plist from the App Binary
29.1.2.5	Source Code Inspection
29.1.3	Dynamic Analysis
29.2	Testing for Sensitive Functionality Exposure Through IPC (MSTG-PLATFORM-4)
29.2.1	Custom URL Schemes
29.2.2	Universal Links
29.2.2.1	Overview
29.2.2.2	Static Analysis
29.2.2.2.1	Checking the Associated Domains Entitlement
29.2.2.2.2	Retrieving the Apple App Site Association File
29.2.2.2.3	Checking the Link Receiver Method
29.2.2.2.4	Checking the Data Handler Method
29.2.2.2.5	Checking if the App is Calling Other App’s Universal Links
29.2.2.3	Dynamic Analysis
29.2.2.3.1	Triggering Universal Links
29.2.2.3.2	Identifying Valid Universal Links
29.2.2.3.3	Tracing the Link Receiver Method
29.2.2.3.4	Checking How the Links Are Opened
29.2.2.3.5	Final Notes about Universal Links and Handoff
29.2.3	UIActivity Sharing
29.2.3.1	Overview
29.2.3.2	Static Analysis
29.2.3.2.1	Sending Items
29.2.3.2.2	Receiving Items
29.2.3.3	Dynamic Analysis
29.2.3.3.1	Sending Items
29.2.3.3.2	Receiving Items
29.2.4	App Extensions
29.2.4.1	Overview
29.2.4.1.1	What are app extensions
29.2.4.1.2	How do app extensions interact with other apps
29.2.4.1.3	Security Considerations
29.2.4.2	Static Analysis
29.2.4.2.1	Verifying if the App Contains App Extensions
29.2.4.2.2	Determining the Supported Data Types
29.2.4.2.3	Checking Data Sharing with the Containing App
29.2.4.2.4	Verifying if the App Restricts the Use of App Extensions
29.2.4.3	Dynamic Analysis
29.2.4.3.1	Inspecting the Items Being Shared
29.2.4.3.2	Identifying the App Extensions Involved
29.2.5	UIPasteboard
29.2.5.1	Overview
29.2.5.2	Static Analysis
29.2.5.3	Dynamic Analysis
29.2.5.3.1	Detect Pasteboard Usage
29.2.5.3.2	Detect Persistent Pasteboard Usage
29.2.5.3.3	Monitoring and Inspecting Pasteboard Items
29.3	Testing Custom URL Schemes (MSTG-PLATFORM-3)
29.3.1	Overview
29.3.2	Static Analysis
29.3.2.1	Testing Custom URL Schemes Registration
29.3.2.2	Testing Application Query Schemes Registration
29.3.2.3	Testing URL Handling and Validation
29.3.2.4	Testing URL Requests to Other Apps
29.3.2.5	Testing for Deprecated Methods
29.3.3	Dynamic Analysis
29.3.3.1	Performing URL Requests
29.3.3.1.1	Using Safari
29.3.3.1.2	Using the Notes App
29.3.3.1.3	Using Frida
29.3.3.2	Identifying and Hooking the URL Handler Method
29.3.3.2.1	Crafting the Link Yourself and Letting Safari Open It
29.3.3.2.2	Dynamically Opening the Link from the App Itself
29.3.3.2.3	Opening a Link by Navigating to a Page and Letting Safari Open It
29.3.3.2.4	Testing for Deprecated Methods
29.3.3.3	Testing URL Schemes Source Validation
29.3.3.4	Fuzzing URL Schemes
29.3.3.4.1	Using Frida
29.4	Testing iOS WebViews (MSTG-PLATFORM-5)
29.4.1	Overview
29.4.1.1	UIWebView
29.4.1.2	WKWebView
29.4.1.3	SFSafariViewController
29.4.2	Static Analysis
29.4.2.1	Identifying WebView Usage
29.4.2.1.1	UIWebView
29.4.2.1.2	WKWebView
29.4.2.2	Testing JavaScript Configuration
29.4.2.3	Testing for Mixed Content
29.4.3	Dynamic Analysis
29.4.3.1	Enumerating WebView Instances
29.4.3.2	Checking if JavaScript is Enabled
29.4.3.3	Verifying that Only Secure Content is Allowed
29.4.3.4	Testing for WebView URI Manipulation
29.5	Testing WebView Protocol Handlers (MSTG-PLATFORM-6)
29.5.1	Overview
29.5.2	Static Analysis
29.5.2.1	Testing How WebViews are Loaded
29.5.2.2	Testing WebView File Access
29.5.2.3	Checking Telephone Number Detection
29.5.3	Dynamic Analysis
29.5.3.1	Checking How WebViews are Loaded
29.5.3.2	Determining WebView File Access
29.6	Determining Whether Native Methods Are Exposed Through WebViews (MSTG-PLATFORM-7)
29.6.1	Overview
29.6.2	Static Analysis
29.6.2.1	Testing UIWebView JavaScript to Native Bridges
29.6.2.2	Testing WKWebView JavaScript to Native Bridges
29.6.3	Dynamic Analysis
29.7	Testing Object Persistence (MSTG-PLATFORM-8)
29.7.1	Overview
29.7.1.1	Object Encoding
29.7.1.2	Object Archiving with NSKeyedArchiver
29.7.1.3	Codable
29.7.1.4	JSON and Codable
29.7.1.5	Property Lists and Codable
29.7.1.6	XML
29.7.1.7	Object-Relational Mapping (CoreData and Realm)
29.7.1.8	Protocol Buffers
29.7.2	Static Analysis
29.7.3	Dynamic Analysis
29.8	Testing enforced updating (MSTG-ARCH-9)
29.8.1	Static Analysis
29.8.2	Dynamic analysis
29.9	References
29.9.1	OWASP MASVS
29.9.2	Regarding Object Persistence in iOS
30	iOS Code Quality and Build Settings
30.1	Making Sure that the App Is Properly Signed (MSTG-CODE-1)
30.1.1	Overview
30.2	Determining Whether the App is Debuggable (MSTG-CODE-2)
30.2.1	Overview
30.2.2	Static Analysis
30.2.3	Dynamic Analysis
30.3	Finding Debugging Symbols (MSTG-CODE-3)
30.3.1	Overview
30.3.2	Static Analysis
30.3.3	Dynamic Analysis
30.4	Finding Debugging Code and Verbose Error Logging (MSTG-CODE-4)
30.4.1	Overview
30.4.2	Static Analysis
30.4.3	Dynamic Analysis
30.5	Checking for Weaknesses in Third Party Libraries (MSTG-CODE-5)
30.5.1	Overview
30.5.2	Static Analysis
30.5.2.1	Detecting vulnerabilities of third party libraries
30.5.2.1.1	Swift Package Manager
30.5.2.1.2	CocoaPods
30.5.2.1.3	Carthage
30.5.2.1.4	Discovered library vulnerabilities
30.5.2.2	Detecting the Licenses Used by the Libraries of the Application
30.5.2.2.1	Swift Package Manager
30.5.2.2.2	CocoaPods
30.5.2.2.3	Carthage
30.5.2.2.4	Issues with library licenses
30.5.3	Dynamic Analysis
30.5.3.1	Listing Application Libraries
30.6	Testing Exception Handling (MSTG-CODE-6)
30.6.1	Overview
30.6.1.1	Exception handling in Objective-C
30.6.1.2	Exception Handling in Swift
30.6.2	Static Analysis
30.6.2.1	Static Analysis in Objective-C
30.6.2.2	Static Analysis in Swift
30.6.2.3	Proper Error Handling
30.6.3	Dynamic Testing
30.7	Memory Corruption Bugs (MSTG-CODE-8)
30.7.1	Static Analysis
30.7.2	Dynamic Analysis
30.8	Make Sure That Free Security Features Are Activated (MSTG-CODE-9)
30.8.1	Overview
30.8.2	Static Analysis
30.8.2.1	Xcode Project Settings
30.8.2.2	With otool
30.8.3	Dynamic Analysis
30.9	References
30.9.1	Memory management - dynamic analysis examples
30.9.2	OWASP MASVS
31	iOS Anti-Reversing Defenses
31.1	Jailbreak Detection (MSTG-RESILIENCE-1)
31.1.1	Overview
31.1.1.1	File-based Checks
31.1.1.2	Checking File Permissions
31.1.1.3	Checking Protocol Handlers
31.1.2	Bypassing Jailbreak Detection
31.2	Testing Anti-Debugging Detection (MSTG-RESILIENCE-2)
31.2.1	Overview
31.2.1.1	Using ptrace
31.2.1.2	Using sysctl
31.2.2	Using getppid
31.3	File Integrity Checks (MSTG-RESILIENCE-3 and MSTG-RESILIENCE-11)
31.3.1	Overview
31.3.1.1	Sample Implementation - Application Source Code
31.3.1.2	Sample Implementation - Storage
31.3.1.3	Bypassing File Integrity Checks
31.3.1.3.1	When you’re trying to bypass the application-source integrity checks
31.3.1.3.2	When you’re trying to bypass the storage integrity checks
31.3.2	Effectiveness Assessment
31.4	Testing Reverse Engineering Tools Detection (MSTG-RESILIENCE-4)
31.4.1	Overview
31.4.2	Detection Methods
31.4.3	Effectiveness Assessment
31.5	Testing Emulator Detection (MSTG-RESILIENCE-5)
31.5.1	Overview
31.6	Testing Obfuscation (MSTG-RESILIENCE-9)
31.6.1	Overview
31.6.2	Name Obfuscation
31.6.3	Instruction Substitution
31.6.4	Control Flow Flattening
31.6.5	Dead Code Injection
31.6.6	String Encryption
31.6.7	Recommended Tools
31.6.8	How to use SwiftShield
31.6.9	Effectiveness Assessment
31.7	Device Binding (MSTG-RESILIENCE-10)
31.7.1	Overview
31.7.2	Static Analysis
31.7.3	Dynamic Analysis
31.7.3.1	Dynamic Analysis with A Simulator
31.7.3.2	Dynamic Analysis Using Two Jailbroken Devices
31.7.4	Remediation
31.8	References
31.8.1	OWASP MASVS
32	Appendix
33	Testing Tools
33.1	Tools for all Platforms
33.1.1	Angr
33.1.1.1	Angr (Android)
33.1.2	Frida
33.1.2.1	Frida for Android
33.1.2.1.1	Installing Frida on Android
33.1.2.1.2	Using Frida on Android
33.1.2.1.3	Tracing Native Libraries with frida-trace
33.1.2.1.4	Frida CLI and the Java API
33.1.2.2	Frida for iOS
33.1.2.2.1	Installing Frida on iOS
33.1.2.2.2	Using Frida on iOS
33.1.2.3	Frida Bindings
33.1.3	Frida CodeShare
33.1.4	Ghidra
33.1.5	Hopper (Commercial Tool)
33.1.6	IDA Pro (Commercial Tool)
33.1.7	LIEF
33.1.8	MobSF
33.1.8.1	MobSF for Android
33.1.8.2	MobSF for iOS
33.1.9	nm
33.1.10	Objection
33.1.10.1	Objection for Android
33.1.10.1.1	Using Objection on Android
33.1.10.2	Objection for iOS
33.1.10.2.1	Using Objection on iOS
33.1.11	r2frida
33.1.12	radare2
33.1.12.1	radare2 (Android)
33.1.12.1.1	Installing radare2
33.1.12.1.2	Using radare2
33.1.12.2	Radare2 (iOS)
33.1.13	RMS Runtime Mobile Security
33.2	Tools for Android
33.2.1	Adb
33.2.2	Android NDK
33.2.3	Android SDK
33.2.4	Android Studio
33.2.5	Android-SSL-TrustKiller
33.2.6	Apktool
33.2.7	apkx
33.2.8	Busybox
33.2.9	Bytecode Viewer
33.2.10	Drozer
33.2.10.1	Installing Drozer
33.2.10.2	Using Drozer
33.2.10.3	Other Drozer commands
33.2.10.4	Other Drozer resources
33.2.11	gplaycli
33.2.12	House
33.2.13	Inspeckage
33.2.14	jadx
33.2.15	jdb
33.2.16	JustTrustMe
33.2.17	Magisk
33.2.18	Proguard
33.2.19	RootCloak Plus
33.2.20	Scrcpy
33.2.21	SSLUnpinning
33.2.22	Termux
33.2.23	Xposed
33.3	Tools for iOS
33.3.1	bfinject
33.3.2	BinaryCookieReader
33.3.3	Burp Suite Mobile Assistant
33.3.4	class-dump
33.3.5	class-dump-z
33.3.6	class-dump-dyld
33.3.7	Clutch
33.3.8	Cyberduck
33.3.9	Cycript
33.3.10	Cydia
33.3.11	dsdump
33.3.12	Dumpdecrypted
33.3.13	FileZilla
33.3.14	Frida-cycript
33.3.15	Frida-ios-dump
33.3.16	Fridpa
33.3.17	gdb
33.3.18	iFunBox
33.3.19	Introspy-iOS
33.3.20	iOSbackup
33.3.21	ios-deploy
33.3.22	iProxy
33.3.23	itunnel
33.3.24	Keychain-Dumper
33.3.25	lldb
33.3.26	MachoOView
33.3.27	optool
33.3.28	otool
33.3.29	Passionfruit
33.3.30	Plutil
33.3.31	Sileo
33.3.32	simctl
33.3.33	SSL Kill Switch 2
33.3.34	swift-demangle
33.3.35	TablePlus
33.3.36	Usbmuxd
33.3.37	Weak Classdump
33.3.38	Xcode
33.3.39	Xcode Command Line Tools
33.3.40	xcrun
33.4	Tools for Network Interception and Monitoring
33.4.1	Android tcpdump
33.4.2	bettercap
33.4.3	Burp Suite
33.4.4	MITM Relay
33.4.5	OWASP ZAP
33.4.6	tcpdump
33.4.7	Wireshark
33.5	Vulnerable applications
33.5.1	Android
33.5.2	iOS
34	Suggested Reading
34.1	Mobile App Security
34.1.1	Android
34.1.2	iOS
34.2	Reverse Engineering
35	Changelog
35.1	v1.2 - 25th July 2021
35.2	v1.1.3 - 2 August 2019
35.3	v1.1.2 - 12 May 2019
35.4	v1.1.1 - 7 May 2019
35.5	v1.1.0 - 30 Nov 2018
35.6	v1.0.2 - 13 Oct 2018
35.7	v1.0.1 - 17 Sept 2018
35.8	v1.0 - 15 Jun 2018 (First release)
OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

翻译过来大体是这样的


OWASP 移动安全测试指南 1.2

1 前言
2 卷首画
2.1 关于OWASP移动安全测试指南
2.2 免责声明
2.3 版权和许可
2.4 国际标准书号
2.5 致谢
2.5.1 作者
2.5.1.1 伯恩哈德·穆勒
2.5.1.2 斯文施莱尔
2.5.1.3 杰罗恩威廉森
2.5.1.4 卡洛斯·霍尔格拉
2.5.2 共同作者
2.5.2.1 Romuald Szkudlarek
2.5.2.2 杰罗恩贝克斯
2.5.2.3 维卡斯·古普塔
2.5.3 杰出贡献者
2.5.4 贡献者
2.5.5 迷你贡献者
2.5.6 审稿人
2.5.7 编辑
2.5.8 捐赠者
2.5.9 上帝模式捐赠者
2.5.9.1 尊敬的恩人
2.5.9.2 好心的施主
2.5.9.3 其他捐赠者
2.5.10 旧版本
2.5.10.1 OWASP MSTG“Beta 2”(谷歌文档)
2.5.10.2 OWASP MSTG“Beta 1”(谷歌文档)
3 概述
3.1 OWASP移动安全测试指南介绍
3.1.1 移动应用安全重点领域
3.1.1.1 本地数据存储
3.1.1.2 与可信端点的通信
3.1.1.3 认证与授权
3.1.1.4 与移动平台的交互
3.1.1.5 代码质量和漏洞利用缓解
3.1.1.6 防篡改和防逆转
3.2 OWASP Mobile AppSec 验证标准
3.3 浏览移动安全测试指南
4 移动应用分类
4.1 原生应用
4.2 网页应用
4.3 混合应用
4.4 渐进式网页应用
4.5 移动测试指南的内容
5 移动应用安全测试
5.1 测试原理
5.1.1 白盒测试与黑盒测试
5.1.2 漏洞分析
5.1.3 静态与动态分析
5.1.4 静态分析
5.1.4.1 手动代码审查
5.1.4.2 自动化源代码分析
5.1.5 动态分析
5.1.6 避免误报
5.1.6.1 自动扫描工具
5.1.6.2 剪贴板
5.1.7 渗透测试(又名 Pentesting)
5.1.7.1 准备
5.1.7.1.1 与客户的协调
5.1.7.1.2 识别敏感数据
5.1.7.1.3 情报收集
5.1.7.1.4 环境信息
5.1.7.1.5 架构信息
5.1.7.2 映射应用程序
5.1.7.3 利用
5.1.8 报告
5.2 安全测试和 SDLC
5.2.1 软件开发生命周期中的安全测试
5.2.2 SDLC 概述
5.2.2.1 SDLC 概述
5.2.2.2 定义测试策略
5.2.3 瀑布中的安全测试
5.2.3.1 什么是瀑布以及测试活动是如何安排的
5.2.4 Agile/DevOps 和 DevSecOps 的安全测试
5.2.4.1 什么是敏捷和 DevSecOps 以及如何安排测试活动
5.2.4.1.1 概述
5.2.4.1.2 基础设施即代码
5.2.4.1.3 部署
5.2.4.1.4 安全
5.3 参考文献
5.3.1 OWASP MASVS
6 移动应用程序篡改和逆向工程
6.1 为什么需要它
6.2 基本篡改技术
6.2.1 二进制补丁
6.2.2 代码注入
6.3 静态和动态二进制分析
6.3.1 使用反汇编器和反编译器
6.3.2 调试和跟踪
6.4 先进技术
6.4.1 动态二进制检测
6.4.2 基于仿真的动态分析
6.4.3 带有逆向工程框架的自定义工具
6.4.3.1 示例:使用符号/Concolic 执行的程序分析
6.5 参考文献
7 移动应用程序认证架构
7.1 测试认证的一般指南
7.1.1 有状态与无状态身份验证
7.1.2 补充认证
7.2 验证适当的身份验证(MSTG-ARCH-2 和 MSTG-AUTH-1)
7.3 密码测试最佳实践(MSTG-AUTH-5 和 MSTG-AUTH-6)
7.3.1 静态分析
7.3.1.1 zxcvbn
7.3.2 我是否被 Pwned:PwnedPasswords
7.3.2.1 登录限制
7.3.3 动态测试(MSTG-AUTH-6)
7.4 测试状态会话管理(MSTG-AUTH-2)
7.4.1 会话管理最佳实践
7.5 测试会话超时(MSTG-AUTH-7)
7.5.1 静态分析
7.5.2 动态分析
7.6 测试用户注销(MSTG-AUTH-4)
7.6.1 静态分析
7.6.2 动态分析
7.7 测试双因素认证和升压认证(MSTG-AUTH-9 和 MSTG-AUTH-10)
7.7.1 SMS-OTP 的危险
7.7.2 使用推送通知和 PKI 进行交易签名
7.7.3 静态分析
7.7.4 动态测试
7.8 测试无状态(基于令牌)认证 (MSTG-AUTH-3)
7.8.1 静态分析
7.8.1.1 执行散列算法
7.8.1.2 代币到期
7.8.2 动态分析
7.9 测试 OAuth 2.0 流程(MSTG-AUTH-1 和 MSTG-AUTH-3)
7.9.1 OAUTH 2.0 最佳实践
7.9.1.1 外部用户代理与嵌入式用户代理
7.9.2 其他 OAuth2 最佳实践
7.10 测试登录活动和设备阻止 (MSTG-AUTH-11)
7.11 参考文献
7.11.1 OWASP MASVS
7.11.1.1 SMS-OTP 研究
8 移动应用网络通信
8.1 拦截 HTTP(S) 流量
8.2 Burp 插件处理非 HTTP 流量
8.3 拦截网络层流量
8.3.1 使用 Bettercap 模拟中间人攻击
8.3.1.1 网络设置
8.3.1.2 中间人攻击
8.3.2 使用接入点模拟中间人攻击
8.3.2.1 网络设置
8.3.2.2 安装
8.3.2.3 配置
8.3.2.4 中间人攻击
8.3.3 网络分析工具
8.3.4 通过运行时检测设置代理
8.3.5 示例 - 处理 Xamarin
8.3.5.1 CA 证书
8.3.5.2 拦截流量
8.4 验证网络数据加密(MSTG-NETWORK-1和MSTG-NETWORK-2)
8.4.1 概述
8.4.1.1 推荐的 TLS 设置
8.4.1.1.1 密码套件术语
8.4.2 静态分析
8.4.3 动态分析
8.5 确保关键操作使用安全通信通道 (MSTG-NETWORK-5)
8.5.1 概述
8.5.2 静态分析
8.5.3 动态分析
8.6 参考文献
8.6.1 OWASP MASVS
8.6.2 安卓
8.6.3 iOS
8.6.4 IANA 传输层安全 (TLS) 参数
8.6.5 OWASP TLS 密码字符串备忘单
8.6.6 SIM 卡交换攻击
8.6.7 国家标准
8.6.8 SIM 卡交换欺诈
8.6.9 IETF
9 移动应用密码学
9.1 关键概念
9.2 识别不安全和/或过时的加密算法 (MSTG-CRYPTO-4)
9.3 常见配置问题(MSTG-CRYPTO-1、MSTG-CRYPTO-2 和 MSTG-CRYPTO-3)
9.3.1 密钥长度不足
9.3.2 使用硬编码密钥的对称加密
9.3.3 弱密钥生成函数
9.3.4 弱随机数生成器
9.3.5 密码学的自定义实现
9.3.6 AES 配置不足
9.3.6.1 弱块密码模式
9.3.6.2 可预测的初始化向量
9.3.6.3 有状态操作模式下的初始化向量
9.3.7 由于较弱的填充或块操作实现而导致的填充 Oracle 攻击
9.3.8 保护内存中的密钥
9.3.9 在传输中保护密钥
9.4 Android 和 iOS 上的加密 API
9.5 密码策略
9.5.1 参考文献
9.5.1.1 密码学参考
9.5.1.2 OWASP MASVS
10 移动应用代码质量
10.1 注射缺陷(MSTG-ARCH-2 和 MSTG-PLATFORM-2)
10.1.1 SQL 注入
10.1.2 XML 注入
10.1.3 注入攻击向量
10.2 跨站脚本缺陷(MSTG-PLATFORM-2)
10.2.1 静态分析
10.2.2 动态分析
10.3 内存损坏错误(MSTG-CODE-8)
10.3.1 缓冲区和整数溢出
10.3.2 静态分析
10.3.3 动态分析
10.4 参考文献
10.4.1 OWASP MASVS
10.4.2 XSS 通过启动 ContentActivity
11 移动应用用户交互
11.1 测试用户教育(MSTG-STORAGE-12)
11.1.1 告知用户隐私信息
11.1.2 告知用户最佳安全实践
11.1.3 访问设备数据
11.1.4 您必须分享的其他信息(OSS 信息)
11.2 参考文献
11.2.1 OWASP MASVS
11.2.2 开源许可提及示例
11.2.3 帮助理解许可证的网站
11.2.4 权限申请指南
12 Android 平台概述
12.1 安卓架构
12.2 Android 安全:深度防御方法
12.2.1 全系统安全
12.2.1.1 设备加密
12.2.1.2 可信执行环境(TEE)
12.2.1.3 验证启动
12.2.2 软件隔离
12.2.2.1 Android 用户和组
12.2.2.2 SELinux
12.2.2.3 权限
12.2.3 网络安全
12.2.3.1 默认的 TLS
12.2.3.2 基于 TLS 的 DNS
12.2.4 反剥削
12.2.4.1 ASLR、KASLR、PIE 和 DEP
12.2.4.2 SECCOMP 过滤器
12.3 安卓应用架构
12.3.1 与操作系统的通信
12.3.2 应用沙盒
12.3.2.1 Linux 用户管理
12.3.2.2 合子
12.3.2.3 应用生命周期
12.3.3 应用程序包
12.3.4 安卓清单
12.3.5 应用组件
12.3.5.1 活动
12.3.5.2 片段
12.3.5.3 内容提供者
12.3.5.4 服务
12.3.6 进程间通信
12.3.6.1 意图
12.3.6.2 广播接收器
12.3.6.3 隐式广播接收器限制
12.4 安卓应用发布
12.4.1 签约流程
12.4.2 APK 签名方案
12.4.2.1 JAR 签名(v1 方案)
12.4.2.2 APK 签名方案(v2 方案)
12.4.2.3 APK 签名方案(v3 方案)
12.4.2.4 创建您的证书
12.4.2.5 签署应用程序
12.4.2.5.1 压缩对齐
12.4.3 发布流程
12.5 Android 应用攻击面
13 Android 基础安全测试
13.1 安卓测试设置
13.1.1 主机设备
13.1.2 测试设备
13.1.2.1 在真机上测试
13.1.2.2 在模拟器上测试
13.1.2.3 获得特权访问
13.1.2.3.1 哪些手机可以root
13.1.2.3.2 用 Magisk 生根
13.1.2.3.3 根检测
13.2 基本测试操作
13.2.1 访问设备外壳
13.2.1.1 远程外壳
13.2.1.1.1 连接多个设备
13.2.1.1.2 通过 Wi-Fi 连接到设备
13.2.1.1.3 通过 SSH 连接到设备
13.2.1.2 设备端 Shell 应用
13.2.2 主机-设备数据传输
13.2.2.1 使用 adb
13.2.2.2 使用 Android Studio 设备文件资源管理器
13.2.2.3 使用异议
13.2.2.4 使用 Termux
13.2.3 获取和提取应用程序
13.2.3.1 替代应用商店
13.2.3.2 使用 gplaycli
13.2.3.3 从设备中提取应用程序包
13.2.4 安装应用
13.2.5 信息收集
13.2.5.1 列出已安装的应用程序
13.2.5.2 探索应用包
13.2.5.2.1 安卓清单
13.2.5.2.2 应用程序二进制
13.2.5.2.3 本地库
13.2.5.2.4 其他应用资源
13.2.5.3 访问应用数据目录
13.2.5.4 监控系统日志
13.3 搭建网络测试环境
13.3.1 基本网络监控/嗅探
13.3.1.1 Firebase/谷歌云消息传递(FCM/GCM)
13.3.1.1.1 测试设置的准备
13.3.1.1.2 HTTP
13.3.1.1.3 XMPP
13.3.1.1.4 拦截请求
13.3.1.1.5 推送通知的端到端加密
13.3.2 设置拦截代理
13.3.2.1 虚拟设备的拦截代理
13.3.2.1.1 在 Android 虚拟设备 (AVD) 上设置 Web 代理
13.3.2.1.2 在虚拟设备上安装 CA 证书
13.3.2.2 物理设备的拦截代理
13.3.2.3 绕过网络安全配置
13.3.2.3.1 在网络安全配置中添加用户证书
13.3.2.3.2 使用 Magisk 在系统信任的 CA 之间添加代理的证书
13.3.2.3.3 在系统信任的 CA 中手动添加 Proxy 的证书
13.3.3 潜在障碍
13.3.3.1 无线网络中的客户端隔离
13.3.3.2 非代理感知应用
13.3.3.2.1 iptables
13.3.3.2.2 更好的上限
13.3.3.3 代理检测
13.3.3.4 证书锁定
13.4 参考文献
14 Android 篡改和逆向工程
14.1 逆向工程
14.1.1 反汇编和反编译
14.1.1.1 反编译 Java 代码
14.1.1.2 反汇编原生代码
14.1.1.2.1 雷达2
14.1.1.2.2 IDA 专业版
14.2 静态分析
14.2.1 基本信息采集
14.2.1.1 检索字符串
14.2.1.1.1 Java 和 Kotlin 字节码
14.2.1.1.2 本地代码
14.2.1.2 交叉引用
14.2.1.2.1 Java 和 Kotlin
14.2.1.2.2 本机代码
14.2.1.3 API 使用
14.2.1.4 网络通讯
14.2.2 手动(反向)代码审查
14.2.2.1 查看反编译的 Java 代码
14.2.2.2 查看反汇编的本地代码
14.2.2.2.1 雷达2
14.2.2.2.2 IDA 专业版
14.2.2.2.3 吉德拉
14.2.3 自动静态分析
14.3 动态分析
14.3.1 非root设备动态分析
14.3.2 基本信息采集
14.3.2.1 打开文件
14.3.2.2 开放连接
14.3.2.3 加载的本地库
14.3.2.4 沙盒检查
14.3.3 调试
14.3.3.1 调试发布应用
14.3.3.2 使用 jdb 调试
14.3.3.3 使用 IDE 调试
14.3.3.4 调试本机代码
14.3.4 追踪
14.3.4.1 执行跟踪
14.3.4.1.1 跟踪系统调用
14.3.4.1.2 跟踪
14.3.4.1.3 K探针
14.3.4.2 方法跟踪
14.3.4.3 原生代码跟踪
14.3.4.4 JNI 跟踪
14.3.5 基于仿真的分析
14.3.6 二元分析
14.3.6.1 符号执行
14.4 篡改和运行时检测
14.4.1 打补丁、重新打包和重新签名
14.4.1.1 补丁示例:禁用证书锁定
14.4.1.2 补丁示例:使应用程序可调试
14.4.1.3 重新包装
14.4.1.4 重新签名
14.4.1.5 “等待调试器”功能
14.4.1.6 修补 React Native 应用程序
14.4.1.7 库注入
14.4.1.7.1 修补应用程序的 Smali 代码
14.4.1.7.2 修补应用程序的原生库
14.4.1.7.3 预加载符号
14.4.2 动态仪表
14.4.2.1 信息收集
14.4.2.1.1 获取加载的类及其方法
14.4.2.1.2 获取加载的库
14.4.2.2 方法挂钩
14.4.2.2.1 Xposed
14.4.2.2.2 弗里达
14.4.2.3 过程探索
14.4.2.3.1 内存映射和检查
14.4.2.3.2 内存搜索
14.4.2.3.3 内存转储
14.4.2.3.4 运行时逆向工程
14.5 为逆向工程定制Android
14.5.1 自定义 RAMDisk
14.5.2 自定义Android内核
14.5.3 启动自定义环境
14.5.4 内核模块的系统调用挂钩
14.5.4.1 示例:文件隐藏
14.6 参考文献
15 安卓数据存储
15.1 理论概述
15.2 数据存储方法概述
15.2.1 共享偏好
15.2.2 数据库
15.2.2.1 SQLite 数据库(未加密)
15.2.2.2 SQLite 数据库(加密)
15.2.2.3 Firebase 实时数据库
15.2.2.4 领域数据库
15.2.3 内部存储
15.2.4 外部存储
15.2.5 密钥库
15.2.5.1 硬件支持的 Android KeyStore
15.2.5.2 密钥认证
15.2.5.3 安全密钥导入密钥库
15.2.5.4 较旧的 KeyStore 实现
15.2.5.5 钥匙串
15.2.5.6 存储密钥 - 示例
15.2.5.7 第三方库
15.2.6 日志
15.2.7 备份
15.2.8 进程内存
15.3 测试敏感数据的本地存储(MSTG-STORAGE-1 和 MSTG-STORAGE-2)
15.3.1 概述
15.3.2 静态分析
15.3.3 动态分析
15.4 为输入验证测试本地存储 (MSTG-PLATFORM-2)
15.4.1 概述
15.4.2 静态分析
15.4.2.1 使用共享首选项
15.4.2.2 使用其他存储机制
15.5 敏感数据的测试日志(MSTG-STORAGE-3)
15.5.1 概述
15.5.2 静态分析
15.5.3 动态分析
15.6 确定敏感数据是否与第三方共享 (MSTG-STORAGE-4)
15.6.1 概述
15.6.2 App内嵌的第三方服务
15.6.3 应用通知
15.6.4 静态分析
15.6.4.1 App内嵌的第三方服务
15.6.4.2 应用通知
15.6.5 动态分析
15.6.5.1 应用内嵌的第三方服务
15.6.5.2 应用通知
15.7 确定是否禁用了文本输入字段的键盘缓存(MSTG-STORAGE-5)
15.7.1 概述
15.7.2 静态分析
15.7.3 动态分析
15.8 确定敏感存储数据是否已通过 IPC 机制暴露(MSTG-STORAGE-6)
15.8.1 概述
15.8.2 静态分析
15.8.2.1 检查 Android 清单
15.8.2.2 检查源代码
15.8.3 动态分析
15.8.3.1 测试内容提供者
15.8.3.2 内容提供者中的 SQL 注入
15.8.3.3 基于文件系统的内容提供者
15.9 通过用户界面检查敏感数据泄露 (MSTG-STORAGE-7)
15.9.1 概述
15.9.2 静态分析
15.9.2.1 文本字段
15.9.2.2 应用通知
15.9.3 动态分析
15.9.3.1 文本字段
15.9.3.2 应用通知
15.10 测试敏感数据的备份 (MSTG-STORAGE-8)
15.10.1 概述
15.10.2 静态分析
15.10.2.1 本地
15.10.2.2 云
15.10.3 动态分析
15.11 在自动生成的屏幕截图中查找敏感信息 (MSTG-STORAGE-9)
15.11.1 概述
15.11.2 静态分析
15.11.3 动态分析
15.12 检查内存中的敏感数据 (MSTG-STORAGE-10)
15.12.1 概述
15.12.2 静态分析
15.12.3 动态分析
15.12.3.1 检索和分析内存转储
15.12.3.2 运行时内存分析
15.12.3.3 显式转储和分析 Java 堆
15.13 测试设备访问安全策略 (MSTG-STORAGE-11)
15.13.1 概述
15.13.2 静态分析
15.13.3 动态分析
15.14 参考文献
15.14.1 OWASP MASVS
15.14.2 库
16 个 Android 加密 API
16.1 建议
16.1.1 安全提供者
16.1.1.1 更新安全提供者
16.1.1.2 较旧的 Android 版本
16.1.2 密钥生成
16.1.3 随机数生成
16.2 测试对称密码(MSTG-CRYPTO-1)
16.2.1 概述
16.2.2 静态分析
16.2.3 动态分析
16.3 测试密码标准算法的配置(MSTG-CRYPTO-2、MSTG-CRYPTO-3 和 MSTG-CRYPTO-4)
16.3.1 概述
16.3.2 静态分析
16.3.3 动态分析
16.4 测试密钥的用途(MSTG-CRYPTO-5)
16.4.1 概述
16.4.2 静态分析
16.4.3 动态分析
16.5 测试随机数生成(MSTG-CRYPTO-6)
16.5.1 概述
16.5.2 静态分析
16.5.3 动态分析
16.6 参考文献
16.6.1 密码学参考
16.6.2 SecureRandom 引用
16.6.3 测试密钥管理参考
16.6.4 关键认证参考
16.6.4.1 OWASP MASVS
17 Android本地认证
17.1 测试确认凭据(MSTG-AUTH-1 和 MSTG-STORAGE-11)
17.1.1 概述
17.1.2 静态分析
17.1.3 动态分析
17.2 测试生物特征认证(MSTG-AUTH-8)
17.2.1 概述
17.2.1.1 FingerprintManager(在 Android 9(API 级别 28)中已弃用)
17.2.2 静态分析
17.2.2.1 生物特征库
17.2.2.2 指纹管理器
17.2.2.3 附加安全功能
17.2.2.4 第三方 SDK
17.2.3 动态分析
17.3 参考文献
17.3.1 OWASP MASVS
17.3.2 请求应用权限
18 个 Android 网络 API
18.1 测试端点身份验证(MSTG-NETWORK-3)
18.1.1 静态分析
18.1.1.1 验证服务器证书
18.1.1.2 WebView 服务器证书验证
18.1.1.3 Apache Cordova 证书验证
18.1.1.4 主机名验证
18.1.2 动态分析
18.2 测试自定义证书存储和证书固定 (MSTG-NETWORK-4)
18.2.1 概述
18.2.1.1 引脚失效时
18.2.2 静态分析
18.2.2.1 网络安全配置
18.2.2.2 信任管理器
18.2.2.3 网络库和 WebView
18.2.2.4 Xamarin 应用程序
18.2.2.5 Cordova 应用程序
18.2.3 动态分析
18.2.3.1 绕过证书锁定
18.2.3.1.1 静态绕过自定义证书固定
18.2.3.1.2 动态绕过自定义证书固定
18.3 测试网络安全配置设置 (MSTG-NETWORK-4)
18.3.1 概述
18.3.1.1 信任锚
18.3.2 静态分析
18.3.3 动态分析
18.4 测试安全提供者 (MSTG-NETWORK-6)
18.4.1 概述
18.4.2 静态分析
18.4.3 动态分析
18.4.4 参考文献
18.4.4.1 OWASP MASVS
18.4.4.2 Android 开发者文档
18.4.4.3 Xamarin 证书固定
18.4.4.4 Cordova 证书固定
19 个 Android 平台 API
19.1 测试应用权限(MSTG-PLATFORM-1)
19.1.1 概述
19.1.1.1 Android 8.0(API 级别 26)变化
19.1.1.2 Android 9(API 级别 28)变化
19.1.1.3 Android 10 变化(测试版)
19.1.2 活动许可执行
19.1.3 服务权限执行
19.1.4 广播权限执行
19.1.5 内容提供者权限执行
19.1.6 内容提供者 URI 权限
19.1.7 URI 权限文档
19.1.7.1 自定义权限
19.1.8 静态分析
19.1.8.1 安卓权限
19.1.8.2 自定义权限
19.1.9 请求权限
19.1.10 处理对权限请求的响应
19.1.11 权限分析
19.1.12 动态分析
19.2 注射缺陷测试(MSTG-PLATFORM-2)
19.2.1 概述
19.2.2 动态分析
19.3 片段注入测试(MSTG-PLATFORM-2)
19.3.1 概述
19.3.2 静态分析
19.3.3 易受攻击的应用程序和利用示例
19.4 在 WebViews 中测试 URL 加载 (MSTG-PLATFORM-2)
19.4.1 概述
19.4.1.1 安全浏览 API
19.4.1.2 病毒总 API
19.4.2 静态分析
19.4.3 动态分析
19.5 测试自定义 URL Schemes (MSTG-PLATFORM-3)
19.5.1 概述
19.5.2 静态分析
19.5.3 动态分析
19.6 即时应用程序不安全配置的测试(MSTG-ARCH-1、MSTG-ARCH-7)
19.6.1 概述
19.6.2 静态分析
19.6.3 动态分析
19.7 通过 IPC (MSTG-PLATFORM-4) 测试敏感功能暴露
19.7.1 概述
19.7.2 静态分析
19.7.3 活动
19.7.3.1 检查 AndroidManifest
19.7.3.2 检查源代码
19.7.4 服务
19.7.4.1 检查 AndroidManifest
19.7.4.2 检查源代码
19.7.4.3 广播接收器
19.7.4.4 检查 AndroidManifest
19.7.4.5 检查源代码
19.7.5 动态分析
19.7.5.1 内容提供者
19.7.5.2 活动
19.7.5.3 服务
19.7.5.4 广播接收器
19.7.5.4.1 嗅探意图
19.8 在 WebViews 中测试 JavaScript 执行 (MSTG-PLATFORM-5)
19.8.1 概述
19.8.2 静态分析
19.8.3 动态分析
19.9 测试 WebView 协议处理程序 (MSTG-PLATFORM-6)
19.9.1 概述
19.9.2 静态分析
19.9.3 动态分析
19.10 确定 Java 对象是否通过 WebView 暴露(MSTG-PLATFORM-7)
19.10.1 概述
19.10.2 静态分析
19.10.3 动态分析
19.11 测试对象持久性(MSTG-PLATFORM-8)
19.11.1 概述
19.11.1.1 对象序列化
19.11.1.2 JSON
19.11.1.3 XML
19.11.1.4 ORM
19.11.1.5 可包裹
19.11.1.6 协议缓冲区
19.11.2 静态分析
19.11.2.1 对象序列化
19.11.2.2 JSON
19.11.2.3 ORM
19.11.2.4 可包裹
19.11.3 动态分析
19.12 覆盖攻击测试 (MSTG-PLATFORM-9)
19.12.1 概述
19.12.2 静态分析
19.12.3 动态分析
19.13 测试强制更新 (MSTG-ARCH-9)
19.13.1 静态分析
19.13.2 动态分析
19.14 参考文献
19.14.1 Android 应用程序包和更新
19.14.2 Android 片段注入
19.14.3 Android 权限文档
19.14.4 Android 捆绑包和免安装应用
19.14.5 Android 8 中的 Android 权限更改
19.14.6 Android WebViews 和 SafeBrowsing
19.14.7 Android 自定义 URL Schemes
19.14.8 安卓应用通知
19.14.9 OWASP MASVS
20 Android 代码质量和构建设置
20.1 确保应用正确签名 (MSTG-CODE-1)
20.1.1 概述
20.1.2 静态分析
20.1.3 动态分析
20.2 测试App是否可调试(MSTG-CODE-2)
20.2.1 概述
20.2.2 静态分析
20.2.3 动态分析
20.3 调试符号测试(MSTG-CODE-3)
20.3.1 概述
20.3.2 静态分析
20.3.3 动态分析
20.4 调试代码和详细错误日志的测试 (MSTG-CODE-4)
20.4.1 概述
20.4.2 静态分析
20.4.3 动态分析
20.5 检查第三方库中的弱点(MSTG-CODE-5)
20.5.1 概述
20.5.2 静态分析
20.5.2.1 检测第三方库的漏洞
20.5.2.2 检测应用程序库使用的许可证
20.5.3 动态分析
20.6 测试异常处理(MSTG-CODE-6 和 MSTG-CODE-7)
20.6.1 概述
20.6.2 静态分析
20.6.3 动态分析
20.7 内存损坏错误(MSTG-CODE-8)
20.7.1 静态分析
20.7.2 动态分析
20.8 确保激活免费安全功能 (MSTG-CODE-9)
20.8.1 概述
20.8.2 静态分析
20.8.3 动态分析
20.9 参考文献
20.9.1 OWASP MASVS
20.9.2 内存分析参考
20.9.3 安卓文档
21个Android反倒车防御
21.1 测试根检测(MSTG-RESILIENCE-1)
21.1.1 概述
21.1.2 常见的根检测方法
21.1.2.1 安全网
21.1.2.1.1 ctsProfileMatch 与 basicIntegrity
21.1.2.1.2 使用 SafetyNetApi.attest 时的建议
21.1.2.2 程序化检测
21.1.2.2.1 文件存在检查
21.1.2.2.2 执行su等命令
21.1.2.2.3 检查正在运行的进程
21.1.2.2.4 检查已安装的应用程序包
21.1.2.2.5 检查可写分区和系统目录
21.1.2.2.6 检查自定义 Android 版本
21.1.2.3 绕过根检测
21.1.3 有效性评估
21.2 测试反调试检测(MSTG-RESILIENCE-2)
21.2.1 概述
21.2.2 JDWP 反调试
21.2.2.1 检查 ApplicationInfo 中的 Debuggable 标志
21.2.2.2 isDebuggerConnected
21.2.2.3 定时器检查
21.2.2.4 混淆 JDWP 相关的数据结构
21.2.3 传统反调试
21.2.3.1 检查 TracerPid
21.2.3.2 使用 Fork 和 ptrace
21.2.4 绕过调试器检测
21.2.4.1 绕过示例:适用于 Android 2 级的 UnCrackable App
21.2.5 有效性评估
21.3 测试文件完整性检查 (MSTG-RESILIENCE-3)
21.3.1 概述
21.3.1.1 示例实现 - 应用程序源代码
21.3.1.2 示例实现 - 存储
21.3.1.3 绕过文件完整性检查
21.3.1.3.1 绕过应用程序源完整性检查
21.3.1.3.2 绕过存储完整性检查
21.3.2 有效性评估
21.3.2.1 用于应用程序源完整性检查
21.3.2.2 用于存储完整性检查
21.4 测试逆向工程工具检测(MSTG-RESILIENCE-4)
21.4.1 概述
21.4.2 检测方法
21.4.3 有效性评估
21.5 测试仿真器检测(MSTG-RESILIENCE-5)
21.5.1 概述
21.5.2 仿真器检测示例
21.5.3 绕过仿真器检测
21.5.4 有效性评估
21.6 测试运行时完整性检查 (MSTG-RESILIENCE-6)
21.6.1 概述
21.6.1.1 运行时完整性检查示例
21.6.1.1.1 检测对 Java 运行时的篡改**
21.6.1.1.2 检测原生钩子
21.6.2 绕过和有效性评估
21.7 测试混淆(MSTG-RESILIENCE-9)
21.7.1 概述
21.7.2 有效性评估
21.8 测试设备绑定(MSTG-RESILIENCE-10)
21.8.1 概述
21.8.2 静态分析
21.8.3 动态分析
21.8.3.1 使用模拟器进行动态分析
21.8.3.2 谷歌实例 ID
21.8.3.3 IMEI 和序列号
21.8.3.4 SSAID
21.8.4 有效性评估
21.8.4.1 使用模拟器
21.8.4.2 使用两个不同的root设备
21.9 参考文献
21.9.1 OWASP MASVS
21.9.2 安全网认证
22 iOS平台概述
22.1 iOS 安全架构
22.1.1 硬件安全
22.1.2 安全启动
22.1.3 代码签名
22.1.4 加密和数据保护
22.1.5 沙盒
22.1.6 一般漏洞利用缓解措施
22.2 iOS 上的软件开发
22.3 iOS 上的应用
22.3.1 IPA 有效载荷——仔细观察
22.3.2 应用权限
22.4 iOS 应用攻击面
23 iOS 基础安全测试
23.1 iOS 测试设置
23.1.1 主机设备
23.1.2 测试设备
23.1.2.1 获取iOS设备的UDID
23.1.2.2 在真机上测试(越狱)
23.1.2.3 在 iOS 模拟器上测试
23.1.2.4 在模拟器上测试
23.1.2.5 获得特权访问
23.1.2.5.1 越狱的好处
23.1.2.5.2 越狱类型
23.1.2.5.3 警告和注意事项
23.1.2.5.4 使用哪种越狱工具
23.2 基本测试操作
23.2.1 访问设备外壳
23.2.1.1 远程外壳
23.2.1.1.1 通过 SSH 通过 USB 连接到设备
23.2.1.2 设备上的 Shell 应用程序
23.2.2 主机-设备数据传输
23.2.2.1 通过 SSH 和 SCP 复制应用程序数据文件
23.2.2.2 百香果
23.2.2.3 反对
23.2.3 获取和提取应用程序
23.2.3.1 从 OTA 分发链接获取 IPA 文件
23.2.3.2 获取应用程序二进制文件
23.2.3.2.1 使用离合器
23.2.3.2.2 使用 Frida-ios-dump
23.2.4 安装应用
23.2.4.1 Cydia Impactor
23.2.4.2 libimobiledevice
23.2.4.3 ipa安装程序
23.2.4.4 ios-部署
23.2.4.5 Xcode
23.2.4.6 允许在非 iPad 设备上安装应用程序
23.2.5 信息收集
23.2.5.1 列出已安装的应用程序
23.2.5.2 探索应用包
23.2.5.2.1 Info.plist 文件
23.2.5.2.2 应用程序二进制
23.2.5.2.3 本地库
23.2.5.2.4 其他应用资源
23.2.5.3 访问应用数据目录
23.2.5.4 监控系统日志
23.2.5.5 转储 KeyChain 数据
23.2.5.5.1 异议(越狱/非越狱)
23.2.5.5.2 百香果(越狱/非越狱)
23.2.5.5.3 Keychain-dumper(越狱)
23.3 搭建网络测试环境
23.3.1 基本网络监控/嗅探
23.3.2 设置拦截代理
23.3.2.1 在越狱设备上通过 USB 使用 Burp
23.3.3 证书锁定
23.4 参考文献
24 iOS 篡改和逆向工程
24.1 逆向工程
24.1.1 反汇编和反编译
24.1.1.1 用 IDA Pro 拆解
24.2 静态分析
24.2.1 基本信息采集
24.2.1.1 应用程序二进制
24.2.1.2 检索字符串
24.2.1.3 交叉引用
24.2.1.4 API 使用
24.2.1.5 网络通讯
24.2.2 手动(反向)代码审查
24.2.2.1 审查反汇编的 Objective-C 和 Swift 代码
24.2.2.1.1 目标-C
24.2.2.2 查看反汇编的本地代码
24.2.3 自动静态分析
24.3 动态分析
24.3.1 非越狱设备动态分析
24.3.1.1 有异议的自动重新包装
24.3.1.2 手动重新包装
24.3.1.3 获取开发者配置文件和证书
24.3.2 基本信息采集
24.3.2.1 打开文件
24.3.2.2 开放连接
24.3.2.3 沙盒检查
24.3.3 调试
24.3.3.1 使用 LLDB 进行调试
24.3.3.2 调试发布应用
24.3.4 追踪
24.3.4.1 方法跟踪
24.3.4.2 本地库跟踪
24.3.5 基于仿真的分析
24.3.5.1 iOS 模拟器
24.3.5.2 Corellium
24.4 二元分析
24.4.1 独角兽
24.4.2 愤怒
24.5 篡改和运行时检测
24.5.1 打补丁、重新打包和重新签名
24.5.1.1 补丁示例:安装 Frida Gadget
24.5.1.2 重新打包和重新签名
24.5.1.3 修补 React Native 应用程序
24.5.2 动态仪表
24.5.2.1 信息收集
24.5.2.2 获取加载的类及其方法
24.5.2.3 获取加载的库
24.5.2.4 方法挂钩
24.5.2.4.1 弗里达
24.5.2.5 过程探索
24.5.2.5.1 内存映射和检查
24.5.2.5.2 内存搜索
24.5.2.5.3 内存转储
24.5.2.5.4 运行时逆向工程
24.6 参考文献
25 iOS 数据存储
25.1 测试本地数据存储(MSTG-STORAGE-1 和 MSTG-STORAGE-2)
25.1.1 数据保护 API
25.1.1.1 钥匙串
25.1.1.1.1 钥匙串数据持久性
25.1.2 静态分析
25.1.2.1 NSUserDefaults
25.1.2.2 文件系统
25.1.2.3 核心数据
25.1.2.4 SQLite 数据库
25.1.2.5 Firebase 实时数据库
25.1.2.6 领域数据库
25.1.2.7 Couchbase Lite 数据库
25.1.2.8 Yap 数据库
25.1.3 动态分析
25.1.3.1 使用 Xcode 和 iOS 模拟器进行动态分析
25.1.3.2 有异议的动态分析
25.1.3.2.1 读取钥匙串
25.1.3.2.2 搜索二进制 Cookie
25.1.3.2.3 搜索属性列表文件
25.1.3.2.4 搜索 SQLite 数据库
25.1.3.2.5 搜索缓存数据库
25.1.3.2.5.1 建议
25.2 检查敏感数据的日志(MSTG-STORAGE-3)
25.2.1 静态分析
25.2.2 动态分析
25.3 确定敏感数据是否与第三方共享(MSTG-STORAGE-4)
25.3.1 概述
25.3.2 静态分析
25.3.3 动态分析
25.4 在键盘缓存中查找敏感数据 (MSTG-STORAGE-5)
25.4.1 静态分析
25.4.2 动态分析
25.5 确定是否通过 IPC 机制暴露敏感数据 (MSTG-STORAGE-6)
25.5.1 概述
25.5.2 静态分析
25.5.2.1 XPC 服务
25.5.2.2 马赫端口
25.5.2.3 NSFileCoordinator
25.5.3 动态分析
25.6 检查通过用户界面披露的敏感数据 (MSTG-STORAGE-7)
25.6.1 概述
25.6.2 静态分析
25.6.3 动态分析
25.7 测试敏感数据的备份 (MSTG-STORAGE-8)
25.7.1 概述
25.7.1.1 钥匙串是如何备份的
25.7.1.2 静态分析
25.7.2 动态分析
25.7.2.1 概念证明:使用篡改备份移除 UI 锁定
25.8 测试自动生成的敏感信息截图 (MSTG-STORAGE-9)
25.8.1 概述
25.8.2 静态分析
25.8.3 动态分析
25.9 测试敏感数据的内存(MSTG-STORAGE-10)
25.9.1 概述
25.9.2 静态分析
25.9.3 动态分析
25.9.3.1 检索和分析内存转储
25.9.3.2 运行时内存分析
25.10 参考文献
25.10.1 OWASP MASVS
26 个 iOS 加密 API
26.1 验证密码标准算法的配置(MSTG-CRYPTO-2 和 MSTG-CRYPTO-3)
26.1.1 概述
26.1.1.1 加密套件
26.1.1.2 CommonCrypto、SecKeyEncrypt 和 Wrapper 库
26.1.1.3 第三方库
26.1.2 静态分析
26.1.2.1 CommonCryptor
26.1.2.2 第三方库
26.2 测试密钥管理(MSTG-CRYPTO-1 和 MSTG-CRYPTO-5)
26.2.1 概述
26.2.2 静态分析
26.2.3 动态分析
26.3 测试随机数生成(MSTG-CRYPTO-6)
26.3.1 概述
26.3.2 静态分析
26.3.3 动态分析
26.4 参考文献
26.4.1 OWASP MASVS
26.4.2 一般安全文件
26.4.3 密码算法的配置
26.4.4 随机数文档
26.4.5 密钥管理
27 iOS本地认证
27.1 测试本地认证(MSTG-AUTH-8 和 MSTG-STORAGE-11)
27.1.1 本地认证框架
27.1.2 使用钥匙串服务进行本地认证
27.1.2.1 斯威夫特
27.1.2.2 目标-C
27.1.2.3 斯威夫特
27.1.2.4 目标-C
27.1.3 静态分析
27.1.4 动态分析
27.2 关于钥匙串中钥匙的临时性的注意事项
27.3 参考文献
27.3.1 OWASP MASVS
28 个 iOS 网络 API
28.1 网络框架
28.2 URLSession
28.3 应用传输安全(MSTG-NETWORK-2)
28.3.1 概述
28.3.1.1 ATS 异常
28.3.2 分析 ATS 配置
28.3.3 使用 ATS 的建议
28.4 测试自定义证书存储和证书固定(MSTG-NETWORK-3 和 MSTG-NETWORK-4)
28.4.1 概述
28.4.1.1 引脚失效时
28.4.2 静态分析
28.4.3 动态分析
28.4.3.1 服务器证书验证
28.4.3.2 客户端证书验证
28.4.3.3 绕过证书锁定
28.4.4 参考文献
28.4.4.1 OWASP MASVS
28.4.4.2 卷曲
29 个 iOS 平台 API
29.1 测试应用权限(MSTG-PLATFORM-1)
29.1.1 概述
29.1.1.1 设备功能
29.1.1.2 权利
29.1.2 静态分析
29.1.2.1 Info.plist 文件中的用途字符串
29.1.2.2 代码签名权利文件
29.1.2.3 嵌入式供应配置文件
29.1.2.4 编译的应用程序二进制文件中嵌入的权利
29.1.2.4.1 从应用程序二进制文件中提取权利 Plist
29.1.2.5 源代码检查
29.1.3 动态分析
29.2 通过 IPC 测试敏感功能暴露 (MSTG-PLATFORM-4)
29.2.1 自定义 URL Schemes
29.2.2 通用链接
29.2.2.1 概述
29.2.2.2 静态分析
29.2.2.2.1 检查关联域授权
29.2.2.2.2 获取苹果应用站点关联文件
29.2.2.2.3 检查链路接收方方法
29.2.2.2.4 检查数据处理程序方法
29.2.2.2.5 检查应用是否调用其他应用的通用链接
29.2.2.3 动态分析
29.2.2.3.1 触发通用链接
29.2.2.3.2 识别有效的通用链接
29.2.2.3.3 跟踪链路接收方方法
29.2.2.3.4 检查链接的打开方式
29.2.2.3.5 关于通用链路和切换的最终说明
29.2.3 UIActivity 分享
29.2.3.1 概述
29.2.3.2 静态分析
29.2.3.2.1 发送物品
29.2.3.2.2 接收物品
29.2.3.3 动态分析
29.2.3.3.1 发送物品
29.2.3.3.2 接收物品
29.2.4 应用扩展
29.2.4.1 概述
29.2.4.1.1 什么是应用扩展
29.2.4.1.2 应用扩展如何与其他应用交互
29.2.4.1.3 安全考虑
29.2.4.2 静态分析
29.2.4.2.1 验证应用是否包含应用扩展
29.2.4.2.2 确定支持的数据类型
29.2.4.2.3 检查与包含应用程序的数据共享
29.2.4.2.4 验证应用是否限制使用应用扩展
29.2.4.3 动态分析
29.2.4.3.1 检查共享项目
29.2.4.3.2 识别所涉及的应用程序扩展
29.2.5 用户界面板
29.2.5.1 概述
29.2.5.2 静态分析
29.2.5.3 动态分析
29.2.5.3.1 检测粘贴板使用情况
29.2.5.3.2 检测持久的粘贴板使用情况
29.2.5.3.3 监控和检查粘贴板项目
29.3 测试自定义 URL Schemes (MSTG-PLATFORM-3)
29.3.1 概述
29.3.2 静态分析
29.3.2.1 测试自定义 URL Schemes 注册
29.3.2.2 测试应用查询方案注册
29.3.2.3 测试 URL 处理和验证
29.3.2.4 测试对其他应用的 URL 请求
29.3.2.5 过时方法的测试
29.3.3 动态分析
29.3.3.1 执行 URL 请求
29.3.3.1.1 使用 Safari
29.3.3.1.2 使用笔记应用
29.3.3.1.3 使用 Frida
29.3.3.2 识别和挂钩 URL 处理程序方法
29.3.3.2.1 自己制作链接并让 Safari 打开它
29.3.3.2.2 从应用本身动态打开链接
29.3.3.2.3 通过导航到页面并让 Safari 打开它来打开链接
29.3.3.2.4 过时方法的测试
29.3.3.3 测试 URL Schemes 源验证
29.3.3.4 模糊 URL Schemes
29.3.3.4.1 使用 Frida
29.4 测试 iOS WebViews (MSTG-PLATFORM-5)
29.4.1 概述
29.4.1.1 UIWebView
29.4.1.2 WKWebView
29.4.1.3 SFSafariViewController
29.4.2 静态分析
29.4.2.1 识别 WebView 使用
29.4.2.1.1 UIWebView
29.4.2.1.2 WKWebView
29.4.2.2 测试 JavaScript 配置
29.4.2.3 混合内容测试
29.4.3 动态分析
29.4.3.1 枚举 WebView 实例
29.4.3.2 检查 JavaScript 是否启用
29.4.3.3 验证只允许安全内容
29.4.3.4 测试 WebView URI 操作
29.5 测试 WebView 协议处理程序 (MSTG-PLATFORM-6)
29.5.1 概述
29.5.2 静态分析
29.5.2.1 测试如何加载 WebView
29.5.2.2 测试 WebView 文件访问
29.5.2.3 检查电话号码检测
29.5.3 动态分析
29.5.3.1 检查 WebView 是如何加载的
29.5.3.2 确定 WebView 文件访问权限
29.6 确定本地方法是否通过 WebView 暴露(MSTG-PLATFORM-7)
29.6.1 概述
29.6.2 静态分析
29.6.2.1 测试 UIWebView JavaScript 到 Native Bridges
29.6.2.2 测试 WKWebView JavaScript 到 Native Bridges
29.6.3 动态分析
29.7 测试对象持久性(MSTG-PLATFORM-8)
29.7.1 概述
29.7.1.1 对象编码
29.7.1.2 使用 NSKeyedArchiver 进行对象归档
29.7.1.3 可编码
29.7.1.4 JSON 和 Codable
29.7.1.5 属性列表和编码
29.7.1.6 XML
29.7.1.7 对象-关系映射(CoreData 和 Realm)
29.7.1.8 协议缓冲区
29.7.2 静态分析
29.7.3 动态分析
29.8 测试强制更新(MSTG-ARCH-9)
29.8.1 静态分析
29.8.2 动态分析
29.9 参考文献
29.9.1 OWASP MASVS
29.9.2 关于 iOS 中的对象持久化
30 iOS 代码质量和构建设置
30.1 确保应用正确签名 (MSTG-CODE-1)
30.1.1 概述
30.2 判断应用是否可调试(MSTG-CODE-2)
30.2.1 概述
30.2.2 静态分析
30.2.3 动态分析
30.3 查找调试符号(MSTG-CODE-3)
30.3.1 概述
30.3.2 静态分析
30.3.3 动态分析
30.4 查找调试代码和详细错误日志(MSTG-CODE-4)
30.4.1 概述
30.4.2 静态分析
30.4.3 动态分析
30.5 检查第三方库中的弱点(MSTG-CODE-5)
30.5.1 概述
30.5.2 静态分析
30.5.2.1 检测第三方库的漏洞
30.5.2.1.1 Swift 包管理器
30.5.2.1.2 CocoaPods
30.5.2.1.3 迦太基
30.5.2.1.4 发现的库漏洞
30.5.2.2 检测应用程序库使用的许可证
30.5.2.2.1 Swift 包管理器
30.5.2.2.2 CocoaPods
30.5.2.2.3 迦太基
30.5.2.2.4 库许可证问题
30.5.3 动态分析
30.5.3.1 列出应用程序库
30.6 测试异常处理(MSTG-CODE-6)
30.6.1 概述
30.6.1.1 Objective-C 中的异常处理
30.6.1.2 Swift 中的异常处理
30.6.2 静态分析
30.6.2.1 Objective-C 中的静态分析
30.6.2.2 Swift 中的静态分析
30.6.2.3 正确的错误处理
30.6.3 动态测试
30.7 内存损坏错误 (MSTG-CODE-8)
30.7.1 静态分析
30.7.2 动态分析
30.8 确保激活免费安全功能 (MSTG-CODE-9)
30.8.1 概述
30.8.2 静态分析
30.8.2.1 Xcode 项目设置
30.8.2.2 使用 otool
30.8.3 动态分析
30.9 参考文献
30.9.1 内存管理 - 动态分析示例
30.9.2 OWASP MASVS
31个iOS反倒车防御
31.1 越狱检测(MSTG-RESILIENCE-1)
31.1.1 概述
31.1.1.1 基于文件的检查
31.1.1.2 检查文件权限
31.1.1.3 检查协议处理程序
31.1.2 绕过越狱检测
31.2 测试反调试检测(MSTG-RESILIENCE-2)
31.2.1 概述
31.2.1.1 使用 ptrace
31.2.1.2 使用 sysctl
31.2.2 使用 getppid
31.3 文件完整性检查(MSTG-RESILIENCE-3 和 MSTG-RESILIENCE-11)
31.3.1 概述
31.3.1.1 示例实现 - 应用程序源代码
31.3.1.2 示例实现 - 存储
31.3.1.3 绕过文件完整性检查
31.3.1.3.1 当你试图绕过应用程序源完整性检查时
31.3.1.3.2 当你试图绕过存储完整性检查时
31.3.2 有效性评估
31.4 测试逆向工程工具检测(MSTG-RESILIENCE-4)
31.4.1 概述
31.4.2 检测方法
31.4.3 有效性评估
31.5 测试仿真器检测 (MSTG-RESILIENCE-5)
31.5.1 概述
31.6 测试混淆(MSTG-RESILIENCE-9)
31.6.1 概述
31.6.2 名称混淆
31.6.3 指令替换
31.6.4 控制流扁平化
31.6.5 死代码注入
31.6.6 字符串加密
31.6.7 推荐工具
31.6.8 如何使用 SwiftShield
31.6.9 有效性评估
31.7 设备绑定(MSTG-RESILIENCE-10)
31.7.1 概述
31.7.2 静态分析
31.7.3 动态分析
31.7.3.1 使用模拟器进行动态分析
31.7.3.2 使用两个越狱设备的动态分析
31.7.4 补救
31.8 参考文献
31.8.1 OWASP MASVS
32 附录
33 测试工具
33.1 适用于所有平台的工具
33.1.1 愤怒
33.1.1.1 Angr (安卓)
33.1.2 弗里达
33.1.2.1 安卓版弗里达
33.1.2.1.1 在 Android 上安装 Frida
33.1.2.1.2 在 Android 上使用 Frida
33.1.2.1.3 使用 frida-trace 跟踪本地库
33.1.2.1.4 Frida CLI 和 Java API
33.1.2.2 iOS 版 Frida
33.1.2.2.1 在 iOS 上安装 Frida
33.1.2.2.2 在 iOS 上使用 Frida
33.1.2.3 Frida 绑定
33.1.3 弗里达代码共享
33.1.4 吉德拉
33.1.5 料斗(商业工具)
33.1.6 IDA Pro(商业工具)
33.1.7 LIEF
33.1.8 暴徒SF
33.1.8.1 安卓版 MobSF
33.1.8.2 iOS 版 MobSF
33.1.9 纳米
33.1.10 反对
33.1.10.1 反对 Android
33.1.10.1.1 在 Android 上使用反对意见
33.1.10.2 反对 iOS
33.1.10.2.1 在 iOS 上使用反对意见
33.1.11 r2frida
33.1.12 雷达2
33.1.12.1radare2(安卓)
33.1.12.1.1 安装radare2
33.1.12.1.2 使用radare2
33.1.12.2 雷达 2 (iOS)
33.1.13 RMS 运行时移动安全
33.2 安卓工具
33.2.1 亚行
33.2.2 安卓 NDK
33.2.3 安卓 SDK
33.2.4 安卓工作室
33.2.5 Android-SSL-TrustKiller
33.2.6 应用工具
33.2.7 apkx
33.2.8 忙箱
33.2.9 字节码查看器
33.2.10 德罗泽
33.2.10.1 安装 Drozer
33.2.10.2 使用 Drozer
33.2.10.3 其他 Drozer 命令
33.2.10.4 其他 Drozer 资源
33.2.11 gplaycli
33.2.12 房子
33.2.13 检验
33.2.14 杰德
33.2.15 数据库
33.2.16 JustTrustMe
33.2.17 魔术师
33.2.18 混淆器
33.2.19 RootCloak Plus
33.2.20 刮痧
33.2.21 SSLUnpinning
33.2.22 终端
33.2.23 Xposed
33.3 iOS 工具
33.3.1 bfinject
33.3.2 BinaryCookieReader
33.3.3 Burp Suite 移动助手
33.3.4 类转储
33.3.5 类转储-z
33.3.6 class-dump-dyld
33.3.7 离合器
33.3.8 赛博鸭
33.3.9 Cycript
33.3.10 Cydia
33.3.11 dsdump
33.3.12 转储解密
33.3.13 FileZilla
33.3.14 Frida-cycript
33.3.15 Frida-ios-dump
33.3.16 弗里德帕
33.3.17 数据库
33.3.18 趣味盒子
33.3.19 Introspy-iOS
33.3.20 iOS备份
33.3.21 ios-部署
33.3.22 代理
33.3.23 隧道
33.3.24 Keychain-Dumper
33.3.25 lldb
33.3.26 MachoOView
33.3.27 选择工具
33.3.28 工具
33.3.29 百香果
33.3.30 实用程序
33.3.31 西莱奥
33.3.32 simctl
33.3.33 SSL 终止开关 2
33.3.34 swift-demangle
33.3.35 表加
33.3.36 Usbmuxd
33.3.37 弱类转储
33.3.38 Xcode
33.3.39 Xcode 命令行工具
33.3.40 xcrun
33.4 网络拦截和监控工具
33.4.1 安卓 tcpdump
33.4.2 更好的上限
33.4.3 打嗝套件
33.4.4 中间人中继
33.4.5 OWASP ZAP
33.4.6 tcpdump
33.4.7 线鲨
33.5 易受攻击的应用程序
33.5.1 安卓
33.5.2 iOS
34 建议阅读
34.1 移动应用安全
34.1.1 安卓
34.1.2 iOS
34.2 逆向工程
35 更新日志
35.1 v1.2 - 2021 年 7 月 25 日
35.2 v1.1.3 - 2019 年 8 月 2 日
35.3 v1.1.2 - 2019 年 5 月 12 日
35.4 v1.1.1 - 2019 年 5 月 7 日
35.5 v1.1.0 - 2018 年 11 月 30 日
35.6 v1.0.2 - 2018 年 10 月 13 日
35.7 v1.0.1 - 2018 年 9 月 17 日
35.8 v1.0 - 2018 年 6 月 15 日(首次发布)
OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

GitHub目录

一般测试指南

OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

安卓测试指南

OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

iOS 测试指南

附录

owasp-mstg v1.2下载地址

OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

共有三种格式提供下载[docx,pdf,epub]

①GitHub下载:

OWASP_MSTG-1.2.epub 28.5 MB
OWASP_MSTG-1.2.pdf 25.7 MB
OWASP_MSTG-1.2_WIP_.docx 26.9 MB

②云中转网盘:(三份文件在一起下载)

yunzhongzhuan.com/#sharefile=aRGkbjhw_…
解压密码 www.ddosi.org

OWASP移动安全测试指南手册MSTG|owasp-mstg v1.2

项目地址

GitHub: github.com/OWASP/owasp-mstg

Leave a Reply

您的电子邮箱地址不会被公开。 必填项已用 * 标注