ineedcodes 1.6.0 → 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 +47 -11
- package/src/skills.js +30 -6
- package/src/ui.js +1 -1
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
# Frida Script Templates for Android Testing
|
|
2
|
+
|
|
3
|
+
> **AI LOAD INSTRUCTION**: Load this when you need ready-to-use Frida scripts for Android application testing. Covers SSL pinning bypass, root detection bypass, method tracing, crypto hooks, and WebView debugging. Assumes the main [SKILL.md](./SKILL.md) is already loaded for general Android testing methodology.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. UNIVERSAL SSL PINNING BYPASS
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
// frida_ssl_bypass.js — hooks multiple SSL validation points
|
|
11
|
+
Java.perform(function() {
|
|
12
|
+
|
|
13
|
+
// Hook TrustManager
|
|
14
|
+
var TrustManager = Java.registerClass({
|
|
15
|
+
name: 'com.frida.TrustManager',
|
|
16
|
+
implements: [Java.use('javax.net.ssl.X509TrustManager')],
|
|
17
|
+
methods: {
|
|
18
|
+
checkClientTrusted: function(chain, authType) {},
|
|
19
|
+
checkServerTrusted: function(chain, authType) {},
|
|
20
|
+
getAcceptedIssuers: function() { return []; }
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
var SSLContext = Java.use('javax.net.ssl.SSLContext');
|
|
25
|
+
SSLContext.init.overload(
|
|
26
|
+
'[Ljavax.net.ssl.KeyManager;',
|
|
27
|
+
'[Ljavax.net.ssl.TrustManager;',
|
|
28
|
+
'java.security.SecureRandom'
|
|
29
|
+
).implementation = function(km, tm, sr) {
|
|
30
|
+
this.init(km, [TrustManager.$new()], sr);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// Hook OkHttp3 CertificatePinner
|
|
34
|
+
try {
|
|
35
|
+
var CertPinner = Java.use('okhttp3.CertificatePinner');
|
|
36
|
+
CertPinner.check.overload('java.lang.String', 'java.util.List')
|
|
37
|
+
.implementation = function(hostname, peerCerts) {
|
|
38
|
+
return; // skip pinning check
|
|
39
|
+
};
|
|
40
|
+
} catch(e) {}
|
|
41
|
+
|
|
42
|
+
// Hook OkHttp3 CertificatePinner.check$okhttp
|
|
43
|
+
try {
|
|
44
|
+
var CertPinner = Java.use('okhttp3.CertificatePinner');
|
|
45
|
+
CertPinner['check$okhttp'].implementation = function(hostname, fn) {
|
|
46
|
+
return;
|
|
47
|
+
};
|
|
48
|
+
} catch(e) {}
|
|
49
|
+
|
|
50
|
+
// Hook HttpsURLConnection
|
|
51
|
+
try {
|
|
52
|
+
var HttpsConn = Java.use('javax.net.ssl.HttpsURLConnection');
|
|
53
|
+
HttpsConn.setSSLSocketFactory.implementation = function(factory) {
|
|
54
|
+
return; // prevent custom factory
|
|
55
|
+
};
|
|
56
|
+
HttpsConn.setHostnameVerifier.implementation = function(verifier) {
|
|
57
|
+
return; // prevent custom verifier
|
|
58
|
+
};
|
|
59
|
+
} catch(e) {}
|
|
60
|
+
|
|
61
|
+
console.log('[+] SSL Pinning bypassed');
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 2. ROOT DETECTION BYPASS
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
// frida_root_bypass.js — comprehensive root detection bypass
|
|
71
|
+
Java.perform(function() {
|
|
72
|
+
|
|
73
|
+
// Hook File.exists for su binary checks
|
|
74
|
+
var File = Java.use('java.io.File');
|
|
75
|
+
var rootPaths = ['/system/xbin/su', '/sbin/su', '/system/bin/su',
|
|
76
|
+
'/system/su', '/data/local/xbin/su', '/data/local/bin/su',
|
|
77
|
+
'/su/bin/su', '/magisk/.core/bin/su'];
|
|
78
|
+
|
|
79
|
+
File.exists.implementation = function() {
|
|
80
|
+
var path = this.getAbsolutePath();
|
|
81
|
+
for (var i = 0; i < rootPaths.length; i++) {
|
|
82
|
+
if (path === rootPaths[i]) {
|
|
83
|
+
console.log('[Root Bypass] File.exists blocked: ' + path);
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return this.exists();
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// Hook Build.TAGS
|
|
91
|
+
var Build = Java.use('android.os.Build');
|
|
92
|
+
Build.TAGS.value = 'release-keys';
|
|
93
|
+
|
|
94
|
+
// Hook PackageManager for Magisk/SuperSU detection
|
|
95
|
+
var PM = Java.use('android.app.ApplicationPackageManager');
|
|
96
|
+
var rootPackages = ['com.topjohnwu.magisk', 'eu.chainfire.supersu',
|
|
97
|
+
'com.koushikdutta.superuser', 'com.noshufou.android.su'];
|
|
98
|
+
|
|
99
|
+
PM.getPackageInfo.overload('java.lang.String', 'int').implementation = function(name, flags) {
|
|
100
|
+
for (var i = 0; i < rootPackages.length; i++) {
|
|
101
|
+
if (name === rootPackages[i]) {
|
|
102
|
+
console.log('[Root Bypass] PM.getPackageInfo blocked: ' + name);
|
|
103
|
+
throw Java.use('android.content.pm.PackageManager$NameNotFoundException').$new(name);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return this.getPackageInfo(name, flags);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// Hook Runtime.exec for "which su" checks
|
|
110
|
+
var Runtime = Java.use('java.lang.Runtime');
|
|
111
|
+
Runtime.exec.overload('java.lang.String').implementation = function(cmd) {
|
|
112
|
+
if (cmd.indexOf('su') !== -1 || cmd.indexOf('which') !== -1) {
|
|
113
|
+
console.log('[Root Bypass] Runtime.exec blocked: ' + cmd);
|
|
114
|
+
throw Java.use('java.io.IOException').$new('Command not found');
|
|
115
|
+
}
|
|
116
|
+
return this.exec(cmd);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Hook System.getProperty for ro.debuggable etc.
|
|
120
|
+
var System = Java.use('java.lang.System');
|
|
121
|
+
System.getProperty.overload('java.lang.String').implementation = function(key) {
|
|
122
|
+
if (key === 'ro.debuggable') return '0';
|
|
123
|
+
if (key === 'ro.secure') return '1';
|
|
124
|
+
return this.getProperty(key);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
console.log('[+] Root detection bypassed');
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 3. METHOD TRACER
|
|
134
|
+
|
|
135
|
+
```javascript
|
|
136
|
+
// frida_trace_methods.js — trace all methods of a class
|
|
137
|
+
Java.perform(function() {
|
|
138
|
+
|
|
139
|
+
function traceClass(className) {
|
|
140
|
+
var clazz = Java.use(className);
|
|
141
|
+
var methods = clazz.class.getDeclaredMethods();
|
|
142
|
+
|
|
143
|
+
methods.forEach(function(method) {
|
|
144
|
+
var methodName = method.getName();
|
|
145
|
+
var overloads = clazz[methodName].overloads;
|
|
146
|
+
|
|
147
|
+
overloads.forEach(function(overload) {
|
|
148
|
+
overload.implementation = function() {
|
|
149
|
+
var args = Array.prototype.slice.call(arguments);
|
|
150
|
+
console.log('[TRACE] ' + className + '.' + methodName +
|
|
151
|
+
'(' + args.map(function(a) { return String(a); }).join(', ') + ')');
|
|
152
|
+
|
|
153
|
+
var ret = this[methodName].apply(this, arguments);
|
|
154
|
+
console.log('[TRACE] ' + className + '.' + methodName +
|
|
155
|
+
' => ' + String(ret));
|
|
156
|
+
return ret;
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
console.log('[+] Tracing ' + methods.length + ' methods in ' + className);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Usage: trace target class
|
|
165
|
+
traceClass('com.target.app.api.AuthService');
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 4. CRYPTO HOOK (KEY & PLAINTEXT EXTRACTION)
|
|
172
|
+
|
|
173
|
+
```javascript
|
|
174
|
+
// frida_crypto_hooks.js — capture encryption keys and plaintext
|
|
175
|
+
Java.perform(function() {
|
|
176
|
+
|
|
177
|
+
// Hook Cipher.init to capture keys
|
|
178
|
+
var Cipher = Java.use('javax.crypto.Cipher');
|
|
179
|
+
Cipher.init.overload('int', 'java.security.Key').implementation = function(mode, key) {
|
|
180
|
+
var algo = this.getAlgorithm();
|
|
181
|
+
var keyBytes = key.getEncoded();
|
|
182
|
+
console.log('[Crypto] Cipher.init: algo=' + algo +
|
|
183
|
+
' mode=' + (mode === 1 ? 'ENCRYPT' : 'DECRYPT') +
|
|
184
|
+
' key=' + bytesToHex(keyBytes));
|
|
185
|
+
return this.init(mode, key);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// Hook Cipher.doFinal to capture plaintext/ciphertext
|
|
189
|
+
Cipher.doFinal.overload('[B').implementation = function(data) {
|
|
190
|
+
console.log('[Crypto] Cipher.doFinal input (' + data.length + ' bytes): ' +
|
|
191
|
+
bytesToHex(data));
|
|
192
|
+
var result = this.doFinal(data);
|
|
193
|
+
console.log('[Crypto] Cipher.doFinal output (' + result.length + ' bytes): ' +
|
|
194
|
+
bytesToHex(result));
|
|
195
|
+
return result;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// Hook SecretKeySpec constructor
|
|
199
|
+
var SecretKeySpec = Java.use('javax.crypto.spec.SecretKeySpec');
|
|
200
|
+
SecretKeySpec.$init.overload('[B', 'java.lang.String').implementation = function(key, algo) {
|
|
201
|
+
console.log('[Crypto] SecretKeySpec: algo=' + algo + ' key=' + bytesToHex(key));
|
|
202
|
+
return this.$init(key, algo);
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// Hook MessageDigest (hash operations)
|
|
206
|
+
var MessageDigest = Java.use('java.security.MessageDigest');
|
|
207
|
+
MessageDigest.digest.overload('[B').implementation = function(data) {
|
|
208
|
+
var algo = this.getAlgorithm();
|
|
209
|
+
console.log('[Crypto] ' + algo + '.digest input: ' + bytesToHex(data));
|
|
210
|
+
var result = this.digest(data);
|
|
211
|
+
console.log('[Crypto] ' + algo + '.digest output: ' + bytesToHex(result));
|
|
212
|
+
return result;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
function bytesToHex(bytes) {
|
|
216
|
+
if (!bytes) return 'null';
|
|
217
|
+
var hex = [];
|
|
218
|
+
for (var i = 0; i < bytes.length; i++) {
|
|
219
|
+
hex.push(('0' + (bytes[i] & 0xFF).toString(16)).slice(-2));
|
|
220
|
+
}
|
|
221
|
+
return hex.join('');
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
console.log('[+] Crypto hooks installed');
|
|
225
|
+
});
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 5. WEBVIEW DEBUGGING ENABLER
|
|
231
|
+
|
|
232
|
+
```javascript
|
|
233
|
+
// frida_webview_debug.js — enable WebView debugging for all WebViews
|
|
234
|
+
Java.perform(function() {
|
|
235
|
+
|
|
236
|
+
// Enable WebView debugging globally
|
|
237
|
+
var WebView = Java.use('android.webkit.WebView');
|
|
238
|
+
WebView.setWebContentsDebuggingEnabled(true);
|
|
239
|
+
|
|
240
|
+
// Hook loadUrl to log all URLs loaded
|
|
241
|
+
WebView.loadUrl.overload('java.lang.String').implementation = function(url) {
|
|
242
|
+
console.log('[WebView] loadUrl: ' + url);
|
|
243
|
+
return this.loadUrl(url);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
WebView.loadUrl.overload('java.lang.String', 'java.util.Map').implementation = function(url, headers) {
|
|
247
|
+
console.log('[WebView] loadUrl: ' + url + ' headers: ' + headers);
|
|
248
|
+
return this.loadUrl(url, headers);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// Hook evaluateJavascript
|
|
252
|
+
WebView.evaluateJavascript.implementation = function(script, callback) {
|
|
253
|
+
console.log('[WebView] evaluateJavascript: ' + script);
|
|
254
|
+
return this.evaluateJavascript(script, callback);
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// Hook addJavascriptInterface to log bridge objects
|
|
258
|
+
WebView.addJavascriptInterface.implementation = function(obj, name) {
|
|
259
|
+
console.log('[WebView] addJavascriptInterface: name=' + name +
|
|
260
|
+
' class=' + obj.getClass().getName());
|
|
261
|
+
return this.addJavascriptInterface(obj, name);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
console.log('[+] WebView debugging enabled');
|
|
265
|
+
});
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## 6. SHARED PREFERENCES DUMPER
|
|
271
|
+
|
|
272
|
+
```javascript
|
|
273
|
+
// frida_dump_prefs.js — dump all SharedPreferences
|
|
274
|
+
Java.perform(function() {
|
|
275
|
+
var ctx = Java.use('android.app.ActivityThread').currentApplication().getApplicationContext();
|
|
276
|
+
var prefsDir = ctx.getFilesDir().getParent() + '/shared_prefs/';
|
|
277
|
+
|
|
278
|
+
var File = Java.use('java.io.File');
|
|
279
|
+
var dir = File.$new(prefsDir);
|
|
280
|
+
var files = dir.listFiles();
|
|
281
|
+
|
|
282
|
+
if (files) {
|
|
283
|
+
for (var i = 0; i < files.length; i++) {
|
|
284
|
+
var name = files[i].getName().replace('.xml', '');
|
|
285
|
+
var prefs = ctx.getSharedPreferences(name, 0);
|
|
286
|
+
var all = prefs.getAll();
|
|
287
|
+
var entries = all.entrySet().iterator();
|
|
288
|
+
|
|
289
|
+
console.log('\n[SharedPrefs] === ' + name + ' ===');
|
|
290
|
+
while (entries.hasNext()) {
|
|
291
|
+
var entry = entries.next();
|
|
292
|
+
console.log(' ' + entry.getKey() + ' = ' + entry.getValue());
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## 7. INTENT SNIFFER
|
|
302
|
+
|
|
303
|
+
```javascript
|
|
304
|
+
// frida_intent_sniffer.js — log all intents sent/received
|
|
305
|
+
Java.perform(function() {
|
|
306
|
+
|
|
307
|
+
var Activity = Java.use('android.app.Activity');
|
|
308
|
+
Activity.startActivity.overload('android.content.Intent').implementation = function(intent) {
|
|
309
|
+
console.log('[Intent] startActivity: ' + intent.toString());
|
|
310
|
+
if (intent.getExtras()) {
|
|
311
|
+
console.log('[Intent] extras: ' + intent.getExtras().toString());
|
|
312
|
+
}
|
|
313
|
+
return this.startActivity(intent);
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
Activity.startActivityForResult.overload('android.content.Intent', 'int')
|
|
317
|
+
.implementation = function(intent, requestCode) {
|
|
318
|
+
console.log('[Intent] startActivityForResult: ' + intent.toString() +
|
|
319
|
+
' requestCode=' + requestCode);
|
|
320
|
+
return this.startActivityForResult(intent, requestCode);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
var Context = Java.use('android.content.ContextWrapper');
|
|
324
|
+
Context.sendBroadcast.overload('android.content.Intent').implementation = function(intent) {
|
|
325
|
+
console.log('[Intent] sendBroadcast: ' + intent.toString());
|
|
326
|
+
return this.sendBroadcast(intent);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
console.log('[+] Intent sniffer installed');
|
|
330
|
+
});
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## 8. BIOMETRIC BYPASS
|
|
336
|
+
|
|
337
|
+
```javascript
|
|
338
|
+
// frida_biometric_bypass.js — bypass fingerprint/face authentication
|
|
339
|
+
Java.perform(function() {
|
|
340
|
+
|
|
341
|
+
// BiometricPrompt (API 28+)
|
|
342
|
+
try {
|
|
343
|
+
var BiometricCallback = Java.use('android.hardware.biometrics.BiometricPrompt$AuthenticationCallback');
|
|
344
|
+
BiometricCallback.onAuthenticationSucceeded.implementation = function(result) {
|
|
345
|
+
console.log('[Biometric] Forcing authentication success');
|
|
346
|
+
this.onAuthenticationSucceeded(result);
|
|
347
|
+
};
|
|
348
|
+
BiometricCallback.onAuthenticationFailed.implementation = function() {
|
|
349
|
+
console.log('[Biometric] Intercepting failure → forcing success');
|
|
350
|
+
// Don't call original — suppress failure
|
|
351
|
+
};
|
|
352
|
+
} catch(e) {}
|
|
353
|
+
|
|
354
|
+
// AndroidX BiometricPrompt
|
|
355
|
+
try {
|
|
356
|
+
var AxCallback = Java.use('androidx.biometric.BiometricPrompt$AuthenticationCallback');
|
|
357
|
+
AxCallback.onAuthenticationFailed.implementation = function() {
|
|
358
|
+
console.log('[Biometric] AndroidX failure suppressed');
|
|
359
|
+
};
|
|
360
|
+
} catch(e) {}
|
|
361
|
+
|
|
362
|
+
// FingerprintManager (legacy, pre-API 28)
|
|
363
|
+
try {
|
|
364
|
+
var FPCallback = Java.use('android.hardware.fingerprint.FingerprintManager$AuthenticationCallback');
|
|
365
|
+
FPCallback.onAuthenticationFailed.implementation = function() {
|
|
366
|
+
console.log('[Biometric] Legacy FP failure suppressed');
|
|
367
|
+
};
|
|
368
|
+
} catch(e) {}
|
|
369
|
+
|
|
370
|
+
console.log('[+] Biometric bypass hooks installed');
|
|
371
|
+
});
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## 9. SCRIPT USAGE QUICK REFERENCE
|
|
377
|
+
|
|
378
|
+
| Script | Command | Use Case |
|
|
379
|
+
|---|---|---|
|
|
380
|
+
| SSL bypass | `frida -U -l frida_ssl_bypass.js -f com.target` | Intercept HTTPS traffic |
|
|
381
|
+
| Root bypass | `frida -U -l frida_root_bypass.js -f com.target` | Run on rooted device without detection |
|
|
382
|
+
| Method tracer | `frida -U -l frida_trace_methods.js -f com.target` | Understand app logic |
|
|
383
|
+
| Crypto hooks | `frida -U -l frida_crypto_hooks.js -f com.target` | Extract keys, see plaintext |
|
|
384
|
+
| WebView debug | `frida -U -l frida_webview_debug.js -f com.target` | Inspect WebView URLs and bridges |
|
|
385
|
+
| Prefs dumper | `frida -U -l frida_dump_prefs.js -f com.target` | Extract stored credentials/tokens |
|
|
386
|
+
| Intent sniffer | `frida -U -l frida_intent_sniffer.js -f com.target` | Monitor IPC |
|
|
387
|
+
| Biometric bypass | `frida -U -l frida_biometric_bypass.js -f com.target` | Skip fingerprint/face auth |
|
|
388
|
+
|
|
389
|
+
Common flags:
|
|
390
|
+
- `-f`: spawn app (fresh start)
|
|
391
|
+
- `-U`: USB-connected device
|
|
392
|
+
- `-F`: attach to frontmost app
|
|
393
|
+
- `--no-pause`: don't pause on spawn (auto-resume)
|
|
394
|
+
- `-H host:port`: remote Frida server
|