Native Execution of Ios Apps on Android

Total Page:16

File Type:pdf, Size:1020Kb

Native Execution of Ios Apps on Android Cider Native Execution of iOS Apps on Android Jeremy Andrus ([email protected]) Alexander Van't Hof, Naser AlDuaij, Christoffer Dall, Nicolas Viennot, Jason Nieh Columbia University In the City of New York March 4, 2014 ASPLOS 2014, Salt Lake City, UT !1 Presentation © 2014, Jeremy C. Andrus Motivation The Goal Presentation © 2014, Jeremy C. Andrus !3 Motivation Virtualization Presentation © 2014, Jeremy C. Andrus !4 Motivation Binary Compatibility Wine API Reimplementation ✤ immense implementation! ✤ 20 years later: still incomplete Presentation © 2014, Jeremy C. Andrus !5 Motivation Overview Binary Compatibility Kernel ABI Compatibility BSD Linux Compatibility ✤ missing kernel subsystem! ✤ opaque driver interfaces Presentation © 2014, Jeremy C. Andrus !6 Motivation Overview Cider : OS Compatibility ✤ Direct execution of unmodified iOS apps" ✤ Reuse existing libraries" ✤ Reuse existing open source kernel code" ✤ iOS apps can use Android libraries Presentation © 2014, Jeremy C. Andrus !7 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Cider : OS Compatibility ✤ Personas" ➡ distinguish iOS and Linux threads" ✤ Duct Tape" ➡ XNU code in the Linux kernel" ✤ Diplomats" ➡ iOS apps use Android libraries Presentation © 2014, Jeremy C. Andrus !8 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Cider : OS Compatibility XNU syscall Linux syscall Interface Interface Cider Linux Kernel Mach-O Loader Presentation © 2014, Jeremy C. Andrus !9 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Per-Thread Personas XNU syscall Linux syscall Interface Interface Cider Linux Kernel Persona Mach-O Management Loader Presentation © 2014, Jeremy C. Andrus !10 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Cider : OS Compatibility XNU Source XNU syscall Linux syscall Interface Interface Mach IPC Cider Linux Kernel Persona Mach-O Management Loader Presentation © 2014, Jeremy C. Andrus !11 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Duct tape XNU Source XNU syscall Linux syscall Interface Interface Mach IPC Cider Linux Kernel Persona Mach-O Duct Tape Management Loader Presentation © 2014, Jeremy C. Andrus !12 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Duct tape XNU Source Foreign Zone Mach IPC Duct Tape Duct Tape Zone Domestic Zone Presentation © 2014, Jeremy C. Andrus !13 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Duct tape lck_mtx_lock() ➡ mutex_lock() lck_mtx_t ➡ struct mutex XNU Source Linux kernel" Mach IPC memory, synch," list management, etc. Synchronization, List Mgmt Duct Tape Mach Semantics kmalloc, Mach IPC syscall stubs spinlock, list… Presentation © 2014, Jeremy C. Andrus !14 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Duct tape XNU Source Cider" Linux" Mach IPC Kernel Synchronization, List Mgmt Mach Semantics kmalloc, spinlock, list… Mach IPC syscall stubs Presentation © 2014, Jeremy C. Andrus !15 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Cider : OS Compatibility iOS OpenGL Apple GPU?! XNU Source XNU syscall Linux syscall Interface Interface Mach IPC Cider Linux Kernel Persona Mach-O Duct Tape Management Loader Presentation © 2014, Jeremy C. Andrus !16 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Cider : OS Compatibility ELF?? Android OpenGL ?? XNU Source XNU syscall Linux syscall Interface Interface Mach IPC Cider Linux Kernel Persona Mach-O Duct Tape Management Loader Presentation © 2014, Jeremy C. Andrus !17 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Cider : OS Compatibility Android ?? OpenGL XNU Source XNU syscall Linux syscall Interface Interface Mach IPC Cider Linux Kernel Persona Mach-O Duct Tape Management Loader Presentation © 2014, Jeremy C. Andrus !18 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Diplomats Android Libraries diplomats XNU Source XNU syscall Linux syscall Interface Interface Mach IPC Cider Linux Kernel Persona Mach-O Duct Tape Management Loader Presentation © 2014, Jeremy C. Andrus !19 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Diplomats iOS App links against diplomats - not iOS symbols! Android diplomats Libraries aFunc() XNU syscall Persona Linux syscall Interface Management Interface Cider Linux Kernel Presentation © 2014, Jeremy C. Andrus !20 Motivation Overview Personas Duct Tape Diplomats Evaluation iOS Android Cider : Architecture iOS Mach" IPC Services launchd configd Android … Libraries diplomats XNU Source XNU syscall Linux syscall Interface Interface Mach IPC Cider Linux Kernel Persona Mach-O Duct Tape Management Loader Presentation © 2014, Jeremy C. Andrus !21 Motivation Overview Personas Duct Tape Diplomats Evaluation Cider: Prototype iOS Apps! ✤ Nexus 7 (Tegra)" ➡ Integrated iOS app launch Android Apps! Presentation © 2014, Jeremy C. Andrus !22 Motivation Overview Personas Duct Tape Diplomats Evaluation Cider: Prototype ✤ Nexus 7 (Tegra)" ➡ Full multi-touch support" ➡ OpenGL for 2D/3D graphics Presentation © 2014, Jeremy C. Andrus !23 Motivation Overview Personas Duct Tape Diplomats Evaluation Cider: Experimental Results ✤ PassMark benchmark application" ✤ Android App" ➡ Stock Nexus 7" ➡ Cider" ✤ iOS App" ➡ Cider" ➡ iPad mini Presentation © 2014, Jeremy C. Andrus !24 Motivation Overview Personas Duct Tape Diplomats Evaluation Cider: Experimental Results PassMark Benchmark 20! Cider Android! Cider iOS! iOS! 15! 10! 5! Performance Normalized Normalized Performance Normalized 0! 4! 3! 2! 1! 0! ! ! ! ! ! ! ! ! ! ! Integer Find Primes Storage Read Floating Point Storage Write Memory WriteMemory Read Data Encryption Data Compression Presentation © 2014, Jeremy C. AndrusRandom String Sort !25 Motivation Overview Personas Duct Tape Diplomats Evaluation Cider: Experimental Results PassMark Benchmark 2.020!! CiderCider AndroidAndroid!! CiderCider iOS iOS! ! iOSiOS! ! 15! 1.510!! 5! 1.00!! 4! 3! 0.5! 2! 1! 0.0! 0! ! ! ! ! ! ! ! ! ! ! !! ! ! ! ! ! Integer Find Primes Solid Vectors Image FiltersStorage Read Floating Point Storage Write Memory WriteMemory Read Data Encryption Simple 3D Test Complex VectorsImageData CompressionRendering Complex 3D Test Presentation © 2014, JeremyTransparent C. AndrusRandom Vectors String Sort 54 Motivation Overview Personas Duct Tape Diplomats Evaluation Cider: Experimental Results PassMark Benchmark 2.0! Cider Android! Cider iOS! iOS! 1.5! 1.0! 0.5! 0.0! ! ! ! ! ! ! ! Solid Vectors Image Filters Simple 3D Test Complex VectorsImage Rendering Complex 3D Test Presentation © 2014, JeremyTransparent C. Andrus Vectors !27 Motivation Overview Personas Duct Tape Diplomats Evaluation Conclusion ✤ Direct execution of unmodified iOS apps" ➡ Per-thread Personas" ➡ Duct Tape" ➡ Diplomats Presentation © 2014, Jeremy C. Andrus !28 Motivation Overview Personas Duct Tape Diplomats Evaluation Thank You Cider http://systems.cs.columbia.edu/projects/cider Logo design by: Steve Lovelace (http://steve-lovelace.com/) Presentation © 2014, Jeremy C. Andrus !29.
Recommended publications
  • App Frameworks #WWDC16
    App Frameworks #WWDC16 Improving Existing Apps Using modern best practices Session 213 Woody L., � to the Knowledge © 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Agenda Reduce Technical Debt Asset Catalogs Dependency Injection Live Playgrounds Cycle of Development You down with ‘Dub-DC? Yeah, you know me. Lots of Requests Your boss More Requests Your customers Technical Debt //TODO: Write and clean up Customer’s Perspective Actuality Duarte requesting hi-res photo AppStore New API zsh AppKit CF AirPortUtility PreferencesApp iCal Foundation AVFoundation AirPortAssistant AirPortSettings AirPortAssistant OpenCL GameKit Dock Mail MapKit MobileMusicPlayer xnu AppKit AppStore MobileSafari zsh QuickTime udf WebKit BlueToothSettings cups Messages Dock ActivityMonitor MobileSafari bash Mail AccessibilitySettings GameKit GameKitServices MediaPlayerUI MediaPlayer MediaStream MobileMail Swift 3 Source code compatibility New and Updated Platforms A Dev’s Run Loop Bug Fixes Technical Debt New and Platforms ♽Updated APIs Customer Roadmap A Dev’s Run Loop Bug Fixes Technical Debt New and Platforms ♽Updated APIs Customer Roadmap A Dev’s Run Loop Bug Fixes Technical Debt New and Platforms ♽Updated APIs Customer Roadmap The Essentials A very good place to start Earlier iOS 8 5% 11% Minimum Deployment of iOS 8 • 95% of Devices iOS 9 84% As measured by the App Store on May 9, 2016 Pick a Deployment Target Latest update of previous release Deprecated API Deprecated API Treat Warnings
    [Show full text]
  • Chapter 1. Origins of Mac OS X
    1 Chapter 1. Origins of Mac OS X "Most ideas come from previous ideas." Alan Curtis Kay The Mac OS X operating system represents a rather successful coming together of paradigms, ideologies, and technologies that have often resisted each other in the past. A good example is the cordial relationship that exists between the command-line and graphical interfaces in Mac OS X. The system is a result of the trials and tribulations of Apple and NeXT, as well as their user and developer communities. Mac OS X exemplifies how a capable system can result from the direct or indirect efforts of corporations, academic and research communities, the Open Source and Free Software movements, and, of course, individuals. Apple has been around since 1976, and many accounts of its history have been told. If the story of Apple as a company is fascinating, so is the technical history of Apple's operating systems. In this chapter,[1] we will trace the history of Mac OS X, discussing several technologies whose confluence eventually led to the modern-day Apple operating system. [1] This book's accompanying web site (www.osxbook.com) provides a more detailed technical history of all of Apple's operating systems. 1 2 2 1 1.1. Apple's Quest for the[2] Operating System [2] Whereas the word "the" is used here to designate prominence and desirability, it is an interesting coincidence that "THE" was the name of a multiprogramming system described by Edsger W. Dijkstra in a 1968 paper. It was March 1988. The Macintosh had been around for four years.
    [Show full text]
  • UCL for Freebsd
    UCL for FreeBSD A universal config language for (almost) everything in FreeBSD Allan Jude -- ScaleEngine Inc. [email protected] twitter: @allanjude Introduction Allan Jude ● 13 Years as FreeBSD Server Admin ● FreeBSD docs committer (focus: ZFS, bhyve, ucl, xo) ● Co-Author of “FreeBSD Mastery: ZFS” ● Architect of the ScaleEngine CDN (HTTP and Video) ● Host of BSDNow.tv & TechSNAP.tv Podcasts ● Extensive work with Puppet to manage our 100+ servers in 35 data centers in 12 countries ● Lots of work with ZFS to manage large collections of videos, extremely large website caches, and the pkg mirror for PCBSD Impetus At EuroBSDCon 2014 in Sofia, Jordan Hubbard ([email protected]) gave the opening keynote Among the recommendations for how FreeBSD could be improved and made easier to manage was to move away from the ‘one config file format per utility’ Jordan, being from Apple, suggested the binary XML plists used by launchd. I really didn’t want the “one true format” to be XML. Why is this a “Good Idea”™? ● Includes allow for more readable, structured, and upgradable config files ● Overlays separate the defaults from your site wide settings, and from your local settings (like defaults/rc.conf rc.conf rc.conf.local) ● Includes allow packages to install default settings (installing apache or nginx adds its log rotation to newsyslog) ● ● What is UCL ● UCL -- universal configuration language ● Inspired by bind/nginx style configuration file that all sysadmins know well ● Fully compatible with JSON, but more liberal in what it accepts, so users do
    [Show full text]
  • *OS Internals::Kernel & Hardware
    12 Ceci n'est pas une "heap"*: Kernel Memory Management Thankfully, kernel KPI users seldom have to deal with the physical layer, and most calls can remain in the virtual layer. We detail how the kernel manages its own vm_map - the kernel_map - through kmem_alloc* and kalloc*. We next present the very important abstractions of kernel zones. Special care is given to the nooks and crannies of the zone allocator, due to their significance over the years in exploitation. Before concluding, we reintroduce memory pressure - also presented in I/8, but described here from the kernel's perspective. The gentle memorystatus of MacOS and the ruthless jetsam of *OS are both detailed. This continues with a discussion of XNU's proprietary purgeable memory, which helps deal with memory pressure automatically. Lastly, we conclude with a rough map of the kernel's address space, and consider the kernel slide. * - Kernel memory is often incorrectly refered to as the the "kernel heap". This term (apparently used within Apple as well) is technically wrong - the heap refers to the data strcuture used in user-mode in backing malloc(3), as opposed to the automatic, thread-local memory of the stack (although the pedantic will correctly argue that user mode "heaps" no longer use the heap structure as well...). Though the kernel does make use of stack memory (for its threads and user-mode threads when in-kernel), the heap data structure is not used in any way in maintaining kernel memory, which is merely segmented into zones, similar to the Linux Slab allocator. Kernel Memory Allocation XNU makes use of multiple memory allocation facilities in the kernel.
    [Show full text]
  • 27Th Large Installation System Administration Conference
    FEBRUARY 2014 vOL. 39, NO. 1 Conference Reports ELECTRONIC SUPPLEMENT 27th Large Installation System Administration maintains the university email systems, DNS, and load balanc- Conference ers, he is also active both on IRC and many mailing lists, such Washington, D.C. as lopsa-discus, bind-users, and several FreeBSD lists. Chen November 3-8, 2013 often provides not only answers to questions, but also frequently includes examples based on his own experience. Summarized by Jonathon Anderson, Ben Cotton, John Dennert, Rik Farrow, Andrew Hoblitz, David Klann, Thomas Knauth, Georgios Larkou, Cory Lueninghoener, Scott Murphy, Tim Nelson, Carolyn Rowland , Keynote Summarized by Thomas Knauth ([email protected]) Josh Simon, and Steve VanDevender Modern Infrastructure: The Convergence of Network, Wednesday, November 6, 2013 Compute, and Data Opening Remarks and Awards Jason Hoffman, Founder, Joyent Summarized by Rik Farrow ([email protected]) Jason started the talk by naming the three main producers of The LISA co-chairs, Narayan Desai, Argonne National Labora- information: nature, humans, and machines. The information tory, and Kent Skaar, VMware, opened the conference by telling produced by nature far outweighs that of either machines (e.g., us that there had been 76 invited talks proposals, of which 33 servers, sensors, cars) or humans (e.g., pictures, photos, emails). were accepted. To fit these in, the co-chairs changed the Invited For example, to sample a single person’s genome will generate 20 Talks format so that most sessions were composed of two talks. I TB of data. was skeptical, as were some others, but the talks actually turned out well, with an excellent set of IT tracks.
    [Show full text]
  • Auditing and Exploiting Apple IPC Ianbeer
    Auditing and Exploiting Apple IPC ianbeer Jailbreak Security Summit May 2015 About me: ● Security Researcher with Project Zero ● Won pwn4fun last year with a JavaScriptCore bug and some kernel bugs ● That macbook air now runs ubuntu :) ● Over the last year reported ~60 OS X sandbox escapes/priv-escs (10 still unpatched) ● Some accidentally also present on iOS This talk: ● Overview of (almost) all IPC mechanisms on iOS/OS X ● Quick look at Mach Message fundamentals ● Deep-dive into XPC services ● Exploiting XPC bugs ● fontd IPC and exploiting fontd bugs ● Mitigations and the future socketpair semaphores AppleEvents IPC Zoo signals domain sockets fifo shmem Pasteboard CFMessage Distributed NSXPC A B Port Notifications D CFPort MIG XPC O Mach Messages XNU Why care about IPC? Sandboxing You probably get initial code execution in some kind of sandbox in userspace… ● renderer/plugin process ● quicklook-satellite ● ntpd Plenty of stuff is still unsandboxed on OS X ● appstore app though (...Adobe Reader...) Sandbox escape models Privilege separation: Two parts of the same application work together to isolate dangerous code Untrusted helper Trusted “broker” IPC Sandboxed Unsandboxed Sandbox escape models Privilege separation: Two parts of the same application work together to isolate dangerous code Chrome PPAPI Plugin Browser IPC Sandboxed Unsandboxed Sandbox escape models Privilege separation: Two parts of the same application work together to isolate dangerous code WebContent WebKit2/Safari IPC Sandboxed Unsandboxed Sandbox escape models Privilege
    [Show full text]
  • Openafs Client for Macos
    OpenAFS client for macOS Marcio Barbosa 2021 OpenAFS Workshop AGENDA • A high-level view of XNU • Kernel Extensions • Securing Modular Architecture • System Extensions • Apple Silicon • Conclusion • References / Contact A HIGH-LEVEL VIEW OF XNU A HIGH-LEVEL VIEW OF XNU • The Mac OS X kernel is called XNU. • Stands for X is Not UNIX. • Microkernel architecture? No, XNU is a hybrid kernel. FreeBSD Mach MONOLITHIC KERNELS • "Classic" kernel architecture. • Predominant in the UNIX and Linux realms. • All kernel functionality in one address space. • If any service fails, the whole system crashes. • Hard to extend. MICROKERNELS • Consists of only the core kernel functionality. • The rest of the functionality exported to external servers. • There exists complete isolation between the individual servers. • Communication between them is carried out by message passing. • Failure is contained. • Monolithic kernel failures usually trigger a complete kernel panic. • Performance can be an issue. HYBRID KERNELS • Hybrid kernels attempt to synthesize the best of both worlds. • The innermost core of the kernel is self-contained. • All other services are outside this core, but in the same memory space. • XNU is a hybrid. • The kernel is modular and allows for pluggable Kernel Extensions. • Absence of isolation exposes the system to bugs introduced by KEXTs. MONOLITHIC, MICROKERNELS, AND HYBRID Golftheman, Public domain, via Wikimedia Commons https://commons.wikimedia.org/wiki/File:OS-structure2.svg KERNEL EXTENSIONS KERNEL EXTENSIONS • No kernel can completely accommodate all the hardware, peripheral devices, and services available. • KEXTs are kernel modules, which may be dynamically inserted or removed on demand. • Augments kernel functionality with entirely self-contained subsystems.
    [Show full text]
  • Platform Being Closed Or Proprietary Is Far Removed from Today's Reality. Nearly Every Technology in Mac OS X Is Based on Well
    48981c01.qxd 12/6/07 8:53 PM Page 12 12 Installation and Initial Setup platform being closed or proprietary is far removed from today’s reality. Nearly every technology in Mac OS X is based on well-known standards. Adoption of common stan- dards saves engineering time and allows for much smoother integration with other plat- forms. Even in the cases where Apple’s developers had to engineer their own technology for a new feature, often Apple will release its details as a new standard. A fine example of this is the Bonjour network discovery protocol, which Apple pioneered and has main- tained as an open standard for others to develop and use. Some examples of common standards supported by Mac OS X are: Ǡ Connectivity standards—Universal Serial Bus (USB), IEEE 1394 (FireWire), Bluetooth wireless, and the IEEE 802 family of Ethernet standards Ǡ File system standards—UNIX File System (UFS), File Allocation Table (FAT32), New Technology File System (NTFS), Zettabyte File System (ZFS), ISO-9660 optical disc standard, Universal Disc Format (UDF) Ǡ Network standards—Dynamic Host Configuration Protocol (DHCP), Domain Name Service (DNS), Hypertext Transfer Protocol (HTTP), Internet Message Access Protocol (IMAP), Simple Mail Transfer Protocol (SMTP), File Transfer Protocol (FTP), Network File System (NFS), and Server Message Block/Common Internet File System (SMB/CIFS) Ǡ Application and development standards—Single UNIX Specification v3 (SUSv3), Portable Operating System Interface 1003.1 (POSIX), C and C++, Java, Ruby, Python, and Pearl Ǡ Document standards—ZIP file archives, Rich Text Format (RTF), Portable Document Format (PDF), Tagged Image File Format (TIFF), Portable Network Graphics (PNG), Advanced Audio Codec (AAC), and the Moving Picture Experts Group (MPEG) fam- ily of media standards Layers of Mac OS X In contrast to the apparent simplicity presented to the user on its surface, Mac OS X is a highly complicated operating system made up of hundreds of different processes and sev- eral hundred thousand files and folders.
    [Show full text]
  • An Overview of Security in the Freebsd Kernel 131 Dr
    AsiaBSDCon 2014 Proceedings March 13-16, 2014 Tokyo, Japan Copyright c 2014 BSD Research. All rights reserved. Unauthorized republication is prohibited. Published in Japan, March 2014 INDEX P1A: Bold, fast optimizing linker for BSD — Luba Tang P1B: Visualizing Unix: Graphing bhyve, ZFS and PF with Graphite 007 Michael Dexter P2A: LLVM in the FreeBSD Toolchain 013 David Chisnall P2B: NPF - progress and perspective 021 Mindaugas Rasiukevicius K1: OpenZFS: a Community of Open Source ZFS Developers 027 Matthew Ahrens K2: Bambi Meets Godzilla: They Elope 033 Eric Allman P3A: Snapshots, Replication, and Boot-Environments—How new ZFS utilities are changing FreeBSD & PC-BSD 045 Kris Moore P3B: Netmap as a core networking technology 055 Luigi Rizzo, Giuseppe Lettieri, and Michio Honda P4A: ZFS for the Masses: Management Tools Provided by the PC-BSD and FreeNAS Projects 065 Dru Lavigne P4B: OpenBGPD turns 10 years - Design, Implementation, Lessons learned 077 Henning Brauer P5A: Introduction to FreeNAS development 083 John Hixson P5B: VXLAN and Cloud-based networking with OpenBSD 091 Reyk Floeter INDEX P6A: Nested Paging in bhyve 097 Neel Natu and Peter Grehan P6B: Developing CPE Routers based on NetBSD: Fifteen Years of SEIL 107 Masanobu SAITOH and Hiroki SUENAGA P7A: Deploying FreeBSD systems with Foreman and mfsBSD 115 Martin Matuška P7B: Implementation and Modification for CPE Routers: Filter Rule Optimization, IPsec Interface and Ethernet Switch 119 Masanobu SAITOH and Hiroki SUENAGA K3: Modifying the FreeBSD kernel Netflix streaming servers — Scott Long K4: An Overview of Security in the FreeBSD Kernel 131 Dr. Marshall Kirk McKusick P8A: Transparent Superpages for FreeBSD on ARM 151 Zbigniew Bodek P8B: Carve your NetBSD 165 Pierre Pronchery and Guillaume Lasmayous P9A: How FreeBSD Boots: a soft-core MIPS perspective 179 Brooks Davis, Robert Norton, Jonathan Woodruff, and Robert N.
    [Show full text]
  • Hacking Mac OS X
    Owning the Fanboys: Hacking Mac OS X Charlie Miller Principal Analyst Independent Security Evaluators [email protected] Who am I? Former National Security Agency (USA) First to hack the iPhone Won MacBook Air at Pwn2Own competition with Safari 0-day Author of “Fuzzing for Software Security Testing and Quality Assurance” Writing “The Mac Hackers Handbook” Due out in January Outline Leopard security Tracing execution Reverse engineering Bug hunting on Macs Exploits Introduction to iPhone Leopard security The good: application sandboxing The bad: Leopard firewall The ugly: library randomization Sandboxing Done via Seatbelt kext Can use default profiles nointernet’, ‘nonet’, ‘nowrite’, ‘write-tmp-only’, and ‘pure-computation’ Or custom written profiles See /usr/share/sandbox for examples Sandboxing demo sandbox-exec -n nonet /bin/bash sandbox-exec –n nowrite /bin/bash More sandboxing Some applications are sandboxed by default: krb5kdc mDNSResponder <--- very good :) mdworker ntpd ... Safari, Mail, QuickTime Player are NOT sandboxed quicklookd.sb (version 1) (allow default) (deny network-outbound) (allow network-outbound (to unix-socket)) (deny network*) (debug deny) Doesn’t allow network connections Imagine malicious file takes over quicklookd - Can’t phone home/ open ports Circumventable: Write a shell script/program to disk Ask launchd (not in sandbox) to execute it via launchctl Leopard firewall Disabled by default Doesn’t block outbound connections No harder to write connect shellcode versus bind shellcode Hard to imagine a scenario
    [Show full text]
  • Copyrighted Material
    Part I Mac OS X Basics COPYRIGHTED MATERIAL 995363c01.indd5363c01.indd 1 11/25/09/25/09 44:39:27:39:27 PPMM 995363c01.indd5363c01.indd 2 11/25/09/25/09 44:39:27:39:27 PPMM CHAPTER 1 Mac OS X Architecture This chapter begins by addressing many of the basics of a Mac OS X system. This includes the general architecture and the tools necessary to deal with the architecture. It then addresses some of the security improvements that come with version 10.5 “Leopard”, the most recent version of Mac OS X. Many of these security topics will be discussed in great detail throughout this book. Basics Before we dive into the tools, techniques, and security of Mac OS X, we need to start by discussing how it is put together. To understand the details of Leopard, you need fi rst to understand how it is built, from the ground up. As depicted in Figure 1-1, Mac OS X is built as a series of layers, including the XNU kernel and the Darwin operating system at the bottom, and the Aqua interface and graphical applications on the top. The important components will be discussed in the following sections. 3 995363c01.indd5363c01.indd 3 11/25/09/25/09 44:39:27:39:27 PPMM 4 Part I ■ Mac OS X Basics Applications Safari, Mail, iCal, etc. GUI Aqua Application Environments BSD, X11, Carbon, Cocoa, AWT, Swing Libraries URL parsing, Networking, Core Audio, HTML rendering, etc. Kernel BSD (signals, sockets, etc.) Mach (virtual memory, IPC, etc.) Firmware EFI Hardware Apple hardware Figure 1-1: Basic architecture of a Mac OS X system XNU The heart of Mac OS X is the XNU kernel.
    [Show full text]
  • Magicpairing: Apple's Take on Securing Bluetooth Peripherals
    MagicPairing: Apple’s Take on Securing Bluetooth Peripherals Dennis Heinze Jiska Classen Felix Rohrbach Secure Mobile Networking Lab Secure Mobile Networking Lab Cryptoplexity TU Darmstadt, Germany TU Darmstadt, Germany TU Darmstadt, Germany [email protected] [email protected] [email protected] ABSTRACT Most problems originated from the initial key negotiation and con- Device pairing in large Internet of Things (IoT) deployments is a nection setup. In Bluetooth, trust is established on first use by challenge for device manufacturers and users. Bluetooth offers a generating a permanent key. This permanent key protects device comparably smooth trust on first use pairing experience. Bluetooth, authenticity, message integrity, and message confidentiality [7, p. though, is well-known for security flaws in the pairing process. 269]. It is established individually between each pair of devices In this paper, we analyze how Apple improves the security of Blue- and only changes when a user manually deletes and reestablishes tooth pairing while still maintaining its usability and specification a pairing. In Classic Bluetooth, the permanent key is called Link compliance. The proprietary protocol that resides on top of Blue- Key (LK), while it is called Long Term Key (LTK) in Bluetooth Low tooth is called MagicPairing. It enables the user to pair a device Energy (BLE)—however, they can be converted into each other [7, once with Apple’s ecosystem and then seamlessly use it with all p. 280]. For the duration of each Bluetooth connection, a session their other Apple devices. key is derived from the permanent key. Thus, if a device is out of We analyze both, the security properties provided by this protocol, reach or switched off, this invalidates a session key.
    [Show full text]