Open alexeyvasilyev opened 4 years ago
Thanks for the feedback! I also arrived to the same conclusions. IMMIS is a custom protocol but I suspect there is the same RTSP protocol under the hood, we just need to find out what the first characters of the communication mean. Take a look at my project bling-wrt, after applying that guide I could mitm the communication and saw that custom data doing dns spoofing and using sslstrip.
I also tried static analysis with retdec and confirmed they do not do mutual ssl but I didn't invest more time with the investigation. I also do not have XT2 cameras so it's difficult to implement it.
Have you been able to dump TCP data from liveview server? Can you share it?
Sorry I have only sniffed traffic between syncmodule and blinkservers and saw that binary data for commands. Liveview is directly done between camera and blink servers that's why camera needs wifi connection. The only way is DNS spoofing at your router level.
DNS spoofing will not work. It uses IP address, not FQDN (immis://3.125.19.18:443). More advanced approach is to make simple Android app with Blink's libwalnut.so component, run fake https server which just logs data and try to establish connection via libwalnut.so to that server. At least first connection packets should be logged.
Can you share sniffed traffic between syncmodule and blinkservers?
That immis URL is sent by blink to clients (app, bling) through rest api, nothing to do with actual communication between camera and blink. I talk about dnsspoofing at camera level as it uses DNS.
I do not have traces since that was several months ago, if you follow bling-wrt guide you will be able to get It. What I can tell you is that communication works doing a long-polling. What I could decrypt were commands like snapshot or liveview and I was impressed about the little data sent. Seems like an identifier to the action to execute plus the camera id.
Why not implementing your own .so that facades the libwalnut.so functions but also logs then decompile blinkapp replace and compile again?
Are you talking about injecting log functions into Blink's libwalnut.so? That is too complicated.
I haven't worked with so files but would It be possible to create a so library that declares same functions as libwalnut but inside directly calls libwalnut library? Then in your library you could log everything. So you have libwalnut.so (fake) that redirects calls to libwalnut_original.so. Just an idea I only develop por Windows platforms so no idea if it's feasible.
That will not work. The only possible solution is to inject log code by patching binary.
Blink supports two protocols for live view: rtsps and immis. Live view works via TLS connection with cipher TLS_RSA_WITH_AES_128_CBC_SHA256 only (at least in my case in Europe).
I have started reverse engineering Blink's Android app. This is what I found.
At the beginning only RTSP protocol was supported. It looks like they modified RTSP protocol since Blink skips some major RTSP commands.
Blink app 1.4.2 (2016-10-18)
Then starting from Android app Blink version 3.0 they added IMMIS protocol.
Blink app 6.0.12 (2020-07-03), libwalnut.so
I think IMMIS is a binary protocol. Typical live view URL is "immis://3.125.19.18:443/uMegdsAvghOuqc4j__IMDS_G8T1940001460JD4?client_id=12345"
These are headers of exported functions of libwalnut.so: