1 William Enck, Damien Octeau, Patrick McDaniel, Swarat Chaudhuri System and Internet Infrastructure Security Laboratory Department of Computer Science.

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

Introduction.  Professor  Adam Porter 
DroidScope: Seamlessly Reconstructing the OS and Dalvik Semantic Views for Dynamic Android Malware Analysis Lok Kwong Yan, and Heng Yin Syracuse University.
2014 Network and Distributed System Security Symposium AppSealer: Automatic Generation of Vulnerability-Specific Patches for Preventing Component Hijecking.
William Enck, Peter Gilbert, Byung-Gon Chun, Landon P
Machigar Ongtang, Stephen McLaughlin, William Enck, Patrick McDaniel Department of Computer Science and Engineering The Pennsylvania State University ACSCA.
Java security (in a nutshell)
Android Security. N-Degree of Separation Applications can be thought as composed by Main Functionality Several Non-functional Concerns Security is a non-functional.
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
Android Security Enforcement and Refinement. Android Applications --- Example Example of location-sensitive social networking application for mobile phones.
William Enck, Machigar Ongtang, and Patrick McDaniel.
Android Middleware Bo Pang
Android Security Architecture
Understanding Android Security Yinshu Wu William Enck, Machigar Ongtang, and PatrickMcDaniel Pennsylvania State University.
Android Introduction Platform Overview.
A METHODOLOGY FOR EMPIRICAL ANALYSIS OF PERMISSION-BASED SECURITY MODELS AND ITS APPLICATION TO ANDROID.
By Mihir Joshi Nikhil Dixit Limaye Pallavi Bhide Payal Godse.
박 종 혁 컴퓨터 보안 및 운영체제 연구실 MobiSys '11 Proceedings of the 9th international conference on Mobile systems, applications,
Lei Wu, Michael Grace, Yajin Zhou, Chiachih Wu, Xuxian Jiang Department of Computer Science North Carolina State University CCS 2013.
Introduction to Android Swapnil Pathak Advanced Malware Analysis Training Series.
TaintDroid: An Information-Flow Tracking System for Realtime Privacy Monitoring on Smartphones Presented By: Steven Zittrower William Enck ( Penn St) (Duke)
D2Taint: Differentiated and Dynamic Information Flow Tracking on Smartphones for Numerous Data Sources Boxuan Gu, Xinfeng Li, Gang Li, Adam C. Champion,
Harvesting Developer Credentials in Android Apps
Authors: William Enck The Pennsylvania State University Peter Gilbert Duke University Byung-Gon Chun Intel Labs Landon P. Cox Duke University Jaeyeon Jung.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Presented by: Kushal Mehta University of Central Florida Michael Spreitzenbarth, Felix Freiling Friedrich-Alexander- University Erlangen, Germany michael.spreitzenbart,
Arpit Jain Mtech1. Outline Introduction Dalvik VM Java VM Examples Comparisons Experimental Evaluation.
1 The Java Virtual Machine Yearly Programming Project.
Implement High-level Program Language on JVM CSCE 531 ZHONGHAO LIU ZHONGHAO LIU XIAO LIN.
Presented by: Tom Staley. Introduction Rising security concerns in the smartphone app community Use of private data: Passwords Financial records GPS locations.
Analyzing and Detecting Network Security Vulnerability Weekly report 1Fan-Cheng Wu.
Erika Chin Adrienne Porter Felt Kate Greenwood David Wagner University of California Berkeley MobiSys 2011.
ITEC 352 Lecture 20 JVM Intro. Functions + Assembly Review Questions? Project due today Activation record –How is it used?
A Presentation Of TaintDroid & Related Topics
University of Central Florida TaintDroid: An Information-Flow Tracking System for Realtime Privacy Monitoring on Smartphones Written by Enck, Gilbert,
Roopa.T PESIT, Bangalore. Source and Credits Dalvik VM, Dan Bornstein Google IO 2008 The Dalvik virtual machine Architecture by David Ehringer.
Effective Real-time Android Application Auditing
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
1 Java applications reverse engineering Antoni Bertel AUGUST 4, 2015.
Mobile Application Security on Android Originally presented by Jesse Burns at Black Hat
Android. Basic Architecture Linux Kernel Libraries Applications Android Runtime Application Framework.
Android System Security Xinming Ou. Android System Basics An open-source operating system for mobile devices (AOSP, led by Google) – Consists of a base.
A S TUDY OF A NDROID A PPLICATION S ECURITY William Enck, Damien Octeau, Patrick McDaniel, Swarat Chaudhuri System and Internet Infrastructure Security.
1 Android Introduction Platform Overview. 2 What is Android?  Android is a software stack for mobile devices that includes an operating system, middleware.
Android Permissions Demystified
Dynamic Taint Analysis for Automatic Detection, Analysis, and Signature Generation of Exploits on Commodity Software Paper by: James Newsome and Dawn Song.
Analyzing Input Validation vulnerabilities in Android System Services NAMJUN PARK (NPAR350)
Java & The Android Stack: A Security Analysis Pragati Ogal Rai Mobile Technology Evangelist PayPal, eBay Java.
RealTimeSystems Lab Jong-Koo, Lim
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Authors: William Enck & Patrick McDaniel In collaboration with: Duke University and Intel Labs Presentation: Ed Novak 1.
Android Mobile Application Development
More Security and Programming Language Work on SmartPhones
Free for All! Assessing User Data Exposure to Advertising Libraries on Android Campbell Foskin.
Understanding Android Security
Android System Security
CASE STUDY 1: Linux and Android
TaintART: A Practical Multi-level Information-Flow Tracking System for Android RunTime Sadiq Basha.
Introduction Enosis Learning.
Topic: Java Security Models
CMPE419 Mobile Application Development
TriggerScope Towards detecting logic bombs in android applications
Mobile Handset Virtual Machine
Introduction Enosis Learning.
Application Development A Tutorial Driven Course
Mobile App Advertisements
Understanding Android Security
CMPE419 Mobile Application Development
Presentation transcript:

1 William Enck, Damien Octeau, Patrick McDaniel, Swarat Chaudhuri System and Internet Infrastructure Security Laboratory Department of Computer Science and Engineering The Pennsylvania State University USENIX Security Symposium 2011

Outlines  Introduction  Background  The ded decompiler  Evaluating Android Security  Application Analysis Results  Study Limitations  What This All Means  Conclusions 2

Introduction  Markets are not in a position to provide security in more than a superficial way  To broadly characterize the security of applications in the Android Market  Contributions  ded: A Dalvik decompiler. DVM-to-JVM bytecode retargeting.  Analyze 21 million LOC from the top 1100 free applicatons 3

Introduction  Wide misuse of privacy sensitive information  “Cookie-esque” tracking  Found no evidence of telephony misuse  Ad and analytic network libraries => 51% applications  AdMob => 29.09%  Google Ads => 18.72%  Many applications include more than one ad library  Failed to securely use Android APIs 4

Background  Android 5

Background  Dalvik Virtual Machine  JVM =>.class  DVM =>.dex  Dalvik dx compiler 6 Constant Pool: -References to other classes -Method names -Numerical constants Class Definition: -Access flags -Class names Data: -Method code -Info related to methods -Variables

Background  Register architecture  DVM: register-based  2^16 available registers  JVM: stack-based  200 opcodes 7

Background  Instruction set  DVM  218 opcodes  Longer instructions  Fewer instructions  30% fewer instructions, but 35% larger code size (bytes)  JVM  200 opcodes 8

Background 9

 Constant pool structure  DVM  Single pool  dx eliminates some constants by inlining their values directly into the bytecode  JVM  Multiple 10

Background  Ambiguous primitive types  DVM  int/float, long/double use the same opcodes  JVM  Different  Null references  DVM  Not specify a null type  Use zero value 11

Background  Comparison of object references  DVM  Comparison between two integers  Comparison of integer and zero  JVM  if_acmpeq / if_acmpne  ifnull / ifnonnull 12

Background  Storage of primitive types in arrays  DVM  Ambiguous opcodes  aget for int/float, aget-wide for long/double 13

The ded decompiler  To decompile the Java source rather than to operate on the DEX opcodes  Leverage existing tools for code analysis  Require access to source code to identify false- positives resulting from automated code analysis 14

The ded decompiler 15

The ded decompiler  Application Retargeting  Type Inference  Constant and variable declaration only specifies 32 or 64 bits  Comparison operators do not distinguish between integer and object reference comparison  Inference must be path-sensitive 16

The ded decompiler  Application Retargeting (cont.)  To infer a register’s type  Compare with a known type  add-int like instruction only operate on specific types  Use as return value or parameters of methods (via method signature)  Branch  Push onto an inference stack  DFS 17

The ded decompiler  Constant Pool Conversion .dex file vs..class file  Single constant pool vs. multiple constant pool  Dalvik bytecode places primitive type constant directly in bytecode 18

The ded decompiler  Method Code Retargeting  Address multidimensional arrays  Bytecode translation  ded maps each referenced register to a Java local variable table index  Instruction traslation  One Dalvik instruction -> multiple Java instructions  ded defines exception tables that describe try/catch/finally blocks 19

The ded decompiler  Example: 20

The ded decompiler  Optimization and Decompilation  Soot Soot  While the Java bytecode generated by ded is legal, the source code failure rate is almost entirely due to Soot’s inability 21

The ded decompiler  Source Code Recovery Validation  decompilation time: hours  99.97% of total time -> Soot 22

The ded decompiler  Retargeting Failures  0.59% of classes  Unresolved reference  Type violations by Android dex compiler  ded produces illegal bytecode (rare)  Decompilation Failures  5% of classes  Soot  Decompile traditonal Java program  94.59% 23

The ded decompiler  Future work  Fernflower Fernflower  98.04% recovery rate 24

Evaluating Android Security  Analysis Specification  Use Fortify SCA static analysis suite  Control flow analysis  A control flow rule is an automaton 25

Evaluating Android Security  Analysis Specification (cont.)  Data flow analysis  IMEI, IMSI, ICC-ID  Data flows between the sources and sinks are violations  Structural analysis  Semantic analysis  Ex: app does not send SMS to hard-coded targets 26

Evaluating Android Security  Overview  Misuse of Phone Identifiers  Exposure of Physical Location  Abuse of Telephony Services  Eavesdropping on Audio/Video  Botnet Characteristics (Sockets)  Harvesting Installed Applications  Use of Advertisement Libraries  Dangerous Developer Libraries  Android-specific Vulnerabilities  General Java Application Vulnerabilities 27

Application Analysis Results  Information Misuse  Phone Identifiers % 19.6%

Application Analysis Results  Finding 1 - Phone identifiers are frequently leaked through plaintext requests  Finding 2 - Phone identifiers are used as device fingerprints  Finding 3 - Phone identifiers, specifically the IMEI, are used to track individual users  Finding 4 - The IMEI is tied to personally identifiable information (PII)  Finding 5 - Not all phone identifier use leads to exfiltration  Finding 6 - Phone identifiers are sent to advertisement and analytics servers 29

Application Analysis Results  Information Misuse (cont.)  Location Information  getLastKnownLocation()  LocationListener => requestLocationUpdates() % 27.6%

Application Analysis Results  Finding 7 - The granularity of location reporting may not always be obvious to the user  Finding 8 - Location information is sent to advertisement servers 31

Application Analysis Results  Phone Misuse  Telephony Services  A constant used for SMS destination number  Creation of URI objects with “tel:” prefix and the string “900”  URI objects with “tel:” prefix  Finding 9 - Applications do not appear to be using fixed phone number services  Finding 10 - Applications do not appear to be misusing voice services 32

Application Analysis Results  Phone Misuse (cont.)  Background Audio/Video  Recording video without calling setPreviewDisplay()  AudioRecord.read() is not reachable from an Android activity component  MediaRecorder.start() is not reachable from an activity component 33

Application Analysis Results  Finding 11 - Applications do not appear to be misusing video recording  Finding 12 - Applications do not appear to be misusing audio recording 34

Application Analysis Results  Phone Misuse (cont.)  Socket API Use  Finding 13 - A small number of applications include code that uses the Socket class directly  Finding 14 - We found no evidence of malicious behavior by applications using Socket directly 35

Application Analysis Results  Phone Misuse (cont.)  Installed Applications  A set of get APIs returning the list of installed app  A set of query APIs that mirrors Android’s runtime intent resolution  Finding 15 - Applications do not appear to be harvesting information about which applications are installed on the phone 36

Application Analysis Results  Included Libraries  Advertisement and Analytics Libraries 37 29% 51% 18.7%

Application Analysis Results  Finding 16 - Ad and analytics library use of phone identifiers and location is sometimes configurable  Finding 17 - Analytics library reporting frequency is often configurable  Finding 18 - Ad and analytics libraries probe for permissions 38

Application Analysis Results  Included Libraries (cont.)  Developer Tookits  Finding 19 - Some developer toolkits replicate dangerous functionality  jackeey.wallapaper sends identifiers to imnet.us  Finding 20 - Some developer toolkits probe for permissions  checkPermission()  Finding 21 - Well-known brands sometimes commission developers that include dangerous functionality 39

Application Analysis Results  Android-specific Vulnerabilities  Leaking Information to Logs  READ_LOGS  Finding 22 - Private information is written to Android’s general logging interface 40

Application Analysis Results  Android-specific Vulnerabilities (cont.)  Leaking Information via IPC  Finding 23 - Applications broadcast private information in IPC accessible to all applications 41

Application Analysis Results  Android-specific Vulnerabilities (cont.)  Unprotected Broadcast Receivers  Finding 24 - Few applications are vulnerable to forging attacks to dynamic broadcast receivers  Intent Injection Attacks  Finding 25 - Some applications define intent addresses based on IPC input 42

Application Analysis Results  Android-specific Vulnerabilities (cont.)  Delegating Control  Pending intent  Cannot change values  But can fill in missing fields  Finding 26 - Few applications unsafely delegate actions  UI notification service  Alarm service  UI widget  main application 43

Application Analysis Results  Android-specific Vulnerabilities (cont.)  Null Checks on IPC Input  Finding 27 - Applications frequently do not perform null checks on IPC input  53.7% (591 applications) 44

Application Analysis Results  Android-specific Vulnerabilities (cont.)  Sdcard Use  22.8% (251 applications)  JNI Use  6.3% (69 applications) 45

Study Limitations  Application popularity  Data and control flows for IPC between components  Source code recovery failures  ProGuard  Obfuscate  Protect against readability 46

What This All Means  Application certification  Misuse of privacy sensitive information  Cookie-esque tracking  Ad and analytic libraries  Free applications!  LOG / unprotected IPC 47

Conclusion  ded decompiler  Dangerous functionality  Future work  Application installation  Malicious JNI  phishing 48