top | item 31494825

Extracting TLS keys from an unwilling application (2020)

145 points| wwarner | 3 years ago |m1el.github.io | reply

19 comments

order
[+] jcalvinowens|3 years ago|reply
Nice work!

I'm curious: did you consider hacking the Oculus binary to accept an SSL cert you made yourself, and MITM-ing it to see the traffic?

I'm sure they have it pinned and don't use the OS certs, but you could just overwrite the root cert that must exist in that binary somewhere with your own, right?

[+] severino|3 years ago|reply
> I'm curious: did you consider hacking the Oculus binary to accept an SSL cert you made yourself, and MITM-ing it to see the traffic?

Is that what he refers to when he says "I didn’t want to add extra root certificates and proxies to inspect all TLS traffic going on the machine", or are we talking about different things?

[+] zevv|3 years ago|reply
> but you could just overwrite the root cert that must exist in that binary somewhere with your own, right?

Unless they use certificate pinning, which is basically just verifying the CA's are not tampered with. Theoretically that could be attacked as well, but it prevents the "just replace the CA" case.

[+] spidey1|3 years ago|reply
Is there a similar tool that a non-security expert could use on the Mac?
[+] matheusmoreira|3 years ago|reply
If the application isn't pinning certificates, you should be able to add your own root certificate to your machine and intercept all encrypted traffic. Same method used by corporations to monitor their own networks. I successfully used this method on a mobile game years ago.

Applications with pinned certificates don't use the system certificates at all which fixes the MITM vulnerability I described. You'd need to reverse engineer them in order to change the certificate to one under your control, difficulty can vary depending on how obfuscated the code is.

[+] chasil|3 years ago|reply
If your application can also use clear text TCP sockets, then stunnel becomes an option.
[+] kasane|3 years ago|reply
What resources could I use to learn how to do this sort of work on my own initiative?
[+] funcDropShadow|3 years ago|reply
If OpenSSL was under LGPL you could relink the Oculus software with a version of OpenSSL that supports exporting the keys.
[+] bruce343434|3 years ago|reply
You can still do that, but maybe not publish your method.