How to manage C # device firmware using HTTP?

I have a piece of hardware with built-in user control that can be accessed by entering the IP address of the device in a web browser. The device connects directly to the computer via an x-over ethernet cable and static IP addresses. I need to integrate device management into my C # application.

My thought was to use packet sniffer to track traffic between my PC and the device, while playing with the device’s controls in my web browser. Then find out which packages my computer sends correspond to the controls that I use at that time. Then I can create a class of HTTP or TCP packets in my C # application and send them to the device using the Socket class.

However, I am not very versed in network protocols, so when I use Wireshark to track traffic between my PC and my device, I’m not sure where to even start when we find out which packages do what. Does anyone have any ideas? I am open to everything. Thanks!!

EDIT: It's hard to explain what my device is, but its mostly a sophisticated sensor and is commonly used in industrial applications, so it can probably use Modbus, which I'm pretty familiar with. Do you know how I can determine which protocol is used to verify packets? I noticed (using Wireshark) that packets sent from my PC to the device appear in a template of 1 HTTP packet, then 5 TCP packets and repeat the same sequence while the control is open in my browser. Are there any resources that could better understand what is happening?

+4
source share
2 answers

If this is controlled by the browser, I thought that first we’ll look at the web pages that the device will send to your browser and see what the browser is instructed to do when you manipulate the controls β€” it seems a lot easier than messing with Wireshark.

Is there something that I am missing that makes this impossible (for example, a Flash-based management system)? If it's just done using HTML or Javascript, as well as HTML POST messages or something more complex like Ajax, it should be relatively easy to work with the interface.

+3
source

Depending on the device, it will either use a variant of the Modbus protocol ( http://en.wikipedia.org/wiki/Modbus ), or something unclear and unpretentious.

The best thing to do is to continue sending the same command to the device again and again until you can recognize the similarities in the packets.

If it is propriatory, it will probably be something as simple as a couple of commands / data or perhaps an XML block. If you are really unlucky, it will be compressed or encoded, but if you do not hack a game or an ATM, this is unlikely.

Asking the device manufacturer if they can give you the specification often also works.

+2
source

All Articles