scottlamb / hikvision-tftpd

Unbrick a Hikvision device (NVR or camera) via TFTP
121 stars 41 forks source link

Mention configuration options for the DS-2CD2035FWD-I in README.md #10

Open synthead opened 3 years ago

synthead commented 3 years ago

The DS-2CD2035FWD-I sets a static IP of 192.168.1.64, and attempts the special handshake and TFTP server to be listening on 192.168.1.128. All of the instructions on the README.md can be followed verbatim, except for using 192.168.1.128 in place of 192.0.0.128.

In addition, this needed to be changed from 512 to 1024:

https://github.com/scottlamb/hikvision-tftpd/blob/1c70589b098bd3b04ac8ea23053d35eae3131741/hikvision_tftpd.py#L25

Otherwise, this exception is raised:

Traceback (most recent call last):
  File "./hikvision_tftpd.py", line 191, in <module>
    server.run_forever()
  File "./hikvision_tftpd.py", line 102, in run_forever
    self._iterate()
  File "./hikvision_tftpd.py", line 110, in _iterate
    self._tftp_read()
  File "./hikvision_tftpd.py", line 132, in _tftp_read
    self._check_total_block_limit()
  File "./hikvision_tftpd.py", line 85, in _check_total_block_limit
    % self._block_size)
__main__.Error: File is too big to serve with 512-byte blocks.

With these two changes made, the script worked fine, and I was able to recover a Hikvision DS-2CD2035FWD-I :heart:

ethaniel commented 3 years ago

Dear @scottlamb! Thank you for the amazing tool. Yes, using the ip 192.168.1.128 did it for me as well. Just needed to make sure that 192.168.1.64 and 192.168.1.128 are not used on the network. Also, in my case, the default _DEFAULT_BLOCK_SIZE = 512 worked fine.

My commands:

sudo ip address add 192.168.1.128/24 dev eth0
sudo ./hikvision_tftpd.py --server-ip=192.168.1.128 --filename=digicap.dav