Good Stuff, keep it coming.
Hikvision Firmware Decrypted
A developer has decrypted Hikvision's firmware, allowing examination of Hikvision's device source code and contents.
In this report, we overview the tool, showing you how it works, sharing a Hikvision's camera decrypted firmware and overviewing some things to look for inside.
Utility ********
*** *********, ***********, ********* *** ******* ** *** ******* tool ** *********. "*******" ** ***** *** "********* packer/unpacker". ** ******** *** ******** ****** Hikvision ******** ******, ******** *** ********* from ******* ** *******, *** ******* them **** *** ****** ******** ** install ** ** * ****** ** recorder. *** ****** ******* ***** * few *******.
*** ******* ******** "** *** **" camera ********* *** "*** *** ***" ******** platforms, ***** ****** *** ******** ** Hikvision's **** ******* ** *******, *** 7600-series *********.
Hikpack *****
* ** *** ***** *********** ** required ** *** *** ******* *******. For ***** ******* * ***** *******, a *********** ** ********** *** * ***-***** ***** ***** ***** *** ** ****.
** *** ******* *** **** ********* ******** images (********* ******** ********* **** [**** no ****** *********]), ***** *** **** unpack ***** *** ********* *******:
** *** ***** ** ****** **** ************* (e.g., ******** ******** **** *******), ******* "-L *" ** **** ** ** convert *** ***** ** ** ******* version:
*** ********* ******** ** **** ****** in *** ********* ********* ("*****" ** this ****), ***** *** ** *******, or ******** ******* ** ******** *****.
Sample ********* ********
***** **** *******, *** ** **** ** decrypt *** ******* *********'* ******** ******** images ** *** * *** ** readable *****. ***** ******* ** .*** ***** ********* ****** ********** ***** and *********** ** *******.
******* **** *** ****, ******** *** key *********** / ********** ** *********'* firmware:
**** *********** ******** **** *** ********* files:
*** ********* "*****.***-**************" ******** *** **** of *** ***** ********* ****** **** runs ** *** ******. **** **** directory ** *** **** ** /***/****** *** see ** ******** * ****** *****:
**** ***** **** ***** ** * hard-coded "****" ****, **** ***** ** not **********, ** ********* ***** ***** at ***** * **** **** ** run ********* *****. *** **** ** other ***** ***** ******** **** ***** process ** *** ****** **** ** root, ***** *** **** ** ***** exploitable ********** ** ********** *** ***** in ***** *********.
/***/****.*/*** ***** *** ********* *** ******** the ****** ***** ** **** ** starts:
*** *********** **** **** ** *** iptables ******** ****, ******* *** ****** to **** *********** ****** ** ** port ** (***). ***** ****** ** no **** ** **** *** *********** if *** ** *** ******* ** the ******.
********* *** /***/*** **** **** ** called ***** **** **** ***** *** first ******* ***** "********", * ****** *** ****** **** on ******** *******:
** *** ******** **** *** ******* out, *** ***** **** ****** ** able ** **** *** ****** ** the ******, ***** ***** **** ******* you ** **** *** **** ******** of *** ******.
***** ** **** * ****** **** called "*************", ***** **** ******* ** could ** ****** **** ***** ********* to ******* ******-***** ******** ** ******** to ***** *******.
***** **** ** ***** ***** ******** an ******** ******** *****, **** ** call **** ******** *** ********* ***** choose ** **** ** *** ****** running, *** ******* ** * ******** rule, ******* ** ****** *** ******* SSH ** ***.
Firmware ********** **** ********
*** ********* ******** ****** **** *********** and ********* ** ******* *** ***** workings ** *** ********. **** **** time *** ******** ** ** ******** to ***** *** ********** ********** **** *** be *********, *********, ***. **** ** how *** ****** ***** ******** *** **** ******** **** **********, **** *********** ******* ** extract ******** ***** *** **** ******* them *** **********.
****** ********* ** *** **** ****** to ******** ***** ** **** *********** components ** * ******, ****** **** access ***** ***** *** **** ******. *** ********* **** *** ********** *** cracked ******** **** ** **+ *** brands ****** **** ** **** **** **** firmware ******** ********.
Funny I didnt have to de-crypt it But then again I use real tool set OS
Binwalk from source does a better job than from the repos in my opinion
Surprised we are doing firmware dumps on here though< i had been debating whether or not post some.
I assume the only reason to have a server running and blocking all inc connection instead of not having the server running at all, would be to be able to access the server via a backdoor...
Or am i being influenced by all those hacks and cia/nsa docs recently? =P
So,
is there a bookdoor? or "phone home" ?
This decrypted firmware download will lead Hikvision into serious issues. Now all the bored ppl. out there start playing with their Kali-Toolbox (decompilers and soucecode vulnerability scanners) and they WILL find many new attack vectors.
Hikvision should prepare for a massive demand of firmware updates...
It's been known how to decrypt the firmware for a long while. Most of the obvious vulnerabilities have been found.
You also don't get sourcecode out of a firmware image.
Could also be a test to verify port 22 is indeed blocked before shipping?
There is no need to a block a port that is not running any services.
Unless I misread, SSH is running:
"Examining the /etc/app file that is called after this line shows the first command loads "dropbear", a common SSH server used on embedded devices:"
"why Hikvision would choose to keep an SSH server running, but blocked by a firewall rule, instead of simply not running SSH at all."
Because they can disable the firewall rule by a hidden cgi or whatever... the answer is in the download.
Here's an interesting thought. I'm not sure I agree with my thought yet, but it's worth a discussion... how about Hikvision just open sources their camera firmware? They make money on hardware sales and if they open source it, they would benefit from the community contributing to their code (or at the very least scrutinizing the security vulnerabilities). There may be a few pieces that they'd want to keep to themselves, like any advanced encoding features, or perhaps some of the analytics, but they could also benefit from the transparency of allowing others to see the source.
Most parts of the firmware are open source anyways.
A Linux system always contains many GPL based packages.
The GPL terms of use allow everybody who's interested to request the source code of all GPL licensed packages at any time. The manufacturer has to send you a file that includes all GPL parts and all of his modifications to GPL based code. The "copyleft" of the GPL requires the manufacturer to publish his modifications to GPL code also under GPL license. This applies e.g. to driver/kernel modifications to support the different SoC's.
Please check yourself: https://en.wikipedia.org/wiki/GNU_General_Public_License
Does Hikvision provide such a GPL download?
Hikvision does now, actually. See Hikvision Discloses Open Source Software Used
Just some of the software used under GPL:
- GCC library
- Linux kernel
- busybox 1.19.3
- u-boot
- udev 114
- IPTables 1.4.18
- ppp - Pauls PPP Package 2.4.3
- RP PPP OE 3.8
- wpa_supplicant 0.7.2
#6, good suggestion, see: Should Dahua And Hikvision Open Source Their Camera Firmware?