HybriDroid: Analysis Framework for Android Hybrid Applications



Similar documents
BASIC COMPONENTS. There are 3 basic components in every Apache Cordova project:

Lecture 17: Mobile Computing Platforms: Android. Mythili Vutukuru CS 653 Spring 2014 March 24, Monday

SYST35300 Hybrid Mobile Application Development

Multi-Platform Mobile Application Development Analysis. Lisandro Delía Nicolás Galdámez Pablo Thomas Leonardo Corbalán Patricia Pesado

Building native mobile apps for Digital Factory

Lecture 4 Cross-Platform Development. <lecturer, date>

Basic Trends of Modern Software Development

Developing and deploying mobile apps

The Decaffeinated Robot

Best practices building multi-platform apps. John Hasthorpe & Josh Venman

max firt.mobi martes 26 de julio de 11

Bridging the Gap: from a Web App to a Mobile Device App

Cross-Platform Tools

An Analysis of Mobile Application Development Approaches

Making Sense of Mobile Development Options. Luis Sala Director, Technology

BELATRIX SOFTWARE. Why you should be moving to mobile Cross Platform Development? Introduction

How To Develop A Mobile App With Phonegap

Introduction to Oracle Mobile Application Framework Raghu Srinivasan, Director Development Mobile and Cloud Development Tools Oracle

Enabling Cordova (aka PhoneGap) on Tizen. René Pourtier / Luc Yriarte

Enterprise Mobile Application Development: Native or Hybrid?

Mobile development with Apache OFBiz. Ean Schuessler, Brainfood

A Way Out of the Mobile App Development Conundrum

Etanova Enterprise Solutions

Whitepaper. Trans. for Mobile

Tracking Load-time Configuration Options

How to pick the right development model for your next mobile project

Contenu du Cours : IBM Mobile Application

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Cross-Platform Development

WebView addjavascriptinterface Remote Code Execution 23/09/2013

A Guide to Mobile App Development Platforms

Android WebKit Development: A cautionary tale. Joe Bowser Nitobi joe.bowser@nitobi.com

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Using AllJoyn with Apache Cordova, Python & Node

How to Choose Right Mobile Development Platform BROWSER, HYBRID, OR NATIVE

Making Mobile a Reality

The Anatomy of a Native App

Developing multidevice-apps using Apache Cordova and HTML5. Guadalajara Java User Group Guillermo Muñoz Java Developer

How To Use Titanium Studio

HYBRID APPLICATION DEVELOPMENT IN PHONEGAP USING UI TOOLKITS

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Development Techniques for Native/Hybrid Tizen Apps. Presented by Kirill Kruchinkin

Experimental Comparison of Hybrid and Native Applications for Mobile Systems

HP AppPulse Mobile. Adding HP AppPulse Mobile to Your Android App

the cross platform mobile apps dream Click to edit Master title style Click to edit Master text styles Third level Fourth level» Fifth level

Lecture 1 Introduction to Android

Enable Your Automated Web App Testing by WebDriver. Yugang Fan Intel

Retool your HTML/JavaScript to go Mobile

Solution Spotlight BEST PRACTICES FOR DEVELOPING MOBILE CLOUD APPS REVEALED

Porting Existing PhoneGap Apps to Tizen OS - Development Story

Reach 4 million Unity developers

True Web Application Management: Fixing the Gaps in EMM Solutions

Write Once, Publish Everywhere. The smart way to develop mobile sites and apps your customers love

Braindumps.C questions

Java Interview Questions and Answers

Publishing to TIZEN Using the Automated Conversion/Repackaging of Existing Android Apps. Hyeokgon Ryu, Infraware Technology, Ltd.

IBM Watson Ecosystem. Getting Started Guide

DevOps Best Practices for Mobile Apps. Sanjeev Sharma IBM Software Group

Cross-Platform Development: Target More Platforms and Devices with a Minimal Amount of Source Code

Cross-Platform Phone Apps & Sites with jquery Mobile

Cross-platform mobile development with Visual C

Application Security from IBM Karl Snider, Market Segment Manager March 2012

CROSS-PLATFORM MOBILE MALWARE: WRITE ONCE, RUN EVERYWHERE William Lee & Xinran Wu Sophos, Australia

Getting started with Android and App Engine

Praktikum Entwicklung von Mediensystemen (Android)

WEB, HYBRID, NATIVE EXPLAINED CRAIG ISAKSON. June 2013 MOBILE ENGINEERING LEAD / SOFTWARE ENGINEER

Native mobile apps: The wrong choice for business?

MOBILIZE ME! APPS FOR MOBILE DEVICES OR MOBILE WEB APPS TECHNOLOGIES, TOOLS, ASSESSMENTS

Developing multi-platform mobile applications: doing it right. Mihail Ivanchev

Developing Native JavaScript Mobile Apps Using Apache Cordova. Hazem Saleh

ADF Mobile Overview and Frequently Asked Questions

Mobile web apps: The best option for business? A whitepaper from mrc

COSC Introduction to Computer Science I Section A, Summer Question Out of Mark A Total 16. B-1 7 B-2 4 B-3 4 B-4 4 B Total 19

Native vs. HTML5 Mobile App Development

Take Your Team Mobile with Xamarin

DEVELOPING NFC APPS for BLACKBERRY

QML and JavaScript for Native App Development

... Introduction Acknowledgments... 19

SAP Mobile Platform Intro

Development Techniques for Native/Hybrid Tizen Apps. Presenter Matti Pakarinen

Multithreading and Java Native Interface (JNI)!

CHAPTER 5 INTELLIGENT TECHNIQUES TO PREVENT SQL INJECTION ATTACKS

Mobile Development Frameworks Overview. Understand the pros and cons of using different mobile development frameworks for mobile projects.

CROSS-PLATFORM MOBILE MALWARE - WRITE ONCE INFECT EVERYWHERE. William Lee & Xinran Wu {william.lee, xinran.wu}@sophos.com.

Build a Mobile App in 60 Minutes with MAF

Introduction to cross-platform mobile development with Appcelerator Titanium

Dave Haseman, Ross. Hightower. Mobile Development for SAP* ^>. Galileo Press. Bonn. Boston

Development for Mobile Devices Tools from Intel, Platform of Your Choice!

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Messing with the Android Runtime

CS 558 Internet Systems and Technologies

Enterprise Mobile Application Management Platform -A Hybrid Approach

NBC.com ipad app reaches #1 in the App Store and 2 million users within 9 months

YOUR MOBILE DEVELOPMENT ROUTE

AGENDA. Background. The Attack Surface. Case Studies. Binary Protections. Bypasses. Conclusions

Issues of Hybrid Mobile Application Development with PhoneGap: a Case Study of Insurance Mobile Application

Safe Harbor Statement

Take full advantage of IBM s IDEs for end- to- end mobile development

Platform Agnostic Mobile App Development

Transcription:

HybriDroid: Analysis Framework for Android Hybrid Applications Sungho Lee, Julian Dolby, Sukyoung Ryu Programming Language Research Group KAIST June 13, 2015 Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 1/45

Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 2/45

Analyzing JavaScript Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 3/45

Analyzing JavaScript Web Applications Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 4/45

Analyzing JavaScript Web Applications in the Wild Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 5/45

Analyzing JavaScript Web Applications in the Wild (Mostly) Statically Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 6/45

Bittersweet ADB: Attacks and Defenses Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 7/45

Bittersweet ADB: Attacks and Defenses Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 8/45

Bittersweet ADB: Attacks and Defenses Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 9/45

Bittersweet ADB: Attacks and Defenses Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 10/45

Bittersweet ADB: Attacks and Defenses Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 11/45

Hey, You, Get Off of My UI Injection of Malicious Activities and Fragments to Control UI Flows Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 12/45

Motivation Many mobile platforms out there. Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 13/45

Motivation Many mobile platforms out there. Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 14/45

Motivation To support multiple platforms with native applications, need to implement one application per platform; need to repeat application development multiple times. Web applications cannot use device features. Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 15/45

Motivation Hybrid applications could be one solution. Hybrid applications use both HTML5 code (HTML, CSS, and JavaScript) and native device features, such as a camera or accelerometer. Cross-platform tools to build hybrid applications: Apache Cordova, Appcelerator Titanium, Xamarin,... Gartner Says by 2016, More Than 50 Percent of Mobile Apps Deployed Will be Hybrid http://www.gartner.com/newsroom/id/2324917 Build Once, Run Everywhere Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 16/45

Motivation Security risks for hybrid applications One Malware for multiple platforms! Building Hybrid Android Apps with Java and JavaScript http://shop.oreilly.com/product/0636920028994.do Challenges in analyzing hybrid applications They are developed in multiple programming languages with different data types, values, and semantics. Inter-language communications are not explicit but implicit; they are not well documented. Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 17/45

Hybrid Applications in Android Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 18/45

Hybrid Applications in Android Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 19/45

Hybrid Applications in Android Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 20/45

Implicit Inter-Language Communications Android Java JavaScript WebView.loadUrl("javascript:request();") WebView.loadUrl is usually for loading a given URL. When the prefix of a string argument of WebView.loadUrl is javascript:, it acts like the eval function. Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 21/45

Implicit Inter-Language Communications JavaScript Android Java WebViewClient.shouldOverrideUrlLoading WebChromeClient.onJsPrompt WebView.addJavascriptInterface (from hybrid applications developed in the Cordova framework) Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 22/45

Implicit Inter-Language Communications JavaScript Android Java WebViewClient.shouldOverrideUrlLoading Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 23/45

Implicit Inter-Language Communications JavaScript Android Java WebChromeClient.onJsPrompt Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 24/45

Implicit Inter-Language Communications JavaScript Android Java WebView.addJavascriptInterface Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 25/45

addjavascriptinterface http://developer.android.com/reference/android/webkit/webview.html Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 26/45

addjavascriptinterface JavaScript can call the Java object s methods. It can not access the Java object s fields. Only public methods annotated with JavascriptInterface can be accessed from JavaScript. Type conversions and restrictions are not specified, but... Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 27/45

Type Compatibility (by Experiments) JavaScript Android Java: function argument types int float String boolean Object Array Null (null) (null) (null) (null) (null) (null) Undefined ("undefined") Number (type conversion) (false) (null) (null) Boolean (0) (0) (type conversion) (null) (null) String (0) (0) (false) (null) (null) Object (0) (0) ("undefined") (false) (null) (null) Array (0) (0) ("undefined") (false) (null) = if the Array element type is one of primitive types; null if the Array element type is Object; 0 if the Array element type is int or float; false if the Array element type is boolean; or "undefined" if the Array element type is String. Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 28/45

Type Compatibility (by Experiments) Android Java JavaScript: function return types int float String boolean Object Array JavaScript (inexact) ({}) (undefined) Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 29/45

HybriDroid Soundy analysis framework for Android hybrid applications Support for partial but most implicit inter-language flows backed by APIs, blogs, and Dalvik VM source code Support for partial but most type compatibility backed by experiments with trials & errors Implementation on top of WALA https://github.com/sungholee/wala/tree/master/hybridroid/src/kr/ ac/kaist/hybridroid/callgraph Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 30/45

HybriDroid Implementation Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 31/45

HybriDroid Implementation Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 32/45

HybriDroid Implementation AndroidHybridCallGraphBuilder Model addjavascriptinterface by binding the Java object (first argument) with the given name (second argument) at the global scope of JavaScript Model Android Java methods as mockup objects that are accessible from JavaScript Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 33/45

HybriDroid Implementation AndroidHybridAnalysisScope Build a single analysis scope covering both Android Java and JavaScript Replace Java with Android Java in the sample JavaJavaScriptAnalysisScope class AndroidHybridMethodTargetSelector Model invocation of Android Java methods from JavaScript by selecting mockup objects constructed by AndroidHybridCallGraphBuilder as invocation targets Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 34/45

Applications API misuse detection Use of void results from Android Java methods in JavaScript Passing values of incompatible types between Android Java methods and JavaScript Wrong number of arguments to Android Java methods from JavaScript Private data leakage detection Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 35/45

Application: API Misuse Detection (I) Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 36/45

Application: API Misuse Detection (I) Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 37/45

Application: API Misuse Detection (II) Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 38/45

Application: API Misuse Detection (II) Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 39/45

Application: API Misuse Detection (III) Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 40/45

Application: API Misuse Detection (III) Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 41/45

Application: Private Data Leakage Detection Private data sources and sinks via network may be anywhere in Android Java and JavaScript. Track flows of private data via data flow analysis and detect possible private data leakage. Four kinds of private data flows Android Java (source) JavaScript (sink) Android Java (source) JavaScript Android Java (sink) JavaScript (source) Android Java (sink) JavaScript (source) Android Java JavaScript (sink) Taint analysis based on WALA s IFDS implementation Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 42/45

Application: Private Data Leakage Detection Private data sources and sinks via network may be anywhere in Android Java and JavaScript. Track flows of private data via data flow analysis and detect possible private data leakage. Four kinds of private data flows Android Java (source) JavaScript (sink) Android Java (source) JavaScript Android Java (sink) JavaScript (source) Android Java (sink) JavaScript (source) Android Java JavaScript (sink) Taint analysis based on WALA s IFDS implementation Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 42/45

Application: Private Data Leakage Detection Private data sources and sinks via network may be anywhere in Android Java and JavaScript. Track flows of private data via data flow analysis and detect possible private data leakage. Four kinds of private data flows Android Java (source) JavaScript (sink) Android Java (source) JavaScript Android Java (sink) JavaScript (source) Android Java (sink) JavaScript (source) Android Java JavaScript (sink) Taint analysis based on WALA s IFDS implementation Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 42/45

Application: Private Data Leakage Detection Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 43/45

Application: Private Data Leakage Detection Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 44/45

Limitations & Future Work Cordova libraries More implicit inter-language communications (?) Android components Concurrency Events Experiments with real-world hybrid applications Sungho Lee, Julian Dolby, Sukyoung Ryu HybriDroid: Analysis Framework for Android Hybrid Applications 45/45