diff --git a/README.md b/README.md
index c597c84..1540061 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
# friTap
-![version](https://img.shields.io/badge/version-1.2.2.0-blue) [![PyPI version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=py&r=r&ts=1683906897&type=6e&v=1.2.2.0&x2=0)](https://badge.fury.io/py/friTap)
+![version](https://img.shields.io/badge/version-1.2.2.8-blue) [![PyPI version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=py&r=r&ts=1683906897&type=6e&v=1.2.2.8&x2=0)](https://badge.fury.io/py/friTap)
The goal of this project is to help researchers to analyze traffic encapsulated in SSL or TLS. For details have a view into the [OSDFCon webinar slides](assets/friTapOSDFConwebinar.pdf) or in [this blog post](https://lolcads.github.io/posts/2022/08/fritap/).
diff --git a/agent/android/android_agent.ts b/agent/android/android_agent.ts
index 6a513ff..bde18db 100644
--- a/agent/android/android_agent.ts
+++ b/agent/android/android_agent.ts
@@ -8,6 +8,7 @@ import { mbedTLS_execute } from "./mbedTLS_android.js";
import { boring_execute } from "./openssl_boringssl_android.js";
import { java_execute} from "./android_java_tls_libs.js";
import { cronet_execute } from "./cronet_android.js";
+import { flutter_execute } from "./flutter_android.js";
var plattform_name = "linux";
@@ -77,6 +78,7 @@ export function load_android_hooking_agent() {
[/.*libssl_sb.so/, invokeHookingFunction(boring_execute)],
[/.*libssl\.so/, invokeHookingFunction(boring_execute)],
[/.*cronet.*\.so/, invokeHookingFunction(cronet_execute)],
+ [/.*flutter.*\.so/, invokeHookingFunction(flutter_execute)],
[/.*libgnutls\.so/, invokeHookingFunction(gnutls_execute)],
[/.*libwolfssl\.so/, invokeHookingFunction(wolfssl_execute)],
[/.*libnspr[0-9]?\.so/,invokeHookingFunction(nss_execute)],
diff --git a/agent/android/conscrypt.ts b/agent/android/conscrypt.ts
index d7e3526..9388321 100644
--- a/agent/android/conscrypt.ts
+++ b/agent/android/conscrypt.ts
@@ -1,4 +1,4 @@
-import { devlog, log } from "../util/log.js";
+import { devlog, devlog_error, log } from "../util/log.js";
import { getAndroidVersion } from "../util/process_infos.js";
function findProviderInstallerImplFromClassloaders(currentClassLoader: Java.Wrapper, backupImplementation: any) : Java.Wrapper | null {
@@ -12,8 +12,8 @@ function findProviderInstallerImplFromClassloaders(currentClassLoader: Java.Wrap
break
} catch (error) {
if(!error.toString().includes("java.lang.ClassNotFoundException")){
- devlog("Error in hooking ProviderInstallerImpl (findProviderInstallerImplFromClassloaders):")
- devlog("[-] Error message: (findProviderInstallerImplFromClassloaders): "+error);
+ devlog_error("Error in hooking ProviderInstallerImpl (findProviderInstallerImplFromClassloaders):")
+ devlog_error("Error message: (findProviderInstallerImplFromClassloaders): "+error);
}
providerInstallerImpl = null;
// On error we return null
@@ -43,8 +43,8 @@ function findProviderInstallerFromClassloaders(currentClassLoader: Java.Wrapper,
} catch (error) {
if(!error.toString().includes("java.lang.ClassNotFoundException")){
- devlog("Error in hooking ProviderInstallerImpl (findProviderInstallerFromClassloaders):")
- devlog("[-] Error message (findProviderInstallerFromClassloaders): "+error);
+ devlog_error("Error in hooking ProviderInstallerImpl (findProviderInstallerFromClassloaders):")
+ devlog_error("Error message (findProviderInstallerFromClassloaders): "+error);
}
providerInstaller = null;
// On error we return null
@@ -131,9 +131,9 @@ export function execute() {
}
}
}catch (error) {
- devlog("Some error in hooking the Providerinstaller")
+ devlog_error("Some error in hooking the Providerinstaller")
if(!error.toString().includes("java.lang.ClassNotFoundException")){
- devlog("[-] Error message: "+error);
+ devlog_error("[-] Error message: "+error);
}
// As it is not available, do nothing
}
diff --git a/agent/android/cronet_android.ts b/agent/android/cronet_android.ts
index 925a664..3b0f167 100644
--- a/agent/android/cronet_android.ts
+++ b/agent/android/cronet_android.ts
@@ -1,7 +1,7 @@
import {Cronet } from "../ssl_lib/cronet.js";
import { socket_library } from "./android_agent.js";
-import {PatternBasedHooking } from "../shared/pattern_based_hooking.js";
+import {PatternBasedHooking, get_CPU_specific_pattern } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js"
import { devlog } from "../util/log.js";
@@ -27,28 +27,13 @@ export class Cronet_Android extends Cronet {
},
"arm": {
primary: "2D E9 F0 43 89 B0 04 46 40 6B D0 F8 2C 01 00 28 49 D0", // Primary pattern
- fallback: "2D E9 F0 43 89 B0 04 46 40 6B D0 F8 2C 01 00 28 49 D0" // Fallback pattern (right now we don't have any)
+ fallback: "2D E9 F0 41 86 B0 04 46 40 6B D0 F8 30 01 00 28 53 D0" // Fallback pattern
}
};
}
-
- // Simulated JSON object (you can replace this with actual file loading)
-
- private get_CPU_specific_pattern(): { primary: string; fallback: string } {
- let arch = Process.arch.toString(); // Get architecture, e.g., "x64", "arm64"
- if(arch == "ia32"){
- arch = "x86"
- }
-
- if (this.default_pattern[arch]) {
- return this.default_pattern[arch]; // Return the pattern for the architecture
- } else {
- throw new Error(`No patterns found for CPU architecture: ${arch}`);
- }
- }
install_key_extraction_hook(){
const cronetModule = Process.findModuleByName(this.module_name);
@@ -62,7 +47,7 @@ export class Cronet_Android extends Cronet {
}else{
// This are the default patterns for hooking ssl_log_secret in BoringSSL inside Cronet
hooker.hookModuleByPattern(
- this.get_CPU_specific_pattern(),
+ get_CPU_specific_pattern(this.default_pattern),
(args) => {
this.dumpKeys(args[1], args[0], args[2]); // Hook args passed to dumpKeys
}
diff --git a/agent/android/flutter_android.ts b/agent/android/flutter_android.ts
index 6915d60..569f890 100644
--- a/agent/android/flutter_android.ts
+++ b/agent/android/flutter_android.ts
@@ -1,9 +1,9 @@
import { Flutter } from "../ssl_lib/flutter.js";
import { socket_library } from "./android_agent.js";
-import {PatternBasedHooking } from "../shared/pattern_based_hooking.js";
+import {PatternBasedHooking, get_CPU_specific_pattern } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js"
-import { devlog } from "../util/log.js";
+import { devlog, devlog_error } from "../util/log.js";
export class Flutter_Android extends Flutter {
@@ -15,40 +15,25 @@ export class Flutter_Android extends Flutter {
this.default_pattern = {
"x64": {
primary: "55 41 57 41 56 41 55 41 54 53 48 83 EC 48 48 8B 47 68 48 83 B8 20 02 00 00 00 0F 84 FE 00 00 00", // Primary pattern
- fallback: "55 41 57 41 56 41 55 41 54 53 48 83 EC 48 48 8B 47 68 48 83 B8 20 02 00 00 00" // Fallback pattern
+ fallback: "55 41 57 41 56 41 55 41 54 53 48 83 EC 38 48 8B 47 68 48 83 B8 10 02 00 00 00 0F 84 19 01 00 00" // Fallback pattern
},
"x86": {
primary: "55 53 57 56 83 EC 4C E8 00 00 00 00 5B 81 C3 A9 CB 13 00 8B 44 24 60 8B 40 34", // Primary pattern
- fallback: "55 53 57 56 83 EC 4C E8 00 00 00 00 5B 81 C3 A9 CB 13 00 8B 44 24 60" // Fallback pattern
+ fallback: "55 89 E5 53 57 56 83 E4 F0 83 EC 50 E8 00 00 00 00" // Fallback pattern
},
"arm64": {
- primary: "3F 23 03 D5 FF C3 01 D1 FD 7B 04 A9 F6 57 05 A9 F4 4F 06 A9 FD 03 01 91 08 34 40 F9 08 11 41 F9 C8 07 00 B4", // Primary pattern
- fallback: "3F 23 03 D5 FF 03 02 D1 FD 7B 04 A9 F7 2B 00 F9 F6 57 06 A9 F4 4F 07 A9 FD 03 01 91 08 34 40 F9 08 11 41 F9 E8 0F 00 B4" // Fallback pattern
+ primary: "E0 03 13 AA E2 03 16 AA 6D 62 FA 17", // Primary pattern
+ fallback: "FF 83 01 D1 F6 1B 00 F9 F5 53 04 A9 F3 7B 05 A9 08 34 40 F9 08 09 41 F9 68 07 00 B4" // Fallback pattern
},
"arm": {
primary: "2D E9 F0 43 89 B0 04 46 40 6B D0 F8 2C 01 00 28 49 D0", // Primary pattern
- fallback: "2D E9 F0 43 89 B0 04 46 40 6B D0 F8 2C 01 00 28 49 D0" // Fallback pattern (right now we don't have any)
+ fallback: "2D E9 F0 41 86 B0 04 46 40 6B D0 F8 30 01 00 28 53 D0" // Fallback pattern
}
};
}
-
- // Simulated JSON object (you can replace this with actual file loading)
-
- private get_CPU_specific_pattern(): { primary: string; fallback: string } {
- let arch = Process.arch.toString(); // Get architecture, e.g., "x64", "arm64"
- if(arch == "ia32"){
- arch = "x86"
- }
-
- if (this.default_pattern[arch]) {
- return this.default_pattern[arch]; // Return the pattern for the architecture
- } else {
- throw new Error(`No patterns found for CPU architecture: ${arch}`);
- }
- }
install_key_extraction_hook(){
const flutterModule = Process.findModuleByName(this.module_name);
@@ -62,7 +47,7 @@ export class Flutter_Android extends Flutter {
}else{
// This are the default patterns for hooking ssl_log_secret in BoringSSL inside Flutter
hooker.hookModuleByPattern(
- this.get_CPU_specific_pattern(),
+ get_CPU_specific_pattern(this.default_pattern),
(args) => {
this.dumpKeys(args[1], args[0], args[2]); // Hook args passed to dumpKeys
}
@@ -83,7 +68,7 @@ export function flutter_execute(moduleName:string, is_base_hook: boolean){
try {
flutter.execute_hooks();
}catch(error_msg){
- devlog(`flutter_execute error: ${error_msg}`)
+ devlog_error(`flutter_execute error: ${error_msg}`)
}
if (is_base_hook) {
@@ -94,7 +79,7 @@ export function flutter_execute(moduleName:string, is_base_hook: boolean){
(global as any).init_addresses[moduleName] = init_addresses;
}
}catch(error_msg){
- devlog(`flutter_execute base-hook error: ${error_msg}`)
+ devlog_error(`flutter_execute base-hook error: ${error_msg}`)
}
}
diff --git a/agent/ios/cronet_ios.ts b/agent/ios/cronet_ios.ts
index ccf3525..82e063a 100644
--- a/agent/ios/cronet_ios.ts
+++ b/agent/ios/cronet_ios.ts
@@ -1,14 +1,22 @@
import {Cronet } from "../ssl_lib/cronet.js";
import { socket_library } from "./ios_agent.js";
-import {PatternBasedHooking } from "../shared/pattern_based_hooking.js";
+import {PatternBasedHooking, get_CPU_specific_pattern } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js"
import { devlog } from "../util/log.js";
-export class Cronet_Android extends Cronet {
+export class Cronet_iOS extends Cronet {
+ private default_pattern: { [arch: string]: { primary: string; fallback: string } };
constructor(public moduleName:string, public socket_library:String, is_base_hook: boolean){
super(moduleName,socket_library,is_base_hook);
+
+ this.default_pattern = {
+ "arm64": {
+ primary: "FF 83 01 D1 F6 57 03 A9 F4 4F 04 A9 FD 7B 05 A9 FD 43 01 91 08 34 40 F9 08 51 41 F9 48 08 00 B4", // Primary pattern
+ fallback: "3F 23 03 D5 FF 03 02 D1 FD 7B 04 A9 F7 2B 00 F9 F6 57 06 A9 F4 4F 07 A9 FD 03 01 91 08 34 40 F9 08 11 41 F9 E8 0F 00 B4" // Fallback pattern
+ }
+ };
}
install_key_extraction_hook(){
@@ -16,10 +24,18 @@ export class Cronet_Android extends Cronet {
const hooker = new PatternBasedHooking(cronetModule);
if (isPatternReplaced()){
- devlog("Hooking libcronet functions by pattern");
- hooker.hook_DumpKeys(this.module_name,"libcronet.so",patterns,(args: any[]) => {
+ devlog("Hooking Cronet functions by pattern\nThis is still untested and might fail");
+ hooker.hook_DumpKeys(this.module_name,"Cronet",patterns,(args: any[]) => {
this.dumpKeys(args[1], args[0], args[2]); // Unpack args into dumpKeys
});
+ }else{
+ // This are the default patterns for hooking ssl_log_secret in BoringSSL inside Cronet
+ hooker.hookModuleByPattern(
+ get_CPU_specific_pattern(this.default_pattern),
+ (args) => {
+ this.dumpKeys(args[1], args[0], args[2]); // Hook args passed to dumpKeys
+ }
+ );
}
@@ -37,7 +53,7 @@ export class Cronet_Android extends Cronet {
export function cronet_execute(moduleName:string, is_base_hook: boolean){
- var cronet = new Cronet_Android(moduleName,socket_library,is_base_hook);
+ var cronet = new Cronet_iOS(moduleName,socket_library,is_base_hook);
cronet.execute_hooks();
if (is_base_hook) {
diff --git a/agent/ios/flutter_ios.ts b/agent/ios/flutter_ios.ts
new file mode 100644
index 0000000..aade5fe
--- /dev/null
+++ b/agent/ios/flutter_ios.ts
@@ -0,0 +1,74 @@
+
+import { Flutter } from "../ssl_lib/flutter.js";
+import { socket_library } from "./ios_agent.js";
+import {PatternBasedHooking, get_CPU_specific_pattern } from "../shared/pattern_based_hooking.js";
+import { patterns, isPatternReplaced } from "../ssl_log.js"
+import { devlog, devlog_error } from "../util/log.js";
+
+
+export class Flutter_iOS extends Flutter {
+ private default_pattern: { [arch: string]: { primary: string; fallback: string } };
+
+ constructor(public moduleName:string, public socket_library:String, is_base_hook: boolean){
+ super(moduleName,socket_library,is_base_hook);
+
+ this.default_pattern = {
+ "arm64": {
+ primary: "FF 83 01 D1 F6 57 03 A9 F4 4F 04 A9 FD 7B 05 A9 FD 43 01 91 08 34 40 F9 08 51 41 F9 48 08 00 B4", // Primary pattern
+ fallback: "3F 23 03 D5 FF 03 02 D1 FD 7B 04 A9 F7 2B 00 F9 F6 57 06 A9 F4 4F 07 A9 FD 03 01 91 08 34 40 F9 08 11 41 F9 E8 0F 00 B4" // Fallback pattern
+ }
+ };
+ }
+
+
+
+
+ install_key_extraction_hook(){
+ const flutterModule = Process.findModuleByName(this.module_name);
+ const hooker = new PatternBasedHooking(flutterModule);
+
+ if (isPatternReplaced()){
+ devlog("Hooking Flutter functions by patterns from JSON file");
+ hooker.hook_DumpKeys(this.module_name,"Flutter",patterns,(args: any[]) => {
+ this.dumpKeys(args[1], args[0], args[2]); // Unpack args into dumpKeys
+ });
+ }else{
+ // This are the default patterns for hooking ssl_log_secret in BoringSSL inside Flutter
+ hooker.hookModuleByPattern(
+ get_CPU_specific_pattern(this.default_pattern),
+ (args) => {
+ this.dumpKeys(args[1], args[0], args[2]); // Hook args passed to dumpKeys
+ }
+ );
+ }
+
+ }
+
+ execute_hooks(){
+ this.install_key_extraction_hook();
+ }
+
+}
+
+
+export function flutter_execute(moduleName:string, is_base_hook: boolean){
+ var flutter = new Flutter_iOS(moduleName,socket_library,is_base_hook);
+ try {
+ flutter.execute_hooks();
+ }catch(error_msg){
+ devlog_error(`flutter_execute error: ${error_msg}`)
+ }
+
+ if (is_base_hook) {
+ try {
+ const init_addresses = flutter.addresses[moduleName];
+ // ensure that we only add it to global when we are not
+ if (Object.keys(init_addresses).length > 0) {
+ (global as any).init_addresses[moduleName] = init_addresses;
+ }
+ }catch(error_msg){
+ devlog_error(`flutter_execute base-hook error: ${error_msg}`)
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/agent/ios/ios_agent.ts b/agent/ios/ios_agent.ts
index 9fdd2b1..fabcac4 100644
--- a/agent/ios/ios_agent.ts
+++ b/agent/ios/ios_agent.ts
@@ -3,6 +3,7 @@ import { log, devlog } from "../util/log.js";
import { getModuleNames, ssl_library_loader, invokeHookingFunction } from "../shared/shared_functions.js";
import { boring_execute } from "./openssl_boringssl_ios.js";
import { cronet_execute } from "./cronet_ios.js"
+import { flutter_execute } from "./flutter_ios.js"
var plattform_name = "darwin";
@@ -59,7 +60,8 @@ function hook_iOS_SSL_Libs(module_library_mapping: { [key: string]: Array<[any,
export function load_ios_hooking_agent() {
module_library_mapping[plattform_name] = [
[/.*libboringssl\.dylib/, invokeHookingFunction(boring_execute)],
- [/.*cronet.*\.dylib/, invokeHookingFunction(cronet_execute)]]
+ [/.*cronet.*\.dylib/, invokeHookingFunction(cronet_execute)],
+ [/.*flutter.*\.dylib/, invokeHookingFunction(flutter_execute)]]
hook_iOS_SSL_Libs(module_library_mapping, true);
hook_iOS_Dynamic_Loader(module_library_mapping, false);
diff --git a/agent/linux/cronet_linux.ts b/agent/linux/cronet_linux.ts
index 4209404..b8e5638 100644
--- a/agent/linux/cronet_linux.ts
+++ b/agent/linux/cronet_linux.ts
@@ -5,7 +5,7 @@ import {PatternBasedHooking } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js"
import { devlog } from "../util/log.js";
-export class Cronet_Android extends Cronet {
+export class Cronet_Linux extends Cronet {
constructor(public moduleName:string, public socket_library:String, is_base_hook: boolean){
super(moduleName,socket_library,is_base_hook);
@@ -37,7 +37,7 @@ export class Cronet_Android extends Cronet {
export function cronet_execute(moduleName:string, is_base_hook: boolean){
- var cronet = new Cronet_Android(moduleName,socket_library,is_base_hook);
+ var cronet = new Cronet_Linux(moduleName,socket_library,is_base_hook);
cronet.execute_hooks();
if (is_base_hook) {
diff --git a/agent/macos/cronet_macos.ts b/agent/macos/cronet_macos.ts
index 12b40b8..caae6aa 100644
--- a/agent/macos/cronet_macos.ts
+++ b/agent/macos/cronet_macos.ts
@@ -6,7 +6,7 @@ import { patterns, isPatternReplaced } from "../ssl_log.js"
import { devlog } from "../util/log.js";
-export class Cronet_Android extends Cronet {
+export class Cronet_MacOS extends Cronet {
constructor(public moduleName:string, public socket_library:String, is_base_hook: boolean){
super(moduleName,socket_library,is_base_hook);
@@ -17,8 +17,8 @@ export class Cronet_Android extends Cronet {
const hooker = new PatternBasedHooking(cronetModule);
if (isPatternReplaced()){
- devlog("Hooking libcronet functions by pattern");
- hooker.hook_DumpKeys(this.module_name,"libcronet.so",patterns,(args: any[]) => {
+ devlog("Hooking Cronet functions by pattern");
+ hooker.hook_DumpKeys(this.module_name,"Cronet",patterns,(args: any[]) => {
this.dumpKeys(args[1], args[0], args[2]); // Unpack args into dumpKeys
});
}
@@ -38,7 +38,7 @@ export class Cronet_Android extends Cronet {
export function cronet_execute(moduleName:string, is_base_hook: boolean){
- var cronet = new Cronet_Android(moduleName,socket_library,is_base_hook);
+ var cronet = new Cronet_MacOS(moduleName,socket_library,is_base_hook);
cronet.execute_hooks();
if (is_base_hook) {
diff --git a/agent/shared/pattern_based_hooking.ts b/agent/shared/pattern_based_hooking.ts
index 952232b..ffa1abb 100644
--- a/agent/shared/pattern_based_hooking.ts
+++ b/agent/shared/pattern_based_hooking.ts
@@ -1,4 +1,4 @@
-import { devlog, log } from "../util/log.js";
+import { devlog, devlog_error, log } from "../util/log.js";
import { isAndroid, isiOS,isMacOS } from "../util/process_infos.js"
type Pattern = {
@@ -14,10 +14,24 @@ type ActionPatterns = {
"KeyLogCallback-Function": Pattern;
};
+export function get_CPU_specific_pattern(default_pattern : { [arch: string]: { primary: string; fallback: string } }): { primary: string; fallback: string } {
+ let arch = Process.arch.toString(); // Get architecture, e.g., "x64", "arm64"
+ if(arch == "ia32"){
+ arch = "x86"
+ }
+
+ if (default_pattern[arch]) {
+ return default_pattern[arch]; // Return the pattern for the architecture
+ } else {
+ throw new Error(`No patterns found for CPU architecture: ${arch}`);
+ }
+}
+
export class PatternBasedHooking {
found_ssl_log_secret: boolean;
module: Module;
private patterns: any = {};
+ private rescannedRanges: Set = new Set(); // Set to keep track of memory ranges that have been rescanned
constructor(module: Module) {
this.found_ssl_log_secret = false;
@@ -34,7 +48,7 @@ export class PatternBasedHooking {
// Method to hook by pattern, with a custom function to handle onEnter and onLeave
hookByPattern(
- pattern: string,
+ patterns: { primary: string; fallback: string },
pattern_name: string,
onMatchCallback: (args: any[]) => void,
onCompleteCallback: (found: boolean) => void
@@ -43,6 +57,13 @@ export class PatternBasedHooking {
const moduleSize = this.module.size;
this.found_ssl_log_secret = false;
+ var pattern: string = "";
+ if (pattern_name === "primary_pattern") {
+ pattern = patterns.primary;
+ }else{
+ pattern = patterns.fallback;
+ }
+
Memory.scan(moduleBase, moduleSize, pattern, {
onMatch: (address) => {
this.found_ssl_log_secret = true;
@@ -59,12 +80,85 @@ export class PatternBasedHooking {
}
});
},
+ onError: (reason) => {
+ if(!this.found_ssl_log_secret){
+ devlog_error('There was an error scanning memory: '+reason);
+ devlog_error('Trying to rescan memory with permissions in mind');
+ this.hookByPatternOnlyReadableParts(patterns, pattern_name, onMatchCallback,(pattern_success) => {
+ // If the primary pattern doesn't work, try the fallback pattern
+ if (!pattern_success) {
+ devlog("Primary pattern failed, trying fallback pattern...");
+ this.hookByPatternOnlyReadableParts(patterns, "fallback_pattern", onMatchCallback, (pattern_success_alt) => {
+ if (!pattern_success_alt) {
+ devlog("None of the patterns worked. You may need to adjust the patterns.");
+ }
+ });
+ }
+
+ });
+ }
+ },
onComplete: () => {
onCompleteCallback(this.found_ssl_log_secret);
}
});
}
+ // Method to hook by pattern, with a custom function to handle onEnter and onLeave
+ hookByPatternOnlyReadableParts(
+ patterns: { primary: string; fallback: string },
+ pattern_name: string,
+ onMatchCallback: (args: any[]) => void,
+ onCompleteCallback: (found: boolean) => void
+ ): void {
+ devlog(`trying to scan only readable parts of ${this.module.name} ...`);
+
+ var pattern: string = "";
+ if (pattern_name === "primary_pattern") {
+ pattern = patterns.primary;
+ }else{
+ pattern = patterns.fallback;
+ }
+
+
+ // Enumerate all readable memory ranges of the specified module and scan each one
+ this.module.enumerateRanges('r--').forEach((range: MemoryRange) => {
+ const rangeKey = `${range.base}-${range.size}`; // Unique key for each memory range
+
+ devlog(`Scanning readable memory range in module: ${this.module.name}, Range: ${range.base} - ${range.base.add(range.size)}, Size: ${range.size}`);
+
+
+ Memory.scan(range.base, range.size, pattern, {
+ onMatch: (address: NativePointer, size: number) => {
+ this.found_ssl_log_secret = true;
+ log(`Pattern found at (${pattern_name}) address: ${address.toString()}`);
+ log(`Pattern based hooks installed.`);
+
+ // Attach the hook using the provided onMatchCallback
+ Interceptor.attach(address, {
+ onEnter: function (args) {
+ onMatchCallback(args);
+ },
+ onLeave: function (retval) {
+ // Optionally handle return value or additional behavior
+ }
+ });
+ },
+ onError: (reason: string) => {
+ devlog_error(`Error scanning memory for range: ${range.base} - ${range.base.add(range.size)}, Reason: ${reason}`);
+ },
+ onComplete: () => {
+ if (this.rescannedRanges.has(rangeKey)) {
+ return;
+ }else{
+ onCompleteCallback(this.found_ssl_log_secret);
+ }
+ }
+ });
+ });
+
+ }
+
// Method to hook the module with patterns provided as arguments
hookModuleByPattern(
patterns: { primary: string; fallback: string },
@@ -76,11 +170,11 @@ export class PatternBasedHooking {
devlog(`Module Size: ${moduleSize}`);
// Start by hooking using the primary pattern
- this.hookByPattern(patterns.primary, "primary_pattern", onMatchCallback, (pattern_success) => {
+ this.hookByPattern(patterns, "primary_pattern", onMatchCallback, (pattern_success) => {
// If the primary pattern doesn't work, try the fallback pattern
if (!pattern_success) {
devlog("Primary pattern failed, trying fallback pattern...");
- this.hookByPattern(patterns.fallback, "fallback_pattern", onMatchCallback, (pattern_success_alt) => {
+ this.hookByPattern(patterns, "fallback_pattern", onMatchCallback, (pattern_success_alt) => {
if (!pattern_success_alt) {
devlog("None of the patterns worked. You may need to adjust the patterns.");
}
@@ -101,16 +195,9 @@ export class PatternBasedHooking {
}
private invoke_pattern_based_hooking(action: keyof ActionPatterns, module_name: string, platform: string, arch: string, hookCallback: (args: any[]) => void){
- /*const modulePatterns = this.patterns.modules[module_name][platform][0];
- const primaryPattern = modulePatterns.primary;
- const fallbackPattern = modulePatterns.fallback;*/
-
var action_specific_patterns = this.get_action_specific_pattern(module_name, platform, arch,action);
devlog(`Using ${action} patterns for ${platform} and ${arch}`);
-
- // Hook the module using the patterns
- //this.hookModuleByPattern({ primary: primaryPattern, fallback: fallbackPattern }, hookCallback);
this.hookModuleByPattern(action_specific_patterns, hookCallback);
}
diff --git a/agent/shared/shared_functions.ts b/agent/shared/shared_functions.ts
index 55b1a8e..625ffdc 100644
--- a/agent/shared/shared_functions.ts
+++ b/agent/shared/shared_functions.ts
@@ -1,4 +1,4 @@
-import { log, devlog } from "../util/log.js";
+import { log, devlog, devlog_error } from "../util/log.js";
import { AF_INET, AF_INET6, ModuleHookingType } from "./shared_structures.js";
@@ -36,9 +36,9 @@ export function ssl_library_loader(plattform_name: string, module_library_mappin
func(module, is_base_hook);
}catch (error) {
- devlog(`error: skipping module ${module}`)
+ devlog_error(`error: skipping module ${module}`)
// when we enable the logging of devlogs we can print the error message as well for further improving this part
- devlog("Loader error: "+error)
+ devlog_error("Loader error: "+error)
// {'description': 'Could not find *libssl*.so!SSL_ImportFD', 'type': 'error'}
}
@@ -250,7 +250,7 @@ export function getPortsAndAddresses(sockfd: number, isRead: boolean, methodAddr
message["ss_family"] = "AF_INET6"
}
} else {
- devlog("[-] getPortsAndAddresses resolving error:"+addr.readU16())
+ devlog("[-] getPortsAndAddresses resolving error: "+addr.readU16())
throw "Only supporting IPv4/6"
}
}
diff --git a/agent/util/log.ts b/agent/util/log.ts
index 4b1c279..34cb153 100644
--- a/agent/util/log.ts
+++ b/agent/util/log.ts
@@ -11,4 +11,12 @@ export function devlog(str: string) {
message["contentType"] = "console_dev"
message["console_dev"] = str
send(message)
+}
+
+
+export function devlog_error(str: string) {
+ var message: { [key: string]: string } = {}
+ message["contentType"] = "console_error"
+ message["console_error"] = str
+ send(message)
}
\ No newline at end of file
diff --git a/agent/windows/cronet_windows.ts b/agent/windows/cronet_windows.ts
index 2d538a2..baea3f3 100644
--- a/agent/windows/cronet_windows.ts
+++ b/agent/windows/cronet_windows.ts
@@ -5,7 +5,7 @@ import {PatternBasedHooking } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js"
import { devlog } from "../util/log.js";
-export class Cronet_Android extends Cronet {
+export class Cronet_Windows extends Cronet {
constructor(public moduleName:string, public socket_library:String, is_base_hook: boolean){
super(moduleName,socket_library,is_base_hook);
@@ -17,7 +17,7 @@ export class Cronet_Android extends Cronet {
if (isPatternReplaced()){
devlog("Hooking libcronet functions by pattern");
- hooker.hook_DumpKeys(this.module_name,"libcronet.so",patterns,(args: any[]) => {
+ hooker.hook_DumpKeys(this.module_name,"libcronet.dll",patterns,(args: any[]) => {
this.dumpKeys(args[1], args[0], args[2]); // Unpack args into dumpKeys
});
}
@@ -37,7 +37,7 @@ export class Cronet_Android extends Cronet {
export function cronet_execute(moduleName:string, is_base_hook: boolean){
- var cronet = new Cronet_Android(moduleName,socket_library,is_base_hook);
+ var cronet = new Cronet_Windows(moduleName,socket_library,is_base_hook);
cronet.execute_hooks();
if (is_base_hook) {
diff --git a/friTap/_ssl_log.js b/friTap/_ssl_log.js
index c58a1bf..a6f329e 100644
--- a/friTap/_ssl_log.js
+++ b/friTap/_ssl_log.js
@@ -1,16 +1,18 @@
📦
2860 /agent/ssl_log.js.map
3711 /agent/ssl_log.js
-2755 /agent/android/android_agent.js.map
-3270 /agent/android/android_agent.js
+2848 /agent/android/android_agent.js.map
+3395 /agent/android/android_agent.js
937 /agent/android/android_java_tls_libs.js.map
1150 /agent/android/android_java_tls_libs.js
4361 /agent/android/bouncycastle.js.map
5111 /agent/android/bouncycastle.js
-3791 /agent/android/conscrypt.js.map
-6386 /agent/android/conscrypt.js
-2575 /agent/android/cronet_android.js.map
-3808 /agent/android/cronet_android.js
+3801 /agent/android/conscrypt.js.map
+6428 /agent/android/conscrypt.js
+2261 /agent/android/cronet_android.js.map
+3304 /agent/android/cronet_android.js
+2274 /agent/android/flutter_android.js.map
+3238 /agent/android/flutter_android.js
1347 /agent/android/gnutls_android.js.map
1401 /agent/android/gnutls_android.js
982 /agent/android/mbedTLS_android.js.map
@@ -21,14 +23,16 @@
2253 /agent/android/openssl_boringssl_android.js
3090 /agent/android/wolfssl_android.js.map
3892 /agent/android/wolfssl_android.js
-1466 /agent/ios/cronet_ios.js.map
-1525 /agent/ios/cronet_ios.js
-1974 /agent/ios/ios_agent.js.map
-2254 /agent/ios/ios_agent.js
+1842 /agent/ios/cronet_ios.js.map
+2275 /agent/ios/cronet_ios.js
+2021 /agent/ios/flutter_ios.js.map
+2548 /agent/ios/flutter_ios.js
+2067 /agent/ios/ios_agent.js.map
+2378 /agent/ios/ios_agent.js
2328 /agent/ios/openssl_boringssl_ios.js.map
3425 /agent/ios/openssl_boringssl_ios.js
1472 /agent/linux/cronet_linux.js.map
-1527 /agent/linux/cronet_linux.js
+1523 /agent/linux/cronet_linux.js
1341 /agent/linux/gnutls_linux.js.map
1399 /agent/linux/gnutls_linux.js
2491 /agent/linux/linux_agent.js.map
@@ -44,19 +48,21 @@
3083 /agent/linux/wolfssl_linux.js.map
3886 /agent/linux/wolfssl_linux.js
1472 /agent/macos/cronet_macos.js.map
-1527 /agent/macos/cronet_macos.js
+1514 /agent/macos/cronet_macos.js
1984 /agent/macos/macos_agent.js.map
2384 /agent/macos/macos_agent.js
1875 /agent/macos/openssl_boringssl_macos.js.map
2619 /agent/macos/openssl_boringssl_macos.js
-5136 /agent/shared/pattern_based_hooking.js.map
-7088 /agent/shared/pattern_based_hooking.js
-10224 /agent/shared/shared_functions.js.map
-12834 /agent/shared/shared_functions.js
+7608 /agent/shared/pattern_based_hooking.js.map
+10664 /agent/shared/pattern_based_hooking.js
+10234 /agent/shared/shared_functions.js.map
+12861 /agent/shared/shared_functions.js
397 /agent/shared/shared_structures.js.map
201 /agent/shared/shared_structures.js
2864 /agent/ssl_lib/cronet.js.map
3948 /agent/ssl_lib/cronet.js
+2867 /agent/ssl_lib/flutter.js.map
+3949 /agent/ssl_lib/flutter.js
6803 /agent/ssl_lib/gnutls.js.map
7899 /agent/ssl_lib/gnutls.js
2725 /agent/ssl_lib/java_ssl_libs.js.map
@@ -73,12 +79,12 @@
5718 /agent/ssl_lib/wolfssl.js
14214 /agent/util/anti_root.js.map
18094 /agent/util/anti_root.js
-550 /agent/util/log.js.map
-290 /agent/util/log.js
+736 /agent/util/log.js.map
+451 /agent/util/log.js
1576 /agent/util/process_infos.js.map
1907 /agent/util/process_infos.js
1478 /agent/windows/cronet_windows.js.map
-1529 /agent/windows/cronet_windows.js
+1530 /agent/windows/cronet_windows.js
974 /agent/windows/gnutls_windows.js.map
1035 /agent/windows/gnutls_windows.js
1019 /agent/windows/matrixssl_windows.js.map
@@ -205,7 +211,7 @@ function load_os_specific_agent() {
}
load_os_specific_agent();
✄
-{"version":3,"file":"android_agent.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/android/android_agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAqB,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,e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,qBAAqB,CAAC,eAAe,CAAC,CAAC;KAAC,CAAC;IAElE,kBAAkB,EAAE,CAAC;IACrB,4BAA4B,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAC3D,2BAA2B,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC"}
+{"version":3,"file":"android_agent.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/android/android_agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAqB,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,IAAI,cAAc,GAAG,OAAO,CAAC;AAC7B,IAAI,WAAW,GAAkB,cAAc,EAAE,CAAC;AACjD,MAAc,CAAC,SAAS,GAAG,EAAE,CAAC;AAE/B,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAA;AAEpC,SAAS,kBAAkB;IACvB,YAAY,EAAE,CAAC;AACnB,CAAC;AAED,SAAS,2BAA2B,CAAC,sBAA0E,EAAE,YAAqB;IAClI,IAAI;QACJ,MAAM,WAAW,GAAG,eAAe,CAAA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AAC,OAAO,KAAK,EAAE;QACZ,MAAM,CAAC,wBAAwB,GAAE,KAAK,CAAC,CAAA;QACvC,GAAG,CAAC,mDAAmD,CAAC,CAAA;KAC3D;AACD,CAAC;AAED,SAAS,4BAA4B,CAAC,sBAA0E,EAAE,YAAqB;IACnI,kBAAkB,CAAC,cAAc,EAAE,sBAAsB,EAAC,WAAW,EAAC,SAAS,EAAC,YAAY,CAAC,CAAA;AAEjG,CAAC;AAGD,MAAM,UAAU,0BAA0B;IACtC,sBAAsB,CAAC,cAAc,CAAC,GAAG;QACrC,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAC;QACzD,CAAC,cAAc,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAC;QACvD,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAC;QACzD,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC;QAC3D,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAC;QAC1D,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC;QAC5D,CAAC,qBAAqB,EAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAC1D,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC;KAAC,CAAC;IAElE,kBAAkB,EAAE,CAAC;IACrB,4BAA4B,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAC3D,2BAA2B,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC"}
✄
import { module_library_mapping } from "../shared/shared_structures.js";
import { getModuleNames, ssl_library_loader, invokeHookingFunction } from "../shared/shared_functions.js";
@@ -217,6 +223,7 @@ import { mbedTLS_execute } from "./mbedTLS_android.js";
import { boring_execute } from "./openssl_boringssl_android.js";
import { java_execute } from "./android_java_tls_libs.js";
import { cronet_execute } from "./cronet_android.js";
+import { flutter_execute } from "./flutter_android.js";
var plattform_name = "linux";
var moduleNames = getModuleNames();
global.addresses = {};
@@ -271,6 +278,7 @@ export function load_android_hooking_agent() {
[/.*libssl_sb.so/, invokeHookingFunction(boring_execute)],
[/.*libssl\.so/, invokeHookingFunction(boring_execute)],
[/.*cronet.*\.so/, invokeHookingFunction(cronet_execute)],
+ [/.*flutter.*\.so/, invokeHookingFunction(flutter_execute)],
[/.*libgnutls\.so/, invokeHookingFunction(gnutls_execute)],
[/.*libwolfssl\.so/, invokeHookingFunction(wolfssl_execute)],
[/.*libnspr[0-9]?\.so/, invokeHookingFunction(nss_execute)],
@@ -404,9 +412,9 @@ export function execute() {
}, 0);
}
✄
-{"version":3,"file":"conscrypt.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/android/conscrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,SAAS,yCAAyC,CAAC,kBAAgC,EAAE,oBAAyB;IAE1G,IAAI,qBAAqB,GAAG,IAAI,CAAC;IACjC,IAAI,YAAY,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAA;IACnD,KAAK,IAAI,EAAE,IAAI,YAAY,EAAE;QACzB,IAAI;YACA,IAAI,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;YAC5C,qBAAqB,GAAG,YAAY,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAA;YACxG,MAAK;SACR;QAAC,OAAO,KAAK,EAAE;YACZ,IAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EAAC;gBAC9D,MAAM,CAAC,qFAAqF,CAAC,CAAA;gBAC7F,MAAM,CAAC,kEAAkE,GAAC,KAAK,CAAC,CAAC;aACpF;YACD,qBAAqB,GAAG,IAAI,CAAC;YAC7B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gBACjC,IAAI,+BAA+B,GAAG,qCAAqC,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAA;gBAClH,IAAI,+BAA+B,KAAK,IAAI,EAAC;oBACzC,qBAAqB,GAAG,yCAAyC,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAA;iBAC3G;gBAGD,IAAI,+BAA+B,KAAK,IAAI,IAAI,qBAAqB,KAAM,IAAI,IAAI,+BAA+B,KAAK,SAAS,EAAE;oBAC9H,MAAM,CAAC,mEAAmE,CAAC,CAAA;iBAC9E;qBAAI;oBAED,IAAG,qBAAqB,KAAK,IAAI,EAAC;wBAC9B,qBAAqB,CAAC,cAAc,CAAC,cAAc,GAAG;4BAClD,MAAM,CAAC,4CAA4C,CAAC,CAAA;wBAExD,CAAC,CAAA;qBACJ;yBAAI;wBAEL,+BAA+B,CAAC,eAAe,CAAC,cAAc,GAAG,UAAU,OAAY;4BACnF,MAAM,CAAC,wCAAwC,CAAC,CAAA;wBACpD,CAAC,CAAA;wBACD,+BAA+B,CAAC,oBAAoB,CAAC,cAAc,GAAG,UAAU,OAAY,EAAE,QAAa;4BACvG,MAAM,CAAC,6CAA6C,CAAC,CAAA;4BACrD,QAAQ,CAAC,mBAAmB,EAAE,CAAA;wBAClC,CAAC,CAAA;qBACJ;iBACA;aACJ;YAAA,OAAO,KAAK,EAAE;gBACX,MAAM,CAAC,6CAA6C,CAAC,CAAA;gBACrD,IAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EAAC;oBAC9D,MAAM,CAAC,qBAAqB,GAAC,KAAK,CAAC,CAAC;iBACvC;gBACD,qCAAqC;aACxC;SAEJ;IACL,CAAC,CAAC,CAAA;AAIN,CAAC"}
+{"version":3,"file":"conscrypt.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/android/conscrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,GA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,UAAU,OAAY;4BACnF,MAAM,CAAC,wCAAwC,CAAC,CAAA;wBACpD,CAAC,CAAA;wBACD,+BAA+B,CAAC,oBAAoB,CAAC,cAAc,GAAG,UAAU,OAAY,EAAE,QAAa;4BACvG,MAAM,CAAC,6CAA6C,CAAC,CAAA;4BACrD,QAAQ,CAAC,mBAAmB,EAAE,CAAA;wBAClC,CAAC,CAAA;qBACJ;iBACA;aACJ;YAAA,OAAO,KAAK,EAAE;gBACX,YAAY,CAAC,6CAA6C,CAAC,CAAA;gBAC3D,IAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EAAC;oBAC9D,YAAY,CAAC,qBAAqB,GAAC,KAAK,CAAC,CAAC;iBAC7C;gBACD,qCAAqC;aACxC;SAEJ;IACL,CAAC,CAAC,CAAA;AAIN,CAAC"}
✄
-import { devlog, log } from "../util/log.js";
+import { devlog, devlog_error, log } from "../util/log.js";
import { getAndroidVersion } from "../util/process_infos.js";
function findProviderInstallerImplFromClassloaders(currentClassLoader, backupImplementation) {
var providerInstallerImpl = null;
@@ -419,8 +427,8 @@ function findProviderInstallerImplFromClassloaders(currentClassLoader, backupImp
}
catch (error) {
if (!error.toString().includes("java.lang.ClassNotFoundException")) {
- devlog("Error in hooking ProviderInstallerImpl (findProviderInstallerImplFromClassloaders):");
- devlog("[-] Error message: (findProviderInstallerImplFromClassloaders): " + error);
+ devlog_error("Error in hooking ProviderInstallerImpl (findProviderInstallerImplFromClassloaders):");
+ devlog_error("Error message: (findProviderInstallerImplFromClassloaders): " + error);
}
providerInstallerImpl = null;
// On error we return null
@@ -444,8 +452,8 @@ function findProviderInstallerFromClassloaders(currentClassLoader, backupImpleme
}
catch (error) {
if (!error.toString().includes("java.lang.ClassNotFoundException")) {
- devlog("Error in hooking ProviderInstallerImpl (findProviderInstallerFromClassloaders):");
- devlog("[-] Error message (findProviderInstallerFromClassloaders): " + error);
+ devlog_error("Error in hooking ProviderInstallerImpl (findProviderInstallerFromClassloaders):");
+ devlog_error("Error message (findProviderInstallerFromClassloaders): " + error);
}
providerInstaller = null;
// On error we return null
@@ -523,9 +531,9 @@ export function execute() {
}
}
catch (error) {
- devlog("Some error in hooking the Providerinstaller");
+ devlog_error("Some error in hooking the Providerinstaller");
if (!error.toString().includes("java.lang.ClassNotFoundException")) {
- devlog("[-] Error message: " + error);
+ devlog_error("[-] Error message: " + error);
}
// As it is not available, do nothing
}
@@ -533,11 +541,11 @@ export function execute() {
});
}
✄
-{"version":3,"file":"cronet_android.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/android/cronet_android.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,MAAM,OAAO,cAAe,SAAQ,MAAM;IAGtC,YAAmB,UAAiB,EAAS,cAAqB,EAAE,YAAqB;QACrF,KAAK,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;QAD/B,eAAU,GAAV,UAAU,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAO;QAG9D,IAAI,CAAC,eAAe,GAAG;YACnB,KAAK,EAAE;gBACH,OAAO,EAAE,iGAAiG;gBAC1G,QAAQ,EAAE,+EAA+E,CAAC,mBAAmB;aAChH;YACD,KAAK,EAAE;gBACH,OAAO,EAAE,+EAA+E;gBACxF,QAAQ,EAAE,sEAAsE,CAAC,mBAAmB;aACvG;YACD,OAAO,EAAE;gBACL,OAAO,EAAE,6GAA6G;gBACtH,QAAQ,EAAE,yHAAyH,CAAE,mBAAmB;aAC3J;YACD,KAAK,EAAE;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AAC,CAAE,+BAA+B;YAC9E,CAAC,CACJ,CAAC;SACL;IAEL,CAAC;IAED,aAAa;QACT,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACvC,CAAC;CAEJ;AAGD,MAAM,UAAU,cAAc,CAAC,UAAiB,EAAE,YAAqB;IACnE,IAAI,MAAM,GAAG,IAAI,cAAc,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;IACxE,IAAI;QACA,MAAM,CAAC,aAAa,EAAE,CAAC;KAC1B;IAAA,OAAM,SAAS,EAAC;QACb,MAAM,CAAC,yBAAyB,SAAS,EAAE,CAAC,CAAA;KAC/C;IAED,IAAI,YAAY,EAAE;QACd,IAAI;YACA,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACpD,wDAAwD;YACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;aAC/D;SACJ;QAAA,OAAM,SAAS,EAAC;YACb,MAAM,CAAC,mCAAmC,SAAS,EAAE,CAAC,CAAA;SACzD;KACJ;AAEL,CAAC"}
+{"version":3,"file":"cronet_android.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/android/cronet_android.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,MAAM,OAAO,cAAe,SAAQ,MAAM;IAGtC,YAAmB,UAAiB,EAAS,cAAqB,E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C,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,+BAA+B;YAC9E,CAAC,CACJ,CAAC;SACL;IAEL,CAAC;IAED,aAAa;QACT,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACvC,CAAC;CAEJ;AAGD,MAAM,UAAU,cAAc,CAAC,UAAiB,EAAE,YAAqB;IACnE,IAAI,MAAM,GAAG,IAAI,cAAc,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;IACxE,IAAI;QACA,MAAM,CAAC,aAAa,EAAE,CAAC;KAC1B;IAAA,OAAM,SAAS,EAAC;QACb,MAAM,CAAC,yBAAyB,SAAS,EAAE,CAAC,CAAA;KAC/C;IAED,IAAI,YAAY,EAAE;QACd,IAAI;YACA,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACpD,wDAAwD;YACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;aAC/D;SACJ;QAAA,OAAM,SAAS,EAAC;YACb,MAAM,CAAC,mCAAmC,SAAS,EAAE,CAAC,CAAA;SACzD;KACJ;AAEL,CAAC"}
✄
import { Cronet } from "../ssl_lib/cronet.js";
import { socket_library } from "./android_agent.js";
-import { PatternBasedHooking } from "../shared/pattern_based_hooking.js";
+import { PatternBasedHooking, get_CPU_specific_pattern } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js";
import { devlog } from "../util/log.js";
export class Cronet_Android extends Cronet {
@@ -560,23 +568,10 @@ export class Cronet_Android extends Cronet {
},
"arm": {
primary: "2D E9 F0 43 89 B0 04 46 40 6B D0 F8 2C 01 00 28 49 D0",
- fallback: "2D E9 F0 43 89 B0 04 46 40 6B D0 F8 2C 01 00 28 49 D0" // Fallback pattern (right now we don't have any)
+ fallback: "2D E9 F0 41 86 B0 04 46 40 6B D0 F8 30 01 00 28 53 D0" // Fallback pattern
}
};
}
- // Simulated JSON object (you can replace this with actual file loading)
- get_CPU_specific_pattern() {
- let arch = Process.arch.toString(); // Get architecture, e.g., "x64", "arm64"
- if (arch == "ia32") {
- arch = "x86";
- }
- if (this.default_pattern[arch]) {
- return this.default_pattern[arch]; // Return the pattern for the architecture
- }
- else {
- throw new Error(`No patterns found for CPU architecture: ${arch}`);
- }
- }
install_key_extraction_hook() {
const cronetModule = Process.findModuleByName(this.module_name);
const hooker = new PatternBasedHooking(cronetModule);
@@ -588,7 +583,7 @@ export class Cronet_Android extends Cronet {
}
else {
// This are the default patterns for hooking ssl_log_secret in BoringSSL inside Cronet
- hooker.hookModuleByPattern(this.get_CPU_specific_pattern(), (args) => {
+ hooker.hookModuleByPattern(get_CPU_specific_pattern(this.default_pattern), (args) => {
this.dumpKeys(args[1], args[0], args[2]); // Hook args passed to dumpKeys
});
}
@@ -619,6 +614,79 @@ export function cronet_execute(moduleName, is_base_hook) {
}
}
✄
+{"version":3,"file":"flutter_android.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/android/flutter_android.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,OAAO,eAAgB,SAAQ,OAAO;IAGxC,YAAmB,UAAiB,EAAS,cAAqB,EAAE,YAAqB;QACrF,KAAK,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAA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CAAC,CAAC,CAAC,CAAE,+BAA+B;YAC9E,CAAC,CACJ,CAAC;SACL;IAEL,CAAC;IAED,aAAa;QACT,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACvC,CAAC;CAEJ;AAGD,MAAM,UAAU,eAAe,CAAC,UAAiB,EAAE,YAAqB;IACpE,IAAI,OAAO,GAAG,IAAI,eAAe,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;IAC1E,IAAI;QACA,OAAO,CAAC,aAAa,EAAE,CAAC;KAC3B;IAAA,OAAM,SAAS,EAAC;QACb,YAAY,CAAC,0BAA0B,SAAS,EAAE,CAAC,CAAA;KACtD;IAED,IAAI,YAAY,EAAE;QACd,IAAI;YACA,MAAM,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACrD,wDAAwD;YACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;aAC/D;SACJ;QAAA,OAAM,SAAS,EAAC;YACb,YAAY,CAAC,oCAAoC,SAAS,EAAE,CAAC,CAAA;SAChE;KACJ;AAEL,CAAC"}
+✄
+import { Flutter } from "../ssl_lib/flutter.js";
+import { socket_library } from "./android_agent.js";
+import { PatternBasedHooking, get_CPU_specific_pattern } from "../shared/pattern_based_hooking.js";
+import { patterns, isPatternReplaced } from "../ssl_log.js";
+import { devlog, devlog_error } from "../util/log.js";
+export class Flutter_Android extends Flutter {
+ constructor(moduleName, socket_library, is_base_hook) {
+ super(moduleName, socket_library, is_base_hook);
+ this.moduleName = moduleName;
+ this.socket_library = socket_library;
+ this.default_pattern = {
+ "x64": {
+ primary: "55 41 57 41 56 41 55 41 54 53 48 83 EC 48 48 8B 47 68 48 83 B8 20 02 00 00 00 0F 84 FE 00 00 00",
+ fallback: "55 41 57 41 56 41 55 41 54 53 48 83 EC 38 48 8B 47 68 48 83 B8 10 02 00 00 00 0F 84 19 01 00 00" // Fallback pattern
+ },
+ "x86": {
+ primary: "55 53 57 56 83 EC 4C E8 00 00 00 00 5B 81 C3 A9 CB 13 00 8B 44 24 60 8B 40 34",
+ fallback: "55 89 E5 53 57 56 83 E4 F0 83 EC 50 E8 00 00 00 00" // Fallback pattern
+ },
+ "arm64": {
+ primary: "E0 03 13 AA E2 03 16 AA 6D 62 FA 17",
+ fallback: "FF 83 01 D1 F6 1B 00 F9 F5 53 04 A9 F3 7B 05 A9 08 34 40 F9 08 09 41 F9 68 07 00 B4" // Fallback pattern
+ },
+ "arm": {
+ primary: "2D E9 F0 43 89 B0 04 46 40 6B D0 F8 2C 01 00 28 49 D0",
+ fallback: "2D E9 F0 41 86 B0 04 46 40 6B D0 F8 30 01 00 28 53 D0" // Fallback pattern
+ }
+ };
+ }
+ install_key_extraction_hook() {
+ const flutterModule = Process.findModuleByName(this.module_name);
+ const hooker = new PatternBasedHooking(flutterModule);
+ if (isPatternReplaced()) {
+ devlog("Hooking libflutter functions by patterns from JSON file");
+ hooker.hook_DumpKeys(this.module_name, "libflutter.so", patterns, (args) => {
+ this.dumpKeys(args[1], args[0], args[2]); // Unpack args into dumpKeys
+ });
+ }
+ else {
+ // This are the default patterns for hooking ssl_log_secret in BoringSSL inside Flutter
+ hooker.hookModuleByPattern(get_CPU_specific_pattern(this.default_pattern), (args) => {
+ this.dumpKeys(args[1], args[0], args[2]); // Hook args passed to dumpKeys
+ });
+ }
+ }
+ execute_hooks() {
+ this.install_key_extraction_hook();
+ }
+}
+export function flutter_execute(moduleName, is_base_hook) {
+ var flutter = new Flutter_Android(moduleName, socket_library, is_base_hook);
+ try {
+ flutter.execute_hooks();
+ }
+ catch (error_msg) {
+ devlog_error(`flutter_execute error: ${error_msg}`);
+ }
+ if (is_base_hook) {
+ try {
+ const init_addresses = flutter.addresses[moduleName];
+ // ensure that we only add it to global when we are not
+ if (Object.keys(init_addresses).length > 0) {
+ global.init_addresses[moduleName] = init_addresses;
+ }
+ }
+ catch (error_msg) {
+ devlog_error(`flutter_execute base-hook error: ${error_msg}`);
+ }
+ }
+}
+✄
{"version":3,"file":"gnutls_android.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/android/gnutls_android.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,OAAO,YAAa,SAAQ,MAAM;IAEpC,YAAmB,UAAiB,EAAS,cAAqB,EAAE,YAAqB;QACrF,KAAK,CAAC,UAAU,EAAC,cAAc,CAAC,CAAC;QADlB,eAAU,GAAV,UAAU,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAO;IAElE,CAAC;IAGD,aAAa;QACT,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACnC,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,IAAI,CAAC,8BAA8B,EAAE,CAAC;IAC1C,CAAC;IAED,8BAA8B;QAC1B,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC,EACtE;YACI,OAAO,EAAE,UAAU,IAAS;gBACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YAC1B,CAAC;YACD,OAAO,EAAE,UAAU,MAAW;gBAC1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;gBACzB,MAAM,CAAC,kCAAkC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,eAAe,CAAC,CAAA;YAEjG,CAAC;SACJ,CAAC,CAAA;IAEF,CAAC;CACJ;AAGD,MAAM,UAAU,cAAc,CAAC,UAAiB,EAAE,YAAqB;IACnE,IAAI,UAAU,GAAG,IAAI,YAAY,CAAC,UAAU,EAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAC3E,UAAU,CAAC,aAAa,EAAE,CAAC;IAE3B,IAAI,YAAY,EAAE;QACd,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACxD,wDAAwD;QACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;SAC/D;KACJ;AAEL,CAAC"}
✄
import { GnuTLS } from "../ssl_lib/gnutls.js";
@@ -855,35 +923,47 @@ export function wolfssl_execute(moduleName, is_base_hook) {
}
}
✄
-{"version":3,"file":"cronet_ios.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/ios/cronet_ios.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,OAAO,cAAe,SAAQ,MAAM;IAEtC,YAAmB,UAAiB,EAAS,cAAqB,EAAE,YAAqB;QACrF,KAAK,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;QAD/B,eAAU,GAAV,UAAU,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAO;IAElE,CAAC;IAED,2BAA2B;QACvB,MAAM,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAErD,IAAI,iBAAiB,EAAE,EAAC;YACpB,MAAM,CAAC,wCAAwC,CAAC,CAAC;YACjD,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAC,cAAc,EAAC,QAAQ,EAAC,CAAC,IAAW,EAAE,EAAE;gBAC1E,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,4BAA4B;YAC3E,CAAC,CAAC,CAAC;SACN;IAOL,CAAC;IAED,aAAa;QACT,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACvC,CAAC;CAEJ;AAGD,MAAM,UAAU,cAAc,CAAC,UAAiB,EAAE,YAAqB;IACnE,IAAI,MAAM,GAAG,IAAI,cAAc,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;IACxE,MAAM,CAAC,aAAa,EAAE,CAAC;IAEvB,IAAI,YAAY,EAAE;QACd,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACpD,wDAAwD;QACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;SAC/D;KACJ;AAEL,CAAC"}
+{"version":3,"file":"cronet_ios.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/ios/cronet_ios.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,OAA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,UAAU,cAAc,CAAC,UAAiB,EAAE,YAAqB;IACnE,IAAI,MAAM,GAAG,IAAI,UAAU,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;IACpE,MAAM,CAAC,aAAa,EAAE,CAAC;IAEvB,IAAI,YAAY,EAAE;QACd,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACpD,wDAAwD;QACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;SAC/D;KACJ;AAEL,CAAC"}
✄
import { Cronet } from "../ssl_lib/cronet.js";
import { socket_library } from "./ios_agent.js";
-import { PatternBasedHooking } from "../shared/pattern_based_hooking.js";
+import { PatternBasedHooking, get_CPU_specific_pattern } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js";
import { devlog } from "../util/log.js";
-export class Cronet_Android extends Cronet {
+export class Cronet_iOS extends Cronet {
constructor(moduleName, socket_library, is_base_hook) {
super(moduleName, socket_library, is_base_hook);
this.moduleName = moduleName;
this.socket_library = socket_library;
+ this.default_pattern = {
+ "arm64": {
+ primary: "FF 83 01 D1 F6 57 03 A9 F4 4F 04 A9 FD 7B 05 A9 FD 43 01 91 08 34 40 F9 08 51 41 F9 48 08 00 B4",
+ fallback: "3F 23 03 D5 FF 03 02 D1 FD 7B 04 A9 F7 2B 00 F9 F6 57 06 A9 F4 4F 07 A9 FD 03 01 91 08 34 40 F9 08 11 41 F9 E8 0F 00 B4" // Fallback pattern
+ }
+ };
}
install_key_extraction_hook() {
const cronetModule = Process.findModuleByName(this.module_name);
const hooker = new PatternBasedHooking(cronetModule);
if (isPatternReplaced()) {
- devlog("Hooking libcronet functions by pattern");
- hooker.hook_DumpKeys(this.module_name, "libcronet.so", patterns, (args) => {
+ devlog("Hooking Cronet functions by pattern\nThis is still untested and might fail");
+ hooker.hook_DumpKeys(this.module_name, "Cronet", patterns, (args) => {
this.dumpKeys(args[1], args[0], args[2]); // Unpack args into dumpKeys
});
}
+ else {
+ // This are the default patterns for hooking ssl_log_secret in BoringSSL inside Cronet
+ hooker.hookModuleByPattern(get_CPU_specific_pattern(this.default_pattern), (args) => {
+ this.dumpKeys(args[1], args[0], args[2]); // Hook args passed to dumpKeys
+ });
+ }
}
execute_hooks() {
this.install_key_extraction_hook();
}
}
export function cronet_execute(moduleName, is_base_hook) {
- var cronet = new Cronet_Android(moduleName, socket_library, is_base_hook);
+ var cronet = new Cronet_iOS(moduleName, socket_library, is_base_hook);
cronet.execute_hooks();
if (is_base_hook) {
const init_addresses = cronet.addresses[moduleName];
@@ -894,13 +974,75 @@ export function cronet_execute(moduleName, is_base_hook) {
}
}
✄
-{"version":3,"file":"ios_agent.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/ios/ios_agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAqB,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGhD,IAAI,cAAc,GAAG,QAAQ,CAAC;AAC9B,IAAI,WAAW,GAAkB,cAAc,EAAE,CAAA;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAA;AAGjD,SAAS,uBAAuB,CAAC,sBAA0E,EAAE,YAAqB;IAC9H,IAAI;QACA,MAAM,WAAW,GAAG,mBAAmB,CAAA;QACvC,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,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sBAAsB,CAAC,cAAc,CAAC,GAAG;QACrC,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAC;QAChE,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAC;KAAC,CAAA;IAEjE,iBAAiB,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAChD,uBAAuB,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC"}
+{"version":3,"file":"flutter_ios.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/ios/flutter_ios.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,OAAO,WAAY,SAAQ,OAAO;IAGpC,YAAmB,UAAiB,EAAS,cAAqB,EAAE,YAAqB;QACrF,KAAK,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;QAD/B,eAAU,GAAV,UAAU,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAO;QAG9D,IAAI,CAAC,eAAe,GAAG;YACnB,OAAO,EAAE;gBACL,OAAO,EAAE,iGAAiG;gBAC1G,QAAQ,EAAE,yHAAyH,CAAE,mBAAmB;aAC3J;SACJ,CAAC;IACN,CAAC;IAKD,2BAA2B;QACvB,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,aAAa,CAAC,CAAC;QAEtD,IAAI,iBAAiB,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J;QAAA,OAAM,SAAS,EAAC;YACb,YAAY,CAAC,oCAAoC,SAAS,EAAE,CAAC,CAAA;SAChE;KACJ;AAEL,CAAC"}
+✄
+import { Flutter } from "../ssl_lib/flutter.js";
+import { socket_library } from "./ios_agent.js";
+import { PatternBasedHooking, get_CPU_specific_pattern } from "../shared/pattern_based_hooking.js";
+import { patterns, isPatternReplaced } from "../ssl_log.js";
+import { devlog, devlog_error } from "../util/log.js";
+export class Flutter_iOS extends Flutter {
+ constructor(moduleName, socket_library, is_base_hook) {
+ super(moduleName, socket_library, is_base_hook);
+ this.moduleName = moduleName;
+ this.socket_library = socket_library;
+ this.default_pattern = {
+ "arm64": {
+ primary: "FF 83 01 D1 F6 57 03 A9 F4 4F 04 A9 FD 7B 05 A9 FD 43 01 91 08 34 40 F9 08 51 41 F9 48 08 00 B4",
+ fallback: "3F 23 03 D5 FF 03 02 D1 FD 7B 04 A9 F7 2B 00 F9 F6 57 06 A9 F4 4F 07 A9 FD 03 01 91 08 34 40 F9 08 11 41 F9 E8 0F 00 B4" // Fallback pattern
+ }
+ };
+ }
+ install_key_extraction_hook() {
+ const flutterModule = Process.findModuleByName(this.module_name);
+ const hooker = new PatternBasedHooking(flutterModule);
+ if (isPatternReplaced()) {
+ devlog("Hooking Flutter functions by patterns from JSON file");
+ hooker.hook_DumpKeys(this.module_name, "Flutter", patterns, (args) => {
+ this.dumpKeys(args[1], args[0], args[2]); // Unpack args into dumpKeys
+ });
+ }
+ else {
+ // This are the default patterns for hooking ssl_log_secret in BoringSSL inside Flutter
+ hooker.hookModuleByPattern(get_CPU_specific_pattern(this.default_pattern), (args) => {
+ this.dumpKeys(args[1], args[0], args[2]); // Hook args passed to dumpKeys
+ });
+ }
+ }
+ execute_hooks() {
+ this.install_key_extraction_hook();
+ }
+}
+export function flutter_execute(moduleName, is_base_hook) {
+ var flutter = new Flutter_iOS(moduleName, socket_library, is_base_hook);
+ try {
+ flutter.execute_hooks();
+ }
+ catch (error_msg) {
+ devlog_error(`flutter_execute error: ${error_msg}`);
+ }
+ if (is_base_hook) {
+ try {
+ const init_addresses = flutter.addresses[moduleName];
+ // ensure that we only add it to global when we are not
+ if (Object.keys(init_addresses).length > 0) {
+ global.init_addresses[moduleName] = init_addresses;
+ }
+ }
+ catch (error_msg) {
+ devlog_error(`flutter_execute base-hook error: ${error_msg}`);
+ }
+ }
+}
+✄
+{"version":3,"file":"ios_agent.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/ios/ios_agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAqB,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGlD,IAAI,cAAc,GAAG,QAAQ,CAAC;AAC9B,IAAI,WAAW,GAAkB,cAAc,EAAE,CAAA;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAA;AAGjD,SAAS,uBAAuB,CAAC,sBAA0E,EAAE,YAAqB;IAC9H,IAAI;QACA,MAAM,WAAW,GAAG,mBAAmB,CAAA;QACvC,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;QACrE,IAAI,KAAK,KAAK,SAAS,EAAE;YACrB,MAAM,kCAAkC,CAAA;SAC3C;QAED,IAAI,MAAM,GAAG,QAAQ,CAAA;QAErB,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,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nE,iBAAiB,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAChD,uBAAuB,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC"}
✄
import { module_library_mapping } from "../shared/shared_structures.js";
import { log, devlog } from "../util/log.js";
import { getModuleNames, ssl_library_loader, invokeHookingFunction } from "../shared/shared_functions.js";
import { boring_execute } from "./openssl_boringssl_ios.js";
import { cronet_execute } from "./cronet_ios.js";
+import { flutter_execute } from "./flutter_ios.js";
var plattform_name = "darwin";
var moduleNames = getModuleNames();
export const socket_library = "libSystem.B.dylib";
@@ -942,7 +1084,8 @@ function hook_iOS_SSL_Libs(module_library_mapping, is_base_hook) {
export function load_ios_hooking_agent() {
module_library_mapping[plattform_name] = [
[/.*libboringssl\.dylib/, invokeHookingFunction(boring_execute)],
- [/.*cronet.*\.dylib/, invokeHookingFunction(cronet_execute)]
+ [/.*cronet.*\.dylib/, invokeHookingFunction(cronet_execute)],
+ [/.*flutter.*\.dylib/, invokeHookingFunction(flutter_execute)]
];
hook_iOS_SSL_Libs(module_library_mapping, true);
hook_iOS_Dynamic_Loader(module_library_mapping, false);
@@ -1016,14 +1159,14 @@ export function boring_execute(moduleName, is_base_hook) {
}
}
✄
-{"version":3,"file":"cronet_linux.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/linux/cronet_linux.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,OAAO,cAAe,SAAQ,MAAM;IAEtC,YAAmB,UAAiB,EAAS,cAAqB,EAAE,YAAq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AC,YAAY,CAAC,CAAC;IACtE,MAAM,CAAC,aAAa,EAAE,CAAC;IAEvB,IAAI,YAAY,EAAE;QACd,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACpD,wDAAwD;QACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;SAC/D;KACJ;AAEL,CAAC"}
✄
import { Cronet } from "../ssl_lib/cronet.js";
import { socket_library } from "./linux_agent.js";
import { PatternBasedHooking } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js";
import { devlog } from "../util/log.js";
-export class Cronet_Android extends Cronet {
+export class Cronet_Linux extends Cronet {
constructor(moduleName, socket_library, is_base_hook) {
super(moduleName, socket_library, is_base_hook);
this.moduleName = moduleName;
@@ -1044,7 +1187,7 @@ export class Cronet_Android extends Cronet {
}
}
export function cronet_execute(moduleName, is_base_hook) {
- var cronet = new Cronet_Android(moduleName, socket_library, is_base_hook);
+ var cronet = new Cronet_Linux(moduleName, socket_library, is_base_hook);
cronet.execute_hooks();
if (is_base_hook) {
const init_addresses = cronet.addresses[moduleName];
@@ -1438,14 +1581,14 @@ export function wolfssl_execute(moduleName, is_base_hook) {
}
}
✄
-{"version":3,"file":"cronet_macos.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/macos/cronet_macos.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,C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KACJ;AAEL,CAAC"}
+{"version":3,"file":"cronet_macos.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/macos/cronet_macos.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,MAAM,OAAO,YAAa,SAAQ,MAAM;IAEpC,YAAmB,UAAiB,EAAS,cAAqB,EAAE,YAAqB;QACrF,KAAK,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;QAD/B,eAAU,GAAV,UAAU,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAO;IAElE,CAAC;IAED,2BAA2B;QACvB,MAAM,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAErD,IAAI,iBAAiB,EAAE,EAAC;YACpB,MAAM,CAAC,qCAAqC,CAAC,CAAC;YAC9C,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAC,QAAQ,EAAC,QAAQ,EAAC,CAAC,IAAW,EAAE,EAAE;gBACpE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,4BAA4B;YAC3E,CAAC,CAAC,CAAC;SACN;IAOL,CAAC;IAED,aAAa;QACT,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACvC,CAAC;CAEJ;AAGD,MAAM,UAAU,cAAc,CAAC,UAAiB,EAAE,YAAqB;IACnE,IAAI,MAAM,GAAG,IAAI,YAAY,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;IACtE,MAAM,CAAC,aAAa,EAAE,CAAC;IAEvB,IAAI,YAAY,EAAE;QACd,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACpD,wDAAwD;QACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;SAC/D;KACJ;AAEL,CAAC"}
✄
import { Cronet } from "../ssl_lib/cronet.js";
import { socket_library } from "./macos_agent.js";
import { PatternBasedHooking } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js";
import { devlog } from "../util/log.js";
-export class Cronet_Android extends Cronet {
+export class Cronet_MacOS extends Cronet {
constructor(moduleName, socket_library, is_base_hook) {
super(moduleName, socket_library, is_base_hook);
this.moduleName = moduleName;
@@ -1455,8 +1598,8 @@ export class Cronet_Android extends Cronet {
const cronetModule = Process.findModuleByName(this.module_name);
const hooker = new PatternBasedHooking(cronetModule);
if (isPatternReplaced()) {
- devlog("Hooking libcronet functions by pattern");
- hooker.hook_DumpKeys(this.module_name, "libcronet.so", patterns, (args) => {
+ devlog("Hooking Cronet functions by pattern");
+ hooker.hook_DumpKeys(this.module_name, "Cronet", patterns, (args) => {
this.dumpKeys(args[1], args[0], args[2]); // Unpack args into dumpKeys
});
}
@@ -1466,7 +1609,7 @@ export class Cronet_Android extends Cronet {
}
}
export function cronet_execute(moduleName, is_base_hook) {
- var cronet = new Cronet_Android(moduleName, socket_library, is_base_hook);
+ var cronet = new Cronet_MacOS(moduleName, socket_library, is_base_hook);
cronet.execute_hooks();
if (is_base_hook) {
const init_addresses = cronet.addresses[moduleName];
@@ -1584,13 +1727,26 @@ export function boring_execute(moduleName, is_base_hook) {
}
}
✄
-{"version":3,"file":"pattern_based_hooking.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/shared/pattern_based_hooking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAC,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAenE,MAAM,OAAO,mBAAmB;IAK5B,YAAY,MAAc;QAFlB,aAAQ,GAAQ,EAAE,CAAC;QAGvB,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAEO,qBAAqB,CAAC,UAAkB;QAC5C,kDAAkD;QAClD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAC/D,mEAAmE;QACnE,MAAM,YAAY,GAAG,KAAK,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC;QAC5D,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC;IACpC,CAAC;IAED,kFAAkF;IAClF,aAAa,CACT,OAAe,EACf,YAAoB,EACpB,eAAsC,EACtC,kBAA4C;QAE5C,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;QAElC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE;YACzC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE;gBACjB,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;gBACjC,GAAG,CAAC,qBAAqB,YAAY,cAAc,OAAO,EAAE,CAAC,CAAC;gBAC9D,GAAG,CAAC,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,CAAC;YAC5C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE;YAChD,IAAI,CAAC,4BAA4B,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;SACjG;aAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC;YACjD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE;YACrD,IAAI,CAAC,4BAA4B,CAAC,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;SACtG;aAAK;YACF,KAAK,MAAM,cAAc,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;gBAChD,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;oBACzB,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE;wBAC1G,IAAI,CAAC,4BAA4B,CAAC,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;qBAChG;iBACJ;qBAAI;oBACD,MAAM,CAAC,qEAAqE,CAAC,CAAC;iBACjF;aACJ;SAEJ;IACL,CAAC;CACJ"}
+{"version":3,"file":"pattern_based_hooking.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/shared/pattern_based_hooking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,E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AI,EAAE,YAAY,CAAC,CAAC;qBAChG;iBACJ;qBAAI;oBACD,MAAM,CAAC,qEAAqE,CAAC,CAAC;iBACjF;aACJ;SAEJ;IACL,CAAC;CACJ"}
✄
-import { devlog, log } from "../util/log.js";
+import { devlog, devlog_error, log } from "../util/log.js";
import { isAndroid, isiOS, isMacOS } from "../util/process_infos.js";
+export function get_CPU_specific_pattern(default_pattern) {
+ let arch = Process.arch.toString(); // Get architecture, e.g., "x64", "arm64"
+ if (arch == "ia32") {
+ arch = "x86";
+ }
+ if (default_pattern[arch]) {
+ return default_pattern[arch]; // Return the pattern for the architecture
+ }
+ else {
+ throw new Error(`No patterns found for CPU architecture: ${arch}`);
+ }
+}
export class PatternBasedHooking {
constructor(module) {
this.patterns = {};
+ this.rescannedRanges = new Set(); // Set to keep track of memory ranges that have been rescanned
this.found_ssl_log_secret = false;
this.module = module;
}
@@ -1602,10 +1758,17 @@ export class PatternBasedHooking {
return new RegExp(regexPattern);
}
// Method to hook by pattern, with a custom function to handle onEnter and onLeave
- hookByPattern(pattern, pattern_name, onMatchCallback, onCompleteCallback) {
+ hookByPattern(patterns, pattern_name, onMatchCallback, onCompleteCallback) {
const moduleBase = this.module.base;
const moduleSize = this.module.size;
this.found_ssl_log_secret = false;
+ var pattern = "";
+ if (pattern_name === "primary_pattern") {
+ pattern = patterns.primary;
+ }
+ else {
+ pattern = patterns.fallback;
+ }
Memory.scan(moduleBase, moduleSize, pattern, {
onMatch: (address) => {
this.found_ssl_log_secret = true;
@@ -1621,11 +1784,71 @@ export class PatternBasedHooking {
}
});
},
+ onError: (reason) => {
+ if (!this.found_ssl_log_secret) {
+ devlog_error('There was an error scanning memory: ' + reason);
+ devlog_error('Trying to rescan memory with permissions in mind');
+ this.hookByPatternOnlyReadableParts(patterns, pattern_name, onMatchCallback, (pattern_success) => {
+ // If the primary pattern doesn't work, try the fallback pattern
+ if (!pattern_success) {
+ devlog("Primary pattern failed, trying fallback pattern...");
+ this.hookByPatternOnlyReadableParts(patterns, "fallback_pattern", onMatchCallback, (pattern_success_alt) => {
+ if (!pattern_success_alt) {
+ devlog("None of the patterns worked. You may need to adjust the patterns.");
+ }
+ });
+ }
+ });
+ }
+ },
onComplete: () => {
onCompleteCallback(this.found_ssl_log_secret);
}
});
}
+ // Method to hook by pattern, with a custom function to handle onEnter and onLeave
+ hookByPatternOnlyReadableParts(patterns, pattern_name, onMatchCallback, onCompleteCallback) {
+ devlog(`trying to scan only readable parts of ${this.module.name} ...`);
+ var pattern = "";
+ if (pattern_name === "primary_pattern") {
+ pattern = patterns.primary;
+ }
+ else {
+ pattern = patterns.fallback;
+ }
+ // Enumerate all readable memory ranges of the specified module and scan each one
+ this.module.enumerateRanges('r--').forEach((range) => {
+ const rangeKey = `${range.base}-${range.size}`; // Unique key for each memory range
+ devlog(`Scanning readable memory range in module: ${this.module.name}, Range: ${range.base} - ${range.base.add(range.size)}, Size: ${range.size}`);
+ Memory.scan(range.base, range.size, pattern, {
+ onMatch: (address, size) => {
+ this.found_ssl_log_secret = true;
+ log(`Pattern found at (${pattern_name}) address: ${address.toString()}`);
+ log(`Pattern based hooks installed.`);
+ // Attach the hook using the provided onMatchCallback
+ Interceptor.attach(address, {
+ onEnter: function (args) {
+ onMatchCallback(args);
+ },
+ onLeave: function (retval) {
+ // Optionally handle return value or additional behavior
+ }
+ });
+ },
+ onError: (reason) => {
+ devlog_error(`Error scanning memory for range: ${range.base} - ${range.base.add(range.size)}, Reason: ${reason}`);
+ },
+ onComplete: () => {
+ if (this.rescannedRanges.has(rangeKey)) {
+ return;
+ }
+ else {
+ onCompleteCallback(this.found_ssl_log_secret);
+ }
+ }
+ });
+ });
+ }
// Method to hook the module with patterns provided as arguments
hookModuleByPattern(patterns, onMatchCallback) {
const moduleBase = this.module.base;
@@ -1633,11 +1856,11 @@ export class PatternBasedHooking {
devlog(`Module Base Address: ${moduleBase}`);
devlog(`Module Size: ${moduleSize}`);
// Start by hooking using the primary pattern
- this.hookByPattern(patterns.primary, "primary_pattern", onMatchCallback, (pattern_success) => {
+ this.hookByPattern(patterns, "primary_pattern", onMatchCallback, (pattern_success) => {
// If the primary pattern doesn't work, try the fallback pattern
if (!pattern_success) {
devlog("Primary pattern failed, trying fallback pattern...");
- this.hookByPattern(patterns.fallback, "fallback_pattern", onMatchCallback, (pattern_success_alt) => {
+ this.hookByPattern(patterns, "fallback_pattern", onMatchCallback, (pattern_success_alt) => {
if (!pattern_success_alt) {
devlog("None of the patterns worked. You may need to adjust the patterns.");
}
@@ -1655,13 +1878,8 @@ export class PatternBasedHooking {
}
}
invoke_pattern_based_hooking(action, module_name, platform, arch, hookCallback) {
- /*const modulePatterns = this.patterns.modules[module_name][platform][0];
- const primaryPattern = modulePatterns.primary;
- const fallbackPattern = modulePatterns.fallback;*/
var action_specific_patterns = this.get_action_specific_pattern(module_name, platform, arch, action);
devlog(`Using ${action} patterns for ${platform} and ${arch}`);
- // Hook the module using the patterns
- //this.hookModuleByPattern({ primary: primaryPattern, fallback: fallbackPattern }, hookCallback);
this.hookModuleByPattern(action_specific_patterns, hookCallback);
}
// Function to retrieve patterns based on the current CPU architecture and action
@@ -1730,9 +1948,9 @@ export class PatternBasedHooking {
}
}
✄
-{"version":3,"file":"shared_functions.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/shared/shared_functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AAG9E,SAAS,uBAAuB,CAAC,WAAmB;IAChD,IAAI,eAAe,GAAG,CAAC,CAAC;IACxB,IAAI,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IACxD,IAAG,aAAa,KAAK,IAAI,IAAI,aAAa,KAAK,IAAI,EAAC;QAChD,GAAG,CAAC,cAAc,GAAC,eAAe,GAAC,mCAAmC,GAAC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IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IACnC,CAAC,CAAC;AACN,CAAC;AAGD,MAAM,UAAU,8BAA8B,CAAC,OAAiC;IAC5E,OAAO,KAAK;SACP,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,qDAAqD;SACnF,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,4CAA4C;SAC1G,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,uCAAuC;AAC1D,CAAC"}
+{"version":3,"file":"shared_functions.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/shared/shared_functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AAG9E,SAAS,uBAAuB,CAAC,WAAmB;IAChD,IAAI,eAAe,GAAG,CAAC,CAAC;IACxB,IAAI,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IACxD,IAAG,aAAa,KAAK,IAAI,IAAI,aAAa,KAAK,IAAI,EAAC;QAChD,GAAG,CAAC,cAAc,GAAC,eAAe,GAAC,mCAAmC,GAAC,WAAW,CAAC,CAAC;QACpF,UAAU,CAAC,uBAAuB,EAAC,eAAe,CAAC,CAAA;KACtD;AACL,CAAC;AAED;;;;;GAKG;AAEH,MAAM,UAAU,kBAAkB,CAAC,cAAsB,EAAE,sBAA0E,EAAE,WAA0B,EAAG,YAAoB,EAAE,YAAqB;IAC3M,KAAI,IAAI,GAAG,IAAI,sBAAsB,CAAC,cAAc,CAAC,EAAC;QAClD,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,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AE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,4CAA4C;SAC1G,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,uCAAuC;AAC1D,CAAC"}
✄
-import { log, devlog } from "../util/log.js";
+import { log, devlog, devlog_error } from "../util/log.js";
import { AF_INET, AF_INET6 } from "./shared_structures.js";
function wait_for_library_loaded(module_name) {
let timeout_library = 5;
@@ -1766,9 +1984,9 @@ export function ssl_library_loader(plattform_name, module_library_mapping, modul
func(module, is_base_hook);
}
catch (error) {
- devlog(`error: skipping module ${module}`);
+ devlog_error(`error: skipping module ${module}`);
// when we enable the logging of devlogs we can print the error message as well for further improving this part
- devlog("Loader error: " + error);
+ devlog_error("Loader error: " + error);
// {'description': 'Could not find *libssl*.so!SSL_ImportFD', 'type': 'error'}
}
}
@@ -1949,7 +2167,7 @@ export function getPortsAndAddresses(sockfd, isRead, methodAddresses, enable_def
}
}
else {
- devlog("[-] getPortsAndAddresses resolving error:" + addr.readU16());
+ devlog("[-] getPortsAndAddresses resolving error: " + addr.readU16());
throw "Only supporting IPv4/6";
}
}
@@ -2153,6 +2371,111 @@ export class Cronet {
}
}
✄
+{"version":3,"file":"flutter.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/ssl_lib/flutter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAKxC,MAAM,OAAO,OAAO;IAUhB,YAAmB,UAAiB,EAAS,cAAqB,EAAC,YAAqB,EAAS,6BAAgE;QAA9I,eAAU,GAAV,UAAU,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAO;QAA+B,kCAA6B,GAA7B,6BAA6B,CAAmC;QAPjK,mBAAmB;QACnB,2BAAsB,GAAqC,EAAE,CAAC;QAO1D,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B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C,GAAG,QAAQ,CAAA;QACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAC,GAAG,GAAC,aAAa,GAAC,GAAG,GAAC,UAAU,CAAC;QAC9D,IAAI,CAAC,OAAO,CAAC,CAAA;IACjB,CAAC;IAED,2BAA2B;QACvB,MAAM;IACV,CAAC;IAED,4BAA4B;QACxB,MAAM;IACV,CAAC;IAED,2BAA2B;QACvB,+CAA+C;IACnD,CAAC;CACJ"}
+✄
+import { get_hex_string_from_byte_array, readAddresses } from "../shared/shared_functions.js";
+import { devlog } from "../util/log.js";
+export class Flutter {
+ constructor(moduleName, socket_library, is_base_hook, passed_library_method_mapping) {
+ this.moduleName = moduleName;
+ this.socket_library = socket_library;
+ this.passed_library_method_mapping = passed_library_method_mapping;
+ // global variables
+ this.library_method_mapping = {};
+ this.module_name = moduleName;
+ this.is_base_hook = is_base_hook;
+ if (typeof passed_library_method_mapping !== 'undefined') {
+ this.library_method_mapping = passed_library_method_mapping;
+ }
+ else {
+ this.library_method_mapping[`*${socket_library}*`] = ["getpeername", "getsockname", "ntohs", "ntohl"];
+ }
+ this.addresses = readAddresses(moduleName, this.library_method_mapping);
+ }
+ get_client_random(s3_ptr, SSL3_RANDOM_SIZE) {
+ if (!s3_ptr.isNull()) {
+ const client_random_ptr = s3_ptr.add(0x30); // Offset in s3 struct
+ //@ts-ignore
+ const client_random = Memory.readByteArray(client_random_ptr, SSL3_RANDOM_SIZE);
+ // Convert the byte array to a hex string
+ const hexClientRandom = get_hex_string_from_byte_array(new Uint8Array(client_random));
+ return hexClientRandom;
+ }
+ else {
+ devlog("[Error] s3 pointer is NULL");
+ return "";
+ }
+ }
+ get_client_random_from_ssl_struct(ssl_st_ptr) {
+ const SSL3_RANDOM_SIZE = 32;
+ let offset_s3;
+ switch (Process.arch) {
+ case 'x64':
+ offset_s3 = 0x30;
+ break;
+ case 'arm64':
+ offset_s3 = 0x30;
+ break;
+ case 'ia32':
+ offset_s3 = 0x2C;
+ break;
+ case 'arm':
+ offset_s3 = 0x2C;
+ break;
+ default:
+ devlog("[Error] Unsupported architecture");
+ return "";
+ }
+ const s3_ptr = ssl_st_ptr.add(offset_s3).readPointer();
+ return this.get_client_random(s3_ptr, SSL3_RANDOM_SIZE);
+ }
+ dumpKeys(labelPtr, sslStructPtr, keyPtr) {
+ const KEY_LENGTH = 32; // Assuming key length is 32 bytes
+ let labelStr = '';
+ let client_random = '';
+ let secret_key = '';
+ // Read the label (the label pointer might contain a C string)
+ if (!labelPtr.isNull()) {
+ labelStr = labelPtr.readCString() ?? ''; // Read label as a C string
+ //devlog(`Label: ${labelStr}`);
+ }
+ else {
+ devlog("[Error] Argument 'labelPtr' is NULL");
+ }
+ // Extract client_random from the SSL structure
+ if (!sslStructPtr.isNull()) {
+ client_random = this.get_client_random_from_ssl_struct(sslStructPtr);
+ }
+ else {
+ devlog("[Error] Argument 'sslStructPtr' is NULL");
+ }
+ if (!keyPtr.isNull()) {
+ //@ts-ignore
+ const keyData = Memory.readByteArray(keyPtr, KEY_LENGTH); // Read the key data (KEY_LENGTH bytes)
+ // Convert the byte array to a string of hex values
+ const hexKey = get_hex_string_from_byte_array(keyData);
+ secret_key = hexKey;
+ }
+ else {
+ devlog("[Error] Argument 'key' is NULL");
+ }
+ //devlog("invoking ssl_log_secret() from BoringSSL statically linked into Cronet");
+ var message = {};
+ message["contentType"] = "keylog";
+ message["keylog"] = labelStr + " " + client_random + " " + secret_key;
+ send(message);
+ }
+ install_plaintext_read_hook() {
+ // TBD
+ }
+ install_plaintext_write_hook() {
+ // TBD
+ }
+ install_key_extraction_hook() {
+ // needs to be setup for the specific plattform
+ }
+}
+✄
{"version":3,"file":"gnutls.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/ssl_lib/gnutls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAe,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACjH,OAAO,EAAE,GA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,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;KACtE;IACD,OAAO,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,iBAAiB,GAAG,GAAG,GAAG,UAAU,CAAA;IACpF,IAAI,CAAC,OAAO,CAAC,CAAA;IACb,OAAO,CAAC,CAAA;AACZ,CAAC,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,AAxCtB,CAwCsB"}
✄
import { readAddresses, getPortsAndAddresses, getBaseAddress } from "../shared/shared_functions.js";
@@ -4583,7 +4906,7 @@ export function anti_root_execute() {
anti_root.execute_hooks();
}
✄
-{"version":3,"file":"log.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/util/log.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,GAAW;IAC3B,IAAI,OAAO,GAA8B,EAAE,CAAA;IAC3C,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;IAClC,OAAO,CAAC,SAAS,CAAC,GAAG,GAAG,CAAA;IACxB,IAAI,CAAC,OAAO,CAAC,CAAA;AACjB,CAAC;AAGD,MAAM,UAAU,MAAM,CAAC,GAAW;IAC9B,IAAI,OAAO,GAA8B,EAAE,CAAA;IAC3C,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA;IACtC,OAAO,CAAC,aAAa,CAAC,GAAG,GAAG,CAAA;IAC5B,IAAI,CAAC,OAAO,CAAC,CAAA;AACjB,CAAC"}
+{"version":3,"file":"log.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/util/log.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,GAAW;IAC3B,IAAI,OAAO,GAA8B,EAAE,CAAA;IAC3C,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;IAClC,OAAO,CAAC,SAAS,CAAC,GAAG,GAAG,CAAA;IACxB,IAAI,CAAC,OAAO,CAAC,CAAA;AACjB,CAAC;AAGD,MAAM,UAAU,MAAM,CAAC,GAAW;IAC9B,IAAI,OAAO,GAA8B,EAAE,CAAA;IAC3C,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA;IACtC,OAAO,CAAC,aAAa,CAAC,GAAG,GAAG,CAAA;IAC5B,IAAI,CAAC,OAAO,CAAC,CAAA;AACjB,CAAC;AAGD,MAAM,UAAU,YAAY,CAAC,GAAW;IACpC,IAAI,OAAO,GAA8B,EAAE,CAAA;IAC3C,OAAO,CAAC,aAAa,CAAC,GAAG,eAAe,CAAA;IACxC,OAAO,CAAC,eAAe,CAAC,GAAG,GAAG,CAAA;IAC9B,IAAI,CAAC,OAAO,CAAC,CAAA;AACjB,CAAC"}
✄
export function log(str) {
var message = {};
@@ -4597,6 +4920,12 @@ export function devlog(str) {
message["console_dev"] = str;
send(message);
}
+export function devlog_error(str) {
+ var message = {};
+ message["contentType"] = "console_error";
+ message["console_error"] = str;
+ send(message);
+}
✄
{"version":3,"file":"process_infos.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/util/process_infos.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,wBAAwB;IAChC,OAAO,OAAO,CAAC,IAAI,CAAC;AAC5B,CAAC;AAGD,MAAM,UAAU,SAAS;IACrB,IAAG,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,EAAC;QAC7C,IAAG;YACC,IAAI,CAAC,cAAc,CAAA,CAAC,yDAAyD;YAC7E,OAAO,IAAI,CAAA;SACd;QAAA,OAAM,KAAK,EAAC;YACT,OAAO,KAAK,CAAA;SACf;KACJ;SAAI;QACD,OAAO,KAAK,CAAA;KACf;AACL,CAAC;AAGD,MAAM,UAAU,KAAK;IACjB,IAAG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14 +5005,14 @@ export function getAndroidVersion() {
return casted_version;
}
✄
-{"version":3,"file":"cronet_windows.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/windows/cronet_windows.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,OAAO,cAAe,SAAQ,MAAM;IAEtC,YAAmB,UAAiB,EAAS,cAAqB,EAAE,YAAqB;QACrF,KAAK,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;QAD/B,eAAU,GAAV,UAAU,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAO;IAElE,CAAC;IAED,2BAA2B;QACvB,MAAM,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAErD,IAAI,iBAAiB,EAAE,EAAC;YACpB,MAAM,CAAC,wCAAwC,CAAC,CAAC;YACjD,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAC,cAAc,EAAC,QAAQ,EAAC,CAAC,IAAW,EAAE,EAAE;gBAC1E,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,4BAA4B;YAC3E,CAAC,CAAC,CAAC;SACN;IAOL,CAAC;IAED,aAAa;QACT,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACvC,CAAC;CAEJ;AAGD,MAAM,UAAU,cAAc,CAAC,UAAiB,EAAE,YAAqB;IACnE,IAAI,MAAM,GAAG,IAAI,cAAc,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;IACxE,MAAM,CAAC,aAAa,EAAE,CAAC;IAEvB,IAAI,YAAY,EAAE;QACd,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACpD,wDAAwD;QACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;SAC/D;KACJ;AAEL,CAAC"}
+{"version":3,"file":"cronet_windows.js","sourceRoot":"/Users/danielbaier/research/projects/github/issues/2024 fritap issues/friTap/","sources":["agent/windows/cronet_windows.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,OAAO,cAAe,SAAQ,MAAM;IAEtC,YAAmB,UAAiB,EAAS,cAAqB,EAAE,YAAqB;QACrF,KAAK,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;QAD/B,eAAU,GAAV,UAAU,CAAO;QAAS,mBAAc,GAAd,cAAc,CAAO;IAElE,CAAC;IAED,2BAA2B;QACvB,MAAM,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAErD,IAAI,iBAAiB,EAAE,EAAC;YACpB,MAAM,CAAC,wCAAwC,CAAC,CAAC;YACjD,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAC,eAAe,EAAC,QAAQ,EAAC,CAAC,IAAW,EAAE,EAAE;gBAC3E,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,4BAA4B;YAC3E,CAAC,CAAC,CAAC;SACN;IAOL,CAAC;IAED,aAAa;QACT,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACvC,CAAC;CAEJ;AAGD,MAAM,UAAU,cAAc,CAAC,UAAiB,EAAE,YAAqB;IACnE,IAAI,MAAM,GAAG,IAAI,cAAc,CAAC,UAAU,EAAC,cAAc,EAAC,YAAY,CAAC,CAAC;IACxE,MAAM,CAAC,aAAa,EAAE,CAAC;IAEvB,IAAI,YAAY,EAAE;QACd,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACpD,wDAAwD;QACxD,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACvC,MAAc,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;SAC/D;KACJ;AAEL,CAAC"}
✄
import { Cronet } from "../ssl_lib/cronet.js";
import { socket_library } from "./windows_agent.js";
import { PatternBasedHooking } from "../shared/pattern_based_hooking.js";
import { patterns, isPatternReplaced } from "../ssl_log.js";
import { devlog } from "../util/log.js";
-export class Cronet_Android extends Cronet {
+export class Cronet_Windows extends Cronet {
constructor(moduleName, socket_library, is_base_hook) {
super(moduleName, socket_library, is_base_hook);
this.moduleName = moduleName;
@@ -4694,7 +5023,7 @@ export class Cronet_Android extends Cronet {
const hooker = new PatternBasedHooking(cronetModule);
if (isPatternReplaced()) {
devlog("Hooking libcronet functions by pattern");
- hooker.hook_DumpKeys(this.module_name, "libcronet.so", patterns, (args) => {
+ hooker.hook_DumpKeys(this.module_name, "libcronet.dll", patterns, (args) => {
this.dumpKeys(args[1], args[0], args[2]); // Unpack args into dumpKeys
});
}
@@ -4704,7 +5033,7 @@ export class Cronet_Android extends Cronet {
}
}
export function cronet_execute(moduleName, is_base_hook) {
- var cronet = new Cronet_Android(moduleName, socket_library, is_base_hook);
+ var cronet = new Cronet_Windows(moduleName, socket_library, is_base_hook);
cronet.execute_hooks();
if (is_base_hook) {
const init_addresses = cronet.addresses[moduleName];
diff --git a/friTap/about.py b/friTap/about.py
index e105fa6..dbfa38e 100644
--- a/friTap/about.py
+++ b/friTap/about.py
@@ -2,5 +2,5 @@
# -*- coding: utf-8 -*-
__author__ = "Daniel Baier, Francois Egner, Max Ufer"
-__version__ = "1.2.2.1"
+__version__ = "1.2.2.8"
debug = False # are we running in debug mode?
\ No newline at end of file
diff --git a/friTap/ssl_logger.py b/friTap/ssl_logger.py
index 0393c22..158cd0c 100644
--- a/friTap/ssl_logger.py
+++ b/friTap/ssl_logger.py
@@ -138,6 +138,9 @@ def on_message(self, message, data):
if p["contentType"] == "console_dev" and p["console_dev"]:
if len(p["console_dev"]) > 3:
print("[***] " + p["console_dev"])
+ elif p["contentType"] == "console_error" and p["console_error"]:
+ if len(p["console_error"]) > 3:
+ print("[---] " + p["console_error"])
if self.verbose:
if(p["contentType"] == "keylog") and self.keylog:
if p["keylog"] not in self.keydump_Set:
diff --git a/package.json b/package.json
index 0eea5d6..148bf91 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "friTap",
- "version": "1.2.2.1",
+ "version": "1.2.2.89",
"description": "Frida agent for logging SSL traffic as plaintext and extracting SSL keys",
"private": true,
"main": "agent/ssl_log.ts",