Live data from Hacker News

Reverse-engineering an encrypted IoT protocol

smlx.dev

21–30 of 44 posts

Re: Reverse-engineering an encrypted IoT protocol

#21

Next time you find yourself reverse engineering a weird protocol - use ImHex. You can literally define patterns (in a C++ / Rust -like language) so that your binary file gets highlighted and processed. I can't recommend it enough - it's perfect for the job and it's free and Open Source. https://imhex.werwolv.net/

[deleted]

Re: Reverse-engineering an encrypted IoT protocol

#22

Next time you find yourself reverse engineering a weird protocol - use ImHex. You can literally define patterns (in a C++ / Rust -like language) so that your binary file gets highlighted and processed. I can't recommend it enough - it's perfect for the job and it's free and Open Source. https://imhex.werwolv.net/

Do you know about any protocol deciphering tool?

I'm trying to reverse engineer a kinda simple tcp data stream, and the values are tag-length-value for the most part, and I made a simple mitm proxy that prints known tags and their data values (that I was able to decipher) live, but I am doing the deciphering of known and unknown tags manually, but I was wondering if there is some way to automate this?

I basically would be interested in automatic seen tag tracking, replaying select tags many times to see if they are idempotent, replaying and modifying bytes on a select tag, omitting a select tag and seeing how the client responds.

I guess I could find the socket receive function in the binary and see if the tag values are in a switch or something too but like the original article, it's also new territory for me to read that.

I am just about to expand my mitm proxy with more code to inject/filter packets.

Re: Reverse-engineering an encrypted IoT protocol

#23
post #22

Next time you find yourself reverse engineering a weird protocol - use ImHex. You can literally define patterns (in a C++ / Rust -like language) so that your binary file gets highlighted and processed. I can't recommend it enough - it's perfect for the job and it's free and Open Source. https://imhex.werwolv.net/

Do you know about any protocol deciphering tool? I'm trying to reverse engineer a kinda simple tcp data stream, and the values are tag-length-value for the most part, and I made a simple mitm proxy that prints known tags and their data values (that I was able to decipher) live, but I am doing the deciphering of known and unknown tags manually, but I was wondering if there is some way to automate this? I basically wou…

Have you tried Wireshark? It does support Lua templates, although for the initial analysis I would still suggested ImHex

Re: Reverse-engineering an encrypted IoT protocol

#24

Earlier quoted context omitted.

Just piggybacking here to mention a variety of other "interpret structured binary data" tools. Apparently I collect links to these (: * fq - like jq for binary data: https://github.com/wader/fq * Kaitai Struct - https://kaitai.io/ ** visualizer, for the above: https://github.com/kaitai-io/kaitai_struct_visualizer/ * HexFiend - a hex editor, but with "binary templates" feature : https://github.com/HexFiend/HexFiend **…

is binwalk still used these days?

From my experience, yes, it's still quite useful to find embedded formats

Re: Reverse-engineering an encrypted IoT protocol

#26
post #25

Well... MY IoT devices don't have garbage security.

I only buy IoT devices with security so garbage that I can make them do my bidding and not somebody else's.

Hopefully a market for these devices remains thriving. It would suck if it wasn't possible to flash the firmware of a robot vacuum cleaner (et al) so that it becomes a LAN device.

Re: Reverse-engineering an encrypted IoT protocol

#27

Earlier quoted context omitted.

Just piggybacking here to mention a variety of other "interpret structured binary data" tools. Apparently I collect links to these (: * fq - like jq for binary data: https://github.com/wader/fq * Kaitai Struct - https://kaitai.io/ ** visualizer, for the above: https://github.com/kaitai-io/kaitai_struct_visualizer/ * HexFiend - a hex editor, but with "binary templates" feature : https://github.com/HexFiend/HexFiend **…

is binwalk still used these days?

binwalk or even strings as your first steps for shaking down a binary is often still very useful before pulling out the big guns

Re: Reverse-engineering an encrypted IoT protocol

#28

Next time you find yourself reverse engineering a weird protocol - use ImHex. You can literally define patterns (in a C++ / Rust -like language) so that your binary file gets highlighted and processed. I can't recommend it enough - it's perfect for the job and it's free and Open Source. https://imhex.werwolv.net/

Just piggybacking here to mention a variety of other "interpret structured binary data" tools. Apparently I collect links to these (: * fq - like jq for binary data: https://github.com/wader/fq * Kaitai Struct - https://kaitai.io/ ** visualizer, for the above: https://github.com/kaitai-io/kaitai_struct_visualizer/ * HexFiend - a hex editor, but with "binary templates" feature : https://github.com/HexFiend/HexFiend **…

Not free, but I have used 010 Editor for years and it's excellent.

Re: Reverse-engineering an encrypted IoT protocol

#29

He mentioned having a private, firewalled VLAN. Is there anywhere to get more info or example setups for the beginner homelabber? I've got Unifi gear, I poke around the interface. I realize I can make new VLANs, but what makes them isolated/private? Also I see his complaints about half assed security but I actually am kind of relieved. If the security was implemented well we wouldn't be able to make our own man-in-th…

I use openwrt

I will say learning how to do it is a pain, but once I got an internal vlan in place, my life got significantly better.

You just want a small internal network that can't get out, or can get out through a proxy.

I set up:

- ipv4 only - cut my configuration in half

- private dns server for the vlan - only resolve internal addresses

- dhcp

- private time server

- privoxy proxy for controlled access to a whitelist of outside

Re: Reverse-engineering an encrypted IoT protocol

#30
MIPS? Wow. Would not have expected that! I guess they went as low budget as possible.

That key tho. /facepalm/ They REALLY don't care about security. Seriously, at least get PSA level 1 FFS and use TLS. But I doubt a cheap-ass MIPS has the horsepower for a handshake.

Post reply on HN