An alternative approach would be to use the browser tools or a browser extension, such as Google Developer Tools for Chrome or Web Console for Firefox. These tools will show you the entire request, response, and body of all network traffic and timeline of when connections are made. In Chrome, you can even edit the page content and review how it affects the ...
If you can make the application use a proxy, check Fiddler.
I used stunnel recently to do the same with an android application - used the dextojar suite to take the application apart, replace the https://game.server.com URL with a http://game.server.com URL in the .dex file, re-create the .dex checksum, re-create and sign the apk, install the apk.
Use this ...
An alternative approach might be to use panda to extract the key from a trace as documented in the panda ssl tutorial. That said, the usual mitm approach is probably a bit easier to get going unless you're dealing with certificate pinning.
(Copy of an answer I gave on Stack Overflow)
You could try injecting code into the Android app to sniff and dump SSL traffic. Take a look at https://github.com/5alt/ssl_logger (5alt's fork works with Android). Note that you need root for this.
This works by hooking functions inside OpenSSL so that the raw traffic can be dumped before encryption/after ...
I managed to decompress it in Python by specifying the decompression dictionary:
header = ("783fe3c6a7c2003b01c4fe00000009000000073a6d6574686f"
The content is encoded with gzip per the Content-encoding header. You can use the decoder in Burp proxy (if that is what you are currently using) to decode the data or by using for intance gunzip in the Linux command line.
I am using burpsuite for HTTPS inspection. Need to install its root cert on the phone. Most apps does not verify cert, or uses phone cert store. Windows users often use Fiddler.
These tools generate a new CA cert, that needs to be moved to the phones cert store, and be trusted.
In case the app downloads cert first time, and uses SSL pinninng, it is best to ...
I will answer my own question because I figured out what was wrong.
The app was not functioning correctly for a number of reasons that frustrated the analysis. For one, there were many advertising domains being contacted by the app on startup. The app made these connections over TLS and the connections would not succeed without trusting the proxy root CA ...
It seems that most of the people are better using the mitmproxy tool (see docs) together with SSLsplit for this kind of usage.
Just for the sake of completeness, here are a few pages explaining how to do:
Intercepting SSL and HTTPS traffic with mitmproxy and SSLsplit.
MITM attack over HTTPS connection with SSLStrip.
Use SSLsplit to transparently sniff TLS/...
Ok, I figured it out. The websocket-client library I use for python writes its own Origin header by default and I was ending up with two Origin headers, which may have been tipping off the server.
I found out you can disable it by adding supress_origin=True when calling connect on the WebSocket.
If you're a Windows user, as a matter of dynamic analysis, you could try using an emulator like BlueStacks, then inspect your system network traffic with a program like Fiddler or WireShark.
Additionally, you could use a program like Cheat Engine to open the BlueStacks process and scan its memory for strings related to URLs. As an aside, you could ...
This isn't a complete answer but I don't have enough rep to comment yet.
First off, giving us binary data with all the non-printable characters presented as ? doesn't help. Try piping it through xxd (like nc -l 8883 | xxd) to get a hex dump which would be far more useful.
When you ran mitmproxy were you using the real device? This is unclear from your ...
Since you are want to bypass HTTPS encryption, why not use Fiddler?
Fiddler is a web debugging proxy that auto-sets itself as the system proxy. It also offers the option to install a self-signed root certificate at the system, so HTTPS sniffing can be done.
All you have to do is start Fiddler, go to Tools -> Fiddler Optios -> HTTPS tab -> check "Decrypt ...
Maybe some of the following tools may help you:
"SSLHOOK is a Win32 DLL that allows hooking of the OpenSSL functions SSL_read and SSL_write"
Immunity Debugger (immdbg) has the !hookssl command (hookssl.py)
If the application in question doesn't verify SSL encryption then you can strip SSL using an intercepting proxy. However, if the application does verify SSL and throws an error if encryption is stripped, one option is to create your own SSL certificate pair and add it to your OS certificate trust store like so: