How to restart or reboot some Dahua device like NVR by command?

TIGOS1

n3wb
Joined
Feb 25, 2020
Messages
29
Reaction score
3
Location
Odessa, Ukraine
Please tell me how to reboot (restart) some devices DAHUA by console command?
Maybe CGI command?

For example NVR5864-4ks2 with last firmware
 

TonyR

IPCT Contributor
Joined
Jul 15, 2014
Messages
16,451
Reaction score
38,164
Location
Alabama
Thank you!

New question.. :)

How to send in commandline login and password?
Put the login between HTTP and the NVR's IP address, like this:

Code:
http://username:password@192.168.1.108/cgi-bin/magicBox.cgi?action=reboot
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,342
Reaction score
3,524
Put the login between HTTP and the NVR's IP address, like this:

Code:
http://username:password@192.168.1.108/cgi-bin/magicBox.cgi?action=reboot
But make sure you're using digest authentication or it won't work.

There's also an unprivileged attack that can crash or reboot (or worse) some firmware versions. So don't expose it to the internet.
 

TIGOS1

n3wb
Joined
Feb 25, 2020
Messages
29
Reaction score
3
Location
Odessa, Ukraine
But make sure you're using digest authentication or it won't work.

There's also an unprivileged attack that can crash or reboot (or worse) some firmware versions. So don't expose it to the internet.
Where i can turn ON digest authentication?



Put the login between HTTP and the NVR's IP address, like this:

Code:
http://username:password@192.168.1.108/cgi-bin/magicBox.cgi?action=reboot
This line is not accepted by browser

This line only works for RTSP protocol



I'm trying to automate this on my router using commands to the NVR executed by the FETCH router console command.

http://192.168.1.20/cgi-bin/magicBox.cgi?action=reboot
admin
admin1111

For Base64 coding I use that data
admin:admin1111

Does not work all of that

/tool fetch url="http://192.168.1.20/cgi-bin/magicBox.cgi?action=reboot" user="admin" password="admin1111"
/tool fetch url="http://192.168.1.20/cgi-bin/magicBox.cgi?action=reboot" user=admin password=admin1111
/tool fetch url="http://admin:admin1111@192.168.1.20/cgi-bin/magicBox.cgi?action=reboot"
/tool fetch http-header-field="Autorization:Basic YWRtaW46YWRtaW4xMTEx" url="http://192.168.1.20/cgi-bin/magicBox.cgi?action=reboot"
/tool fetch http-header-field="h1: admin,h2: admin1111,Autorization:Basic YWRtaW46YWRtaW4xMTEx" url="http://192.168.1.20/cgi-bin/magicBox.cgi\?action=reboot" user="admin" password="admin1111"
/tool fetch mode=http url="http://192.168.1.20/cgi-bin/magicBox.cgi" http-metod=get http-data="action=reboot" user="admin" password="admin1111"
/tool fetch mode=http url="http://192.168.1.20/cgi-bin/magicBox.cgi" http-metod=get http-data="action=reboot" http-header-field="Autorization:Basic YWRtaW46YWRtaW4xMTEx"
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,342
Reaction score
3,524
Where i can turn ON digest authentication?
You have so set up whatever software you're trying to use so that it uses digest authentication instead of basic authentication.
 

TonyR

IPCT Contributor
Joined
Jul 15, 2014
Messages
16,451
Reaction score
38,164
Location
Alabama
This line is not accepted by browser

This line only works for RTSP protocol
It's a HTTP command according to Dahua. That image in my post #2 is right out of the Dahua HTTP API 2.76 manual.
It should work if you set up digest authentication as instructed by @tangent.
 

TIGOS1

n3wb
Joined
Feb 25, 2020
Messages
29
Reaction score
3
Location
Odessa, Ukraine
It's a HTTP command according to Dahua. That image in my post #2 is right out of the Dahua HTTP API 2.76 manual.
It should work if you set up digest authentication as instructed by @tangent.
Thank you

I will answer this way:
1) I did not manage to switch authorization to digest mode so that it would work.
2) I found out that digest greatly simplifies the protection of the DVR. Maybe it's not good.

Perhaps there is still a way to use this API link to use, for example, via linux console command like FETCH?



Screenshot_39.png
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,342
Reaction score
3,524
Here are a few things you could try:

1. Try to do the command from a computer. There are a variety of tools you could use.
2. Observe what's being sent/received by your attempt to do this from some ?MikroTik router and a camera / nvr (computer with multiple nics and wireshark or IGMP snooping on the router / switch)
3. Use Smart PSS and the built in P2P Nat Traversal to manage the NVR

a MikroTik router console is not the same as a linux console.

Depending on the NVR firmware version you may have an option to switch it to basic authentication instead of digest or may be able to ssh into the nvr and execute commands that way.

Why are you trying to do this? What are you actually trying to accomplish?
 

TIGOS1

n3wb
Joined
Feb 25, 2020
Messages
29
Reaction score
3
Location
Odessa, Ukraine
Why are you trying to do this? What are you actually trying to accomplish?
I am using DAHUA DSS SERVER and few Dahua NVR5864-4ks2

After I updated my NVRs with the latest firmware, they periodically become invisible to the server.

This invisibility is very strange - the NVR shows the DSS server that the cameras connected to it are offline.

There is no liveview to such cameras through DSS Server.

But if I open records the small lifeview window shows me the live camera on top of the old video.

Reboot helps.

I don't know how to downgrade the NVR to a previous version.

Until I found a solution, I want to use TELEGRAM which I control my main router to give a command to the desired NVR to reboot
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,342
Reaction score
3,524
I am using DAHUA DSS SERVER and few Dahua NVR5864-4ks2

After I updated my NVRs with the latest firmware, they periodically become invisible to the server.

This invisibility is very strange - the NVR shows the DSS server that the cameras connected to it are offline.

There is no liveview to such cameras through DSS Server.

But if I open records the small lifeview window shows me the live camera on top of the old video.

Reboot helps.

I don't know how to downgrade the NVR to a previous version.

Until I found a solution, I want to use TELEGRAM which I control my main router to give a command to the desired NVR to reboot
Are the cameras all on the same local network? Are you using P2P NAT traversal?

They make downgrading a bit of a pain, I'm not sure what currently works. I suspect you may have to TFTP the firmware.

There are other ways you could potentially tunnel into the network and issue reboot command (VPN server, SSH tunnel, a service like Zero Tier).

Unfortunately if the NVR's acting up there's a chance it also may not respond to the reboot command. In this case your best option is some type of remote controlled outlet allowing you to unplug remotely and plug back in.

What firmware are they running?

Good Luck!
 

TIGOS1

n3wb
Joined
Feb 25, 2020
Messages
29
Reaction score
3
Location
Odessa, Ukraine
Are the cameras all on the same local network? Are you using P2P NAT traversal?

They make downgrading a bit of a pain, I'm not sure what currently works. I suspect you may have to TFTP the firmware.

There are other ways you could potentially tunnel into the network and issue reboot command (VPN server, SSH tunnel, a service like Zero Tier).

Unfortunately if the NVR's acting up there's a chance it also may not respond to the reboot command. In this case your best option is some type of remote controlled outlet allowing you to unplug remotely and plug back in.

What firmware are they running?

Good Luck!
Thank you for your wishes)

All my cameras, and NVRs and DSS Server at same network (phisically and "+-" by subnet)
But before i was update that NVR to last firmware i didn't see too many errors at its work..
DHI-NVR5864-4KS2. System version V4.002.0000000.3.R, Build Date: 2022-03-22

Question: Is there anyone on the forum or somewhere else who could help me with DSS Server (DSS7016D-S2) ?
 
Top