Skip to content

Commit 8a70915

Browse files
authored
Merge pull request #1916 from HackTricks-wiki/research_update_src_mobile-pentesting_android-app-pentesting_android-anti-instrumentation-and-ssl-pinning-bypass_20260219_024214
Research Update Enhanced src/mobile-pentesting/android-app-p...
2 parents bd576dc + 2b23d68 commit 8a70915

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

src/mobile-pentesting/android-app-pentesting/android-anti-instrumentation-and-ssl-pinning-bypass.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ Many apps only look for obvious indicators (su/Magisk paths/getprop). DenyList o
2323
References:
2424
- Magisk (Zygisk & DenyList): https://github.com/topjohnwu/Magisk
2525

26+
### Play Integrity / Zygisk detections (post‑SafetyNet)
27+
28+
Newer banking/ID apps tie runtime checks to Google Play Integrity (SafetyNet replacement) and can also crash if Zygisk itself is present. Quick triage tips:
29+
30+
- Temporarily disable Zygisk (toggle off + reboot) and retry; some apps crash as soon as Zygote injection loads.
31+
- If attestation blocks login, patch Google Play Services with PlayIntegrityFix/Fork + TrickyStore or use ReZygisk/Zygisk‑Next only when testing. Keep the target in DenyList and avoid LSPosed modules that leak props.
32+
- For one‑off runs, use KernelSU/APatch (no Zygote injection) to stay under Zygisk heuristics, then attach Frida.
33+
2634
## Step 2 — 30‑second Frida Codeshare tests
2735

2836
Try common drop‑in scripts before deep diving:
@@ -185,6 +193,41 @@ Notes
185193
- Extend for OkHttp: hook okhttp3.CertificatePinner and HostnameVerifier as needed, or use a universal unpinning script from CodeShare.
186194
- Run example: `frida -U -f com.target.app -l ssl-bypass.js --no-pause`
187195

196+
### OkHttp4 / gRPC / Cronet pinning (2024+)
197+
198+
Modern stacks pin inside newer APIs (OkHttp4+, gRPC over Cronet/BoringSSL). Add these hooks when the basic SSLContext hook hangs:
199+
200+
```js
201+
Java.perform(() => {
202+
try {
203+
const Pinner = Java.use('okhttp3.CertificatePinner');
204+
Pinner.check.overload('java.lang.String', 'java.util.List').implementation = function(){};
205+
Pinner.check$okhttp.implementation = function(){};
206+
} catch (e) {}
207+
208+
try {
209+
const CronetB = Java.use('org.chromium.net.CronetEngine$Builder');
210+
CronetB.enablePublicKeyPinningBypassForLocalTrustAnchors.overload('boolean').implementation = function(){ return this; };
211+
CronetB.setPublicKeyPins.overload('java.lang.String', 'java.util.Set', 'boolean').implementation = function(){ return this; };
212+
} catch (e) {}
213+
});
214+
```
215+
216+
If TLS still fails, drop to native and patch BoringSSL verification entry points used by Cronet/gRPC:
217+
218+
```js
219+
const customVerify = Module.findExportByName(null, 'SSL_CTX_set_custom_verify');
220+
if (customVerify) {
221+
Interceptor.attach(customVerify, {
222+
onEnter(args){
223+
// arg0 = SSL_CTX*, arg1 = mode, arg2 = callback
224+
args[1] = ptr(0); // SSL_VERIFY_NONE
225+
args[2] = NULL; // disable callback
226+
}
227+
});
228+
}
229+
```
230+
188231
## Step 6 — Follow the JNI/native trail when Java hooks fail
189232

190233
Trace JNI entry points to locate native loaders and detection init:
@@ -322,5 +365,7 @@ Notes
322365
- [Magisk](https://github.com/topjohnwu/Magisk)
323366
- [Medusa (Android Frida framework)](https://github.com/Ch0pin/medusa)
324367
- [Build a Repeatable Android Bug Bounty Lab: Emulator vs Magisk, Burp, Frida, and Medusa](https://www.yeswehack.com/learn-bug-bounty/android-lab-mobile-hacking-tools)
368+
- [Frida OkHttp4 SSL pinning bypass script](https://github.com/Zero3141/Frida-OkHttp-Bypass)
369+
- [XDA guide to strong Play Integrity bypass (2025)](https://xdaforums.com/t/updated-11-17-2025-guide-get-strong-integrity-fix-banking-apps-revolut-google-wallet-android-16-working.4753805/)
325370

326371
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)