 Group 6 Project Presentation. Application Overview  The idea of the Android application is to use the Gale–Shapley algorithm that will match Medical.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Programming Paradigms and languages
Lecture 1: Overview of Computers & Programming
1 Java Programming Basics SE-1011 Dr. Mark L. Hornick.
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
16/13/2015 3:30 AM6/13/2015 3:30 AM6/13/2015 3:30 AMIntroduction to Software Development What is a computer? A computer system contains: Central Processing.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
IPT Readings on Instrumentation, Profiling, and Tracing Seminar presentation by Alessandra Gorla University of Lugano December 7, 2006.
Introduction to a Programming Environment
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Protection of Agent Teamwork By Jeremy Hall. Agent Teamwork Overview ● Mobile agent framework  AgentTeamwork 2 is a mobile-agent based middleware system.
2  Problem Definition  Project Purpose – Building Obfuscator  Obfuscation Quality  Obfuscation Using Opaque Predicates  Future Planning.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Software design and development Marcus Hunt. Application and limits of procedural programming Procedural programming is a powerful language, typically.
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
Your Interactive Guide to the Digital World Discovering Computers 2012.
1 Chapter-01 Introduction to Computers and C++ Programming.
CSCI 5801: Software Engineering
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
Chapter 7 Designing Classes. Class Design When we are developing a piece of software, we want to design the software We don’t want to just sit down and.
A First Program Using C#
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
Introduction For some compiler, the intermediate code is a pseudo code of a virtual machine. Interpreter of the virtual machine is invoked to execute the.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Data and its manifestations. Storage and Retrieval techniques.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 4: Control Structures I (Selection)
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
CS266 Software Reverse Engineering (SRE) Reversing and Patching Java Bytecode Teodoro (Ted) Cipresso,
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Making Good Code AKA: So, You Wrote Some Code. Now What? Ray Haggerty July 23, 2015.
RIVERSIDE RESEARCH INSTITUTE Deobfuscator: An Automated Approach to the Identification and Removal of Code Obfuscation Eric Laspe, Reverse Engineer Jason.
Virtual Machines, Interpretation Techniques, and Just-In-Time Compilers Kostis Sagonas
Implementation of Least Significant Bit Image Steganography and its Steganalaysis By: Deniz Oran Fourth Quarter.
Chapter Three The UNIX Editors.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Cross Language Clone Analysis Team 2 February 3, 2011.
The Hashemite University Computer Engineering Department
Automating programming via concept mining, probabilistic reasoning over semantic knowledge base of SE domain by Max Talanov.
Implementation of Least Significant Bit Image Steganography and its Steganalaysis By: Deniz Oran Third Quarter.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
G2 - Keit Team members: ●Siyang Piao ●Peter Huang ●Bojun Jin ●Ivy Wang ●Jing Wang.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
The purpose of a CPU is to process data Custom written software is created for a user to meet exact purpose Off the shelf software is developed by a software.
Code Optimization.
Assembler, Compiler, MIPS simulator
Application of Obfuscation Techniques on Android Applications
Cash Me Presented By Group 8 Kartik Patel, Aaron Zhong, Wen-Kai Chen,
Harvesting Runtime Values in Android Applications That Feature Anti-Analysis Techniques Presented by Vikraman Mohan.
Presented by Xiaohui (Amy) Lin
UNIT - V STORED PROCEDURE.
UoABuddyApp.
Un</br>able’s MySecretSecrets
Objective of This Course
Chapter 11 Introduction to Programming in C
Chapter 11 Introduction to Programming in C
Optimization 薛智文 (textbook ch# 9) 薛智文 96 Spring.
Zorah Fung University of Washington, Winter 2016
Programming Logic and Design Eighth Edition
Presentation transcript:

 Group 6 Project Presentation

Application Overview  The idea of the Android application is to use the Gale–Shapley algorithm that will match Medical students and Hospitals based on specific criteria.  A user can input a medical student and his/her hospital preferences or hospitals and preferred choice of medicine students as another approach.  This information will be stored in a SQLite database and then the algorithm generate a stable matching between the medical students and hospitals. This solution is optimized for the hospitals.  The application is developed as an Android studio project, which includes a Java library as compile dependency and the algorithm is located in that java library.  The application is composed of a User Interface (UI) and a service that implements the library.

Obfuscation Tool - Overview  The approach of developing our own obfuscation technique and tool would be extremely difficult in the given time frame, so we decided to look for some open-source obfuscation tools and enhance them to suit our Android application.  We discovered a powerful tool; “Ob” that is based on BCEL, injected trailing instructions with “ireturn” after normal unconditional branch instructions like “goto” and “xreturn” to confuse the JD-GUI decompiling tool and break the functionality to decompile a JAR/Class file into a Java file.  We also injected useless bytecode into this branch to make it difficult for the decompilers, without altering the stack height.

Obfuscation Tool - Overview  We took advantage of String Encryption provided by the tool and implemented source code obfuscation in lieu of Unconditional Branch Transformation, Class Renaming and Field Renaming techniques to maintain high level of complexity.  We then used hashlib library to obfuscate all methods and variable names using SHA256 algorithm whilst maintaining the legality of the names in Java.  Additionally we introduced dummy classes and methods into the code to serve as distractions for people trying to reverse engineer our code and refactored the code so that most of our method calls called another class or interface. import hashlib import sys names = sys.argv[1:] for name in names: temp =hashlib.sha256(name.encode("UTF-8")).hexdigest() if list(temp)[0]>='0' and list(temp)[0]<='9': temp+='a‘ temp = temp[::-1] print(name,temp) input()

Lessons learned from byte code manipulation  JVM has nothing to do with DVM, JVM byte code obfuscating techniques most probably do not compatible with Dalvik byte code convention, so the result will be better if we try DVM methods at the beginning.  There is no general and effective byte code obfuscation technique, basically all such methods are exploiting one or multiple flaws in the decompiler, because the class or dex files contain too much information for reverse-engineering (e.g. classes, methods)  To protect your app, a better way is to hide your critical logic on your sever or in native code.

Obfuscation Evaluation  In our implementation of the Gale-Shapley algorithm, obfuscation doesn’t affect the efficiency of our application since the algorithm is stored in a java library and used as a compiled dependency whereas the application part contains only the GUI and a service which implements the library.  There was no noticeable difference in performance overhead (execution time or memory heap) or storage overhead between our application’s normal version vs. its obfuscated one.  There were no memory leaks found in both our versions of the application.  We used Nimbledroid to run some tests.

Obfuscation Evaluation Non-ObfuscatedObfuscated

Obfuscation Evaluation Non-ObfuscatedObfuscated

Obfuscation Comparisons  An advantage is taken from the discrepancy between what is representable as legitimate Java code and its translation into bytecode or Dalvik bytecode. Java programming language does not implement a goto statement, yet when a loop or switch structures are translated into bytecode, this is done with a goto Dalvik instruction.  By working directly on bytecode, it is possible to inject correct sequences composed of goto statements which either cannot be processed by the decompilers or do not translate back to correct Java source code  In our method of obfuscation, we have injected bad code to confuse and/or break popular decompilers.

Our Application Limitations  Our application works on matching the Gale-Shapely algorithm creating a pairing between hospitals and medical students, but there are some restrictions to our application. This release of our application crashes if specific steps are not followed.  Our application includes a method, which encrypts the names of the students and hospitals as well as the preference lists. Use of this method restricts the input to letters of the alphabet, not allowing numbers to be entered in the name or preference list fields. Possible Extensions  Our application can be extended, in future, to include new possibilities and real world situations to provide a better match between medical students and hospitals providing each college a deferred acceptance procedure and eliminate uncertainties.

Reverse Engineering G1 Code Overview  This application uses basic steganography techniques to hide a message in an image  Group 1’s primary obfuscation technique was to obfuscate class names and field variables with a binary number counting system.  Secondary obfuscation technique was to break up their program logic into single calls to static methods in other classes. G1 Code Status  Use of tools such as BytecodeViewer and jd-gui reverse engineering this application to obtain the obfuscated source code was relatively easy.  Used a Python script to assign more human readable names to variables and classes  Then through the use of an IDE like Eclipse it was a trivial but laborious task to follow the static function calls through the various classes and replace them with the original logic.

Reverse Engineering G2 Code Overview  They use an existing tool called DexUnShell to re-inforce the original apk file.  They first wrote the functional code in the normal way, and then compiled the source code to an apk file. Then they wrote the proxy application (works as a shell and the decryption tool) from the template provided together by that tool. The proxy application is then compiled and get the dex file out.  To reassemble the proxy and actual application, DexUnShell is then applied to encrypt the apk, put the actual apk’s encrypted byte behind the proxy dex byte, recalculate the dex file header, checksum and SHA1. The output dex is then put into the apk and replace the dex with in it. G2 Code Status  First way is to dump the android memory when the proxy is regenerating the actual apk.  The second way will be to compile the reverse engineered proxy application, get the dex file, and compare it with the dex we get from the apk. The byte difference will be the encrypted bye of the original apk. And since the proxy application class have the decryption method, we can write a tool to do the decryption, and then do a de-compile on the original apk, which have no obfuscation.

Reverse Engineering G3 Code Overview  Used String Obfuscation and anonymous class as their obfuscation techniques.  They used base64 and a custom algorithm to encrypt the string and stored the encrypted string in a messages.properties file with a key- value map.  Then they used a key within the application and called decrypted method in package a to get plain text G3 Code Status  We created a tool which use the code found in their decryption part with some modification, we are able to decrypt the string used in this application.

Reverse Engineering G4 Code Overview  The obfuscation techniques they used:  AES plus base64 encryption for all strings including SQL query.  Some control flow obfuscation method that messed up the original control flow with try catch and goto.  Class/method renaming to remove the meaning represented by the original name  Inserting some middle classes to increase the difficulty of analysis. G4 Code Status  Control Flow obfuscation method is not a good method since the bytecode can be combined with not very accurate decompiled source code to understand it.  Class/method renaming is not a significant method since the original names have been removed permanently  Inserting some middle classes is also not a good method; it just tries to write down the functionalities of every class/method

Reverse Engineering G5 Code Overview  Group 5’s obfuscation techniques were to use base64 encoding on their strings and to add branch statements which will never exe- cute one of the branches.  They also used some basic name obfuscation. G5 Code Status  The misleading branch statements were not particularly difficult to de-obfuscate since the Boolean values were constant and it wasn’t hard to work out what those constants are.  Through the use of tools such as BytecodeViewer and which is an online decompiler, reverse engineering this application was relatively easy.  we used a tool, Android application x, to decode the base64 encoded strings. Then through the use of an IDE like Eclipse we worked through the program logic removing the misleading branch statements.

Reverse Engineering G7 Code Overview  Group 7’s primary obfuscation technique was name obfuscation  They appear to have used an algorithm such as the SHA1 hashing algorithm to produce garbled names for methods and variables  The secondary obfuscation technique was some minor flow control obfuscation G7 Code Status  Through the use of tools such as BytecodeViewer and jd- gui reverse engineering this app to obtain the obfuscated source code was relatively easy  Then through the use of an IDE like Eclipse renaming and editing the flow controls was quite easy  The compilable code was obtained by using a few different reverse engineering tools and comparing the results of each. The names were assigned by reading through the code and picking names that made general sense.

Reverse Engineering G8 Code Overview  Group 8 used a very limited source-code obfuscation techniques in their application:  Adding thousands of junk classes/methods  Class/method rename: Basically useless since it just adds a few reading difficulties  Adding an infinite loop in an unreachable branch marked with string “opening” to confuse the reader  Mirroring all the classes: Two sets of exact same classes and both of them are invoked G8 Code Status  Removing the useless stuff: There are many many way to remove the thousands of useless classes, methods, for example: python, ruby, even C.  The class/method rename: Can change the long name into shorter ones to facilitate analysis, this can be done by source analyzing tools or even manually.  Bug in the APP - The obfuscated string showed in the application: It seems like that the obfuscation tools mistakenly replaced some strings that will be used in the activities while doing the renaming

 Demo

 Questions?