Commit Graph
65 Commits
Author SHA1 Message Date
Tim Perry de4493d1f7 Disable hostname verification for our CA certificate only
We previously left this in, since it's generally better to follow TLS
rules, but there's one case where it matters: when a client sends a
request without using SNI, and so the proxy may not show the right
certificate. We want to allow that, and to do so we need to ensure that
hostname checks are skipped (but only for our CA - not for any others,
which must still follow normal TLS rules).
2023-11-13 22:47:25 +01:00
Tim Perry 15869c6a7c Improve logging and error handling in Android cert injection 2023-11-10 14:12:22 +01:00
Tim Perry 61cb054e16 Handle non-message arguments in fallback script 2023-11-08 18:59:12 +01:00
Tim Perry 4cb2d44f6c Use targetMethod.call(this...) over this.[method](...)
This avoids the potential for bugs (calling the method directly does
dynamic lookup based on argument types, which may not match the called
method in ambiguous cases, e.g. int vs double are indistinguishable in
JS) and improves performance (skipping any dynamic method lookup).
2023-11-08 14:26:19 +01:00
Tim Perry dbbe864b35 Make the config structure a little clearer & easier to use 2023-11-08 13:48:37 +01:00
Tim Perry 676627d01f Handle the signature of built-in okhttp.Address in Android Nougat 2023-11-07 18:21:32 +01:00
Tim Perry 05d9b8ab44 Add more details about the multi-script structure & usage to the README 2023-11-03 19:11:39 +00:00
Tim PerryandGitHub ac328e719c Fix NLnet casing 2023-10-30 16:29:08 +01:00
Tim PerryandGitHub 4b7a49fb8a Tweak NLNet badge 2023-10-30 14:55:42 +01:00
Tim PerryandGitHub fae8b6024b Add NLNet funding details & badge to the README 2023-10-30 14:37:49 +01:00
Tim Perry 025ec5cc6c Add missing SPDX info to native-connect-hook 2023-10-24 18:08:46 +02:00
Tim Perry 996a76127e Update outdated CI step 2023-10-23 18:53:25 +02:00
Tim Perry 9fd6dfd249 Fix CI output artifact name 2023-10-23 18:45:56 +02:00
Tim Perry f3dff0bd63 Clear the certificate data, and add a helpful missing-config check 2023-10-23 18:43:53 +02:00
Tim Perry d88d6ef87a Add a nice blurb to script releases 2023-10-23 18:37:33 +02:00
Tim Perry f6fef5a46a Automatically publish pre-concatenated scripts for easy usage 2023-10-23 18:36:53 +02:00
Tim Perry 88d3796893 Leave a placeholder frida-script.js script to avoid broken URLs 2023-10-23 18:10:10 +02:00
Tim Perry 91d693f22d Tweak the README further 2023-10-23 17:53:02 +02:00
Tim Perry ae11390aee Add source & license info to script header comment 2023-10-23 17:49:41 +02:00
Tim Perry e126af2902 Expand and polish up the per-script documentation 2023-10-23 17:43:40 +02:00
Tim Perry fa12f2010d Migrate to AGPLv3 to align licensing with core HTTP Toolkit projects
This shouldn't significantly affect any normal usage (for Frida
scripts, redistribution _is_ distribution of the source code) but limits
the ability of others to directly turn these scripts into proprietary
closed source products elsewhere.
2023-10-23 16:49:33 +02:00
Tim Perry 50a23a38be Update README and move Android-specific scripts into a subdirectory 2023-10-23 16:48:30 +02:00
Tim Perry 48dee79145 Add an patch against additional check config on native Android OkHttp
This seems to be used internally by some Android TLS connections - note
that this is OkHttp (v2 I think), but vendored into com.android and used
internally, not as a separate module.
2023-10-20 17:28:42 +02:00
Tim Perry 65ca2d4664 Add an Android auto-patching fallback script 2023-10-20 17:23:18 +02:00
Tim Perry 2860d14600 Remove OkHttp <v3 and TrustKit hostname verification patches
Looks like they're actually the same implementation, it's just that
TrustKit inlined OkHttp's version.

These aren't required, as they doesn't implement certificate pinning,
and it's trivial to work around with any functional MitM setup: you
just have to return valid certs with the right hostnames. No need to
mess with that, best to check it properly, so dropped.
2023-10-19 21:51:51 +02:00
Tim Perry 6f6d8cce6f Remove unnecessary webview unpinning patch
WebViews use the system trust successfully, so as soon as you inject
into the default TrustedCertificateIndex, they start trusting the
certificate happily.
2023-10-19 21:47:20 +02:00
Tim Perry f30d5b8c42 Widen & make safer Trustkit, Appcelerator & Appmattus unpinning hooks
Previously, all three allowed _any_ cert - they now delegate to our
pre-configured TrustManager that allows only the one trusted cert
(protecting against a meta-mitm). In addition, Appmattus now covers two
entirely new cases that were missed before (for HttpsUrlConn and manual
TLS validation).
2023-10-19 20:48:46 +02:00
Tim Perry 1c5dcb1d4a Rename & tweak docs of native connect hook 2023-10-18 19:19:44 +02:00
Tim Perry bc70add19c Match native hook logging to the other scripts 2023-10-18 19:16:53 +02:00
Tim Perry 66873783ec Remove unnecessary lax Conscrypt hooks
This is covered more effectively by our injection of our system
certificate into the default trust store for all Conscrypt
implementations via the index.
2023-10-18 19:13:15 +02:00
Tim Perry e91199642d Change native hook to capture all ports by default
Capturing just a few ports makes sense for device-wide capture, but for
targeted interception it makes more sense to intercept absolutely
everything and handle issues separately (or not at all).
2023-10-18 18:37:00 +02:00
Tim Perry ff1882f3d5 Improve debug logging: log activated hooks & more clearly list conns 2023-10-18 18:33:37 +02:00
Tim Perry eaf6075303 Widen CWAC-Netsecurity CertPinManager hook 2023-10-18 18:32:01 +02:00
Tim Perry 6279e6e7a6 Remove overly lax hook on TrustManagerImpl
This isn't required, because our system certificate injection
prepopulates the index used by all trust managers anyway, so they trust
our cert regardless. As configured, the previous hook just trusted _all_
certificates, exposing 3rd party MitM risk - better to keep it strict
for just our certificate where we can.
2023-10-18 18:29:25 +02:00
Tim Perry f9ed941ba5 Add clearer start/stop wrappers around debug output 2023-10-18 18:15:34 +02:00
Tim Perry 99b6adcd5d Remove unnecessary (maybe problematic) setTimeout delays 2023-10-18 18:15:27 +02:00
Tim Perry 7800b44d53 Improve webview interception & unpinning 2023-10-18 17:17:33 +02:00
Tim Perry 1b1dbe7d58 Disable unnecessary AbstractVerifier patch
This only applied to a specific backport of Apache's HttpClient to
Android, from 2014, so this is pretty niche anyway.

Regardless of that, this doesn't actually do cert pinning - it just
disables all normal checks entirely. These scripts are intended to be
used for a working interception setup, so those shouldn't be required.
AbstractVerifier (in every version I can find) doesn't support check for
a specific cert or CA at all.
2023-10-17 16:22:13 +02:00
Tim Perry 385f6368f8 Add patch for Cordova/PhoneGap Advanced HTTP Plugin 2023-10-17 16:20:10 +02:00
Tim Perry e8bb2a160b Simplify & improve hooks for IBM WorkLight 2023-10-17 15:53:48 +02:00
Tim Perry bd9699ee05 Fix hook from PhoneGap sslCertificateChecker plugin 2023-10-17 15:52:52 +02:00
Tim Perry 45c83b1499 Improve log output for easier debugging 2023-10-13 18:24:10 +02:00
Tim Perry 5e094e2e6b Fix lots of errors in unpinning patch application logic 2023-10-13 18:22:50 +02:00
Tim Perry 897bf0f58a Improve CertPinManager unpinning hook 2023-10-13 18:19:25 +02:00
Tim Perry 6d7e711787 Improve TrustManagerImpl patch to trust exactly one cert (not _all_ certs) 2023-10-13 18:18:43 +02:00
Tim Perry 369d66115f Convert all core unpinning patches to a structured declarative format
This notably also adds a NetworkSecurityConfig hook en route, which
disables even reading the pins from the config in the first place.
2023-10-06 13:00:17 +02:00
Tim Perry 0ec1820af8 Add DEBUG_MODE configuration to toggle detailed logging 2023-09-21 19:59:03 +03:00
Tim Perry 6ee3d4ebb1 Centralize config parameters and document the use of each script 2023-09-19 20:40:21 +02:00
Tim Perry 653cb60b9e Manually hook libc connect() to capture even more traffic 2023-09-19 19:43:39 +02:00
Tim Perry 6ba4419e1b Add a script to directly inject one always-trusted cert into Conscrypt
This is a notably different approach to the past certificate unpinning
setup. Through this new mechanism, we trust just one additional
certificate (instead of disabling cert verification entirely) and handle
just the standard Android certificate trust (we'll integrate unpinning
into this later).

This uses a hardcoded cert for now just for testing, but that will of
course be configurable in future.
2023-09-19 11:35:14 +02:00