-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnougat.js
More file actions
25 lines (23 loc) · 1.2 KB
/
nougat.js
File metadata and controls
25 lines (23 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Java.perform(function x() {
console.log("");
console.log("[.] Android Nougat Trust CAs Bypass");
try{
var ANDROID_VERSION_M = 23;
var DefaultConfigSource = Java.use("android.security.net.config.ManifestConfigSource$DefaultConfigSource");
var NetworkSecurityConfig = Java.use("android.security.net.config.NetworkSecurityConfig");
DefaultConfigSource.$init.overload("boolean", "int").implementation = function(usesCleartextTraffic, targetSdkVersion){
console.log("[-] Nougat Modifying DefaultConfigSource constructor");
return this.$init.overload("boolean", "int").call(this, usesCleartextTraffic, ANDROID_VERSION_M);
};
NetworkSecurityConfig.getDefaultBuilder.overload("int").implementation = function(targetSdkVersion){
console.log("[-] Nougat getDefaultBuilder original targetSdkVersion => " + targetSdkVersion.toString());
return this.getDefaultBuilder.overload("int").call(this, ANDROID_VERSION_M);
};
}catch(err){}
try {
var TrustManagerImpl = Java.use('com.android.org.conscrypt.TrustManagerImpl');
TrustManagerImpl.verifyChain.implementation = function (untrustedChain, trustAnchorChain, host, clientAuth, ocspData, tlsSctData) {
return untrustedChain;
}
}catch (err) {}
});