httptoolkit / frida-interception-and-unpinning

Frida scripts to directly MitM all HTTPS traffic from a target mobile application
https://httptoolkit.com/android/
GNU Affero General Public License v3.0
1.06k stars 198 forks source link

new setup is complicated #51

Closed ghost closed 11 months ago

ghost commented 11 months ago

the new setup seems to be really complicated, which I don't like. I guess if the end result is better unpinning that is good, but I think it would help explain the extra complexity. for example:

  1. why is config.js even needed? the previous script did not need to know this information. Note I am using Android Studio with MITM Proxy and not HTTP Toolkit, not sure if that makes a difference.

  2. why are we ALSO needing to supply an ADDITIONAL 5 scripts on top of config.js? I think it would be helpful to explain what people are getting using all 6 scripts versus just one or two.

  3. what is the absolute minimum needed to have some form of unpinning support? just config.js and one other JS file? if so which one?

pimterry commented 11 months ago

To be clear, if the old script is easier, you can keep using it! It's all in the git history - the final version is available here.

why is config.js even needed?

Config.js itself doesn't really do anything - it just defines variables used by the other scripts.

It's needed because the scripts now do lots of things they didn't used to. Most notably:

The end goal is that you can take a totally fresh device or emulator, install Frida, run these scripts, and immediately see all the traffic - no other setup required.

For these, it needs two settings (the proxy host+port, and the CA certificate) and there's also a new DEBUG_MODE boolean that makes it much easier to debug how this setup is working (or not) so you can tweak it for your specific target. Those settings are all defined in config.js.

why are we ALSO needing to supply an ADDITIONAL 5 scripts on top of config.js? I think it would be helpful to explain what people are getting using all 6 scripts versus just one or two.

What each of the scripts does is documented in the big comment at the top of each one.

I think they also have quite clear names to be honest, but PRs for improvements to any of this are welcome of course.

what is the absolute minimum needed to have some form of unpinning support?

To do just Android unpinning alone, on a device that's otherwise fully setup for interception, you want just config.js (really just the CERT_PEM variable) and android/android-certificate-unpinning.js.

You might also want android/android-certificate-unpinning-fallback.js, which adds some more experimental unpinning that can help to handle unrecognized weird cases (it attempts to patch unknown failures by pattern matching, to handle fully obfuscated cases).

Does that make sense?

ghost commented 11 months ago

this is great information thanks. sorry if I came off harsh, I love this repo its very useful. I would only ask that you add this info to the readme, or at least link to this issue from the readme to help with the transition of any users of the old script

pimterry commented 11 months ago

Good suggestion, I've added more details in the README: https://github.com/httptoolkit/frida-interception-and-unpinning#the-scripts