Skip to content

Commit bd8c3a6

Browse files
committed
Update Frida scripts for iOS native connect hooks
1 parent 979ad8b commit bd8c3a6

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

overrides/frida/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The scripts can automatically handle:
6262
-l ./config.js \
6363
-l ./ios/ios-connect-hook.js \
6464
-l ./native-tls-hook.js \
65+
-l ./native-connect-hook.js \
6566
-f $APP_ID
6667
```
6768
7. Explore, examine & modify all the traffic you're interested in! If you have any problems, please [open an issue](https://github.com/httptoolkit/frida-interception-and-unpinning/issues/new) and help make these scripts even better.
@@ -98,7 +99,7 @@ Each script includes detailed documentation on what it does and how it works in
9899

99100
This is a low-level hook that applies to _all_ network connections. This ensures that all connections are forcibly redirected to the target proxy server, even those which ignore proxy settings or make other raw socket connections.
100101

101-
This hook applies to libc, and works for Android, Linux, and many related environments (but not iOS or Mac).
102+
This hook applies to libc, and works for Android, Linux, iOS, and many other related environments.
102103

103104
* `native-tls-hook.js`
104105

@@ -138,7 +139,7 @@ Each script includes detailed documentation on what it does and how it works in
138139
139140
You probably don't want to use this normally as part of interception itself, but it can be very useful as part of your configuration setup.
140141

141-
This script allows you to configure a list of possible IP addresses and a target port, and have the process test each address, and send a message to the Frida client for the first reachable address provided. This can be useful for automated configuration processeses, if you don't know which IP address is best to use to reach the proxy server (your computer) from the target device (your phone).
142+
This script allows you to configure a list of possible IP addresses and a target port, and have the process test each address, and send a message to the Frida client for the first reachable address provided. This can be useful for automated configuration processes, if you don't know which IP address is best to use to reach the proxy server (your computer) from the target device (your phone).
142143
143144
---
144145

overrides/frida/native-connect-hook.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const PROXY_HOST_IPv6_BYTES = IPv6_MAPPING_PREFIX_BYTES.concat(PROXY_HOST_IPv4_B
2323

2424
const connectFn = (
2525
Module.findExportByName('libc.so', 'connect') ?? // Android
26-
Module.findExportByName('libc.so.6', 'connect') // Linux
26+
Module.findExportByName('libc.so.6', 'connect') ?? // Linux
27+
Module.findExportByName('libsystem_kernel.dylib', 'connect') // iOS
2728
);
2829

2930
if (!connectFn) { // Should always be set, but just in case

src/interceptors/frida/frida-scripts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export async function buildIosFridaScript(
5454
),
5555
...[
5656
['ios', 'ios-connect-hook.js'],
57-
['native-tls-hook.js']
57+
['native-tls-hook.js'],
58+
['native-connect-hook.js'],
5859
].map((hookRelPath) =>
5960
fs.readFile(path.join(FRIDA_SCRIPTS_ROOT, ...hookRelPath), { encoding: 'utf8' })
6061
)

0 commit comments

Comments
 (0)