27

Hi everyone, I've been trying to understand how MiTM setups like a transparent proxy work.

Obviously, the use-case here is in a personal scope: I'd like to inspect the traffic of some of my machines. I am aware that Squid can be a transparent proxy, and some might use the Burp Suite to analyse network traffic.

Could someone explain the basic networking and the concept of certificates in this scenario? I feel like I don't understand how certificates are used well enough.


For example: I realise that if someone inserts a root certificate in the certificate store of an OS, the machine trusts said CA, thus allowing encrypted traffic from the machine to be decrypted. However, say the machine was trying to access Amazon; won't Amazon have its own certificate? I don't know how I'm confused about such a simple matter. Would really appreciate your help!

you are viewing a single comment's thread
view the rest of the comments
[-] stifle867@programming.dev 4 points 1 year ago

There are some cases where this would not work by the way. It's called certificate pinning and it's basically when an application comes with the trusted certificate for a host built-in. Even if you were to override it with a root certificate in the certificate store, the app simply wouldn't use it.

[-] MigratingtoLemmy@lemmy.world 1 points 1 year ago

Shouldn't flushing the cache mitigate this problem?

[-] stifle867@programming.dev 6 points 1 year ago

No, not at all. The request never hits the cache. The certificate is stored within the app and all internet communication is specifically pinned to said certificate. It doesn't even ask your certificate store.

[-] MigratingtoLemmy@lemmy.world 1 points 1 year ago

I see. Thanks, I'll have to rethink the idea in that case.

[-] stifle867@programming.dev 2 points 1 year ago

Yeah, unfortunately it's a huge barrier if you're wanting to see why your devices are phoning home and the data being sent. It makes it extremely difficult if not impossible for most people to bypass.

[-] MigratingtoLemmy@lemmy.world 1 points 1 year ago

I understand. What other methods would you suggest to be able to snoop on/decrypt the traffic from my device?

[-] stifle867@programming.dev 3 points 1 year ago* (last edited 1 year ago)

Specifically for attempting to bypass certificate pinning you're solidly in the realm of reverse engineering. I haven't attempting it myself but I have read the efforts of others over the years and the process was quite evolved and ever changing. If you are interested in going down this rabbit hole you may use these links as starting points but be prepared to adapt them.

https://felipe-herranz.medium.com/uncertify-a-tool-for-recompiling-android-apps-bypassing-different-certificate-pinning-techniques-de3d30ded2c6

https://gist.github.com/approovm/e550374428065ff1ecafca6a0488d384

https://frida.re/

https://codeshare.frida.re/browse

Best of luck.

[-] MigratingtoLemmy@lemmy.world 2 points 1 year ago

Thanks, I had heard of frida before, but never tried it. I'll save this comment, many thanks for the pointers!

this post was submitted on 24 Oct 2023
27 points (100.0% liked)

Selfhosted

39964 readers
234 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS