payload.cat

Hacking my 2016 Hisense TV for fun (and how you can too)

(no, this isn't one of those cringy TV debloats using AI and ADB)

Disclaimer

If you decide to follow the guide in this post, I am not responsible for what happens to your device; you follow it understanding the consequences that may come. While it is difficult to accidentally put your device into a state where it would take disassembly of the TV to fix, anything can happen.

This blog post is talking about the Hisense H8C Series 4K Ultra HD Smart LED TV. While I'm fairly confident the exploits talked about here apply to any Hisense-made TV that uses this custom operating system, if you are using a different model, do your due diligence and check the firmware yourself by grabbing it from the Hisense support site.

Introduction

My adventures into hacking this TV started a few days prior to this blog post, when I decided to try using it and noticed that almost all of the apps on the device had come to a grinding halt in terms of speed and time to load, with some not even working anymore (one being the Apple TV+ app). Being the curious person I am, I decided to delve into how these apps are working and why they have become so slow with time.

Firmware Analysis

Part 0: Obtaining and extracting

Hisense makes it fairly easy to obtain the firmware for any of their TVs, and has detailed guides on installing it as well (how kind of them!). All that is required is visiting the firmware download page, inputting the serial number of your TV, and grabbing the firmware package.

Now, with the firmware package, running it through unixtract gives you all of the partitions as .bin files:

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          11/23/2026 11:16 PM      168148992 3rdp.bin
-a---          11/23/2026 11:16 PM     2013265920 3rdw.bin
-a---          11/23/2026 11:16 PM        3042256 adsp.bin
-a---          11/23/2026 11:16 PM          13412 aqda.bin
-a---          11/23/2026 11:16 PM            209 cfig.bin
-a---          11/23/2026 11:16 PM           8196 eepr.bin
-a---          11/23/2026 11:16 PM         655360 facs.bin
-a---          11/23/2026 11:16 PM        3577216 kerA.bin
-a---          11/23/2026 11:16 PM        3577216 kerB.bin
-a---          11/23/2026 11:16 PM        1303616 load.bin
-a---          11/23/2026 11:16 PM        1303616 loda.bin
-a---          11/23/2026 11:16 PM        5958582 logo.bin
-a---          11/23/2026 11:16 PM        1966080 pqda.bin
-a---          11/23/2026 11:16 PM       46305280 rfsA.bin
-a---          11/23/2026 11:16 PM       46305280 rfsB.bin
-a---          11/23/2026 11:16 PM           5052 uenv.bin
-a---          11/23/2026 11:16 PM            512 usig.bin

This still isn't much use to us in this form, but with a bit of peeking at the files it is fairly easy to determine what each is responsible for:

File Responsibility
cfig.bin Partition map (lists all partitions below, including perm which holds per-device keys like HDCP and the Widevine keybox)
load.bin / loda.bin MTK bootloader, both are the same (U-Boot + Hisense's own loader)
kerA.bin / kerB.bin uImage holding the Linux kernel (3.10.79), both are the same
rfsA.bin / rfsB.bin NFSB files (filesystem wrapper that is signed + hashed) that hold the SquashFS root filesystem
3rdp.bin NFSB file that holds the read-only part of the main filesystem as SquashFS, mounted as /3rd
3rdw.bin ext4 filesystem that is read/write, mounted as /3rd_rw
uenv.bin ELF file that holds the U-Boot memory config
usig.bin 256-byte RSA signature for the package
eepr.bin EEPROM image, mostly blank
facs.bin Factory picture/panel tables
logo.bin JPEG boot logo
adsp.bin, pqda.bin, aqda.bin Audio DSP firmware + Picture/Audio quality data

You can extract these to readable files however you want; since I'm on Windows, I used unsquashfs and 7-Zip.

Part 1: Attack Surface

Considering the last time that Hisense pushed out a firmware update for this TV was 2018-2019, a good amount of the software running on the TV is vulnerable in some severe or critical way. However, since no services are exposed to the LAN/internet (minus the remote control, which isn't exploitable in a way we want), the only influences we have over the TV that could lead to exploitation are:

Looking at the attack surface alone, my first choice was browser exploitation, since there should already be existing PoCs and even full exploit chains for different platforms that can be ported for this browser. Let's find out how wrong I was :)

Part 1.5: Failed browser exploitation

I'm going to preface this section by saying I do not know a lot about browser exploitation and properly chaining them together. A lot of attempts came from going back and forth talking with my good friend Ciarán who is really knowledgeable about browsers and their security. If you like web security, you should check out his blog (but finish my post first!)

In essence, my foray into exploiting the browser was a lot of testing CVEs from js-vuln-db, finding the ones that worked, and trying to port them into something that would work. This ultimately led to me having an addrof primitive using CVE-2017-5030, but this exploit only allows OOB reads, and the rest of the exploits I was attempting that would also give me writes ended up crashing the renderer 100% of the time regardless of how I changed it.

This was a lot of hours spent getting essentially nowhere, which led to me giving up and looking for other exploits that were maybe much easier to abuse. Little did I know, it was right in front of me.

Part 2: Exploit discovery

While poking around in the extracted firmware, I noticed that a lot of the update process is implemented entirely in bash scripts. Most importantly, the entire update flow for when you update via a USB drive is in bash, which calls the FlashWriter directly. A deeper look into usb_upgrade_strategy.sh in the root filesystem reveals:

update_flag_partition=/dev/mmcblk0p23
update_flag_offset=9

"$RdUSBUpdateFlag" "$update_flag_partition" "$update_flag_offset"
ResultFlag=$?

if [ "$ResultFlag" != "170" ]
then
    echo "  There is no usb diff upgrade flag, then exit !"
    exit 1
fi

# upgrade...
echo "[UsbBSUpgrade] check patch files and update"
patch_proc

This reads a specific byte from the eMMC to tell it that it needs to run patch_proc. The important thing about patch_proc is that it is entirely different from the firmware file I received: it looks for a patch_package_usb.tar.gz, not the usb_HU55K3300UW_1001.pkg that I had downloaded from Hisense's website. The shocking revelation that came from looking into patch_proc is that the patch package is not verified in any way, meaning if we can trigger this update, we have a way to copy a file from a USB drive to anywhere that is writable on the system, since the script runs as root.

This means exploitation is as simple as:

  1. Figure out how to get that flag to be set
  2. Plug in USB with a crafted patch_package_usb.tar.gz that overwrites some boot script with a script that starts a telnet shell
  3. We now have root shell available over network!

Part 2.1: Figuring out the update flag

This part took a while, but once figured out it made a lot of sense. Once again, if you look at the firmware files, almost all of the TV UI, including the launcher, settings, etc., is implemented in JS with a native module that actually does the tasks. This led me to the JS file for AudioAdvance, which keeps the last 4 numbers pressed on the remote when hovering over the "Balance" option, and if it equals "1969" it calls StartFactory, which opens the factory menu.

Doing this on my own TV, it results in a green M appearing in the top left of the screen and a lot of the UI changing to be much more prototype/factory-esque. I later found out this is because when factory mode is enabled, the binary factory_lite takes over all of the UI rendering, including all the buttons in the factory menu.

Browsing through the factory menu, one menu item immediately stuck out to me: "USB Diff Upgrade". As you saw in the script mentioned in Part 2, it was called that as well. This made me instantly think that this could be the way to set the flag and get our trigger for the exploit. Opening factory_lite in IDA we see that the handler for the button does:

BOOL his_fac_menu_diff_pkg_upgrade()
{
  if ( his_fac_show_message_dialog(text: "Program already exist, rewrite it?", dlg_mode: DIALOG_MODE_YES_NO) != DIALOG_RET_YES )
    return -1;
  system_reboot();
  return true;
}

Oh, well, that isn't very helpful. (In hindsight, maybe this is a mitigation for the exploit?)

I then began to dig around for where the flag referenced by the update script is written to other than the script clearing it on exit. This led me to unpacking the MediaTek load.bin. Piggybacking off some code from epk2extract, I was able to decompress the Hisense bootloader that gets started by the MediaTek preloader. Loading this into IDA and tracing through the main function (the function specified by the reset vector), we see:

if ( sub_D0E328(a1: v4) == 1 )              // check AC power + factory mode
    {
      LDR_CheckUpgrade(a1: v2);
      sub_D23B5C(a1: "usb upgrade with AC Power On and Factory Mode! \n");
...
// LDR_CheckUpgrade:
  v5 = sub_D0CAE0(a1: 3006);
  if ( LdrUsbUpgrade(a1, a2: v5) == 0 )
...
// LdrUsbUpgrade:
v36 = (unsigned __int8)sub_D0DF7C();          // scan the stick's root directory
...
if ( v36 == 1 )                               // we did not find a regular MTK upgrade.pkg
{
  ...
  v37 = sub_D0E49C(a1: v38);
  if ( MEMORY[0xDE5EC4] == 1 )                // set by sub_D0DF7C if it found patch_package_usb.tar.gz
    v37 = sub_D0DD10(a1: 22, a2: 9, a3: 170); // LDR_SetUpgradeFlag: partition 23 (zero-indexed), offset 9, value 170 (our update flag!!)
}

We found it! We now know exactly what is required to trigger the update path that sets the update flag and allows us to perform the exploit we discovered. They are:

Our method of "hard reset" here is just unplugging the TV from power while factory mode is active.

Now it's time for the fun part!

Exploitation

Now that we know how to trigger this specific update, it's time to use the exploit to gain root access on the TV.

In the root filesystem, there is a Hisense script called delayrun.sh, which is launched by autorun.sh. The reason delayrun.sh is the interesting script here is because of this specific line:

# Hisense ZhuMin Add for run the ftp server 2016/03/10
if [ -x /3rd_rw/start_ftp.sh ]; then
    /3rd_rw/start_ftp.sh
else
    echo "Failed to Run start_ftp.sh ......"
fi
# Hisense ZhuMin Add end

This attempts to start a script that does not normally exist in the firmware image, in the only writable partition on the TV, and with our exploit we are able to copy files to anywhere that is writable. This means that by crafting an update package that places that file there, we can run whatever we want.

My patch_package_usb folder looked like this:

patch_package_usb
    -> update_list.ini
    3rd_rw
        -> start_ftp.sh

update_list.ini tells patch_proc what to do with the files in the package, and has to be created by hand in this format:

create;3rd_rw/start_ftp.sh;<md5_hash>;<file_size>

Where <md5_hash> is the MD5 hash of start_ftp.sh and <file_size> is its size in bytes.

start_ftp.sh itself is:

#!/bin/sh
BB=/bin/busybox

(
  n=0
  while [ $n -lt 90 ]; do
    if ifconfig 2>/dev/null | grep -q "inet addr"; then break; fi
    n=$((n+1))
    sleep 2
  done

  $BB telnetd -l /bin/sh
  $BB tcpsvd -vE 0.0.0.0 2121 $BB ftpd -w /
) &

All the script does is start a background task that waits for a network connection, then starts up a telnet and FTP server using busybox's telnetd and tcpsvd. Make sure it's marked executable in the tarball, since delayrun.sh checks for that before running it.

Now we trigger the exploit:

And once my TV connected back to my network and I tried port 23:

 Telnet  Connecting to 192.168.1.39
 Telnet  Connected

sh-3.2#
> busybox whoami 2>/dev/null
root

We now have root access! At this point you have full access to the TV and can do what you please. I have already discovered many interesting things about the inner workings (especially relating to the "hidden" perm partition), but I will leave that as an exercise for the reader. This also allowed me to fully analyze the performance hits that happen when opening apps, due to them all using browsers and with sites growing more heavy over the years that explains why. I want to try writing some native apps so this TV still has some life before it's eventually sold.

Other exploits

Going to keep this short, but in my time of looking at the update process I noticed that the OTA update process can also allow you to deliver a similar payload to a much more impactful degree, simply by having a custom DNS server.

When checking for a version it goes to http://api.hismarttv.com/upgrade/check_version, which you can tell is plain HTTP and can be intercepted with no issue. They attempted to mitigate this with a response that is signed, but it uses a 512-bit RSA key, which with today's hardware can easily be factored in a few days, or a few hours if you rent server hardware. This means you can fake a response and deliver a very similar exploit; you can see the code for OTA software updates in bspatch.sh, around lines 850-875.

This would work well for a USB-less root and is very user-friendly: simply change DNS settings, run a software update check, and let the exploit run (reminds me of that Wii exploit called str2hax, which uses the same principle of changing DNS and visiting a specific page to trigger code execution).

Conclusion

I hope you had as much fun reading this as I had finding it. It's been a while since I've done exploit stuff like this, and with little LLM assistance (besides the browser exploitation), which feels very refreshing in the current day and age.

Apologies for the lack of blog posts from me; ever since getting a full-time job, I haven't had a lot of free time to do stuff like this. Also, feel free to contact me by pressing the "about" button at the top of the blog.

Anyways, thanks for reading. See you next time.