[00:00.000 --> 00:07.020] Hello everyone. Thank you for attending this presentation. This is my first time presenting in [00:07.020 --> 00:13.220] English, so I appreciate your understanding if there are any mistakes. Today, we will discuss [00:13.220 --> 00:22.800] the topic Inside Dash Cam. Thank you. Before we begin, let's introduce ourselves. I am Hyojin Lee, [00:22.800 --> 00:28.680] and the other speaker is Hanyeol Park. We are researchers at Xi'an, the XIOT security [00:28.680 --> 00:34.940] convergence company. We have been conducting research and development on automated Xi'an [00:34.940 --> 00:40.320] firmware SECA solutions and are continuously advancing our work. [00:41.700 --> 00:48.620] Our agenda for today is as follows. First, we will provide an overview of dash cams, [00:48.620 --> 00:55.740] including market size, reasons for choosing this topic, and general information about dash cams. [00:55.740 --> 01:00.880] Following that, we will explain the method used to analyze dash cams. [01:02.720 --> 01:09.020] And then, we will describe the features of dash cams and explore potential zero-day scenarios [01:09.020 --> 01:15.900] that may arise from these features. Finally, we will propose future countermeasures and wrap up [01:15.900 --> 01:23.900] the presentation. Let's begin by providing some preliminary information about dash cams. [01:23.900 --> 01:31.820] There are several dash cam vendors, such as Mobidian, Blackview, Nextbase, and HL Mando. [01:33.200 --> 01:42.340] The global dash cam market was valued at $4.03 billion in 2023. Experts project a compound annual [01:42.340 --> 01:52.540] growth rate of 9.6% from 2024 to 2030. Unlike in the past, when only SD cards were used, [01:52.540 --> 01:58.640] most modern dash cams now use networks for connectivity and are controlled via dedicated [01:58.640 --> 02:04.980] apps. This convenience has played a significant role in contributing to the dash cam market's [02:04.980 --> 02:12.160] growth. However, this technological advancement introduces new security threats. [02:13.820 --> 02:20.060] Despite this, only three CVEs have been reported in the past three years. [02:20.060 --> 02:25.800] To raise awareness about dash cam security and contribute to a safer market, [02:25.800 --> 02:34.580] we have chosen this topic. It looks delicious, right? We analyzed a total of nine dash cams, [02:34.580 --> 02:41.500] four from Korea, one from China, and four built-in models. Here are the features we discovered by [02:41.500 --> 02:47.160] type. Korean dash cams generally provide firmware downloads on their official websites [02:47.160 --> 02:53.780] and some offer cloud services. Chinese dash cam also offers firmware downloads on their [02:53.780 --> 03:00.840] official websites, and we found 10 airports open. Built-in dash cams typically do not provide [03:00.840 --> 03:08.200] firmware downloads on their official websites and use the RTSP protocol. Many of built-in dash [03:08.200 --> 03:14.620] cams are OEM devices, which means they are manufactured by one company and sold under [03:14.620 --> 03:22.140] another company's brand. For OEM devices, if a vulnerability is discovered in one device, [03:22.140 --> 03:28.080] it can potentially affect devices, highlighting the critical importance of implementing robust [03:28.080 --> 03:35.560] security measures. Dash cam connectivity can be categorized into three types, [03:35.560 --> 03:40.360] connecting via Bluetooth and dash cam Wi-Fi, connecting through a phone's hotspot, [03:40.360 --> 03:47.400] and communicating via the cloud. We'll explore these categories in detail on the next slide. [03:48.500 --> 03:56.000] First, the app connects to the dash cam via Bluetooth, then the dash cam activates AP mode. [03:56.180 --> 04:02.560] Once the app connects to the dash cam's Wi-Fi, communication between the app and the dash cam [04:02.560 --> 04:10.340] is established. By configuring the phone's hotspot to align with the dash cam's Wi-Fi settings, [04:10.360 --> 04:17.080] and activating the hotspot, the dash cam can establish and communicate through it. [04:18.440 --> 04:25.260] In cloud communication, the dash cam's AP mode remains activated, and no need Bluetooth [04:25.260 --> 04:32.180] connection. Begin by connecting to the dash cam's Wi-Fi, then translate the router's SSID [04:32.180 --> 04:38.400] and password to connect the dash cam to the internet and enable cloud functionality. [04:39.040 --> 04:44.860] Communication between the app and the dash cam is managed through the cloud. [04:45.480 --> 04:51.360] Now, let's review the method we employed to analyze the dash cams. [04:52.520 --> 05:01.140] Before beginning the analysis, it's essential to obtain the firmware. This is crucial for tasks [05:01.140 --> 05:07.560] such as decompiling code, analyzing the file system, and understanding the boot logic. [05:07.560 --> 05:11.420] There are four primary methods to obtain firmware. [05:11.940 --> 05:17.380] The first method is to download it from the official website. [05:18.580 --> 05:26.540] The second method involves using debugging ports such as UART or JTAG. During our analysis, [05:26.540 --> 05:32.440] we found the UART port as illustrated in the picture, soldered connecting cables, [05:32.440 --> 05:41.880] and accessed the shell. Here are the statistics for UART shells found in the analyzed devices. [05:41.940 --> 05:48.720] Out of nine devices, five had UART shells, and four of these allowed shell access without a [05:48.720 --> 05:57.620] password. One of these four had a custom shell. Using the debugging shell obtained earlier, [05:57.620 --> 06:03.880] you can copy the firmware to an SD card, connect the SD card to a laptop, and extract the firmware. [06:05.480 --> 06:12.920] All the analyzed dashcams have firmware upgrade functionality. The third method involves analyzing [06:12.920 --> 06:19.860] this functionality to either obtain the firmware download URL or capture package to get the latest [06:19.860 --> 06:29.300] firmware. The final method involves extracting firmware from APK files. Many recent dashcams [06:29.300 --> 06:35.560] come with dedicated apps. By installing the app and accessing the ADB shell, you can find [06:35.560 --> 06:41.800] firmware-related APK files in the app's installation directory. Extracting and [06:41.800 --> 06:50.300] decompressing these files can provide access to the firmware. Most of the analyzed dashcams [06:50.300 --> 06:57.060] allowed us to obtain firmware from their official websites. We successfully retrieved firmware for [06:57.060 --> 07:05.060] all devices, and none of the firmware was encrypted. The next step is to extract the [07:05.060 --> 07:13.360] file system from the obtained firmware. Tools such as binoc and 7zip can be used for this purpose [07:13.360 --> 07:21.860] as illustrated in the picture. The second step in the analysis process is port scanning. Using [07:21.860 --> 07:28.300] the nmap tool, we can identify open ports on the dashcam, analyze services, and discover potential [07:28.820 --> 07:37.100] security vulnerabilities. For instance, if port 21 is open, we might attempt an FTP connection. [07:37.100 --> 07:44.780] Similarly, if port 80 is open, it suggests the presence of a web service. Here are the statistics [07:44.780 --> 07:53.520] for open ports on the analyzed devices. Among the well-known ports, FTP, telnet, DNS, HTTP, [07:53.520 --> 08:02.360] RPC, and RTSP ports were frequently open. The third step in the analysis process is analyzing [08:02.360 --> 08:10.300] boot logic. We examine files in etc-init-daemon, etc-rc-local, and system-daemon configuration [08:10.300 --> 08:18.820] files to identify and analyze the scripts executed during boot. For example, the picture shows the [08:18.820 --> 08:26.720] RCS file in etc-init-daemon, which runs all files starting with S in etc-init-daemon. [08:26.960 --> 08:35.480] We analyze the code of all S files to understand the boot logic. Next, we access the shell obtained [08:35.480 --> 08:42.740] via UART, JTAG, or other vulnerabilities. By using the ps command, we can identify running [08:42.740 --> 08:50.140] processes and understand how service operations and main binaries. The nested command helps us [08:50.140 --> 08:58.040] identify open ports and the binaries using those ports. This information provides valuable insights [08:58.040 --> 09:02.840] into the current state of the system and the services that are running. [09:04.160 --> 09:09.340] Now, he will discuss the process of debugging the main binary. [09:13.840 --> 09:19.720] Hi, I'm Hanyeol Park. I'll continue the presentation by discussing the next topic. [09:20.440 --> 09:26.520] For convenience, tools such as GDB and BusyBox can be stored in the SD card directory for easy [09:26.520 --> 09:33.620] access. We decompiled the main binary and tracked vulnerable functions such as system, [09:33.620 --> 09:40.920] beopen, string copy, get, and scanf for code analysis. Using our R&D solution, [09:40.920 --> 09:45.880] gIoT, we were to quickly and easily visualize and analyze the vulnerabilities. [09:47.960 --> 09:52.880] Using the UART shell, we proceeded with debugging by utilizing the GDB binary [09:52.880 --> 09:59.420] stored on the SD card. The example code is a script that gets the PID of the running main [09:59.420 --> 10:07.000] binary and executes GDB. Running this script connects directly to GDB for debugging. [10:08.180 --> 10:14.440] This allows us to analyze the main binary's behavior in real time and debug any vulnerabilities. [10:16.280 --> 10:21.860] During debugging, the watchdog timer, which detects system unresponsiveness, [10:21.860 --> 10:29.040] caused the device to reboot. We tried many things, but it was quite challenging to bypass the [10:29.040 --> 10:36.800] watchdog. Even though we made it, we managed to crack it in three cases, and we'd like to share [10:36.800 --> 10:44.900] those with you. In the first case, the initial script executed at boot contained a function [10:44.900 --> 10:50.600] to stop the watchdog. We used this function to execute the corresponding command. [10:51.360 --> 10:57.860] For instance, writing the value 1A3A to test register stops the watchdog, allowing us to [10:57.860 --> 11:07.180] dynamically debug the main binary with GDB. In the second case, we repeatedly pressed Ctrl-G [11:07.180 --> 11:13.640] during boot to interrupt the boot script. Then, we executed the code to disable the watchdog [11:13.640 --> 11:20.820] and resume the script, enabling dynamic debugging of the binary with GDB. [11:23.370 --> 11:28.850] In the third case, we entered the boot loader and modified the boot arguments. [11:29.190 --> 11:34.550] By repeatedly pressing ESC and F1, we accessed the boot loader. [11:35.270 --> 11:42.070] In the boot arguments, we modified the init value from Linux.hash to bin.sh and added the value [11:42.070 --> 11:49.990] no-watchdog. After that, we manually executed the initial script line by line and used GDB [11:49.990 --> 11:59.320] to debug the main binary. Protocol analysis capturing the analyzing communication [11:59.320 --> 12:06.280] packets between the app and the dashcam, or analyzing APK code and dashcam binary code. [12:07.240 --> 12:12.720] Among the analyzed devices, six used custom protocols, four had web interfaces, [12:13.260 --> 12:17.500] two supported cloud services, and one used encrypted communication. [12:18.520 --> 12:26.000] For encrypted communication, we can use Frida to hook the app and inspect plain text packets. [12:29.340 --> 12:35.760] Among the analyzed dashcams, here are the custom protocol formats for four devices. [12:37.540 --> 12:42.100] Custom protocol formats are mainly divided into HEX and JSON formats. [12:42.480 --> 12:47.840] Bvendor's request format is in HEX, consisting of four bytes for dummy data, [12:47.840 --> 12:53.180] two bytes for the command number, two bytes for command number, and four or more bytes for the [12:53.180 --> 12:59.820] parameters. In this example, since there are no parameters, four bytes of data are sent to [12:59.820 --> 13:07.200] represent null values. And vendor's request format consists of four bytes of command number, [13:07.200 --> 13:12.020] four bytes for packet length, four bytes for command number, and four or more bytes for [13:12.020 --> 13:19.100] the parameters. In this example, the parameter is sent as cmd equals set semicolon. [13:21.660 --> 13:27.440] Next, tvendor's request format is in JSON and consists of three keys. [13:27.640 --> 13:33.080] A token generated at the session start, a command number labeled message underscore id, [13:33.080 --> 13:40.300] and a parameter labeled param. Hvendor's request format is similar to tvendor's, [13:40.300 --> 13:47.660] but has slight differences. It consists of a token incremented by one from the previous request [13:47.660 --> 13:55.600] token, a command number labeled message id, and a parameter labeled param. Each vendor's custom [13:55.600 --> 14:01.720] protocol format has a unique structure, and analyzing these formats helps us understand [14:01.720 --> 14:08.320] the communication content. Now, we will discuss zero-day scenarios. [14:10.460 --> 14:16.300] Dash cams have the following features. They use SD cards for video strategy, [14:16.300 --> 14:20.160] and they employ the RTSP protocol for live view functionality. [14:21.800 --> 14:27.360] They offer settings for Wi-Fi, ADAS, GPS, firmware updates, and communication via [14:27.360 --> 14:33.740] custom protocols. Let's explore which vulnerabilities are associated with these [14:33.740 --> 14:42.640] features in the next slide. The use of SD card is associated with the shell script execution [14:42.640 --> 14:50.000] vulnerabilities. Let's explore this scenario. The boot script includes code that executes [14:50.000 --> 14:56.740] test shell from the SD card path. An attacker can create a test shell file on the SD card [14:56.740 --> 15:04.960] with a script using a tele-demon binary to open a tele-connection. When the SD card is inserted [15:04.960 --> 15:10.840] into the dash cam and the device is booted, the boot script runs test shell, which enables [15:10.840 --> 15:18.920] tele-access and allows the attacker to gain a share. The live view feature provided through [15:18.920 --> 15:24.160] the RTSP protocol is associated with the stack buffer overflow vulnerabilities. [15:25.280 --> 15:31.980] An attacker crafts an RTSP request for live view and hooks the app library to modify the RTSP [15:31.980 --> 15:39.020] header data. If the dash cam does not properly check the request length when receiving data, [15:39.140 --> 15:43.780] a stack buffer overflow can occur and potentially altering the PC register. [15:45.220 --> 15:49.480] By gathering gadgets for the buffer overflow attack and performing gadget chaining, [15:50.100 --> 15:53.080] the attacker can exploit this vulnerability to gain a share. [15:56.050 --> 16:02.170] The settings for Wi-Fi, ADAS, GPS, and other features can lead to OS command injection [16:02.170 --> 16:09.870] vulnerabilities. When sending device configuration packets, an attacker can manipulate the data [16:09.870 --> 16:17.890] using a proxy tool with backticks and $(). If the dash cam does not validate special characters [16:17.890 --> 16:24.390] and uses this data as parameters for system functions, OS command injection can occur. [16:25.910 --> 16:29.230] This can allow the attacker to take control of the system. [16:31.290 --> 16:36.370] The feature of app and dash cam communication via custom protocols can lead to improper [16:36.370 --> 16:42.470] authentication vulnerabilities. Capturing a packet requesting the file list from the app [16:42.470 --> 16:49.470] shows the data in hex format. The packet consists of four bytes representing the command number [16:50.040 --> 16:54.570] for the file list request, followed by four bytes for the packet length, [16:54.570 --> 16:59.050] another four bytes for the command number, and finally four bytes for the parameter, [16:59.050 --> 17:06.990] which is null in this case. By replicating the same packet and sending it to the dash cam, [17:06.990 --> 17:16.630] the response will yield the file list. After capturing the SD card format packet, [17:16.630 --> 17:23.530] you can perform a replay attack to execute the function. Additionally, all functions can be [17:23.530 --> 17:27.610] accessed without authentication, and you can try a replay attack. [17:30.760 --> 17:33.420] Finally, let's move on to the conclusion. [17:36.510 --> 17:42.070] Across the nine analyzed dash cams, we discovered eight types of CWEs. [17:44.430 --> 17:49.570] Based on these findings, we have outlined our recommendations and future work. [17:49.850 --> 17:56.650] First, we need to remove script execution code. Remove script execution code from the SD card [17:56.650 --> 18:03.910] path used for developer testing. Second, enhance communication security. [18:04.230 --> 18:08.470] Add authentication and verification processes during communication. [18:09.430 --> 18:16.550] Third, input validation. Implement thorough input validation for special characters and [18:16.550 --> 18:25.980] length values to prevent security vulnerabilities. In closing, throughout this presentation, [18:25.980 --> 18:32.040] we aim to raise awareness about the potential security threats associated with dash cams. [18:32.200 --> 18:36.700] We hope to encourage dash cam manufacturers to develop more secure products, [18:36.700 --> 18:44.500] ultimately leading to safer and more reliable devices for consumers. Due to our limited ability [18:44.500 --> 18:50.740] to provide prompt answers, we are unable to open the floor for real-time Q&A during this [18:50.740 --> 18:58.800] presentation. However, please use the QR code displayed above to contact our company or send [18:58.800 --> 19:06.040] an email with your inquiries. We are committed to provide detailed responses to your questions. [19:09.040 --> 19:14.580] We extend our gratitude to the IoT Village team for giving us this opportunity to present. [19:14.580 --> 19:17.260] Thank you for listening to our presentation.