Spy-Sense: Spyware Tool for Executing Stealthy Exploits Against Sensor Networks
Total Page:16
File Type:pdf, Size:1020Kb
Spy-Sense: Spyware Tool for executing Stealthy Exploits against Sensor Networks Thanassis Giannetsos Tassos Dimitriou Athens Information Tech. Athens Information Tech. 19.5 km Markopoulo Ave. 19.5 km Markopoulo Ave. Athens, Greece Athens, Greece and [email protected] Aalborg University Fr. Bajers Vej 7A5 DK-9220,Denmark [email protected] ABSTRACT 1. BACKGROUND AND MOTIVATION As the domains of pervasive computing and sensor network- Recent technological advances in sensing, computation, stor- ing are expanding, a new era is about to emerge, enabling age, and communications, enabled the design and prolifera- the design and proliferation of intelligent sensor-based ap- tion of new intelligent sensor-based environments in a vari- plications. At the same time, sensor network security is a ety of application domains, ranging from military to civilian very important research area whose goal is to maintain a and commercial ones. It is expected that their adoption high degree of con¯dentiality, integrity and availability of will spread even more in the future and WSNs will soon both information and network resources. However, a com- become as important as the Internet. Just as the Web al- mon threat that is often overlooked in the design of secure lows easy access to digital information, sensor networks will sensor network applications is the existence of spyware pro- provide vast arrays of real-time, remote interaction with the grams. As most works try to defend against adversaries who physical world. Ongoing trends include their integration in plan to physically compromise sensor nodes and disrupt net- smart environments [1, 2, 3], structural and environmental work functionality, the risk of spyware programs and their monitoring [4, 5, 6, 7], participatory sensing [8, 9], smart potential for damage and information leakage is bound to grids [10, 11], assistive healthcare [12, 13] and so on. increase in the years to come. At the same time, sensor network security is a widely re- This work demonstrates Spy-Sense, a spyware tool that al- searched area with solutions mainly focusing on securing in- lows the injection of stealthy exploits in the nodes of a sensor formation and resources, as well as maintaining con¯dential- network. Spy-Sense is undetectable, hard to recognize and ity, integrity and availability of data. Most of the currently get rid of, and once activated, it runs discretely in the back- proposed defense mechanisms try to counteract the disas- ground without interfering or disrupting normal network op- trous threat of the most important security issue in WSNs; eration. It provides the ability of executing a stealthy exploit node compromise spread [14, 15]. Sensor nodes are typically sequence that can be used to achieve the intruder's goals unattended and subject to security compromise, upon which while reliably evading detection. To the best of our knowl- the adversary can obtain the secret keys stored in the nodes, edge, this is the ¯rst instance of a spyware program that is and use the compromised nodes to launch insider attacks. able to crack the con¯dentiality and functionality of a sensor Originating from a single infected node, such a compromise network. By exposing the vulnerabilities of sensor networks can propagate further in the network via communication to spyware attacks, we hope to instigate discussion on these links and pre-established mutual trust. critical issues because sensor networks will never succeed without adequate provisions on security and privacy. As opposed to \strong" node-compromise defenses (code at- testation [16, 17], malware detection [18], intrusion detec- Keywords tion [19, 20]) that has been a very active area of research, there has been very little research on memory related vul- Wireless Sensor Networks, Spyware, Exploits, Malicious Code nerabilities. As sensor nodes are deeply embedded wireless Injection, Content Con¯dentiality, Multi-Stage Bu®er Over- computing devices, it is possible for an attacker to run unau- flow attacks thorized software on them. The only previous work in this area focused on trying to prevent transient attacks that can execute sequences of instructions present in sensor program memory [21]. However, permanent code injection attacks are much more powerful: an attacker can inject malicious pro- grams in order to take full control of a node, change and/or disclose its security parameters upon will. As a result, an attacker can hijack a network or monitor its activities. 1 Motivated by this unexplored security aspect, we demon- to inject into a sensor node before activation. This reveals strate Spy-Sense, a spyware tool that can be useful not all sensor network vulnerabilities that can be targeted by only in highlighting the importance of defending sensor net- sophisticated attack tools such as Spy-Sense. work applications against permanent code injection attacks but also in studying the severity of their e®ects on the sen- By publishing such a tool, we wish to shed light on revealing sor network itself. This in turn can lead to the development the e®ects of such programs in the network itself as well as of more secure applications and better detection/prevention highlighting all the weaknesses that make them susceptible mechanisms. to these kind of threats. We thus expect that our work will be particularly useful in the design and implementation of Spy-Sense allows remote injection, through specially crafted more e±cient security protocols. messages, of various code exploits in the heart of each node in a sensor network. Once injected, it is undetectable, hard to recognize and get rid of (as it remains idle in an un- Paper Organization used memory region), and when activated, it runs in a dis- The remainder of this paper is organized as follows. Sec- crete background mode without interfering or disrupting tion 2 gives a high level description of Spy-Sense, what it normal network activities. It gives an attacker the ability can do and how it threatens sensor network security. Sec- to threaten network security through the execution of in- tion 3 is the heart of this work; it gives an overview of the jected stealthy exploits. Exploits are sequences of machine tool's architecture along with a detailed description of all im- code instructions that cause unintended behavior to occur on plemented system components. Assembly code description the host sensor. Examples of loaded Spy-Sense exploits in- of all Spy-Sense provided exploits is presented in Section 4. clude data manipulation (theft and/or alteration), cracking Finally, Section 5 concludes the paper. (energy exhaustion, change of node IDs), network damage (radio communication faults or break downs, system shut 2. WHAT IS SPY-SENSE downs), etc. Additionally, exploits may run periodically al- As the name suggests, Spy-Sense is malicious software that lowing adversaries to continuously spy on nodes' activities \spies" on sensor node activities and relays collected infor- (more information can be found in Section 3.3). mation back to the adversary. It can install remotely, se- cretly, and without consent, a number of stealthy exploits The intuition behind this work is to introduce the notion of for threatening the network's security pro¯le. Example of spyware programs in sensor networks and highlight their dis- exploits include data manipulation, cracking and network astrous e®ects on their security pro¯le in terms of functional- damage (Table 1). As the total size of these exploits (312 ity, content and transactional con¯dentiality. Content con- bytes) is very small, Spy-Sense can be easily and rapidly ¯dentiality is to ensure that no external entity can infer the injected into the nodes of a sensor network. meaning of the messages being sent whereas transactional con¯dentiality involves preventing adversaries from learning Typically, a sensor node is compromised via a software vul- information based on message creation and flow within the nerability (e.g., bu®er overflow, format string speci¯er, inte- network. Our tool is capable of threatening all of the above ger overflow, etc.) that allows sequences of code instructions since even in its most benign form, it can simply consume to be injected and stored anywhere in the mote's memory. CPU cycles and network bandwidth.When utilized fully, it They occur when a malformed input is being used to over- can lead to stolen cryptographic material and other criti- write the return address stored on the stack in order to trans- cal application data, breaches in privacy, and the creation fer program control in code placed either in a bu®er or past of \backdoor" entries that adversaries can use to target the the end of a bu®er. Since all sensor nodes execute the same network with more direct attacks [22] (Sinkhole attack [23], program image and reserve the same memory addresses for Replay attack [24], Wormhole attack, etc.). particular operations (as the result of only static memory allocation support), ¯nding such a vulnerability can leave Our Contribution the entire network exposed to exploit injection and not just Even though research in spyware programs against several a small portion of it. types of networks has increased signi¯cantly over the years, existing literature in sensor networks is very limited. To the Spy-Sense exploits will reside in a continuous memory region best of our knowledge, this is the ¯rst instance of a spyware in the host sensor platform. They can operate in stealth tool that allows the execution of a number of stealthy ex- mode as they are programmed to change and restore the ploits threatening the security, privacy and functionality of flow of the system's control in such a way so that they such networks. Our contribution is twofold: don't let the underlying micro-controller go into an unsta- ble state. These exploits make use of the existence of an First, we describe an implementation that further advances empty memory region reserved to be used as the heap for the use of \multistage bu®er-overflow attacks" in order to dynamic memory allocation.