Hello everyone. Thank you for attending this presentation. This is my first time presenting in English, so I appreciate your understanding if there are any mistakes. Today, we will discuss the topic Inside Dash Cam. Thank you. Before we begin, let's introduce ourselves. I am Hyojin Lee, and the other speaker is Hanyeol Park. We are researchers at Xi'an, the XIOT security convergence company. We have been conducting research and development on automated Xi'an firmware SECA solutions and are continuously advancing our work. Our agenda for today is as follows. First, we will provide an overview of dash cams, including market size, reasons for choosing this topic, and general information about dash cams. Following that, we will explain the method used to analyze dash cams. And then, we will describe the features of dash cams and explore potential zero-day scenarios that may arise from these features. Finally, we will propose future countermeasures and wrap up the presentation. Let's begin by providing some preliminary information about dash cams. There are several dash cam vendors, such as Mobidian, Blackview, Nextbase, and HL Mando. The global dash cam market was valued at $4.03 billion in 2023. Experts project a compound annual growth rate of 9.6% from 2024 to 2030. Unlike in the past, when only SD cards were used, most modern dash cams now use networks for connectivity and are controlled via dedicated apps. This convenience has played a significant role in contributing to the dash cam market's growth. However, this technological advancement introduces new security threats. Despite this, only three CVEs have been reported in the past three years. To raise awareness about dash cam security and contribute to a safer market, we have chosen this topic. It looks delicious, right? We analyzed a total of nine dash cams, four from Korea, one from China, and four built-in models. Here are the features we discovered by type. Korean dash cams generally provide firmware downloads on their official websites and some offer cloud services. Chinese dash cam also offers firmware downloads on their official websites, and we found 10 airports open. Built-in dash cams typically do not provide firmware downloads on their official websites and use the RTSP protocol. Many of built-in dash cams are OEM devices, which means they are manufactured by one company and sold under another company's brand. For OEM devices, if a vulnerability is discovered in one device, it can potentially affect devices, highlighting the critical importance of implementing robust security measures. Dash cam connectivity can be categorized into three types, connecting via Bluetooth and dash cam Wi-Fi, connecting through a phone's hotspot, and communicating via the cloud. We'll explore these categories in detail on the next slide. First, the app connects to the dash cam via Bluetooth, then the dash cam activates AP mode. Once the app connects to the dash cam's Wi-Fi, communication between the app and the dash cam is established. By configuring the phone's hotspot to align with the dash cam's Wi-Fi settings, and activating the hotspot, the dash cam can establish and communicate through it. In cloud communication, the dash cam's AP mode remains activated, and no need Bluetooth connection. Begin by connecting to the dash cam's Wi-Fi, then translate the router's SSID and password to connect the dash cam to the internet and enable cloud functionality. Communication between the app and the dash cam is managed through the cloud. Now, let's review the method we employed to analyze the dash cams. Before beginning the analysis, it's essential to obtain the firmware. This is crucial for tasks such as decompiling code, analyzing the file system, and understanding the boot logic. There are four primary methods to obtain firmware. The first method is to download it from the official website. The second method involves using debugging ports such as UART or JTAG. During our analysis, we found the UART port as illustrated in the picture, soldered connecting cables, and accessed the shell. Here are the statistics for UART shells found in the analyzed devices. Out of nine devices, five had UART shells, and four of these allowed shell access without a password. One of these four had a custom shell. Using the debugging shell obtained earlier, you can copy the firmware to an SD card, connect the SD card to a laptop, and extract the firmware. All the analyzed dashcams have firmware upgrade functionality. The third method involves analyzing this functionality to either obtain the firmware download URL or capture package to get the latest firmware. The final method involves extracting firmware from APK files. Many recent dashcams come with dedicated apps. By installing the app and accessing the ADB shell, you can find firmware-related APK files in the app's installation directory. Extracting and decompressing these files can provide access to the firmware. Most of the analyzed dashcams allowed us to obtain firmware from their official websites. We successfully retrieved firmware for all devices, and none of the firmware was encrypted. The next step is to extract the file system from the obtained firmware. Tools such as binoc and 7zip can be used for this purpose as illustrated in the picture. The second step in the analysis process is port scanning. Using the nmap tool, we can identify open ports on the dashcam, analyze services, and discover potential security vulnerabilities. For instance, if port 21 is open, we might attempt an FTP connection. Similarly, if port 80 is open, it suggests the presence of a web service. Here are the statistics for open ports on the analyzed devices. Among the well-known ports, FTP, telnet, DNS, HTTP, RPC, and RTSP ports were frequently open. The third step in the analysis process is analyzing boot logic. We examine files in etc-init-daemon, etc-rc-local, and system-daemon configuration files to identify and analyze the scripts executed during boot. For example, the picture shows the RCS file in etc-init-daemon, which runs all files starting with S in etc-init-daemon. We analyze the code of all S files to understand the boot logic. Next, we access the shell obtained via UART, JTAG, or other vulnerabilities. By using the ps command, we can identify running processes and understand how service operations and main binaries. The nested command helps us identify open ports and the binaries using those ports. This information provides valuable insights into the current state of the system and the services that are running. Now, he will discuss the process of debugging the main binary. Hi, I'm Hanyeol Park. I'll continue the presentation by discussing the next topic. For convenience, tools such as GDB and BusyBox can be stored in the SD card directory for easy access. We decompiled the main binary and tracked vulnerable functions such as system, beopen, string copy, get, and scanf for code analysis. Using our R&D solution, gIoT, we were to quickly and easily visualize and analyze the vulnerabilities. Using the UART shell, we proceeded with debugging by utilizing the GDB binary stored on the SD card. The example code is a script that gets the PID of the running main binary and executes GDB. Running this script connects directly to GDB for debugging. This allows us to analyze the main binary's behavior in real time and debug any vulnerabilities. During debugging, the watchdog timer, which detects system unresponsiveness, caused the device to reboot. We tried many things, but it was quite challenging to bypass the watchdog. Even though we made it, we managed to crack it in three cases, and we'd like to share those with you. In the first case, the initial script executed at boot contained a function to stop the watchdog. We used this function to execute the corresponding command. For instance, writing the value 1A3A to test register stops the watchdog, allowing us to dynamically debug the main binary with GDB. In the second case, we repeatedly pressed Ctrl-G during boot to interrupt the boot script. Then, we executed the code to disable the watchdog and resume the script, enabling dynamic debugging of the binary with GDB. In the third case, we entered the boot loader and modified the boot arguments. By repeatedly pressing ESC and F1, we accessed the boot loader. In the boot arguments, we modified the init value from Linux.hash to bin.sh and added the value no-watchdog. After that, we manually executed the initial script line by line and used GDB to debug the main binary. Protocol analysis capturing the analyzing communication packets between the app and the dashcam, or analyzing APK code and dashcam binary code. Among the analyzed devices, six used custom protocols, four had web interfaces, two supported cloud services, and one used encrypted communication. For encrypted communication, we can use Frida to hook the app and inspect plain text packets. Among the analyzed dashcams, here are the custom protocol formats for four devices. Custom protocol formats are mainly divided into HEX and JSON formats. Bvendor's request format is in HEX, consisting of four bytes for dummy data, two bytes for the command number, two bytes for command number, and four or more bytes for the parameters. In this example, since there are no parameters, four bytes of data are sent to represent null values. And vendor's request format consists of four bytes of command number, four bytes for packet length, four bytes for command number, and four or more bytes for the parameters. In this example, the parameter is sent as cmd equals set semicolon. Next, tvendor's request format is in JSON and consists of three keys. A token generated at the session start, a command number labeled message underscore id, and a parameter labeled param. Hvendor's request format is similar to tvendor's, but has slight differences. It consists of a token incremented by one from the previous request token, a command number labeled message id, and a parameter labeled param. Each vendor's custom protocol format has a unique structure, and analyzing these formats helps us understand the communication content. Now, we will discuss zero-day scenarios. Dash cams have the following features. They use SD cards for video strategy, and they employ the RTSP protocol for live view functionality. They offer settings for Wi-Fi, ADAS, GPS, firmware updates, and communication via custom protocols. Let's explore which vulnerabilities are associated with these features in the next slide. The use of SD card is associated with the shell script execution vulnerabilities. Let's explore this scenario. The boot script includes code that executes test shell from the SD card path. An attacker can create a test shell file on the SD card with a script using a tele-demon binary to open a tele-connection. When the SD card is inserted into the dash cam and the device is booted, the boot script runs test shell, which enables tele-access and allows the attacker to gain a share. The live view feature provided through the RTSP protocol is associated with the stack buffer overflow vulnerabilities. An attacker crafts an RTSP request for live view and hooks the app library to modify the RTSP header data. If the dash cam does not properly check the request length when receiving data, a stack buffer overflow can occur and potentially altering the PC register. By gathering gadgets for the buffer overflow attack and performing gadget chaining, the attacker can exploit this vulnerability to gain a share. The settings for Wi-Fi, ADAS, GPS, and other features can lead to OS command injection vulnerabilities. When sending device configuration packets, an attacker can manipulate the data using a proxy tool with backticks and $(). If the dash cam does not validate special characters and uses this data as parameters for system functions, OS command injection can occur. This can allow the attacker to take control of the system. The feature of app and dash cam communication via custom protocols can lead to improper authentication vulnerabilities. Capturing a packet requesting the file list from the app shows the data in hex format. The packet consists of four bytes representing the command number for the file list request, followed by four bytes for the packet length, another four bytes for the command number, and finally four bytes for the parameter, which is null in this case. By replicating the same packet and sending it to the dash cam, the response will yield the file list. After capturing the SD card format packet, you can perform a replay attack to execute the function. Additionally, all functions can be accessed without authentication, and you can try a replay attack. Finally, let's move on to the conclusion. Across the nine analyzed dash cams, we discovered eight types of CWEs. Based on these findings, we have outlined our recommendations and future work. First, we need to remove script execution code. Remove script execution code from the SD card path used for developer testing. Second, enhance communication security. Add authentication and verification processes during communication. Third, input validation. Implement thorough input validation for special characters and length values to prevent security vulnerabilities. In closing, throughout this presentation, we aim to raise awareness about the potential security threats associated with dash cams. We hope to encourage dash cam manufacturers to develop more secure products, ultimately leading to safer and more reliable devices for consumers. Due to our limited ability to provide prompt answers, we are unable to open the floor for real-time Q&A during this presentation. However, please use the QR code displayed above to contact our company or send an email with your inquiries. We are committed to provide detailed responses to your questions. We extend our gratitude to the IoT Village team for giving us this opportunity to present. Thank you for listening to our presentation.