Chuyển đến nội dung
Skillpedia
Bảo mật35k · #8352

reverse-engineering-ios-app-with-frida

Skill này làm gì

Công cụ này giúp tìm hiểu cách một ứng dụng iPhone hoạt động bên trong, ngay cả khi không có mã gốc. Nó cho phép bạn xem ứng dụng đang làm gì theo thời gian thực, giao tiếp với các dịch vụ khác như thế nào hoặc bảo vệ thông tin ra sao.

Khi nào nên dùng

  • ✓Khi bạn cần hiểu một ứng dụng để kiểm thử bảo mật (với sự cho phép).
  • ✓Khi bạn muốn tìm hiểu cách một ứng dụng lưu trữ hoặc dùng thông tin bí mật, như mật khẩu hoặc khóa mã hóa.
  • ✓Khi bạn muốn xem ứng dụng xử lý và bảo vệ dữ liệu quan trọng như thế nào.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/reverse-engineering-ios-app-with-frida/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/reverse-engineering-ios-app-with-frida/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tìm hiểu ứng dụng 'MyApp' để xem nó lưu thông tin đăng nhập của người dùng như thế nào.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ kết nối với ứng dụng đang chạy trên iPhone của bạn và quan sát các hành động bên trong. Nó có thể cho biết hàm nào đang được gọi, dữ liệu nào đang được trao đổi và thậm chí cho phép bạn thay đổi hành vi của ứng dụng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Reverse Engineering iOS App with Frida

When to Use

Use this skill when:

  • Analyzing iOS app internals during authorized security assessments without source code
  • Extracting encryption keys, API secrets, or proprietary protocol details from running iOS apps
  • Understanding obfuscated Swift/Objective-C logic through runtime method tracing
  • Bypassing complex security mechanisms (jailbreak detection, anti-tampering, anti-debugging)

Do not use this skill for unauthorized reverse engineering that violates terms of service or intellectual property law.

Prerequisites

  • Jailbroken iOS device with Frida server installed via Cydia/Sileo, or non-jailbroken device with Frida Gadget-injected IPA
  • Python 3.10+ with frida-tools (pip install frida-tools)
  • USB connection to iOS device
  • class-dump or dsdump for Objective-C header extraction
  • Hopper Disassembler or Ghidra for static binary analysis (complementary)
  • Knowledge of Objective-C runtime and Swift name mangling

Workflow

Step 1: Extract and Analyze the Binary

# On jailbroken device, find app binary
ssh root@<device_ip>
find /var/containers/Bundle/Application/ -name "TargetApp" -type f

# Pull decrypted binary (apps from App Store are encrypted with FairPlay)
# Use frida-ios-dump or Clutch for decryption
pip install frida-ios-dump
dump.py com.target.app

# Extract Objective-C class headers
class-dump -H decrypted_binary -o headers/
ls headers/  # Lists all class header files

Step 2: Enumerate Classes and Methods at Runtime

// enumerate_classes.js - List all loaded classes
Java.perform(function() {});  // N/A for iOS

// iOS uses ObjC runtime
if (ObjC.available) {
    var classes = ObjC.classes;
    for (var className in classes) {
        if (className.indexOf("Target") !== -1 ||
            className.indexOf("Auth") !== -1 ||
            className.indexOf("Crypto") !== -1) {
            console.log("[Class] " + className);

            // List methods
            var methods = classes[className].$ownMethods;
            for (var i = 0; i < methods.length; i++) {
                console.log("  [Method] " + methods[i]);
            }
        }
    }
}
frida -U -n TargetApp -l enumerate_classes.js

Step 3: Trace Method Calls with frida-trace

# Trace all methods of a class
frida-trace -U -n TargetApp -m "*[TargetAuth *]"

# Trace specific patterns
frida-trace -U -n TargetApp -m "*[*Crypto* *]"
frida-trace -U -n TargetApp -m "*[*KeyChain* *]"
frida-trace -U -n TargetApp -m "*[*Token* *]"

# Trace Swift methods (mangled names)
frida-trace -U -n TargetApp -m "*[*$s*Auth*]"

Step 4: Hook and Modify Method Behavior

// hook_auth.js - Intercept authentication logic
if (ObjC.available) {
    // Hook Objective-C method
    var AuthManager = ObjC.classes.AuthManager;
    if (AuthManager) {
        Interceptor.attach(AuthManager["- validateToken:"].implementation, {
            onEnter: function(args) {
                // args[0] = self, args[1] = selector, args[2+] = method args
                var token = new ObjC.Object(args[2]);
                console.log("[Auth] validateToken called with: " + token.toString());
            },
            onLeave: function(retval) {
                console.log("[Auth] validateToken returned: " + retval);
                // Optionally modify return value
                // retval.replace(ptr(1));  // Force return true
            }
        });
    }

    // Hook CommonCrypto for encryption analysis
    var CCCrypt = Module.findExportByName("libcommonCrypto.dylib", "CCCrypt");
    if (CCCrypt) {
        Interceptor.attach(CCCrypt, {
            onEnter: function(args) {
                this.operation = args[0].toInt32();  // 0=encrypt, 1=decrypt
                this.algorithm = args[1].toInt32();  // 0=AES128, 1=DES, 2=3DES
                this.keyLength = args[4].toInt32();
                this.key = Memory.readByteArray(args[3], this.keyLength);
                console.log("[CCCrypt] Op:" + (this.operation === 0 ? "Encrypt" : "Decrypt"));
                console.log("[CCCrypt] Key: " + hexify(this.key));
            },
            onLeave: function(retval) {
                console.log("[CCCrypt] Status: " + retval);
            }
        });
    }
}

function hexify(buffer) {
    var bytes = new Uint8Array(buffer);
    var hex = [];
    for (var i = 0; i < bytes.length; i++) {

…
Câu hỏi thường gặp

Tôi có cần một chiếc iPhone đặc biệt không?

Có, thường cần iPhone đã jailbreak (một cách sửa đổi để có nhiều quyền kiểm soát hơn) hoặc một ứng dụng đã được chỉnh sửa để công cụ hoạt động.

Việc này có hợp pháp không?

Chỉ nên dùng trên các ứng dụng mà bạn được phép điều tra, chẳng hạn như trong kiểm thử bảo mật có ủy quyền. Dùng với ứng dụng khác có thể vi phạm pháp luật hoặc điều khoản dịch vụ.

“Method” và “class” là gì?

Hãy hình dung 'class' là các loại khối xây dựng của ứng dụng, còn 'method' là các hành động mà những khối đó có thể thực hiện. Công cụ cho phép bạn xem và thậm chí tương tác với các hành động này.

Chi tiết

Mô tả gốc của tác giả

Reverse engineers iOS applications using Frida dynamic instrumentation to understand internal logic, extract encryption keys, bypass security controls, and discover hidden functionality without source code access. Use when performing authorized iOS penetration testing, analyzing proprietary protocols, understanding obfuscated logic, or extracting runtime secrets from iOS binaries. Activates for re

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8352
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự