Closed dragon788 closed 1 year ago
I've not done much work on this in a while and am currently exploring other (hopefully soon to be open-sourced) approaches using mqtt and some custom firmware. I don't see the value that protobuf would provide given that the inner payload of the inform is a JSON blob. That being said, if you want to submit a pull-request as a proposal of what you're thinking I'd be willing to consider merging it.
Hmm, is it using JSONP or just regular JSON with a number of fairly static fields defined for the messages?
The protocol is basically TR-069 with a plain JSON payload. The payload structure seemed pretty static but was device dependent (access points different than mFI devices). I didn't actually test what the Unifi routers are sending but I think it's a variant of the config.json used by the controller. I also haven't tested any new Dream based hardware.
Interesting, I hadn't heard of TR-069 before, but while looking it up I found TR-369 which might be what they are using. There is even a mention of using protobuf to allow for a more flexible data structure to accommodate new endpoint types.
https://usp.technology/specification/
https://www.qacafe.com/articles/data-collection-analytics-with-tr069-tr369-usp/
Have you tried decrypting the packets and testing them? I have not done so for newer generations of hardware but it was definitely TR-069 encapsulated JSON back when I did the original reverse engineering. That being said, the protocol does allow for setting the protocol version and the data version, so it would be at least theoretically possible for them to use protobufs in newer products.
Out of curiosity, are you interested in interoperability with UI gear or are you trying to use this protocol for a different design?
It's worth noting that the UI implementation is more TR-069 inspired than it is implemented per the spec. It doesn't use XML or SOAP for signalling within a packet. It also uses an initial static bootstrapping secret for encryption and then negotiates a per-device key after that. TLS wasn't introduced into the mix until about a year ago and even then it's not strictly mandatory IIRC. This is far from a secure protocol, especially for someone with passive listening or man-in-the-middle capability on a network that's bootstrapping to a controller.
https://developers.google.com/protocol-buffers
https://github.com/protocolbuffers/protobuf#protobuf-runtime-installation