1 00:00:00,000 --> 00:00:01,760 Hello everyone. 2 00:00:02,040 --> 00:00:04,580 Thank you for attending this presentation. 3 00:00:04,820 --> 00:00:11,940 This is my first time presenting in English, so I appreciate your understanding if there are any mistakes. 4 00:00:11,940 --> 00:00:15,500 Today, we will discuss the topic Inside Dash Cam. 5 00:00:16,840 --> 00:00:18,200 Thank you. 6 00:00:18,300 --> 00:00:21,400 Before we begin, let's introduce ourselves. 7 00:00:21,400 --> 00:00:25,520 I am Hyojin Lee, and the other speaker is Hanyeol Park. 8 00:00:25,520 --> 00:00:30,580 We are researchers at Xi'an, the XIOT security convergence company. 9 00:00:30,660 --> 00:00:40,320 We have been conducting research and development on automated Xi'an firmware SECA solutions and are continuously advancing our work. 10 00:00:41,700 --> 00:00:45,020 Our agenda for today is as follows. 11 00:00:45,020 --> 00:00:55,740 First, we will provide an overview of dash cams, including market size, reasons for choosing this topic, and general information about dash cams. 12 00:00:55,740 --> 00:01:00,880 Following that, we will explain the method used to analyze dash cams. 13 00:01:02,720 --> 00:01:11,900 And then, we will describe the features of dash cams and explore potential zero-day scenarios that may arise from these features. 14 00:01:11,900 --> 00:01:17,400 Finally, we will propose future countermeasures and wrap up the presentation. 15 00:01:18,400 --> 00:01:23,900 Let's begin by providing some preliminary information about dash cams. 16 00:01:23,900 --> 00:01:31,820 There are several dash cam vendors, such as Mobidian, Blackview, Nextbase, and HL Mando. 17 00:01:33,200 --> 00:01:40,060 The global dash cam market was valued at $4.03 billion in 2023. 18 00:01:40,180 --> 00:01:47,820 Experts project a compound annual growth rate of 9.6% from 2024 to 2030. 19 00:01:48,220 --> 00:01:59,960 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. 20 00:02:00,000 --> 00:02:06,080 This convenience has played a significant role in contributing to the dash cam market's growth. 21 00:02:06,080 --> 00:02:12,160 However, this technological advancement introduces new security threats. 22 00:02:13,820 --> 00:02:20,060 Despite this, only three CVEs have been reported in the past three years. 23 00:02:20,060 --> 00:02:27,960 To raise awareness about dash cam security and contribute to a safer market, we have chosen this topic. 24 00:02:28,500 --> 00:02:30,600 It looks delicious, right? 25 00:02:31,340 --> 00:02:39,260 We analyzed a total of nine dash cams, four from Korea, one from China, and four built-in models. 26 00:02:39,500 --> 00:02:42,500 Here are the features we discovered by type. 27 00:02:42,720 --> 00:02:50,220 Korean dash cams generally provide firmware downloads on their official websites and some offer cloud services. 28 00:02:50,340 --> 00:02:57,940 Chinese dash cam also offers firmware downloads on their official websites, and we found 10 airports open. 29 00:02:58,280 --> 00:03:06,500 Built-in dash cams typically do not provide firmware downloads on their official websites and use the RTSP protocol. 30 00:03:07,040 --> 00:03:16,860 Many of built-in dash cams are OEM devices, which means they are manufactured by one company and sold under another company's brand. 31 00:03:17,140 --> 00:03:30,060 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. 32 00:03:31,480 --> 00:03:43,040 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. 33 00:03:43,080 --> 00:03:47,400 We'll explore these categories in detail on the next slide. 34 00:03:48,500 --> 00:03:56,000 First, the app connects to the dash cam via Bluetooth, then the dash cam activates AP mode. 35 00:03:56,180 --> 00:04:04,100 Once the app connects to the dash cam's Wi-Fi, communication between the app and the dash cam is established. 36 00:04:05,360 --> 00:04:17,080 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. 37 00:04:18,440 --> 00:04:26,700 In cloud communication, the dash cam's AP mode remains activated, and no need Bluetooth connection. 38 00:04:26,760 --> 00:04:38,400 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. 39 00:04:39,040 --> 00:04:44,860 Communication between the app and the dash cam is managed through the cloud. 40 00:04:45,480 --> 00:04:51,360 Now, let's review the method we employed to analyze the dash cams. 41 00:04:52,520 --> 00:04:59,400 Before beginning the analysis, it's essential to obtain the firmware. 42 00:04:59,400 --> 00:05:07,560 This is crucial for tasks such as decompiling code, analyzing the file system, and understanding the boot logic. 43 00:05:07,560 --> 00:05:11,420 There are four primary methods to obtain firmware. 44 00:05:11,940 --> 00:05:17,380 The first method is to download it from the official website. 45 00:05:18,580 --> 00:05:24,760 The second method involves using debugging ports such as UART or JTAG. 46 00:05:24,760 --> 00:05:34,120 During our analysis, we found the UART port as illustrated in the picture, soldered connecting cables, and accessed the shell. 47 00:05:36,720 --> 00:05:41,880 Here are the statistics for UART shells found in the analyzed devices. 48 00:05:41,940 --> 00:05:49,340 Out of nine devices, five had UART shells, and four of these allowed shell access without a password . 49 00:05:49,620 --> 00:05:52,480 One of these four had a custom shell. 50 00:05:54,480 --> 00:06:03,880 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. 51 00:06:05,480 --> 00:06:10,620 All the analyzed dashcams have firmware upgrade functionality. 52 00:06:10,840 --> 00:06:21,240 The third method involves analyzing this functionality to either obtain the firmware download URL or capture package to get the latest firmware. 53 00:06:22,420 --> 00:06:28,140 The final method involves extracting firmware from APK files. 54 00:06:28,140 --> 00:06:31,520 Many recent dashcams come with dedicated apps. 55 00:06:31,520 --> 00:06:40,480 By installing the app and accessing the ADB shell, you can find firmware-related APK files in the app's installation directory. 56 00:06:40,820 --> 00:06:46,480 Extracting and decompressing these files can provide access to the firmware. 57 00:06:47,880 --> 00:06:54,700 Most of the analyzed dashcams allowed us to obtain firmware from their official websites. 58 00:06:54,700 --> 00:07:01,080 We successfully retrieved firmware for all devices, and none of the firmware was encrypted. 59 00:07:02,860 --> 00:07:08,000 The next step is to extract the file system from the obtained firmware. 60 00:07:08,200 --> 00:07:15,800 Tools such as binoc and 7zip can be used for this purpose as illustrated in the picture. 61 00:07:16,720 --> 00:07:21,520 The second step in the analysis process is port scanning. 62 00:07:21,520 --> 00:07:30,700 Using the nmap tool, we can identify open ports on the dashcam, analyze services, and discover potential security vulnerabilities. 63 00:07:30,880 --> 00:07:37,100 For instance, if port 21 is open, we might attempt an FTP connection. 64 00:07:37,100 --> 00:07:42,840 Similarly, if port 80 is open, it suggests the presence of a web service. 65 00:07:43,400 --> 00:07:48,100 Here are the statistics for open ports on the analyzed devices. 66 00:07:48,100 --> 00:07:57,760 Among the well-known ports, FTP, telnet, DNS, HTTP, RPC, and RTSP ports were frequently open. 67 00:07:58,760 --> 00:08:03,860 The third step in the analysis process is analyzing boot logic. 68 00:08:03,860 --> 00:08:16,120 We examine files in etc-init-daemon, etc-rc-local, and system-daemon configuration files to identify and analyze the scripts executed during boot. 69 00:08:16,120 --> 00:08:26,720 For example, the picture shows the RCS file in etc-init-daemon, which runs all files starting with S in etc-init-daemon. 70 00:08:26,960 --> 00:08:32,320 We analyze the code of all S files to understand the boot logic. 71 00:08:32,700 --> 00:08:39,180 Next, we access the shell obtained via UART, JTAG, or other vulnerabilities. 72 00:08:39,320 --> 00:08:48,220 By using the ps command, we can identify running processes and understand how service operations and main binaries. 73 00:08:48,260 --> 00:08:55,320 The nested command helps us identify open ports and the binaries using those ports. 74 00:08:55,480 --> 00:09:02,840 This information provides valuable insights into the current state of the system and the services that are running. 75 00:09:04,160 --> 00:09:09,340 Now, he will discuss the process of debugging the main binary. 76 00:09:13,840 --> 00:09:16,480 Hi, I'm Hanyeol Park. 77 00:09:16,480 --> 00:09:19,720 I'll continue the presentation by discussing the next topic. 78 00:09:20,440 --> 00:09:27,360 For convenience, tools such as GDB and BusyBox can be stored in the SD card directory for easy access. 79 00:09:28,520 --> 00:09:38,360 We decompiled the main binary and tracked vulnerable functions such as system, beopen, string copy, get, and scanf for code analysis. 80 00:09:39,440 --> 00:09:45,880 Using our R&D solution, gIoT, we were to quickly and easily visualize and analyze the vulnerabilities. 81 00:09:47,960 --> 00:09:55,360 Using the UART shell, we proceeded with debugging by utilizing the GDB binary stored on the SD card. 82 00:09:55,680 --> 00:10:02,120 The example code is a script that gets the PID of the running main binary and executes GDB. 83 00:10:03,340 --> 00:10:07,000 Running this script connects directly to GDB for debugging. 84 00:10:08,180 --> 00:10:14,440 This allows us to analyze the main binary's behavior in real time and debug any vulnerabilities. 85 00:10:16,280 --> 00:10:23,960 During debugging, the watchdog timer, which detects system unresponsiveness, caused the device to reboot. 86 00:10:25,100 --> 00:10:30,020 We tried many things, but it was quite challenging to bypass the watchdog. 87 00:10:31,140 --> 00:10:38,240 Even though we made it, we managed to crack it in three cases, and we'd like to share those with you. 88 00:10:40,080 --> 00:10:46,480 In the first case, the initial script executed at boot contained a function to stop the watchdog. 89 00:10:46,800 --> 00:10:50,600 We used this function to execute the corresponding command. 90 00:10:51,360 --> 00:11:01,060 For instance, writing the value 1A3A to test register stops the watchdog, allowing us to dynamically debug the main binary with GDB. 91 00:11:03,720 --> 00:11:10,300 In the second case, we repeatedly pressed Ctrl-G during boot to interrupt the boot script. 92 00:11:10,360 --> 00:11:20,820 Then, we executed the code to disable the watchdog and resume the script, enabling dynamic debugging of the binary with GDB. 93 00:11:23,370 --> 00:11:28,850 In the third case, we entered the boot loader and modified the boot arguments. 94 00:11:29,190 --> 00:11:34,550 By repeatedly pressing ESC and F1, we accessed the boot loader. 95 00:11:35,270 --> 00:11:43,630 In the boot arguments, we modified the init value from Linux.hash to bin.sh and added the value no-watchdog. 96 00:11:44,530 --> 00:11:52,190 After that, we manually executed the initial script line by line and used GDB to debug the main binary. 97 00:11:56,300 --> 00:12:06,280 Protocol analysis capturing the analyzing communication packets between the app and the dashcam, or analyzing APK code and dashcam binary code. 98 00:12:07,240 --> 00:12:17,500 Among the analyzed devices, six used custom protocols, four had web interfaces, two supported cloud services, and one used encrypted communication. 99 00:12:18,520 --> 00:12:26,000 For encrypted communication, we can use Frida to hook the app and inspect plain text packets. 100 00:12:29,340 --> 00:12:35,760 Among the analyzed dashcams, here are the custom protocol formats for four devices. 101 00:12:37,540 --> 00:12:42,100 Custom protocol formats are mainly divided into HEX and JSON formats. 102 00:12:42,480 --> 00:12:54,020 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. 103 00:12:54,780 --> 00:13:01,800 In this example, since there are no parameters, four bytes of data are sent to represent null values. 104 00:13:03,120 --> 00:13:13,160 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. 105 00:13:13,680 --> 00:13:19,100 In this example, the parameter is sent as cmd equals set semicolon. 106 00:13:21,660 --> 00:13:27,440 Next, tvendor's request format is in JSON and consists of three keys. 107 00:13:27,640 --> 00:13:35,380 A token generated at the session start, a command number labeled message underscore id, and a parameter labeled param. 108 00:13:37,200 --> 00:13:42,520 Hvendor's request format is similar to tvendor's, but has slight differences. 109 00:13:42,820 --> 00:13:53,680 It consists of a token incremented by one from the previous request token, a command number labeled message id, and a parameter labeled param. 110 00:13:54,580 --> 00:14:03,640 Each vendor's custom protocol format has a unique structure, and analyzing these formats helps us understand the communication content. 111 00:14:04,920 --> 00:14:08,320 Now, we will discuss zero-day scenarios. 112 00:14:10,460 --> 00:14:13,240 Dash cams have the following features. 113 00:14:13,600 --> 00:14:20,160 They use SD cards for video strategy, and they employ the RTSP protocol for live view functionality. 114 00:14:21,800 --> 00:14:29,300 They offer settings for Wi-Fi, ADAS, GPS, firmware updates, and communication via custom protocols. 115 00:14:29,940 --> 00:14:36,400 Let's explore which vulnerabilities are associated with these features in the next slide. 116 00:14:38,340 --> 00:14:43,900 The use of SD card is associated with the shell script execution vulnerabilities. 117 00:14:44,460 --> 00:14:46,520 Let's explore this scenario. 118 00:14:47,720 --> 00:14:52,880 The boot script includes code that executes test shell from the SD card path. 119 00:14:53,780 --> 00:15:02,480 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. 120 00:15:03,400 --> 00:15:14,640 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. 121 00:15:16,700 --> 00:15:24,160 The live view feature provided through the RTSP protocol is associated with the stack buffer overflow vulnerabilities. 122 00:15:25,280 --> 00:15:33,240 An attacker crafts an RTSP request for live view and hooks the app library to modify the RTSP header data. 123 00:15:34,260 --> 00:15:43,780 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. 124 00:15:45,220 --> 00:15:53,080 By gathering gadgets for the buffer overflow attack and performing gadget chaining, the attacker can exploit this vulnerability to gain a share. 125 00:15:56,050 --> 00:16:03,770 The settings for Wi-Fi, ADAS, GPS, and other features can lead to OS command injection vulnerabilities. 126 00:16:04,850 --> 00:16:13,490 When sending device configuration packets, an attacker can manipulate the data using a proxy tool with backticks and $(). 127 00:16:14,750 --> 00:16:24,390 If the dash cam does not validate special characters and uses this data as parameters for system functions, OS command injection can occur. 128 00:16:25,910 --> 00:16:29,230 This can allow the attacker to take control of the system. 129 00:16:31,290 --> 00:16:38,290 The feature of app and dash cam communication via custom protocols can lead to improper authentication vulnerabilities. 130 00:16:39,510 --> 00:16:44,930 Capturing a packet requesting the file list from the app shows the data in hex format. 131 00:16:46,250 --> 00:17:01,090 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. 132 00:17:03,050 --> 00:17:09,470 By replicating the same packet and sending it to the dash cam, the response will yield the file list. 133 00:17:13,210 --> 00:17:20,650 After capturing the SD card format packet, you can perform a replay attack to execute the function. 134 00:17:21,610 --> 00:17:27,610 Additionally, all functions can be accessed without authentication, and you can try a replay attack. 135 00:17:30,760 --> 00:17:33,420 Finally, let's move on to the conclusion. 136 00:17:36,510 --> 00:17:42,070 Across the nine analyzed dash cams, we discovered eight types of CWEs. 137 00:17:44,430 --> 00:17:49,570 Based on these findings, we have outlined our recommendations and future work. 138 00:17:49,850 --> 00:17:53,270 First, we need to remove script execution code. 139 00:17:53,770 --> 00:17:59,950 Remove script execution code from the SD card path used for developer testing. 140 00:18:00,130 --> 00:18:03,910 Second, enhance communication security. 141 00:18:04,230 --> 00:18:08,470 Add authentication and verification processes during communication. 142 00:18:09,430 --> 00:18:12,330 Third, input validation. 143 00:18:12,770 --> 00:18:20,350 Implement thorough input validation for special characters and length values to prevent security vulnerabilities. 144 00:18:22,780 --> 00:18:32,040 In closing, throughout this presentation, we aim to raise awareness about the potential security threats associated with dash cams. 145 00:18:32,200 --> 00:18:41,900 We hope to encourage dash cam manufacturers to develop more secure products, ultimately leading to safer and more reliable devices for consumers. 146 00:18:42,980 --> 00:18:51,960 Due to our limited ability to provide prompt answers, we are unable to open the floor for real-time Q&A during this presentation. 147 00:18:52,520 --> 00:19:00,880 However, please use the QR code displayed above to contact our company or send an email with your inquiries. 148 00:19:01,440 --> 00:19:06,040 We are committed to provide detailed responses to your questions. 149 00:19:09,040 --> 00:19:14,580 We extend our gratitude to the IoT Village team for giving us this opportunity to present. 150 00:19:14,580 --> 00:19:17,260 Thank you for listening to our presentation.