Analysis of EM Emanations from Cache Side-Channel Attacks on Iot Devices
Total Page:16
File Type:pdf, Size:1020Kb
Analysis of EM Emanations from Cache Side-Channel Attacks on IoT Devices Moumita Dey School of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, USA [email protected] Abstract— As the days go by, the number of IoT devices are growing exponentially and because of their low computing capabilities, they are being targeted to perform bigger attacks that are compromising their security. With cache side channel attacks increasing on devices working on different platforms, it is important to take precautions beforehand to detect when a cache side channel attack is performed on an IoT device. In this paper, the FLUSH+RELOAD attack, a popular cache side channel attack, is first implemented and the proof of concept is demonstrated on GnuPG RSA and bitcnts benchmark of MiBench suite. The effects it has are then seen through EM emanations of the device under different conditions. There was distinctive activity observed due to FLUSH+RELOAD attack, which can be identified by profiling the applications to be monitored. INTRODUCTION Fig. 1. IoT devices demand trend [1] The Internet of Things (IoT) is the next frontier in technology, and there’s already several companies trying to capitalize it. Its a network of products that are connected to the Internet, thus they have their own IP address and can GitHub, Netflix, Shopify, SoundCloud, Spotify, Twitter, and connect to each other to automate simple tasks. As prices a number of other major websites. This piece of malicious of semiconductor fall and connectivity technology develops, code took advantage of devices running out-of-date versions more machines are going online. Appearance of smart ob- of the Linux kernel and relied on the fact that most users jects is the main driver of IoT industry’s development. The do not change the default usernames/passwords on their number of IoT devices connected will increase to 25 billion devices. Verizon Wireless released a report that included an by 2020 [1]. unnamed university that saw more than 5,000 IoT devices The true value of the Internet of Things does not lay in attacked. When senior members of the campus IT staff the lights turning on when the car reaches the driveway, started receiving numerous complaints about slow or inac- but rather the data that the connected devices collect about cessible network connectivity, they discovered their name its users. The collection of data from devices will allow servers were producing a high volume of alerts and showed consumers, businesses and even entire connected cities to an abnormal number of sub-domains related to seafood. It run more efficiently. However, collecting large amounts of turned out more than 5,000 discrete systems were found to data presents challenges. With the collection of data come be making hundreds of DNS lookups every 15 minutes. The major privacy and security concerns for consumers. [2] botnet spread via brute force attack to break through weak IoT devices usually run on low power and computing capa- passwords on IoT devices. [4] bilities. Running anti-virus software and malware-detection With side channel attacks gaining popularity on vari- software take up a lot of its computing power, which makes it ous computing platforms, generally trying to break private difficult to monitor the security of IoT devices. Hence these keys of various cryptographic algorithms, it is simply a devices aren’t being developed with security in mind, which matter of time that a cache side channel attack such as leaves lots of rooms for vulnerabilities. Attackers are fully FLUSH+RELOAD, that extracts cryptographic keys based aware of this reality and scan networks for vulnerable device on the information obtained from the memory access pat- connections. [3] tern, is performed on IoT devices, thereby compromising Attacks on IoT devices are increasing everyday. One their security. This paper uses this motivation and tries to such attack was the Mirai botnet. This particular botnet propose a solution to this problem of IoT security, using the infected numerous IoT devices (primarily older routers and useful information obtained from physical electromagnetic IP cameras), then used them to flood DNS provider Dyn emanations of the IoT device. with a DDoS attack. The Mirai botnet took down Etsy, This paper is organized as follows. Firstly, a background systems, the last level cache is generally the shared cache among all the cores. On Intel architectures, the caches are considered inclusive, meaning that whatever data is contained in a cores L1 cache will also be contained in the cores L2 and L3 caches. Consequently, flushing or evicting data from the last level cache also remove said data from all other cache levels of the processor. To reduce the memory footprint of a system, the system software shares identical memory pages between processes running on the system [6]. When a process accesses a shared page in memory, the contents of the accessed memory location is cached. With page deduplication scheme, the operating system scans memory pages during idle CPU cycles, and looks for pages that are identical in content. It collapses those pages into a single page that is then shared by all processes that were accessing those identical pages. As a result of this page deduplication scheme, processes may be unknowingly or unintentionally sharing memory with one another. However, to prevent malicious access to the shared pages, the operating system maps shared pages as copy-on- write; that is, when a process wishes to write to a page, Fig. 2. Typical CPU cache architecture [8] it must first make a local copy for itself that it can safely modify. required to understand the FLUSH+RELOAD attack, and the C. FLUSH+RELOAD generation and extraction of EM emanations will be pro- Retrieving data from memory or from cache levels closer vided. In the next section, the implementation of the attack to memory takes longer than retrieving it from cache lev- on the IoT device will be discussed. In the third section, els closer to the core. This difference in timing has been the experimental setup to obtain the EM emanations will exploited for side-channel attacks. Such attacks have been be described. In the fourth section, the results of the attack performed by interpreting the time difference based on the will be explained. All related work to the FLUSH+RELOAD prior known state of the cache. FLUSH+RELOAD heavily attack will be discussed in the fifth section. In the subsequent relies on this time difference. sections, the takeaway from this paper, and the future work Another feature that FLUSH+RELOAD relies is on page that can be built up on the preliminary results from this paper sharing across processes, in this case, the spy and the will be discussed. victim processes. With shared pages, the spy can ensure I. BACKGROUND that a memory line has been evicted out of the entire cache hierarchy. A. CACHE SIDE CHANNEL ATTACKS The entire attack is performed in three stages. In the first Side channel attack is an attack that tries to obtain infor- stage, the spy clears the line that is being monitored out of mation about the application of interest, without changing the entire cache. In Intel x86 systems, this is done using the application execution behavior. For example, timing the clflush special instruction. clflush invalidates the cache information, power consumption, electromagnetic leaks or line that contains the linear address specified with the source even sound can provide an extra source of information, which operand from all levels of the processor cache hierarchy (data can be exploited to break the system. General classes of side and instruction) [7]. The invalidation is broadcast throughout channel attacks include cache side channel attacks, timing the cache coherence domain. If, at any level of the cache attacks, power-monitoring attack, electromagnetic attack and hierarchy, the line is inconsistent with memory (dirty) it is so on. Cache attack is an attack based on attacker’s ability written to memory before invalidation. to monitor cache accesses made by the victim in a shared In the second stage, the spy waits for the victim to execute physical system as in virtualized environment or a type of the application and perform accesses to the intended memory cloud service. [6] The FLUSH+RELOAD attack is a type of line. The wait period is decided by the attacker. If the wait cache side channel attack targeting x86 systems. period is too long, there might be multiple accesses to the same memory line but the spy may just identify it as a single B. x86 MEMORY SYSTEM memory access by the victim. If the wait time is too short, In modern computer architectures, the cache is typically there might be a higher risk of cutting out the victim when laid out in multiple levels, generally referred to as L1, L2 it is mid-way performing the access to the memory line. and so on, with the subsequent levels of caches larger than In the third stage, the spy reloads the memory line. The the lower levels as shown in Fig.2. In the case of multi-core spy calculates the time difference between the third and the Fig. 3. Spectrogram for Basicmath benchmark with large (profiling run) Fig. 4. Exponentiation by Square and Multiply. [6] inputs. [9] spikes characteristic for each loop appear and disappear, first stage. If during the wait period the victim accessed the allowing it to determine when each loop is entered and memory line being monitored, the memory line would have exited. been mapped to the cache when the spy tried to reload the Spectral Profiling [9] monitors EM emanations uninten- line. This means that the time difference will be lesser and tionally produced by the profiled system, looking for spectral will correspond to a cache hit.