So, hello. Thank you for coming to our presentation. We're going to talk about exploiting the IoT Hub, which includes attacking the smart home by compromising IoT Hub devices and some counter measures for this attack. And I know that the IoT Village is also running GeoJet track and Cydia track, and maybe this talk is helpful for those who are participating in the tracks. So, my name is Hyun Lee and I'm a graduate student of HL Lab at Korea University, and I like to play CDF, and I'm currently participating in Defcon CDF Final as Defcon Routine. And I've been researching on open-source software targeted fuzzing and contributing to software security by reporting the found bugs and I got some CVs. And I'm also interested in embedded security such as IoT and SCADA and so forth. And we're also a mentee of Best of the Best, also known as B.O.B. program, which is a cyber security expert educating platform in Korea. Hello. My name is Chang Hyun. I'm working in a cyber security consulting team at the company UI Korea. I'm a graduate student of Sungkyunkwan University, and I'm so excited, but also a little nervous, giving my first overseas presentation. Thank you. Thank you. So, now we're going to talk about the We'll introduce our agenda of this presentation, and we'll briefly explain the structure of Smart Home after the introduction of this overall talk. And we'll analyze real-world case study of threats that may arise in the Smart Home environment. Next, we'll conduct vulnerability analysis for different IoT devices. We found 20 vulnerabilities, and we'll describe their types. And we'll suggest feasible tech scenarios by training these vulnerabilities. Then, we'll briefly outline the countermeasures required to prevent these attacks and conclude this talk. So, now let's get started. In 2016, there were minor infections targeting IP cameras and home routers. The attack targeted against a large number of internet-connected devices to form a bot network, which was used for large-scale DDoS attack. In fact, the vulnerability used for this attack is quite simple, but fairly critical. Attackers can easily compromise those devices just by pre-forcing the password for teleth, which means that there was no secretive consideration in IoT devices. In 2017, a new internet-themed bot network called PerseRai has been discovered, targeting over 1,000 IP camera models. The use for this attack was command injection with authentication bypass, and approximately 120,000 IP cameras were found vulnerable. However, the worst is, many of these vulnerable users didn't recognize that their IP cameras were exposed to the internet. There are also cases of attacks on Zip-on routers, which are used widely in the world. Even the exploit codes were released on the exploitative website. This attack consists of only two vulnerabilities as well. Command injection and authentication bypass were needed to compromise the routers. Likewise, attackers can download and execute a model on the device, and build a sensible network to fully take control of the devices remotely. So, now let's focus on the security of smart home. You know, the IoT hub, which connects all the smart things with the same network area and communicate with remote servers for management, is considered a vital element in the smart home environment. The hub device is also connected to the internet, which means, it can be attacked, as there are previous IoT exploit cases. if an externally accessible port is open, or attackers can access the same network area. In fact, Cisco Tower's intelligence recently released vulnerability analysis results on Samsung's SmartThings Hub device. The found vulnerabilities include command ejection, buffer flow, information leakage. And these vulnerabilities can be chained together to form a fully split code compromising the Hub device. So as you know, the IoT threats are still ongoing, and countermeasures for these threats should be considered urgently, I think. So we have conducted threat analysis and found many vulnerabilities for the Hub devices made from different manufacturers, and we want to share the results from now on. Yes, next I will talk about the structure of a smart home. According to this diagram, smart home services can be broken down into apps, application, platform server, IoT Hub, IoT Things. There are times when there is no need for an IoT Hub, but it is present in most smart homes. I will now explain more about the IoT Hub in detail. IoT Hub manages small devices in the smart home. It supports wireless protocol like the C-Wave, C-Guby, Wi-Fi, Bluetooth, and Cera. Also, to connect to a platform server, it uses diverse provisioning protocols. These protocols include DRO69, MQTT, COAP, HTTP, 1M2M, and custom protocols. Next is the process of IoT Hub. The IoT Hub process is composed of four steps, First, the smart home service app will register the IoT hub with the server. And second, the IoT hub performs a user authentication through the server. Third, the IoT hub and the things go through the process of pairing. Finally, the user is able to access the things through the application. So far, we have covered the functions of the IoT hub in smart homes, and now we will explain why we chose the IoT hub as our target. Our first lesson is that once the IoT hub is taken over, it is very possible to take over everything connected to the IoT hub. Because of this, there would be many possible scenarios. For the more, we imagine that through the exploitation of the IoT hub, we would be able to hack difficult wireless protocols, such as the Z-Wave. Lastly, our most important reason for choosing our target as the IoT hub was for money, and we are both. Now, we will find out more about the IoT hub. This picture shows a threat that exists in smart home services. I have separated the threat into two graphs, the external part, which is outside the home, and the internal part, which is inside the home. I have only included points that were important in my opinion. So, let's start. In the external section, the primary threat, the supply chain attack of the firmware server, and the user us-bypass, and man-in-the-middle. And the internal section, there are memory corruption, command injection, LPE, man-in-the-middle, and a very important threat is remote control of things. And now we will consider a real example of a threat. In each section, this case is a mobile application, an example of a threat that can occur outside the home. One is able to control another device using one's own application. There are two examples in the internal section. We will first examine the one concerning the IoT hub. Many vulnerabilities have been discovered in the Samsung IoT hub. This including threat is RCE, DAS, information disclosure, and injection. This one was discovered in the Z-Wave which is a wireless protocol. It is using the default encryption key. Man-in-the-middle attack was possible. and now the first has been patched. Let us take a closer look at the IoT hub to run more precisely and carefully into potential thread of the IoT hub. We drew a thread model based on slides. As you can see in the flow diagram, the IoT hub indicated by red dot line is connected to the other section, including the platform server and things. The IoT hub was many processes and flows. Process is a circle, just line is flows. A lot of thread and other vectors exist because of this. Yes, in the table below, which thread is explained, now we will talk about all of these in detail. Thread number 32 is the potential lack of info validation or poor pairing. We will now present a specific example of an instance when this thread was properly exploited. My partner, Huion, will take it from here. Yeah, so from now on, I'm gonna talk about vulnerability analysis for IoT hub. We analyzed total four products. For each product, the MCU architecture is classified as ARM and MIPS. Also, a JetWave, Wi-Fi, Bluetooth, and RF are used for wireless communication between IoT hub and smart devices. And the IoT hub transmits the status information of the device, such as form information, certificates, and secret keys and so on to the server via provisioning so that the remote server can't manage the device, such as automatic update, device registration, connection, and communication with mobile application. So, company A uses TR-069 as provisioning, that is, customer premises equipment, wide area network management protocol, also known as CWMP. And this will be explained in more detail later on on our slide. And company C uses the MQTT protocol. MQTT is a machine-tested protocol. It was designed as an extremely lightweight, publicly-subscribed messaging transport. To manage IoT hub devices, there are management services in the form of web application or something else. And web applications are usually developed based on open source, such as Go Ahead for web server and Light Edge TPD. But nowadays, it seems to be a trend to customize the source or develop the server. So, it's a very popular service directly from the manufacturer. In addition, we confirmed whether we can access to the debugging shell for remote or UART serial debugging port. As you can see, we can get a debugging shell by UART for all of the target devices. So, there are six steps to analyze IoT devices. First of all, extract the firmware. Because the functions that need to be analyzed are usually embedded in the firmware. Second, acquire a command shell for debugging. When you access the shell, you will notice which processes are running as a key role. Nozio mainly handles lots of requests. Once the main binary is extracted, we can analyze the vulnerabilities and finally exploit them. There are roughly three ways to extract the firmware. Through the provisioning, the remote server checks the firmware version of the hub device and performs automatic update when the version is not up to date. At the same time, the updated firmware URL information can be obtained and the firmware can be downloaded. Another way to get the firmware is using the UART debugging port. As you can run all commands in the debugging shell, we can extract the desired binary through commands like tftp, ftpget, curlnc, and so on. Also, we can use jtag instead of the UART, but we'll skip it because it's too expensive. So, if both methods are impossible, there is a way to dump the flash memory directly. There are many ways to dumping the flash memory, but in our case, we used Arduino Uno equipment. In addition, we can also remove the flash memory chip through the disordering for memory dump. Next, we need to acquire a debugging shell, usually using the UART method. Sometimes, it's easy to get a shell if telnet or ss-14, is open, and it's set as a default account, which can be easily cracked, and the VRI attack exploits this type of vulnerability. Usually, a login account is required, as you know, when accessing via UART or telnet. Then, how to log into the shell? Let's suppose the firmware is extracted, already obtained in a different way. Then, we can search the hard-coded password or check the password routine. By reversing the relevant binary containing the login-related functions, sometimes the password is written in the config file, and we can find it easily. Now, what if we cannot get the firmware, or do not know the password? Easier way to log in, even if U-Boot's boot delay option is set to zero? You know, U-Boot is a bootloader, handling lots of tasks such as system initialization, current loading, and execution. Normally, Normally if the boot delay option is set to enough, we can get it to bootload prompt and change the kernel image booting option. But otherwise, we'll have to short the NAND flash chip. It's the principle that connection between ground pin and the particular pin of the NAND chip causes kernel loading error and can lead to bootload prompt. After entering bootload prompt, we can set boot ARGS options by adding init equal pin as a string and then reboot. Then we can get the UR debugging shell with the root account. Next, identify main process. Since the program startup commands are usually defined in the startup script file, we can easily find the main process. The network status check command tells you which ports are open and which processes are running. There are five categories of vulnerabilities we have found. Let's take a closer look at each one. When sending a payload to a web application, it usually validates the session value and we can bypass the authentication with a simple URL tree. As you can see, if the request URL ends in .css, .grf, .jpg, and et cetera, the function of validation for a session is not called, which means we can bypass authentication routine. In some cases, the program itself creates a session value with non-random. In this case, we can bypass the authentication by generating a forced session value. In fact, this is one of the vulnerabilities using the recently released JIP and router exploit. As you can see, the first vulnerability is authentication bypass. This was done by putting question mark image, strings at the end of the URL. Attackers could easily bypass authentication by inserting certain keywords into the end of the URL and succeed in remote code execution with a second vulnerability, command injection. The most common but fatal vulnerability is command injection. The vulnerabilities could be implemented literally by inserting arbitrary commands into certain headers or parameters. This can reliably execute attack code, without the need for bypassing mitigations like DP and AS at all. As you can see in the image, if you inject a command into a certain parameter, it passes an argument of the system function without sanitization, the resulting command injection. So, as you can see, one simple command injection makes it possible to access to the system remotely. This is the most attractive vulnerability for attackers. Now, this is the very typical vulnerability, birth-forward flow. In fact, many of the IT devices we had analyzed didn't have secure coding applied. So, we focused on the vulnerable functions like searching copy, S3 Intel, memcpy, and so on, to find birth-forward flow. As can be seen from the image below, the functions are used quite a lot. Now, on some devices, we could find functions that simply execute commands. This function is assumed to be used for debugging from the perspective of developer. However, it is considered as a backdoor from attacker's point of view. Unlike most cases, in this picture, the name of the function is too clear that it is a backdoor. However, the function is usually hidden, and some constraints should be met to execute commands. Likewise, you can control the device very easily. As you can see, we inserted command creating directory, on command parameter, and we can create the directory successfully. Lastly, local privilege escalation vulnerability. There are many ways to elevate privileges on Linux embedded systems. Sometimes, in an embedded system, the privileges are separated as root and user, so that certain processes run with normal user account. In the account accessed through Telet, is a normal user account. Elevation of privilege is required to execute more commands. Instead of Linux current exploitation, we'll show you privilege escalation by using a logical bug, which is user-owned script file executed as root account. As you can see, the user account is linear, it's a normal account. And the rc.local file is a startup script that is executed with root permission, and it executes serial.sh, file as a command. However, the serial.sh is a user-owned file, and can be modified as normal user account. If we insert a command to change the password of the root account into the serial.sh file, then we can access to the system with root account successfully. Based on the found vulnerabilities, we can develop a final exploit. Profile flow can be exploited to remote code execution. To do this, our and shellcode development are needed. So, you can run shellcode by chaining three gussets that control specific registers, get the address of the shellcode on the stack, and jump to the shellcode. This code is a reverse TCP connection shellcode for MISP's architecture, that allows you to execute commands from a remotely connected server. So, we have developed a complete exploit for a Company A hub product, and we will demonstrate that we can fully take control of the hub device by combining the authentication bypass with buffer flow. So, in first demo, we'll show you the Company A's hub device fully compromised by buffer flow and authentication bypass. The left side is attacker side. So, we have to open the port, a listening port, from remote reverse TCP connection. And the right side is a tele-session for checking the our exploit is success. And this is the UART debugging shell, also checking the exploit's accessibility. And the middle side is the attacker side, and executing the exploit code by setting target IP. The target IP is a web service of the hub device, and we can get a remote shell. For proof of concept, we create a flag file as contents pwned. And as you can see, the flag file is created successfully, and the content is the same. And also in the UART debugging shell. So, as you can see, we can execute any commands as we want. So, we compromised the hub device successfully. So, now let's look at which attack scenarios by scenarios are possible with the identified vulnerabilities. First, it is the scenario that controls the themes. If an attacker gains control of the hub device, the IoT devices connected to the hub can be controlled. Usually, hubs and devices communicate wirelessly by JetWave, JigBee, and RF, but there is no authentication between them. So, we can leverage these points to manipulate command packets to control devices, or for status information. As you can see, the hub device recognizes the specific byte of the packet as control code. And based on this, we can control it. It gives a certain command to the relevant devices. Also, if the main process is implemented as Java application, you can see that the payload is also sent in a specific format. So, by delivering packets based on this format, we can control the devices as we want. So, this is a second demo. This is a door open sensor. In this demo, we will show that we can forward status information of the smart things, and it can lead to false information on mobile application. Because the company only service for Korean customers, so the mobile application supports only Korean. So, please understand that. And we have subtitle as English. So, as you can see, the application tells the door open sensor is open. However, if we send the packet that includes closed information for the sensor, then you can see that the application status information is just forced. But still, the door open sensor is open. And the next demo, we can disconnect the smart things by sending this connection packet to the hub device. So, yeah, as before demo, we can disconnect the device and we can also control the smart bulbs. It's the Phillips Hue Bridge and the smart light. If you compromise the hub device, you can analyze many command packets and send counter packet to the connected smart things. For the proof of concept, we developed a Python script, yeah, to control the light bulb. At first, we can turn on the light bulb. And also, we can adjust the brightness of the light bulb. So, if you set, oh, sorry, sorry. If you set the brightness as middle, the brightness will be dim. And also, we can turn off the light. And you can flash the light bulb also. So, this means. we can control the device as you want if you compromise the hub device. Then let's look at the cases of encrypted communication between the server and the hub. Since the up-to-date devices are communicating with servers as encrypted as SSL or TLS, there is no useful information to be extracted in the case of man-in-the-middle. However, one of the devices we have analyzed uses a scheme that the IoT hub itself generates and stores the encryption key in the device, which means that the packet can be decrypted if the hub is compromised. So we analyzed the encryption algorithm and found that it is ACE 128 ECB mode. This is a symmetric key cipher, so the server and the hub share the same key. Coincidentally, there was a buffer for vulnerability in the hub device, which we could take over the system and extract the 16-byte encryption key. So as you can see, the data area of the packet is encrypted. For proof of concept, ACE AES-128 ECB mode encryption algorithm was written in C code. And the corresponding message is decrypted by entering the extracted key, which is the key values. This can be used as a scenario for disconnecting a hub device by sending first information to the server. So my partner, Chang-Yan, will talk continuously. Hi, I'm back. This scenario is the man-in-the-middle. Some IoT hubs uses TR-069 protocol for provisioning with the server. When the server and IoT hub communicate, the HTTP response message is changed and exposing the hub's critical information. We will show the admin web password in the next demo. Let's see. Wait a minute. Oh, sorry. Yeah. Wait a minute. Okay. The TR-069 protocol is authenticated via two HTTP requests with the server. After authentication, change the HTTP response. This point, yeah, change. Just as the server asks for information, this hub is disclosed. The admin web password and the string is more, sorry, this is the web admin password and we drop the packet. It's so simple man-in-the-middle demo. These vulnerabilities may be used in .net because its IoT devices are connected to internet, which means that those capabilities may be used in .net because its IoT devices are connected to internet. A lot of .net have a code since the Mirai.net case. Yes. Let me take a closer look at the IoT .net in detail. First, IoT .net is increasing. .net such as Mirai, Hajime, and the Moon continue to be found. Last year, many IoT malware were discovered. Second, the IoT attack methods includes .net, .net, and .net. One day on the admin web, one day on the open source, and misconfiguration like the same password, default password, and so the attack purpose is evolving. In the beginning, IoT .net used the DOS, but today used as PDOS, ransomware, and mining pool. Finally, many countries are causing damage like the Mirai .net. So how about the IoT hub? We found, we searched, we researched through Shodan. We haven't found much, but 70,000 devices has been exposed. Also, the vulnerabilities of IoT hub can be used as a mining pool. There are cases where Bitcoin was mined through OpenWrt firmware. Of course, you need hardware support. For mining, it is just one of the many scenario. Two weeks ago, the article came out. It was mining through micro-thick devices. According to this article, there was a mining code on the admin web page of micro-thick devices. Like this example, mining pools can damage devices or users. Maybe the IoT hub. The final part of our presentation will be IoT security. How should we secure IoT? I think, just I think, there are three necessary steps to follow. Device security, compliance, and detect of anomalies and threats. The first is device security. Each device. This is the first step. And, it is according to this rule, it is the most important. For each device, we need each unique password. Share, admin web and the Wi-Fi password. Most all, we different each following password rules. Debugging port like UART, JTAG must be disabled. For codes developed individually, secure coding is absolutely necessary. And, if we have an open source it must always be updated too. It should be. latest version. We are able to easily carry out our analysis because 3 out of the 4 corporations had not encrypted in their respective formulas. Then, even if the hacker obtains the formula, the file system will not easily be obtained. Second, about compliance, IoT security guideline made by international organizations must be followed. It is good to keep this guideline as a reference because they explain the security of the IoT ecosystem. A good guideline to follow is NIST, I-R-A-2-O-O, made by NIST. But we should not stop here. The guidelines are minimal. And security must constantly be maintained. Third, one must be ready to deal with anomalies and threat detection. To detect anomalies and threats, one must do the following data collection, intelligence analysis, automated response and visualization. So is conclusion of our target – U- R- S- Our talk, sorry, our talk, to wrap up our presentation, we found many different threats at the IoT hub and smart home services increasing due to technology like the voice recognition, AI, and machine learning. Furthermore, the IoT hub is evolving to the forms of AI speakers and WordPath. This is good news for us. We have plenty of research to do in the IoT security. We will threaten more findings and research about security in the future. Here are the references, and special thanks to Anastra, Sengi, Mongi, and Moonbum Park. Thank you for listening to our presentation. If you have any questions, we are happy. We are happy to take them. When you come to us, please, we are always open. Thank you. Thank you. Thank you.