jankesec/evilcorp-ios

GitHub: jankesec/evilcorp-ios

一款专为移动安全培训设计的故意存在漏洞的 iOS 应用,提供覆盖 OWASP MASVS 各分类的实战挑战与配套 Frida 脚本。

Stars: 0 | Forks: 0

# EvilCorp iOS **专为移动安全培训设计的故意存在漏洞的 iOS 应用 —— 涵盖 OWASP MASVS 各分类的 30 项挑战。** [![Swift](https://img.shields.io/badge/Swift-5.0-orange?style=flat&logo=swift)](https://swift.org) [![iOS](https://img.shields.io/badge/iOS-16%2B-black?style=flat&logo=apple)](https://apple.com/ios) [![License](https://img.shields.io/badge/license-GPLv3-blue?style=flat)](LICENSE) [![Challenges](https://img.shields.io/badge/challenges-30-green?style=flat)]() [![Size](https://img.shields.io/badge/binary-3.1MB%20arm64-lightgrey?style=flat)] EvilCorp 是一款专为**移动安全培训**设计的、故意存在漏洞的 iOS 应用。应用中的 **27 项挑战**均对应现实世界中的各类漏洞 (CWE)、OWASP MASVS 要求以及 MASWE 弱点 —— 这使其成为实践 iOS 渗透测试、逆向工程以及使用 Frida 进行动态插桩的绝佳动手实验室。 该应用采用现代 SwiftUI 界面,提供进度追踪、CTF 模式、实时控制台、针对各挑战的 Frida 脚本以及多标签页本地数据存储浏览器 —— 所有这些均集成在一个仅 3.3 MB 的 arm64 二进制文件中。 ## 架构 ``` ┌──────────────────────────────────────────────────────┐ │ EvilCorp iOS │ ├────────────┬────────────┬────────────┬───────────────┤ │ Home │ Labs │ MASVS │ Console │ │ · Stats │ · Search │ · Checklist│ · Live logs │ │ · CTF │ · Filter │ · Coverage │ · Filter │ │ · Cards │ · Tags │ · Gaps │ · Auto-scroll│ ├────────────┴────────────┴────────────┴───────────────┤ │ Challenge Detail (per vuln) │ │ Lab │ Hints (3 levels) │ Frida Script │ ├──────────────────────────────────────────────────────┤ │ 25 self-contained SwiftUI views + 5 service files │ │ arm64 · 3.1 MB · parse-as-library · iOS 16+ │ └──────────────────────────────────────────────────────┘ ``` ## 截图
Home Labs MASVS Progress Console
Home · Labs · MASVS · Progress · Console

Device Extras Resources Settings More
Device · Extras · Resources · Settings · More
## 挑战 | # | 挑战 | 分类 | 难度 | CWE | MASVS | MASWE | CVSS | |---|-----------|----------|------------|-----|-------|-------|------| | 1 | NSUserDefaults Storage | 存储 | 简单 | CWE-312 | STORAGE-1 | MASWE-0010 | 5.0 | | 2 | Keychain Misuse | 存储 | 简单 | CWE-922 | STORAGE-1 | MASWE-0011 | 6.8 | | 3 | Property List Files | 存储 | 简单 | CWE-312 | STORAGE-1 | MASWE-0010 | 5.0 | | 4 | SQLite Injection | 存储 | 中等 | CWE-89 | STORAGE-1 | MASWE-0015 | 7.5 | | 5 | Jailbreak Detection | 认证 | 中等 | CWE-693 | RESILIENCE-1 | MASWE-0095 | 4.3 | | 6 | SSL Pinning Bypass | 网络 | 中等 | CWE-295 | NETWORK-2 | MASWE-0061 | 5.9 | | 7 | WebView XSS | 网络 | 中等 | CWE-79 | PLATFORM-2 | MASWE-0057 | 6.1 | | 8 | Insecure Logging | 存储 | 简单 | CWE-532 | STORAGE-3 | MASWE-0005 | 4.0 | | 9 | Hardcoded Secrets | 存储 | 中等 | CWE-798 | STORAGE-1 | MASWE-0062 | 7.8 | | 10 | Biometric Bypass | 认证 | 困难 | CWE-287 | AUTH-1 | MASWE-0025 | 6.8 | | 11 | Broken Cryptography | 加密 | 中等 | CWE-327 | CRYPTO-1 | MASWE-0048 | 7.5 | | 12 | Insecure Network (HTTP) | 网络 | 中等 | CWE-319 | NETWORK-1 | MASWE-0046 | 6.5 | | 13 | URL Scheme Hijacking | 网络 | 中等 | CWE-939 | PLATFORM-2 | MASWE-0056 | 6.5 | | 14 | Screenshot Leakage | 存储 | 简单 | CWE-200 | STORAGE-3 | MASWE-0042 | 3.3 | | 15 | Anti-Debugging Bypass | 认证 | 困难 | CWE-693 | RESILIENCE-4 | MASWE-0096 | 5.5 | | 16 | Pasteboard Leakage | 存储 | 简单 | CWE-200 | STORAGE-3 | MASWE-0042 | 2.4 | | 17 | iTunes File Sharing | 存储 | 中等 | CWE-200 | STORAGE-2 | MASWE-0010 | 4.6 | | 18 | Keyboard Cache Leak | 存储 | 简单 | CWE-200 | STORAGE-3 | MASWE-0042 | 2.4 | | 19 | Binary Patching | 加密 | 困难 | CWE-1275 | RESILIENCE-4 | MASWE-0096 | 6.5 | | 20 | Vulnerable Vault (PIN) | 认证 | 困难 | CWE-307 | AUTH-1 | MASWE-0025 | 7.5 | | 21 | NSURLSession Cache | 网络 | 中等 | CWE-200 | STORAGE-3 | MASWE-0010 | 5.0 | | 22 | Excessive Permissions | 存储 | 中等 | CWE-863 | PLATFORM-1 | MASWE-0098 | 5.5 | | 23 | Phishing & UI Redressing | 网络 | 中等 | CWE-1021 | PLATFORM-2 | MASWE-0099 | 6.5 | | 24 | Memory Sensitive Data | 存储 | 困难 | CWE-316 | STORAGE-3 | MASWE-0043 | 6.8 | | 25 | XPC/IPC Communication | 网络 | 困难 | CWE-306 | PLATFORM-2 | MASWE-0056 | 7.5 | ## 快速开始 ### 选项 1:下载 IPA(推荐) 从 [Releases](https://github.com/byjanke/evilcorp-iosios/releases/latest) 下载最新的 IPA。 **越狱设备 (rootless: Dopamine, palera1n, XinaA15):** ``` unzip EvilCorp-v1.0.ipa scp -r Payload/EvilCorp.app root@:/var/root/ ssh root@ cp -r /var/root/EvilCorp.app /var/jb/Applications/ ldid -S ent.plist /var/jb/Applications/EvilCorp.app/EvilCorp uicache -a && killall -9 SpringBoard ``` **非越狱设备 (Sideload):** | 方式 | 有效期 | 指南 | |--------|----------|-------| | **AltStore** | 7 天 (免费) / 1 年 (付费) | [altstore.io](https://altstore.io) | | **Sideloadly** | 7 天 (免费) | [sideloadly.io](https://sideloadly.io) | | **TrollStore** | 永久 (iOS 14-16.5) | [github.com/opa334/TrollStore](https://github.com/opa334/TrollStore) | | **Xcode** | 7 天 (免费 Apple ID) | Xcode → Devices → Install | ### 选项 2:从源码构建 ``` git clone https://github.com/byjanke/evilcorp-iosios cd evilcorp-ios # 单命令构建 swiftc -sdk $(xcrun --sdk iphoneos --show-sdk-path) \ -target arm64-apple-ios16.0 -O -parse-as-library \ -framework SwiftUI WebKit LocalAuthentication Security \ AVFoundation Contacts CoreLocation Photos \ -o EvilCorp.app/EvilCorp EvilCorp/*.swift # 打包为 IPA mkdir -p Payload/EvilCorp.app cp EvilCorp.app/EvilCorp EvilCorp/Info.plist EvilCorp/evilcorp.jpg Payload/EvilCorp.app/ zip -r EvilCorp.ipa Payload/ ``` ## 功能 ### 核心 - 跨越存储、网络、加密、认证领域的 **25 个漏洞** - **自包含 SwiftUI** —— 零外部依赖 - **单文件构建** —— `swiftc EvilCorp/*.swift` - **3.1 MB** arm64 二进制文件,iOS 16+ ### 交互性 - **5 个标签页**:主页 · 实验室 · MASVS · 进度 · 控制台 - **实时控制台** —— 支持过滤的应用内 NSLog 查看器 - **CTF 模式** —— 带评分 (100/200/300 分) 的限时挑战 - **进度追踪** —— 持久化的完成状态、环形图、分类进度条 - **智能搜索** —— 支持 CWE、MASVS、MASWE 及关键字过滤 ### 按挑战划分 - **实验室** —— 交互式漏洞演示 - **提示** —— 3 级逐步解锁 - **Frida 脚本** —— 可直接复制粘贴的绕过脚本 ### 安全配置 (故意存在漏洞) - `NSAllowsArbitraryLoads = true` —— ATS 已禁用 - `UIFileSharingEnabled = true` —— USB 文件访问 - `evilcorp://` URL scheme —— 无输入验证 - `kSecAttrAccessibleAlways` —— Keychain 在锁定状态下可访问 ## 渗透测试快速指南 ``` # 从二进制文件中提取硬编码 secrets grep -ao 'sk_live_evilcorp\|AKIA_EVILCORP\|EvilCorp_Super' EvilCorp # 读取 UserDefaults plist cat /var/mobile/Containers/Data/*/Library/Preferences/com.evilcorp.ios.plist | plutil -p - # Dump SQLite 数据库 sqlite3 /var/mobile/Containers/Data/*/Documents/evilcorp.db "SELECT * FROM users;" # 拦截 HTTP 流量 (ATS 已禁用) mitmproxy --mode transparent # 从系统日志中捕获 credentials idevicesyslog | grep EVILCORP_AUTH # Bypass SSL pinning objection -g com.evilcorp.ios run ios sslpinning disable # Dump Keychain ./keychain_dumper -a | grep evilcorp ``` ## 项目结构 ``` EvilCorp-iOS/ ├── README.md ├── LICENSE ├── .gitignore ├── EvilCorp/ │ ├── EvilCorpApp.swift # @main entry point │ ├── ContentView.swift # All UI (tabs, detail, components) │ ├── EvilCorpChallenge.swift # 25 challenge data model │ ├── Info.plist # ATS bypass + URL scheme │ ├── evilcorp.jpg # App logo │ ├── UserDefaultsChallengeView.swift │ ├── KeychainChallengeView.swift │ ├── PlistChallengeView.swift │ ├── SQLiteChallengeView.swift │ ├── JailbreakChallengeView.swift │ ├── SSLPinningChallengeView.swift │ ├── WebViewXSSChallengeView.swift │ ├── LoggingChallengeView.swift │ ├── HardcodedSecretsChallengeView.swift │ ├── BiometricBypassChallengeView.swift │ ├── CryptoChallengeView.swift │ ├── NetworkChallengeView.swift │ ├── URLSchemeChallengeView.swift │ ├── ScreenshotLeakChallengeView.swift │ ├── AntiDebugChallengeView.swift │ ├── PasteboardChallengeView.swift │ ├── FileSharingChallengeView.swift │ ├── KeyboardCacheChallengeView.swift │ ├── BinaryPatchingChallengeView.swift │ ├── PinBruteforceView.swift │ ├── URLCacheChallengeView.swift │ ├── ExcessivePermsChallengeView.swift │ ├── PhishingChallengeView.swift │ ├── MemorySensitiveChallengeView.swift │ └── XPCChallengeView.swift ``` ## 漏洞与 MASVS 映射 | MASVS | 挑战 | |-------|-----------| | STORAGE-1 | #1, #2, #3, #4, #9 | | STORAGE-2 | #17 | | STORAGE-3 | #8, #14, #16, #18, #21, #24 | | CRYPTO-1 | #11 | | NETWORK-1 | #12 | | NETWORK-2 | #6 | | AUTH-1 | #10, #20 | | RESILIENCE-1 | #5 | | RESILIENCE-4 | #15, #19 | | PLATFORM-1 | #22 | | PLATFORM-2 | #7, #13, #23, #25 | ## 使用的工具 | 分类 | 工具 | |----------|-------| | 静态分析 | Hopper, Ghidra, IDA Pro, radare2, class-dump, strings | | 动态分析 | Frida, Objection, lldb | | 网络 | Burp Suite, mitmproxy, Wireshark | | 数据提取 | Keychain-Dumper, SQLite CLI, plutil | | 部署 | ldid, scp, uicache | ## 免责声明 本应用**仅供教育目的**。请勿部署在生产设备上,或用于非您所有的系统。开发者不对任何滥用行为承担责任。 ## 支持 如果这个项目对您有帮助: [![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-sevbandonmez-FFDD00?style=flat&logo=buymeacoffee&logoColor=black)](https://www.buymeacoffee.com/sevbandonmez) ## 许可证 GPLv3 —— 详见 [LICENSE](LICENSE)
标签:iOS, OPA, 云资产清单, 安全训练, 目录枚举, 移动安全, 逆向工程, 靶场