{"id":19602351,"url":"https://github.com/scottlamb/hikvision-tftpd","last_synced_at":"2025-04-27T17:32:14.955Z","repository":{"id":82257817,"uuid":"50169238","full_name":"scottlamb/hikvision-tftpd","owner":"scottlamb","description":"Unbrick a Hikvision device (NVR or camera) via TFTP","archived":false,"fork":false,"pushed_at":"2021-05-20T12:44:53.000Z","size":21,"stargazers_count":129,"open_issues_count":12,"forks_count":42,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-05T01:51:12.847Z","etag":null,"topics":["hikvision","security-camera"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottlamb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-01-22T08:46:49.000Z","updated_at":"2025-03-24T08:51:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"5ace86ba-e3e3-4452-9b40-4aea8091fc15","html_url":"https://github.com/scottlamb/hikvision-tftpd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottlamb%2Fhikvision-tftpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottlamb%2Fhikvision-tftpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottlamb%2Fhikvision-tftpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottlamb%2Fhikvision-tftpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottlamb","download_url":"https://codeload.github.com/scottlamb/hikvision-tftpd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251178007,"owners_count":21548146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hikvision","security-camera"],"created_at":"2024-11-11T09:23:38.131Z","updated_at":"2025-04-27T17:32:14.708Z","avatar_url":"https://github.com/scottlamb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Unbrick a Hikvision device. Use as follows:\n\nSetup the expected IP address:\n\n    linux$ sudo ifconfig eth0:0 192.0.0.128\n    osx$   sudo ifconfig en0 alias 192.0.0.128 255.255.255.0\n\nDownload the firmware to use:\n\n    $ curl -o digicap.dav \u003curl of firmware\u003e\n\nRun the script:\n\n    $ sudo ./hikvision_tftpd.py\n\nHit ctrl-C when done.\n\nThe Hikvision TFTP handshake (for both cameras and NVRs) is stupid but easy\nenough. The client sends a particular packet to the server's port 9978 from\nthe client port 9979 and expects the server to echo it back.  Once that\nhappens, it proceeds to send a tftp request (on the standard tftp port, 69)\nfor a specific file, which it then installs. The tftp server must reply\nfrom port 69 (unlike the tftpd package that comes with Debian).\n\nThis script handles both the handshake and the actual TFTP transfer.\nThe TFTP server is very simple but appears to be good enough.\n\nNote the expected IP addresses and file name appear to differ by model. So far\nthere are two known configurations:\n\n| client IP    | server IP    | filename      |\n| ------------ | ------------ | ------------- |\n| 192.0.0.64   | 192.0.0.128  | `digicap.dav` |\n| 172.9.18.100 | 172.9.18.80  | `digicap.mav` |\n\nThis program defaults to the former. The latter requires commandline overrides:\n\n    $ sudo ./hikvision_tftp.py --server-ip=172.9.18.80 --filename=digicap.mav\n\nIf nothing happens when your device restarts, your device may be expecting\nanother IP address. tcpdump may be helpful in diagnosing this:\n\n    $ sudo tcpdump -i eth0 -vv -e -nn ether proto 0x0806\n    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes\n    16:21:58.804425 28:57:be:8a:aa:53 \u003e ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 172.9.18.80 tell 172.9.18.100, length 46\n    16:22:00.805251 28:57:be:8a:aa:53 \u003e ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 172.9.18.80 tell 172.9.18.100, length 46\n\nFeel free to open an issue for help.\n\nSee [discussion thread](https://www.ipcamtalk.com/showthread.php/3647-Hikvision-DS-2032-I-Console-Recovery).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottlamb%2Fhikvision-tftpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottlamb%2Fhikvision-tftpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottlamb%2Fhikvision-tftpd/lists"}