Close
0%
0%

Zmodo - Local Controller

Zmodo have some cool cameras! This project is about reversing protocols / bins of all things zomodo to bypass the cloud.

Similar projects worth following
This camera is really cool but is uses some "cloud app" for all video to be uploaded to. I would like to create a NodeJS server for this to bypass sending all my video / audio to China :) This is just a place for me to dump files and notes. If you want to help check out the main App3518 (which is the cpu Hi3518C) binary and help start to reverse it.

All files for this project are in the dropbox link. The main "App" file is App3518 and it is in the Dropbox link. This file is also the local webserver. It is responsible to posting video data to the MeShare website. You can downlod the MeShare app for IOS and Android as well if you would like to poke around in that.

What I am hoping for is some others that want to use this camera to get involved in the reversing of the networking protocol. I am not 100% certain.. But it might make more sense to place a different "app" on the device that we write and can post all the video data straight to our server code.

Amazon sells these cameras for around $38 here:

http://www.amazon.com/gp/product/B00ZZ4HX1K

Cameras known to run the same software (perhaps different hardware)

  1. Zmodo ZH-IXY1D
  2. Zmodo ZM-SH75D0001

If you know of a Zmodo camera running the same version (or contacting the same cloud servers) leave a comment and I will add them to the list. The App3518 has the shasum of ba5fa306d519c57124f9de96a1f007f0. App3518 is the main binary that runs on these Zmodo* cameras.

zmodoboot.txt

Out of the box boot log. This is before connecting to a wireless network.

plain - 49.00 kB - 01/16/2016 at 03:27

Download

zmodowireless.txt

Log showing the wireless connection process during and after setup.

plain - 28.64 kB - 01/16/2016 at 03:27

Download

  • Dumping the MTD Partitions

    ril3y01/21/2016 at 03:21 5 comments

    I went ahead and dumped the files to the Dropbox for the MTD partitions.

    https://www.dropbox.com/sh/adups6kczg65138/AACquDl-FP1ZT0KB1yB-4aGia?dl=0


    # cat /proc/mtd
    dev: size erasesize name
    mtd0: 00040000 00010000 "boot"
    mtd1: 000c0000 00010000 "config"
    mtd2: 00480000 00010000 "rootfs"
    mtd3: 00a80000 00010000 "app"

    More to come....

  • Initial rooting (or read that as loggin in) and poking around

    ril3y12/02/2015 at 19:16 2 comments

    There is a 3 pad test point on the other size of the main board. It is 3v3 ttl serial. tx rx gnd. Solder a few tiny wires to each pad then hook up to a ttl 3v3 usb to serial ( I use the prolific ones) and open a serial terminal (coolterm etc) 115200 8N1. I did place a dab of hot glue to hold the wires in place as to not pull the test point's pads right off of the pcb. I forgot to take a picture of it first. I have another camera on order and will post some pics when it gets in.

    This will drop you to a root shell.... Heres some boot messages.. The full boot messages are in the dropbox link.

    U-Boot 2010.06 (Apr 28 2015 - 09:46:30)
    
    Check spi flash controller v350... Found
    Spi(cs1) ID: 0x01 0x20 0x18 0x4D 0x01 0x80
    Spi(cs1): Block:64KB Chip:16MB Name:"S25FL129P1"
    MMC:   MMC FLASH INIT: No card on slot!
    In:    serial
    Out:   serial
    Err:   serial
    No mmc storage device found!
    Hit any key to stop autoboot:  1 ... 0 
    16384 KiB hi_sfc at 0:0 is now current device
    
    cramfs load file : /boot/hikernel
    ### CRAMFS load complete: 2409600 bytes loaded to 0x82000000
    ## Booting kernel from Legacy Image at 82000000 ...
       Image Name:   hilinux
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2409536 Bytes = 2.3 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Loading Kernel Image ... OK
    OK
    
    Starting kernel ...

    There is a really annoying feature that they felt the need to leave in place. All print statements from ./App3518 program seem to spit out to the tty. And its a very chatty program. However it does give you a glimpse into some of the communications with the "MeShare" streaming video service. Observe....

    Dec  2 14:02:09 <P2P>: web.cpp[471]web_report_upnp:recv:{"result":"ok","data":[],"addition":""}
    
    Dec  2 14:02:09 <P2P>: device_operation.cpp[744]p2p_send_cover_pic:begin upload cover picture for channel[0]...
    
    Dec  2 14:02:09 <P2P>: web_task.cpp[42]SetUrl:http://192.241.59.218:80/factorydevice/picture_report
    
    Dec  2 14:02:09 <P2P>: web_task.cpp[83]AddPostString:tokenid:p4yL5zwYSQRL8vcCNUbx9v12bmKcQF
    
    Dec  2 14:02:09 <P2P>: web_task.cpp[83]AddPostString:channel:0
    
    Dec  2 14:02:09 <P2P>: web_task.cpp[93]AddPostPicture:image_name:/tmp/cover.jpg
    
    Dec  2 14:02:09 <P2P>: web.cpp[402]web_report_picture:recv:{"result":"ok","data":"","addition":""}
    
    Dec  2 14:02:09 <P2P>: device_operation.cpp[942]p2p_is_timezone_set_by_meshare:timezone America/New_York, America/New_York
    
    Dec  2 14:02:09 <P2P>: web_task.cpp[42]SetUrl:http://192.241.59.218:80/factorydevice/gettimezone?tokenid=p4yL5zwYSQRL8vcCNUbx9v12bmKcQF
    
    Dec  2 14:02:09 <P2P>: web_task.cpp[252]SetConnectTimeout:[10]
    
    Dec  2 14:02:09 <P2P>: web.cpp[425]web_get_timezone:recv reply:{"result":"ok","offset_seconds":"-18000"}
    
    Dec  2 14:02:09 <P2P>: web.cpp[434]web_get_timezone:get timezone:-18000
    
    Dec  2 14:02:09 <P2P>: device_operation.cpp[905]p2p_set_timezone_offset[1170719936]
    
    Dec  2 14:02:11 <P2P>: p2p_sip.cpp[148]keep_alive_timer_func:keep alive timeout, resend !
    
    Dec  2 14:02:11 <P2P>: p2p_sip.cpp[120]send_keep_alive:send_keep_alive:{ "MethodName": "Option.update", "TokenId": "p4yL5zwYSQRL8vcCNUbx9v12bmKcQF", "DevId": "ZMD00ID02206860", "UserType": 2, "Interval": 90 }
    
    Dec  2 14:02:11 <P2P>: p2p_sip.cpp[40]p2p_keep_alive_cb:reply:{ "ResultCode": 0, "ResultReason": "ok", "CmuId": 1001000000 }
    
    

    The program generating all of these print statements is App3518 which I tftp'ed off of the device and posted in the dropbox link. There is also a message file which I am unclear of what it is doing.

    ril3ys-MBP:Zmodo Reversing ril3y$ file message App3518 
    message: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
    App3518: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped

View all 2 project logs

Enjoy this project?

Share

Discussions

Bill wrote 01/06/2016 at 04:55 point

I bought this camera from Frys Electronics and they list it as the Zmodo ZM-SH75D001-WA. The Packing List and label on the shrink wrap also call it the ZM-SH75D001-WA, but the carton and the camera itself only refer to the ZH-IXY1D. This confirms what chris wrote on 12/10/2015 below and the idea that these were rushed out the door.

The Zmodo site also has a Category on the KB page called FUNLUX. There are some references to this Zmodo camera (both numbers) on their "forum". The 2 different Zmodo model numbers add to the difficulty and confusion when searching for info on it.

I can confirm that a generic cell phone charging battery and cable will power the camera with no modifications.

I am not a programmer and can't add much technical help here, but I do want to mention that I can record a live stream from my unit directly to my QNAP NAS. I do it from the IE web GUI by right clicking on the live image and select Record. It records in a proprietary .264 file extension format that can't be played in VLC, MPC, DVDFab Media Player 2 or any other player I have tried. A Russian site I looked at hinted that the Zviewer application from Zmodo can play them, but I have not been able to do that. MediaInfo can read the data and a sample recording looks like this:

Format                                   : AVC
Format/Info                              : Advanced Video Codec
File size                                : 28.7 MiB

Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L3.1
Format settings, CABAC                   : No
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=100
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive

Note that there is no info on duration or Bit Rate, etc.

A readable BMP image CAN be saved in the same manner, just choose Capture instead of Record. The image I saved is 1280x720 and is 2.60 MB in size.

I have very little knowledge of Linux, but I do have a Raspberry Pi and am willing to help out testing with it or Windows if needed.

Hope this info is of use to a few of you.

  Are you sure? yes | no

Neil Cherry wrote 01/09/2016 at 00:07 point

Hi Bill, sounds like you have the same camera. The CH-S1A-WA or ZH-IXY1D or ZM-SH75D001 seemed to be based on the same hardware. The proprietary file format is not unusual, they seem to think it makes there product better (really???). But that's the Windows software and not the camera. The camera streams h264 video. I'm not an expert on video.

I would expect that the Raspberry Pi can run the commands I have used below. I haven't gotten any further on these cameras yet ( my friend gave me yet another, different camera, with PTZ that I've been hacking :-) ). So far I can get that one to give me video and I can start/stop the PTZ controls. That needs a bit more work. :-)

  Are you sure? yes | no

Neil Cherry wrote 01/04/2016 at 21:28 point

I've put all my notes up on my web site (I'll continue to post here also). I thought it would be nice to have the information sorted and tidied up a bit.

http://ushomeautomation.com/Notes/Funlux/index.html

Also I found some information that suggests that the audio might be: g711a (64Kbps), A-Law (64Kbps), or g726 (16Kbps). One can hope :-) I've got a trace with audio being sent from the PC browser and receiving. 

  Are you sure? yes | no

Neil Cherry wrote 01/03/2016 at 17:32 point

Single snapshot:

$ echo -e '\x55\x55\xaa\xaa\x00\x00\x00\x00\x00\x00\x00\x50' | netcat -w 2 192.168.24.130 8000 | avconv -i pipe:0 -q:v 1 -vframes 1 screenshot-%03d.png

  Are you sure? yes | no

Neil Cherry wrote 01/02/2016 at 03:54 point

Hehe! Success! I can now see the video stream in mplayer. Not sure how I'll get that into stills or into the browser but I can at least now make use of the camera. :-)

$echo -e '\x55\x55\xaa\xaa\x00\x00\x00\x00\x00\x00\x00\x50' |netcat -w 600 192.168.2.5 8000 | mplayer -fps 24.976 -demuxer h264es -

(soory, fixed that now)

  Are you sure? yes | no

gastonoso wrote 01/04/2016 at 19:44 point

Hi Neil. Congratulations for your progress ! Would you mind explain a little bit the script that you used?  Thank you. Regards.

  Are you sure? yes | no

Neil Cherry wrote 01/04/2016 at 20:56 point

Yes that is a bit of magic. This is quick and dirty programming via the bash command line on my Linux server . :-) I'll later write a program to do this but it will be much more complex but a lot faster. I try to use the command line when I need to toss together a proof of concept (and I stole parts of the commands from @Peter Jerde below, but I upvoted him too).

Short answer:

The echo command sends the magic string into the stdin of netcat, netcat sends it to the camera, the camera begins to stream the video and mplayer displays it on the console of the Linux computer.

Long answer:

The magic string ( '\x55\x55\xaa\xaa\x00\x00\x00\x00\x00\x00\x00\x50') is what tells the camera to start sending video. There are other magic strings also and I haven't figured them all out yet. The \x55 means translate that to the byte 0x55 in hex. That's a 12 byte string.

The camera is on IP 192.168.2.5 and listening on port 8000 for a command (that string above).

Netcat (or nc on some systems) sort of opens a 2 way pipe between the command line and the camera. It hides the network magic (watch with wireshark to see the magic). The -w 600 tells netcat to keep the connection open for 600 seconds (10 minutes). 

The mplayer will play the video. You need to be running X under Linux or Mac,

The fps is the frame per second (25 should work, I was messing around). I'm not sure what the ' -demux h264es - ' options mean exactly yet (other than treat the input as h264).

I'm not sure what to do on Windows.

If you wanted to save the video to a file you can use this command:

$ echo -e '\x55\x55\xaa\xaa\x00\x00\x00\x00\x00\x00\x00\x50' |netcat -w 600 192.168.2.5 8000 > video.h264

That should give you 10 minutes of video from the camera. Then you can use other tools to play the video. I plan on getting the video and images into a browser at some point.

  Are you sure? yes | no

Neil Cherry wrote 12/31/2015 at 23:34 point

I also have a similar camera. CH-S1R-WA (Funlux mini wireless). I'm able to telnet (as per above) into the device and the md5: 

# md5sum App3518
3497597d45ee5fd79825db92db1d6564  App3518

I've also found:

http://IPADDRESS/ with admin/111111 as ID and password.

I downloaded the cab file which results in a bunch of binaries and I think it's python source (odd but nice). I see that the device is listening on tcp ports 23, 80, 8000 and 9000 and using UDP ports 5844, 39770 and 8080.

I now also have a sniffer trace of the IE (cab) to camera communication. It's on port 8000 and it appears to be v7409. Unfortunately I'm not sure what to make of the stream yet.

More useful info:

$ (echo -e '\x55\x55\xaa\xaa\x00\x00\x00\x00\x00\x00\x00\x91') | netcat -w 600 192.168.2.5 8000 > video.h264

Gives me this:

$ ls -l video.h264
-rw-r--r-- 1 njc njc 52488 Jan  1 18:09 video.h264
$ file video.h264
video.h264: VISX image file

Well that was interesting, not sure what kind of file it really is but contained inside was my wifi information, in plain text (grrr).

  Are you sure? yes | no

alixjg wrote 12/22/2015 at 12:04 point

I recently purchased and setup a Funlux CH-S1R-WA, but I noticed after I took it out of the box, the back of it says ZH-IXY1D.  It uses meShare as well and appears to be the same camera, just different housing.  http://www.funlux.com/funlux-ip-network-cameras/indoor-ip-camera/720p-hd-wifi-wireless-network-ip-camera-with-audio.html I'm currently using this camera just as a baby monitor, but I'd really like to set it up with something like iSpy in the future.  I'm not of much help here, but I'd really like to see something become of this!

  Are you sure? yes | no

chris wrote 12/19/2015 at 19:22 point

  Are you sure? yes | no

Mark Alex wrote 12/17/2015 at 10:32 point
I also have since a few days a Zmodo ZH-IXY1D and I'm trying to use it for the Synology Surveillance Station (a DVR package for the NAS). So far I have also captured the network traffic from the ZViewer. The applications sends to commands via TCP to port 8000: First: 55 55 aa aa 00 00 00 00 00 00 02 90 This is slightly different than the one from Peter Second: 55:55:aa:aa:20:00:00:00:00:00:00:9a:61:64:6d:69:6e:00:00:00:00:00:00:00:00:00:00:00:31:31:31:31:31:31:00:00:00:00:00:00:00:00:00:00 This includes the default login / password: admin / 111111 Audio to and from devices seems to be via TCP port 9000

  Are you sure? yes | no

Neil Cherry wrote 01/01/2016 at 18:52 point

I think that port 9000 is for mobile devices. The settings under the cab file report web on 80, video on 8000 and mobile video on 9000. I don't know what the difference between 8000 and 9000 is yet.

Also my unit kind of works with: 55 55 aa aa 00 00 00 00 00 00 00 98 and my unit seems a bit different from everyone elses.

  Are you sure? yes | no

chris wrote 12/10/2015 at 20:25 point

Best I can tell the ZH-IXY1D is the same device as the ZM-SH75D001-WA. The latter is the model number on the box and what the device reports on the version tab of the embedded app. These things just sort of appeared out of nowhere and my local store was flooded with them for the holidays. Current firmware being advertised through the meshare app is v7.4.0.16

I bought a bunch of these hoping that I could use them with my DVR software, but they have the RTSP and ONVIF features disabled. I'm not a huge fan of them constantly streaming video and audio out to china 24/7.  So, we should hack the crap out of this and make it do our bidding

A couple things I noticed. The FCC number on the label on the rear of the camera mount is for a completely different product. It is for one of their wired cameras in a bullet type enclosure. I grabbed some hardware info from the filing for that product and the hardware inside really doesn't match. But, from poking around through telnet it looks like these cameras may be rushed out the door clones with stripped down firmware. I'm going to do a little more digging on the hardware this week and see if I can find another model that has the same boards inside. It may be easier to find and modify the running system on what this camera was based on than to reverse the stripped down firmware in this one.

  Are you sure? yes | no

ril3y wrote 12/11/2015 at 03:11 point

Chris,  Thanks for the comment!  BTW, @KitBag started reversing the "MeShare" to China networking communications.  I have another friend that took a stab at the MeShare app (like perhaps an hour?)  Its pretty horrible!  The MeShare app should be avoided.  Its first order of business is to post your data "encrypted" (aka base64 doh!) to some Chinese URL!  I will let @KitBag comment more but it looks like he's got the image data parsed and "un-encrypted" (de-base64'ed)

Very interesting work on the FCC id's.  I did not think about that one.  Also check out the dropbox folder it has all the data in there.  Including some files taken from the MeShare app (resources) that list a bunch of models that work with the MeShare App as well as their "update urls" which when visited shoot back some obsfucated data (7mb worth) as a firmware update.  I am not sure if this is the camera / android app yet.

If you want to join the project let me know.

  Are you sure? yes | no

chris wrote 12/12/2015 at 23:44 point

While tearing one of these down and running part numbers of components I noticed that there is a sister company called Funlux which has a comparable camera with a model number CH-S1R-WA. If I can locate one of these I'll see if it is just a repackaged clone of the hardware in these cameras. I'm also going to look into some other method of setting these cameras up to avoid the meshare app just to configure the wireless network. There is also an odd behavior that happens with the motion detection captures. Aside from the OCX and the Zsight PC apps not having the ability to record on motion detection even though you can configure them both for it. The meshare app will show 5 screen grabs plus a thumbnail. But, it does not have the date and time overlay on the image if you have it on. The camera name overlay shows just fine. Also, the default motion detect only seems to send to the meshare sight about half the time. 

  Are you sure? yes | no

les.v2 wrote 12/09/2015 at 20:34 point

Just to inform you, I succeed also to download file using Netcat, sorry for my simple question ;-)

  Are you sure? yes | no

ril3y wrote 12/11/2015 at 03:05 point

Sorry @les.v2 I missed your comments.  Anyhow good deal that you were able to get the files out.  I used tftp btw and setup a tftp server on my linux box then transferred the files out that I wanted.  Good job getting in!  What username/pass are you using for telnet.  I have not poked at it.  I just used the usart port on the board itself.

  Are you sure? yes | no

les.v2 wrote 12/19/2015 at 07:42 point

hi,

Telnet login: root

Telnet password: (empty)

To see file and access command line: just do a "cd /"

Enjoy ;-)

log:

(none) login: root
Password:
Welcome to HiLinux.
None of nfsroot found in cmdline.
# ls
# cd /
# ls
app            etc            lost+found     opt            system
bin            hdd00          mkimg.rootfs   proc           tmp
boot           home           mknod_console  root           tool
config         init           mnt            sbin           usr
data           lib            mount.sh       share
dev            linuxrc        nfsroot        sys
#

  Are you sure? yes | no

les.v2 wrote 12/09/2015 at 18:44 point

Device Version that I have: V7.8.0.14

  Are you sure? yes | no

les.v2 wrote 12/09/2015 at 18:43 point

But still a question for me, how I can download it on my computer ?

  Are you sure? yes | no

Neil Cherry wrote 01/04/2016 at 13:31 point

on the camera you can use:

ftpput -u USERNAME -p PASSWORD ftp_server_ip local_filename remote_filename

If you have a Linux ftp server you'll need to make sure it's enabled. On Windows you'll need an ftp server.

  Are you sure? yes | no

les.v2 wrote 12/09/2015 at 18:42 point

Oups, I found it ;-) but I don't have the same because certainly I updated the version recently

# md5sum App3518

17e8ddbcb18de29079c2a60f440a555b  App3518

  Are you sure? yes | no

les.v2 wrote 12/09/2015 at 18:38 point

Hi All, I have one also (ZH-IXY1D), I could help you ;-) For the moment, I just access in telnet to the camera but I have a question of beginner (may be :-), how do you calculate the md5 ? did you download the App3518 file and how ? Thanks in advance.

  Are you sure? yes | no

Peter Jerde wrote 12/08/2015 at 19:34 point

Here's the picture of the ZH-IXY1D inside and out:

http://imgur.com/a/F1TGQ

  Are you sure? yes | no

ril3y wrote 12/08/2015 at 21:40 point

Looks exactly the same.

  Are you sure? yes | no

Peter Jerde wrote 12/05/2015 at 21:35 point

So http://surveillance.zmodo.com/support-software has "zviewer for pc" which works to connect to and reconfigure the camera settings, including frames per second and bitrate etc.

I sniffed the traffic between zviewer and the camera, and discovered requesting the H264 video stream is pretty simple:

Just open a TCP connection to port 8000 on the camera and send these bytes: 55 55 AA AA 00 00 00 00 00 00 00 50

As long as you leave the connection open, the camera will just keep sending you a raw h264 bytestream which mplayer is able to play, and which  you can  manipulate with ffmpeg or whatever.

I was able to capture a stream for ten minutes with this:

(cat getstream; sleep 600) | nc CAMERA_IP 8000 > video.h264

where "getstream" is a binary file with those 12 bytes in it.

I'm going to keep sniffing around to see how to get audio, too.

  Are you sure? yes | no

ril3y wrote 12/05/2015 at 21:17 point

Well it really depends.  It looks like its a pretty capable arm board.  I think the camera streams RTSP video out of one of the ports its listening on.  I literally took about 20 minutes on this to see what I could do.  I am working another project but got stuck and had to do something else to take my mind of of it.  :)  I plan on taking some more time and interest on this in a few weeks.  I tossed it into IDA pro and its pretty clean.  Clear text passwords... No obsfucation no real anti-debugging stuff... So looks pretty doable. 

  Are you sure? yes | no

Peter Jerde wrote 12/05/2015 at 19:36 point

I have a new Zmodo ZH-IXY1D that appears to be the same product by a different name. The App3518 executable is the same (md5 ba5fa306d519c57124f9de96a1f007f0)

How doable is it to reverse engineer an executable and compile our own? I was sad that there didn't seem to be any tools present on the device to  "grab one jpeg image" and the like.

It's really slick how seamlessly these work with their app, getting through nat and such, but man it's creepy to have some faceless foreign company running a security camera with audio for me. I hope we can succeed in taking these cute cheap devices over for our PRIVATE use!

  Are you sure? yes | no

ril3y wrote 12/06/2015 at 23:30 point

Nice Peter.  I changed the description a bit to be more Zmodo* vs just the specific model I have.  Can you take some internal pics of the hardware and verify its the same? 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates