CopperDroid Logan Horton. Android - Background Android is complicated to analyse due to having 2 places to check for code execution Normally, code is.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Configuration management
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
DroidScope: Seamlessly Reconstructing the OS and Dalvik Semantic Views for Dynamic Android Malware Analysis Lok Kwong Yan, and Heng Yin Syracuse University.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Lab#1 (14/3/1431h) Introduction To java programming cs425
API Design CPSC 315 – Programming Studio Fall 2008 Follows Kernighan and Pike, The Practice of Programming and Joshua Bloch’s Library-Centric Software.
G Robert Grimm New York University Lightweight RPC.
Ritu Varma Roshanak Roshandel Manu Prasanna
1 Java Grande Introduction  Grande Application: a GA is any application, scientific or industrial, that requires a large number of computing resources(CPUs,
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
.NET Mobile Application Development Remote Procedure Call.
Chapter 2: Algorithm Discovery and Design
Configuration Management
C++ fundamentals.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Chapter 1 - Introduction. Ch 1Goals To understand the activity of programming To learn about the architecture of computers To learn about machine code.
Introducing Java.
Object Oriented Software Development
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Abstract Data Types (ADTs) and data structures: terminology and definitions A type is a collection of values. For example, the boolean type consists of.
Presented by: Kushal Mehta University of Central Florida Michael Spreitzenbarth, Felix Freiling Friedrich-Alexander- University Erlangen, Germany michael.spreitzenbart,
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
University of Central Florida TaintDroid: An Information-Flow Tracking System for Realtime Privacy Monitoring on Smartphones Written by Enck, Gilbert,
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
Programming Logic and Design Using Methods. 2 Objectives Review how to use a simple method with local variables and constants Create a method that requires.
Programs and Classes A program is made up from classes Classes may be grouped into packages A class has two parts static parts exist independently Non-static.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
M. Accetta, R. Baron, W. Bolosky, D. Golub, R. Rashid, A. Tevanian, and M. Young MACH: A New Kernel Foundation for UNIX Development Presenter: Wei-Lwun.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Classes, Interfaces and Packages
VMM Based Rootkit Detection on Android
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Java State Explorer by: Richard Sherman Stephanie Taylor.
Nguyen Thi Thanh Nha HMCL by Roelof Kemp, Nicholas Palmer, Thilo Kielmann, and Henri Bal MOBICASE 2010, LNICST 2012 Cuckoo: A Computation Offloading Framework.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Analyzing Input Validation vulnerabilities in Android System Services NAMJUN PARK (NPAR350)
Software, IEE Proceedings, Vol.152, Num.3, June 2005,Page(s): Prasanthi.S March, Java-based component framework for dynamic reconfiguration.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Operating Systems {week 11a}
Instructor: Mazhar Hussain
Lecture 7: Android Services
Java Primer 1: Types, Classes and Operators
Unified Modeling Language
Defending Binder Attack Surfaces in Android
Understanding and Defending Binder Attack Surface in Android
Programming Models for Distributed Application
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Android Topics Asynchronous Callsbacks
Programs and Classes A program is made up from classes
Prof. Leonardo Mostarda University of Camerino
(Computer fundamental Lab)
Java SE 7 One and Multi Dimensional Arrays Module 6
Last Class: Communication in Distributed Systems
A type is a collection of values
Presentation transcript:

CopperDroid Logan Horton

Android - Background Android is complicated to analyse due to having 2 places to check for code execution Normally, code is written in Java and executed through the Dalvik virtual machine but some native code execution is possible through the Java Native Interface (JNI) Android utilises inter-process communications (IPC) and remote procedure calls (RPC) which are high-level Android specific semantics - this makes it difficult to reconstruct through system call analysis

Android Issues - the CopperDroid solution All interesting Android application behaviour is characterized by system calls and their parameters Sending a message through the system is done through the Binder using the ioctl system call invoked on the Binder driver, /dev/binder These ioctl calls contain a buffer of marshalled data (the parameters for the call) and the code of the call (numeric representation of the method that is called)

Binder

CopperDroid - What is it? A testing platform to check for malware using an emulator built on QEMU Performs Virtual Machine based dynamic analysis to reconstruct malware behaviour Consists of 2 parts; the emulator component and the analysis component The emulator runs the Android system and the analysis component analyses the emulators gathered data

CopperDroid specifics CopperDroid is not a tool run on something, it is an emulator system that you run and test applications on It is built on the QEMU emulator (an open source processor emulator) which is modified to allow for system calls to be tracked. This is achieved through Virtual Machine Introspection (VMI) Utilises a regular “vanilla” Android emulator for the unmarshalling Oracle The analyses are completed on the machine running the emulator, outside the CopperDroid emulator

CopperDroid The CopperDroid emulator runs the Android system, with unmarshalling of the Binder data done through the Oracle Binder data is the ioctl information from before; the parameters given to the Binder and the numeric representation of the call made to the Binder

CopperDroid - Unmarshalling Oracle The Oracle is the unique part of CopperDroid The unmarshalling part is the deconstruction of the parameters and numeric instruction code into a readable string This string is then reviewable to see what behaviour is being performed There are 3 possible data types that the Oracle can receive: - Primitive (e.g. String) - Class Object - IBinder Object

Oracle - Primitive Primitive data is simple to break down The primitive types are broken down using the corresponding read function provided by the Parcel class. Parcel’s are containers for messages passed through the Binder, both flattened data to be unflattened later or references to live Binder objects For Strings, this would be the readString() method

Oracle - Class Objects To unmarshall class instances, Oracle uses Java reflection. This allows dynamic retrieval of field CREATOR, implementing the Parcelable interface Objects must have a CREATOR field to be able to be written/read from a Parcel Once this is setup, the Oracle begins reading from the class using the createFromParcel() method to unmarshall and read its data Once the type has been unmarshalled, the Oracle creates the string representation using the toString() method which is appended to an output string list and moves onto the next item to be unmarshalled

Oracle - IBinder Objects Some Binder objects are not marshalled, instead a reference is sent When this occurs, if its not primitive, the Oracle verifies if it contains a binder reference object. Here, you parse the first four bytes of the marshalled object looking for reference types Normally, Binder references keep objects from being freed, stopping the extraction of the data from the system. To circumvent this, the CopperDroid emulator keeps references to items created in shared memory and allows retrieval of them as needed for the Oracle

Recap Android is complicated to analyse so CopperDroid uses the ioctl calls to reconstruct the behaviour through the Oracle and analyses that externally to the CopperDroid emulators (sometimes manually) CopperDroid uses 2 emulators; an emulator to run the Android system and an emulator to run the Oracle which breaks down the Binder data to readable information The analyses are done outside the CopperDroid system, run on the machine the emulators are run on

CopperDroid - Success and aims CopperDroid was run on 2900 samples in 3 different sets to test its reliability/success rate in detecting malware CopperDroid detected additional behaviours at a minimum of 60% for the samples with the highest being 73% for one of the sets CopperDroid is not a complete package. The creators make this known through their report in multiple places mentioning this project shows “that a simple, external, stimulation contributes to the discovery of additional behaviors “

Comments and criticism ❖It does analyse malware and does it in a controlled environment which is very preferable. The downside is it is still on an emulator which some types of malware are able to detect this causing issues ❖There is an overhead of 25% compared to regular android running meaning a lot of processing power used to test one application ❖One major upside is that it is not affected by Android version changes. The emulators run will still detect the ioctl calls regardless of Android version (until the baseline behaviour is changed from this) which means it will work on any version. It has been tested on Froyo, Gingerbread, Jelly Bean, KitKat, and Lollipop without issues

Comments and criticism ❖Some unmarshalling must be done manually. Unfortunately, some Bound services such as the ActivityManager do not use AIDL (Android Interface Definition Language) and as such cannot be unmarshalled automatically. This means a person is required to watch over the running of each application on CopperDroid as it could get stuck waiting on manual intervention ❖No static analysis. CopperDroid only uses dynamic analysis, analysis done during runtime of the application to see what it does. This can mean code not always run will get by that would be detected by static analysis so adding another tool to CopperDroid that checks the code would be preferable

Final Remarks The team behind CopperDroid did not set out to create the ultimate malware detection tool, they were mainly wanting to create a tool that did “system-call analysis” to detect malware behaviour This was wanted through an automatic VMI-based dynamic analysis system which would reconstruct the behaviours of Android applications which was achieved to a point All in all, it is good as a tool to try detect behaviour, would be helpful for Android testing such as the Bouncer setup but it does need manual intervention in its current state, does need some static analysis added to it for ease-of-mind and other tools to be run alongside it for effectiveness