MACTANS: INJECTING MALWARE INTO IOS DEVICES VIA MALICIOUS CHARGERS

Transcription

1 MACTANS: INJECTING MALWARE INTO IOS DEVICES VIA MALICIOUS CHARGERS BILLY LAU, YEONGJIN JANG, CHENGYU SONG, TIELEI WANG, PAK HO CHUNG, AND PAUL ROYAL GEORGIA INSTITUTE OF TECHNOLOGY, ATLANTA, GA, USA ABSTRACT Apple ios devices are considered by many to be more secure than other mobile offerings. In evaluating this belief, we investigated the extent to which security threats were considered when performing everyday activities such as charging a device. The results were alarming: despite the plethora of defense mechanisms in ios, we successfully injected arbitrary software into currentgeneration Apple devices running the latest ios software. All users are affected, as our approach requires neither a jailbroken device nor user interaction. In this paper, we show how an ios device can be compromised within one minute of being plugged into a malicious charger. We first examine Apple s existing security mechanisms to protect against arbitrary software installation, and then describe how USB capabilities can be leveraged to bypass these defense mechanisms. To demonstrate persistence of the resulting infection, we detail how an attacker can hide their software in the same way Apple hides its own built-in applications. To demonstrate practical application of these vulnerabilities, we built a proof-of-concept malicious charger, called Mactans, using a BeagleBoard. This hardware was selected to demonstrate the ease with which innocent-looking but malicious USB chargers can be constructed. While Mactans was built with a limited amount of time and a small budget, we also briefly consider what more motivated, well-funded adversaries could accomplish. Finally, we recommend ways in which users can protect themselves and suggest security features Apple could implement to make the attacks we describe substantially more difficult to pull off. 1

2 2. INTRODUCTION In recent years, consumers have shifted their attention from traditional computing devices such as PCs and laptops to mobile devices such as smart phones and tablets. Although these devices come with new security features, they are not bulletproof. Given the predominance of Apple s ios devices, we set out to explore how well users are protected against various types of attacks when using products such as the iphone or ipad. Currently, ios is considered by many to be more secure than other mobile offerings, based on security mechanisms such as mandatory code signing, app sandboxing, and a single, centralized app store. In evaluating this belief, we examined how Apple s existing security mechanisms protect against arbitrary software installation and execution. Specifically, we investigated the extent to which security threats were considered when performing everyday activities such as charging a device. The results were alarming: despite the plethora of defense mechanisms in ios, we successfully injected arbitrary software (in a surreptitious manner) into current-generation Apple devices running the latest operating system. So far, this attack works on devices equipped with ios versions up to and including ios 6. To demonstrate practical application of these vulnerabilities, we built a proof-of-concept malicious charger, called Mactans, using a BeagleBoard. This hardware was selected to demonstrate the ease with which innocent-looking but malicious USB chargers can be constructed. The name was chosen to portray the characteristics of a species of spider commonly known as the Black Widow, whose bite delivers potent neurotoxin that can be deadly to humans. While Mactans was built with a limited amount of time and a small budget, in Section 5.1 we also briefly consider what more motivated, well-funded adversaries could accomplish. To provide a defense against such attacks, in Section 5.3 we recommend mitigations that Apple could implement to make the attacks we describe substantially more difficult to pull off. Following our disclosure to Apple, we received an from Apple Product Security that invited us to test ios 7 Beta 2. Upon examination, we discovered that Apple had implemented one of our recommendations to require user consent for an ios device to be paired with an unknown host for the first time. 2

3 3. OBSERVATIONS We begin by describing observations made during the course of our security research that enabled us to circumvent existing security features of ios, install and execute arbitrary apps. The attack consists of injecting an arbitrary app into an ios device through a USB cable connected to a custom-made malicious charger. Additional details are provided in Section 4, while possible mitigations are suggested in Section PHYSICAL WEAKNESS DESCRIPTIONS The weaknesses we describe affect ios devices up to and including those running ios 6. Following the client-server communication model, we refer to the ios device as client, and the entity that attempts to communicate with the client as the host. Using this terminology, below is a list of weaknesses we discovered ANY HOST CAPABLE OF ESTABLISHING A SESSION WITH THE CLIENT IS IMPLICITLY TRUSTED BY THE CLIENT As a result, without the user s permission, any host that understands the proprietary RPC communications protocol like that used by itunes to communicate with an ios device can similarly and directly query or modify the state of the client. We note that this communication protocol lacks proper authentication and assumes trust too broadly. The consequence of this weakness is further described in Section THE CLIENT DOES NOT SEEK THE USER S CONSENT FOR ACTIONS THAT WOULD ALTER ITS STATE AND PROVIDES NO INDICATION TO THE USER WHEN ITS STATE (I.E., UDID) IS QUERIED As a result, the scenarios described in Section 4.2 through Section 4.4 can occur automatically without the user s consent or knowledge. This weakness is a security problem with significant consequences. 3

4 3.1.3 APPLICATIONS INSTALLED ON THE CLIENT CAN BE HIDDEN IN THE SAME WAY APPLE HIDES ITS OWN IOS SYSTEM APPLICATIONS (E.G., FIELDTEST.APP) As a result, the execution (through a weakness described in Section 3.1.4) of a hidden application installed by the host will not be visible (e.g., via SpringBoard or the ios main screen) to the user. This characteristic contradicts the popular assumption that all installed apps are visible and therefore enumerable from the SpringBoard. In addition, it permits malware-like apps to be installed without leaving any traces visible to the user THE HOST CAN EXECUTE APPLICATIONS ON THE CLIENT (I.E., DEBUGSERVER) WITHOUT THE USER S CONSENT As a result, and in combination with the weaknesses described in the previous sections, the host could mount an Apple-signed disk image (DeveloperDiskImage.dmg) and launch com.apple.debugserver to execute an installed application regardless of whether it is hidden THE USE OF THE APPLE PROVISIONING PORTAL CAN BE EASILY AUTOMATED TO OBTAIN A PROVISIONING PROFILE As a result, provisioning profiles can be obtained automatically by submitting UDIDs of target devices. Thus, potential attacks do not need to depend on availability of an Enterprise Provisioning Profile, which while imposing no cap on the number of devices, is more difficult to obtain. 3.2 UNIFIED DATA, CONTROL, AND POWER INTERFACE Due to space and user-convenience considerations, ios designers have built a unified hardware interface that serves two primary functions: 1. Charging the battery of the ios device, and 2. Facilitating data communications and device control. Such choices can be seen in the form of Apple s 30-Pin dock connector (for older devices) and Lightning USB interfaces (for newer devices). This minimalism continues in software we noticed that there are no visual indicators on the screen when an ios device is being plugged into a host which can alter the state of a device. These observations motivated us to explore attacks that exploit this absence of information. 4

5 4. IOS MALWARE INJECTION ATTACK Using the observations described in the previous section, we chained together weaknesses and the potential threat vector mentioned in Section 3.2 to construct an end-to-end malware injection attack for ios devices. As a proof-of-concept, we successfully injected a malicious app into a target ios device that was plugged into a fake USB charger; this attack requires neither a jailbroken device nor user interaction. While some users may already be aware that connecting a mobile device to a compromised computer could lead to a compromise of the device, there is usually little concern given when the connection for a mobile device appears to be simply a device charger. As a result, the charger is often trusted implicitly. With the above context as a guide, we investigated the extent to which commodity USB-based functionalities can be miniaturized and arrived at the idea of integrating a computer into the space profile of a charger, which we later called Mactans. With Mactans, the assumption that chargers are trustable does not hold. Using small financial and time budgets, we were able to build a proofof-concept charger out of inexpensive, commodity hardware, the BeagleBoard, which is a functional mini-computer on an 8cm x 7.5cm board. 4.1 PROOF- OF- CONCEPT REQUIREMENTS Below are the requirements for the proof-of-concept attack we describe in this section Apple 30-Pin or Lightning USB cable Active ios individual developer s license ios device (target) Internet connection (via Wi-Fi or cellular data connection) Mactans charger, consisting of: o A USB port that can provide power o Small scale microprocessor/microcontroller o Linux operating system o ios RPC communications library (e.g., libimobiledevice) 4.2 OBTAINING UDID A Unique Device Identifier (UDID) is a 40 digit hexadecimal number that serves as a fingerprint of an ios device. It was originally used by app developers to uniquely identify different devices for various purposes. However, today the UDID is considered a sensitive piece of information and its use in regular apps has been deprecated since ios Therefore, unauthorized access to the UDID can be considered a privacy leak. In our proof-of-concept attack, obtaining the UDID is an essential preliminary step in preparing the target device for app injection. To obtain the UDID, we simply query the device s USB 1 https://developer.apple.com/library/ios/#documentation/uikit/reference/uidevice_class/deprecationappen dix/appendixadeprecatedapi.html 5

6 identifier using standard tools such as lsusb. The UDID can be obtained even if the device is passcode-locked. 4.3 OBTAINING & INSTALLING A PROVISIONING PROFILE Once obtained, the UDID can be used to create a provisioning profile for the target device, which will allow the injection of attacker-decided applications. A provisioning profile is a cryptographically signed file that contains information about the developer who created the profile as well as UDIDs of devices that can execute apps signed by this developer. To maintain control of the walled garden model, all provisioning profiles are signed by Apple. Without an appropriate provisioning profile, the installation of arbitrary apps will be rejected by ios on the target device. Creation of a provisioning profile introduces the requirement of a working internet connection for Mactans. Specifically, the UDID must be submitted to developer.apple.com for profile generation. There are at least two ways to fulfill this requirement: 1. Mactans can be equipped with 3G/4G cellular capabilities via a SIM card module. Moreover, there are SIM vendors that provide anonymous cellular activation; Mactans can thus be on-air anonymously. Therefore, Mactans can directly connect to the Apple Provisioning Portal, submit the UDID of a target device, and then obtain a provisioning profile for that device. 2. Mactans can be equipped with Wi-Fi capabilities via various wireless modules. Under this option, connecting to the Internet will be a matter of scanning for unprotected access points, cracking weak access points 2, brute forcing wireless passwords, or tunneling over DNS. With Internet connectivity, Mactans can generate a provisioning profile that is unique to the victim device containing the UDID obtained previously. With a provisioning profile in hand, Mactans can trivially install it onto the target device through communication with com.apple.misagent (via lockdownd). 4.4 INJECT MALICIOUS APP After the provisioning profile has been installed successfully, Mactans will proceed to inject an arbitrary app into the ios device. This step is performed via communication with com.apple.mobile.installation_proxy. In our proof-of-concept, we demonstrate the significance of a Mactans attack by showing how it can be used to inject a Trojan horse Facebook app; please see the presentation slides that accompany this whitepaper for additional details. 2 Aircrack & Reaver 6

7 4.5 PAYLOAD Even though Mactans can inject any app into the target device, another hurdle exists for the payload: app sandboxing. In our proof-of-concept, Mactans does not perform jailbreaking nor does it escape from the sandbox; the injected app has the same privileges as other regular apps (i.e., those of the mobile account). However, a Mactans-injected app completely bypasses Apple s App Store review process. In combination with publicly available information about various private ios APIs 3, attackers can create apps that would otherwise be rejected during the app review process. As examples of private API abuses, we introduce two proof-of-concept capabilities of a potential payload app. First, as a live background process, such an app can take a screenshot of the current foreground screen by making a private API call. Second, an injected app could generate screen touch events and simulate the hardware button presses by exploiting functionality available in private libraries present in DeveloperDisk.dmg after mounting it through communication with com.apple.mobile_image_mounter. 3 https://github.com/nst/ios-runtime-headers 7

8 5. DISCUSSION 5.1 ATTACK SCENARIOS In this section, we discuss possible scenarios in which an attack could be successful GOVERNMENT TARGETED ATTACK In this scenario, an attacker wishing to target a particular individual could provide a suitably packaged Mactans charger to the target. While this vector requires careful construction of a malicious charger that looks indistinguishable from an original Apple accessory, such an approach by a nation state is well within the realm of plausibility. Alternatively, a priori knowledge of the target could be leveraged by a resourceful attacker to selectively modify the environment. Examples include installation of a custom, Mactans-like charger in a specific airplane seat or hotel room (e.g., built into a console or desk) GENERAL ATTACK In a more general scenario, a Mactans charger can be installed in a public waiting area. One example of such a station is pictured in Figure 1. High-traffic areas, such as airports, could result in many hundreds of victims each day. 8

9 5.3 MITIGATIONS Possible mitigations to overcome the weaknesses we describe in Section 3.1 are listed here. In particular, we believe that any mobile OS should by default inform the user before the state of their device is queried or modified by a USB-connected host. More specifically, we think that it is important to require the user s consent in the following cases: 1) Prior to the process of USB device pairing, which enables additional capabilities, including those stated next in 2). 2) Prior to installing a provisioning profile or side-loading an application associated with a provisioning profile (as described in Section 3.1.2). A primary possible mitigation is to require the user s consent (e.g., via introduction of a debugging mode setting on the client) in order for the host to launch applications on the client (or perhaps to launch specific applications such as debugserver). In the case of ios, Apple could also prevent third party developers from setting the SBAppTags with the value hidden in an app s Info.plist so that side-loaded apps cannot be invisible. Furthermore, the process of obtaining provisioning profiles can be made less-automatable by requiring ios developers to solve a CAPTCHA prior to issuing a profile for a device specified by a UDID. 5.4 LIMITATIONS If an ios device is passcode-protected, Mactans requires the phone to be unlocked at least once after being connected. While this requirement may seem to render Mactans impractical, we posit that users will regularly create this situation while charging their device. Given that our proof-of-concept relies on an individual developer license, a Mactans charger equipped with one individual license can accommodate only 100 devices. However, more resourceful adversaries are likely to have access to an enterprise developer license, which waives this limit. Enterprise license possession also lowers the bar for provisioning profile injection, as a UDID need not be submitted to Apple s Provisioning Portal to generate a provisioning profile. Diligent, security-minded users may detect attempts to compromise their ios device if they check installed developer licenses in the Settings section of their device. However, we believe that regular users may not know of the existence or purpose of this information and therefore will not check or understand this setting. Furthermore, even if the provisioning profile is removed, the injected app will continue to run until the device is rebooted. Upon a subsequent connection to a Mactans charger, the attack can be repeated. 10

10 6. CONCLUSION In this paper, we have shown that for ios devices up to and including those running ios 6, arbitrary apps can be injected into a user s mobile device when connected to a malicious host. We demonstrated the potential danger of this capability through a proof-of-concept implementation of a malicious charger that injects a Trojan horse app with a payload. The relevance of our work is represented by Apple s release of an update to ios 7 that implements a mitigation we recommended in our disclosure; Figure 2 shows a screenshot of ios 7 when an unknown host tries to communicate with the phone through a USB connection. Figure 2: Screenshot of ios 7 Beta 2 when the device is plugged into an unknown host that tries to pair with the phone. 11

Overview Mobile applications (and the devices they run on) are powerful, as they can play music, check email, read documents, purchase products, get directions, play games, watch movies, scan barcodes,

> ARMING IT AGAINST SMARTPHONE THREATS Trust Digital Best Practices April 2009 The information contained herein is subject to change at any time, and Trust Digital makes no warranties, either express or

Smartphones and tablets are invading the workplace along with the security risks they bring with them. Every day these devices go unchecked by standard vulnerability management processes, even as malware

Persistence Persistence Mechanisms as Indicators of Compromise An automated technology for identifying cyber attacks designed to survive indefinitely the reboot process on PCs White Paper Date: October

Enterprise Mobility - Mobile Device Security Story Context: TechnoLabs has been focusing and offers Enterprise Mobility as one of its solution offering. No can deny the fact that mobile computing can bring

Mobile Device Management The objective of this document is to provide you with context about mobile device management, for both ipad and Mac, to enable you to have a relevant conversation with your customer

Security Guide BlackBerry Enterprise Service 12 for ios, Android, and Windows Phone Version 12.0 Published: 2015-02-06 SWD-20150206130210406 Contents About this guide... 6 What is BES12?... 7 Key features

1. Executive Summary Penetration Testing Report Client: xxxxxx Date: 19 th April 2014 On the 19th of April, a security assessment was carried out on the internal networks of xxxxxx, with the permission

Closing Wireless Loopholes for PCI Compliance and Security Personal information is under attack by hackers, and credit card information is among the most valuable. While enterprises have had years to develop

Introduction Many of today s endpoints are neither known nor protected. According to Gartner, enterprises are only aware of 80 percent of the devices on their network. Those 20 percent of unknown devices

Two Factor Authentication Two Factor Authentication (TFA; 2FA) is a security process in which two methods of authentication are used to verify who you are. For example, one method currently utilized within

Using TS-ACCESS for Remote Desktop Access Introduction TS-ACCESS is a remote desktop access feature available to CUA faculty and staff who need to access administrative systems or other computing resources

WHITE PAPER: DON T LOSE THE DATA: SIX WAYS YOU MAY BE LOSING........ MOBILE....... DATA......................... Don t Lose the Data: Six Ways You May Be Losing Mobile Data and Don t Even Know It Who should

Security for the Road Warrior Mark K. Mellis Associate Information Security Officer Stanford University Information Security Office Version 1.1 We are all mobile We all travel from home to campus or from

User Manual 350 East Plumeria Drive San Jose, CA 95134 USA August 2012 202-10933-04 v1.0 Support Thank you for choosing NETGEAR. To register your product, get the latest product updates, get support online,

Enabling Seamless & Secure Mobility in BYOD, Corporate-Owned and Hybrid Environments Efficiently and Cost- Effectively Managing Mobility Risks in the Age of IT Consumerization Table of Contents EXECUTIVE

WHITE PAPER CHALLENGES Protecting company systems and data from costly hacker intrusions Finding tools and training to affordably and effectively enhance IT security Building More Secure Companies (and

{ipad Security} plantemoran.com for K-12 Understanding & Mitigating Risk Plante Moran The ipad is in K-12. Since its debut in April 2010, the ipad has quickly become the most popular tablet, outselling

CMPT 471 Networking II Firewalls Janice Regan, 2006-2013 1 Security When is a computer secure When the data and software on the computer are available on demand only to those people who should have access

Securing ios Applications Dr. Bruce Sams, OPTIMAbit GmbH About Me President of OPTIMAbit GmbH Responsible for > 200 Pentests per Year Ca 50 ios Pentests and code reviews in the last two years. Overview

Quick Start Thank you for purchasing the Mobile WiFi. This Mobile WiFi brings you a high speed wireless network connection. This document will help you understand your Mobile WiFi so you can start using

Mobility options and landscapes are evolving quickly for the corporate enterprise. Mobile platform providers such as Apple, Google and Microsoft, and leading device hardware vendors are constantly updating

Why you need McAfee Multi Acess PARTNER SERVICES McAfee Multi Access is an online security app that protects all types of devices. All at once. The simple monthly subscription covers up to five devices

Quick Start Thank you for purchasing the Mobile WiFi. This Mobile WiFi brings you a high speed wireless network connection. This document will help you understand your Mobile WiFi so you can start using

Kaspersky Lab Mobile Device Management Deployment Guide Introduction With the release of Kaspersky Security Center 10.0 a new functionality has been implemented which allows centralized management of mobile

Secure By Default: Platforms Computing platforms contain vulnerabilities that can be exploited for malicious purposes. Often exploitation does not require a high degree of expertise, as tools and advice