Last active
January 7, 2019 03:41
-
-
Save tiiime/101d659f2161a9a9cf894492f289e6ec to your computer and use it in GitHub Desktop.
android network security config bypass with frida
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -O https://build.frida.re/frida/android/arm/bin/frida-server | |
adb push frida-server /data/local/tmp/ | |
adb shell "chmod 755 /data/local/tmp/frida-server" | |
adb shell "/data/local/tmp/frida-server &" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// frida -U -l network-security-config-bypass.js --no-pause -f tv.danmaku.bili | |
Java.perform(function(){ | |
NetworkSecurityConfig_Builder =Java.use("android.security.net.config.NetworkSecurityConfig$Builder") | |
CertificatesEntryRef = Java.use("android.security.net.config.CertificatesEntryRef") | |
CertificateSource = Java.use("android.security.net.config.CertificateSource") | |
UserCertificateSource = Java.use("android.security.net.config.UserCertificateSource") | |
NetworkSecurityConfig_Builder.getEffectiveCertificatesEntryRefs.implementation = function(){ | |
origin = this.getEffectiveCertificatesEntryRefs() | |
source = UserCertificateSource.getInstance() | |
userCert = CertificatesEntryRef.$new(source,true) | |
origin.add(userCert) | |
return origin | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment