Informatik und Kram

Da wir lange nicht wußten, wo wir das für die Uni ausgearbeitete Material unterbringen sollten und auch einen schrecklichen Drang hatten der Welt diverse Sachen aufzudrücken...

Network Cam IP-250E with Linux
de-flagge aktiviert en-flagge aktiviert

Last newsletter from pollin: the networkcam IP-250E from Iguard for just 50 euro. And since we were searching for a cam to directly plug into the fonera, this was clearly a sign!
But how do we get the stream now? For Windows there's already an app to watch the stream, but of course not for linux. So Andieh and Meissna did a little reverse engineering and hacked it together all night long, and voila, there it is!

Status Quo

The cam has a webinterface to setup different parameters like framerate, resolution and features like motion capture and image-upload together with email-notification. One can also setup ip and port-number, we tried to connect directly to the port with mplayer -> nothing. Nmapped the port -> nothing. So andieh fired up his virtualbox, cause wine wouldn't start the ipguard-software. The Windows app IGuardView directly gets the stream and allows you to watch it.

Capture some packets

But what's happening at this connection? Guess: Authentication at the port somehow and then start the stream. So lets watch whats passing the ether! A tcpdump -s 0 -i eth0 -o /tmp/output and starting IGuardView and we're on the way! Wireshark is one of the top candidates for data-analysis. ( The -s 0 switch tells tcpdump to log the whole packets.)

Reverse Engineering

First they exchange some packets to authenticate the user and create a connection. After that it requests new images with increasing numbers, which comes in 9-13 packets, each 1022 bytes.
The first packet from the cam contains 29bytes of information like the number of the image, size, etc. The next 941 bytes contain the image and start with the common JPEG Header "FF D8 FF".

TODO and Tips

Currently there's no user/password switch in our app. We created a user admin with password admin, if it doesn't match nothing happens! So first create this user with the webinterface before using our application!
Also remember to put gui.glade in the same directory as you pyView, it supplies the info for the GUI.

Result

Python rocks, so we wrapped it all up and built a GUI around it. The result is worth it! Here's the python-file, just change ip and port of the camera and start it with python pyView.py! And here's the video:

Kommentare

Kommentar schreiben