Frida is a dynamic instrumentation toolkit that allows you to inject JavaScript into native iOS applications to hook functions, trace calls, modify behavior, and bypass security controls at runtime.
# Install Python 3 first from python.org# Install Fridapip install frida-tools# Verifyfrida --version
2
Install Frida on iOS Device
Requires a jailbroken iOS device. Frida does not work on stock iOS devices.
# Add Frida repository to Cydia/Sileo# Open Cydia → Sources → Edit → Add# URL: https://build.frida.re# Search for "Frida" and install# This installs frida-server on the device
Or manually via SSH:
# SSH to devicessh root@<device-ip># Download frida-server for your iOS versionwget https://github.com/frida/frida/releases/download/16.x.x/frida-server-16.x.x-ios-arm64.deb# Installdpkg -i frida-server-16.x.x-ios-arm64.deb# Start frida-serverfrida-server &
3
Verify Connection
# List running processes on devicefrida-ps -U# Should show iOS processes like:# PID Name# --- ----# 123 SpringBoard# 456 Safari# 789 YourApp
-U flag means “USB device”. Use -H <device-ip> for network connection.
// Hook a simple methodif (ObjC.available) { // Get class reference var LoginViewController = ObjC.classes.LoginViewController; // Hook instance method var validateMethod = LoginViewController['- validateCredentials:password:']; Interceptor.attach(validateMethod.implementation, { onEnter: function(args) { // args[0] = self // args[1] = selector // args[2] = first argument (username) // args[3] = second argument (password) var username = ObjC.Object(args[2]).toString(); var password = ObjC.Object(args[3]).toString(); console.log("[+] validateCredentials called"); console.log(" Username: " + username); console.log(" Password: " + password); }, onLeave: function(retval) { console.log(" Return value: " + retval); // Modify return value to always return true retval.replace(ptr(1)); } }); console.log("[*] Hooked validateCredentials:password:");}
// Swift method names are mangled// Find mangled name using: frida-trace -U -m "*[* *login*]" YourAppif (ObjC.available) { // Example mangled Swift name var className = "_TtC6MyApp19LoginViewController"; var methodName = "- authenticateWithUsername:password:"; var LoginVC = ObjC.classes[className]; var method = LoginVC[methodName]; Interceptor.attach(method.implementation, { onEnter: function(args) { console.log("[+] Swift authentication called"); // Swift strings are more complex var username = ObjC.Object(args[2]); console.log(" Username: " + username); }, onLeave: function(retval) { console.log(" Original result: " + retval); } });}
// Use frida-ios-dump tool// Install: pip install frida-ios-dump// On your computer:frida-ios-dump -H <device-ip> -u com.example.app// Or with USB:frida-ios-dump -U com.example.app// This will:// 1. Attach to the running app// 2. Dump decrypted binary from memory// 3. Package it as an IPA// 4. Save to current directory