Application of Obfuscation Techniques on Android Applications

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Utilizing the GDB debugger to analyze programs Background and application.
CS266 Software Reverse Engineering (SRE) Applying Anti-Reversing Techniques to Machine Code Teodoro (Ted) Cipresso,
JavaScript Obfuscation Facts and Fiction Pedro Fortuna, Co-Founder and CTO AuditMark.
CS266 Software Reverse Engineering (SRE) Applying Anti-Reversing Techniques to Java Bytecode Teodoro (Ted) Cipresso,
.NET IL Obfuscation Presented by: Sarath Chandra Dorbala.
Name: Hao Yuan Supervisor: Len Hamey ITEC810 ProjectTransformations for Obfuscating Object-Oriented Programs1.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 4 – Introducing Algorithms, Pseudocode and.
Run-Time Storage Organization
Obfuscation techniques in Java Therese Berge Jonas Ringedal.
OllyDbg Debuger.
Efficient Instruction Set Randomization Using Software Dynamic Translation Michael Crane Wei Hu.
2  Problem Definition  Project Purpose – Building Obfuscator  Obfuscation Quality  Obfuscation Using Opaque Predicates  Future Planning.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Application Security Tom Chothia Computer Security, Lecture 14.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
DEBUGGING CHAPTER Topics  Getting Started with Debugging  Types of Bugs –Compile-Time Bugs –Bugs Attaching Scripts –Runtime Errors  Stepping.
KEVIN COOGAN, GEN LU, SAUMYA DEBRAY DEPARTMENT OF COMUPUTER SCIENCE UNIVERSITY OF ARIZONA 報告者:張逸文 Deobfuscation of Virtualization- Obfuscated Software.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 4 – Wage Calculator Application: Introducing.
Debugging in Java. Common Bugs Compilation or syntactical errors are the first that you will encounter and the easiest to debug They are usually the result.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
CPS4200 Unix Systems Programming Chapter 2. Programs, Processes and Threads A program is a prepared sequence of instructions to accomplish a defined task.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Introduction Selenium IDE is a Firefox extension that allows you to record, edit, and debug tests for HTML Easy record and playback Intelligent field selection.
Formal Refinement of Obfuscated Codes Hamidreza Ebtehaj 1.
Hello world !!! ASCII representation of hello.c.
Operating Systems A Biswas, Dept. of Information Technology.
 Group 6 Project Presentation. Application Overview  The idea of the Android application is to use the Gale–Shapley algorithm that will match Medical.
WHAT THE APP IS THAT? DECEPTION AND COUNTERMEASURES IN THE ANDROID USER INTERFACE.
Polymorphic Virus Analysis Nicolas BRULEZ Senior Virus Researcher Websense Security Labs IMPROVISED TALK MMMKAY?!
Mobile Device Development
More Security and Programming Language Work on SmartPhones
Chapter 2: The Visual Studio .NET Development Environment
Compiler Design (40-414) Main Text Book:
Programming in visual basic .net Visual Basic Building Blocks
Static and dynamic analysis of binaries
Cash Me Presented By Group 8 Kartik Patel, Aaron Zhong, Wen-Kai Chen,
Physical Changes That Don’t Change the Logical Design
Android Studio, Android System Basics and Git
Looking at our “Getting Started” application
Pamela Moore & Zenia Bahorski
Chapter 8: Main Memory Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
UoABuddyApp.
The GoogleMap API By Cody Littley.
A First Book of ANSI C Fourth Edition
TriggerScope Towards Detecting Logic Bombs in Android Applications
Un</br>able’s MySecretSecrets
Eclipse 20-Sep-18.
TriggerScope Towards detecting logic bombs in android applications
TRANSLATORS AND IDEs Key Revision Points.
Behavioral Models for Software Development
CIS 470 Mobile App Development
CS100J 26 April. Matlab Use help button!!! Variables, values, types
Units with – James tedder
Focus of the Course Object-Oriented Software Development
Chapter 8 Advanced SQL.
CIS 470 Mobile App Development
Introduction to Computer Systems
When a function is called...
Module 6: Debugging a Windows CE Image
Min Heap Update E.g. remove smallest item 1. Pop off top (smallest) 3
Chapter 15 Debugging.
Corresponds with Chapter 5
Hello World Program In Visual Studio and Debugging
SPL – PS1 Introduction to C++.
Return-to-libc Attacks
CIS 694/EEC 693 Android Sensor Programming
Chapter 15 Debugging.
Framework Anil
Presentation transcript:

Application of Obfuscation Techniques on Android Applications By Ammar Bagasrawala, Hanzhi Wang, Jordan Wong, Jun Hao Xu, and Kevin Yu

Background Mobile devices are widely used in everyday life Applications for these devices can be distributed through their respective app store. Apps which aren’t properly protected and secured, can be a target of reverse engineering Reverse engineering refers to obtaining the source code Obfuscation is a technique which helps overcome this problem http://www.staticwhich.co.uk/media/images/trusted-trader/desktop-main/scanning-mobile-security-412514.jpg

Our Application The Android application we developed is a Bus Tracker Used the Auckland Transport API Several functions Search for a specific bus stop Favourite a bus stop Search for nearby stops Permissions ACCESS_FINE_LOCATION ACCESS_COARSE_LOCATION

Obfuscation Terms Control Flow Obfuscation Data Obfuscation Changing the control flow of the system so that it performs the required functionality but in an illogical manner. E.g. opaque predicates Data Obfuscation Obscuring the data in the program through techniques such as encryption and variable splitting Layout Obfuscation Modifying layout of the program, making code less intuitive. E.g. renaming variables and classes Design Obfuscation Obscuring the design of the system. E.g. splitting classes

Our Obfuscation Created an automated obfuscator Used Data Obfuscation Used Control Flow Obfuscation Used Layout Obfuscation

Data Obfuscation Masked each literal (String, int, double, long) by XORing with key Key generated from random number generator with seed Examples: string = "hello world"; string = lmao(new int[] { 193, 204, 197, 197, 198, 137, 222, 198, 219, 197, 205 }, z); int k = 5*9; int k = (172 ^ z) * (160 ^ z); double l = 7.56d; double l = (Double.longBitsToDouble(Double.doubleToRawLongBits(2.4133151069369105E- 306) ^ Double.doubleToRawLongBits((double) z)));

Control Flow Obfuscation Method bodies replaced with call to ‘execute’ method, containing a large switch statement Each statement is translated to an ‘instruction’ character Execute method takes a string of instruction characters Instructions are pushed on to a stack, then popped off one by one and given to switch statement to run the corresponding statements For if-else, try-catch, while, and for constructs, elements on the instruction stack are manipulated according to the condition

Evaluation Strength of our obfuscation Performance Overhead Storage Increased complexity of CFG Performance Overhead Method unobfuscated 10000 times: 6.265 ms Method obfuscated 10000 times 614.564 ms 98x slower Storage Unobfuscated 1014Kb Obfuscated 1025Kb 1.08% increase in size

Deobfuscation Tools DeGuard FernFlower Infers variable names Doesn’t decompile all files FernFlower Decompiles all files No deobfuscation performed

Data Deobfuscation Application includes a ‘decode’ method Identify the string or resource to decode, and the decode method, e.g. this.a.a is the decode method Attach debugger to running process Set breakpoint at method entry point When breakpoint is hit, use immediate window to evaluate the result of the decode method call Didn’t need to fully analyse data obfuscation logic

Control Flow Deobfuscation Rebuild project Used breakpoints Static manual analysis Noticed a lot of redundant methods Pseudo rebuilding Copy only the obfuscated parts into an IDE Fix the code to make it compilable and run it to see the order of execution for the statements

Resource Values Made script to invert mapping Mappings are stored in public.xml

Limitations Duplicate variable names Static variables Recursion Switch Exceptions Anonymous Inner Classes XORing is not very effective

Extensions Fix limitations Improve data obfuscation Improve performance https://d3n8a8pro7vhmx.cloudfront.net/votelibraries/pages/256/meta_images/original/iStock_nextsteps896502.jpg.800x600_q96.png?1489933510

Debugging & Updating Application Obfuscated application is quite difficult to step through and debug We propose a new obfuscator which creates a commented version of the app These comments indicate the original line number of each statement Updating the Application Currently the obfuscator needs to be manually run Use of Gradle can streamline the process Allows for the obfuscator to be automatically run

Obfuscation Techniques per Team Group Control Flow Data Layout Design G1   G2 G3 G4 G5 G6 G7 G8 G9 G11 G12 G13

Questions?