DahuaSunriseSunset icon indicating copy to clipboard operation
DahuaSunriseSunset copied to clipboard

Exception while running on Dahua EZ-IP cameras

Open vascojdb opened this issue 3 years ago • 5 comments

Hi, I have 10 Dahua EZ-IP IPC-D20B20-ZS cameras, and unfortunately It seems your tool gives me an exception:

Exception thrown attempting web request (http://192.168.0.130/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1): The request was aborted: The operation has timed out.

Opening that link on a browser returns a 404 error page (generated by the camera, not the browser)

I tried to sniff the browser data being changed while sapping the Day/Night options via the web interface and I got this:

Message: POST
To: 192.168.0.130:80/RPC2
Authorization: Basic Authentication (user+pass)
Body: JSON with contents: {"method":"configManager.setConfig","params":{"name":"VideoInMode","table":[{"Config":[X],"Mode":0}],"options":[]},"id":0,"session":"528b19ba62cb02611358896"}

Where [X] is 1 or 0 depending on the day or night profile, the session ID its generated somewhere.

Has anyone contacted you related to any API changes? Since I am not able to find the cgi-bin directory.

Thank you so much for the information

vascojdb avatar Apr 29 '21 17:04 vascojdb

I don't know anything about that camera. Couldn't find it via google. It could be that the camera for some reason just doesn't support any of the usual APIs designed for 3rd-party use.

While it is possible to implement something that uses their internal API to basically impersonate a web browser and log in, send the command, and log out, that is not something this app supports.

Has anyone contacted you related to any API changes?

No.

bp2008 avatar Apr 29 '21 17:04 bp2008

This camera it is a Huawei product sold under Dahua name and yes it have all the backdoor required to be sold outside China. https://breakingdefense.com/2019/07/hunting-huaweis-hidden-back-doors/

rapi3 avatar Apr 29 '21 18:04 rapi3

Thank you for the fast answer. I actually managed to find a python script called DahuaRpc wrapper which implements an RPC protocol wrapper (https://gist.github.com/gxfxyz/48072a72be3a169bc43549e676713201), and I have managed to change the configuration on the cameras. Apparently these cameras use the API via RPC protocol.

vascojdb avatar Apr 29 '21 19:04 vascojdb

Unfortunatly I know nothing of C++/C# to be able to implement this on a fork of your project, so I am afraid I will have to just make a python script on my end :(

vascojdb avatar Apr 29 '21 19:04 vascojdb

here you can find something that can be useful if you change to use the RPC protocol wrapper you found it: https://github.com/mcw0/Tools

rapi3 avatar Apr 29 '21 19:04 rapi3