The OWASP Foundation http://www.owasp.org



Similar documents
Hacking your Droid ADITYA GUPTA

Pentesting Android Apps. Sneha Rajguru

Beginners Guide to Android Reverse Engineering

Android (in)security. Having fun with Android. Sarantis Makoudis

Reversing Android Malware

Mobile Application Hacking for Android and iphone. 4-Day Hands-On Course. Syllabus

AppUse - Android Pentest Platform Unified

Android malware analysis InfoSec Institute IT Training and Information Security Resources

Forensics II. Android reverse engineering Logs [repetition]

Advanced ANDROID & ios Hands-on Exploitation

Android Application Repackaging

Malware Analysis for Android Operating

Mobile Malware and Spyware: Working Through the Bugs. Detective Cindy Murphy

Tushar Dalvi Sr. Security Engineer at LinkedIn Penetration Tester. Responsible for securing a large suite mobile apps

Android Packer. facing the challenges, building solutions. Rowland YU. Senior Threat Researcher Virus Bulletin 2014

Bypassing SSL Pinning on Android via Reverse Engineering

Blackbox Android. Breaking Enterprise Class Applications and Secure Containers. Marc Blanchou Mathew Solnik 10/13/

OWASP NZ Day 2011 Testing Mobile Applications

Mobile security, forensics & malware analysis with Santoku Linux. * Copyright 2013 viaforensics, LLC. Proprietary Information.

Android Security Evaluation Framework

APPLICATION SECURITY: FROM WEB TO MOBILE. DIFFERENT VECTORS AND NEW ATTACK

Introduction to Android Android Architecture Software Development Purpose of the project Location Based Service (LBS) Android. Location class Google

Overview. The Android operating system is like a cake consisting of various layers.

MASTER'S THESIS. Android Application Security with OWASP Mobile Top James King 2014

Mobile Application Security: Who, How and Why

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

Pentesting Android Mobile Application

Android Malware Past, Present, and Future

CompTIA Mobile App Security+ Certification Exam (Android Edition) Live exam ADR-001 Beta Exam AD1-001

WebView addjavascriptinterface Remote Code Execution 23/09/2013

Penetration Testing Android Applications

Introduction to Android

Android Programming and Security

Mercury User Guide v1.1

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

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

BLACK HAT ASIA Singapore, March 2014

Efficient Code Obfuscation for Android

Jordan Jozwiak November 13, 2011

Introduction to Android

Risk-Rating Framework for Mobile Applications (Sponsored by DISA CTO)

The Behavioral Analysis of Android Malware

Getting started with Android and App Engine

Lab 4 In class Hands-on Android Debugging Tutorial

Smartphone market share

SYLLABUS MOBILE APPLICATION SECURITY AND PENETRATION TESTING. MASPT at a glance: v1.0 (28/01/2014) 10 highly practical modules

ANDROID BASED MOBILE APPLICATION DEVELOPMENT and its SECURITY

Frameworks & Android. Programmeertechnieken, Tim Cocx

OpenCV on Android Platforms

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

Mobile Application Hacking for ios. 3-Day Hands-On Course. Syllabus

Allow Installation from Unknown Sources

An Android Application Sandbox System for Suspicious Software Detection

ProfileDroid: Multi-layer Profiling of Android Applications. Xuetao Wei Lorenzo Gomez Iulian Neamtiu Michalis Faloutsos

Deep Inside Android. OpenExpo Zurich September 25 th, Gilles Printemps - Senior Architect. Copyright 2007 Esmertec AG.

Reverse Engineering Of Malware On Android

Mobile Application Security and Penetration Testing Syllabus

Smartphone Security for Android Applications

Running a Program on an AVD

Android Basics. Xin Yang

Developing In Eclipse, with ADT

Tutorial on Basic Android Setup

A Study of Android Application Security

CYBERCRIMINAL IN BRAZIL SHARES MOBILE CREDIT CARD STORE APP

Messing with the Android Runtime

An Introduction to Android. Huang Xuguang Database Lab. Inha University

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

Android Development. Marc Mc Loughlin

Mobile Application Development 2014

Basic Android Setup Windows Version

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

Android Geek Night. Application framework

Centrify Mobile Authentication Services

How To Analyze The Malicious Behavior Of An Android Applications

Two-factor Authentication in Smartphones: Implementations and Attacks

An Introduction to Android

App Development for Smart Devices. Lec #2: Android Tools, Building Applications, and Activities

With a single download, the ADT Bundle includes everything you need to begin developing apps:

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Mobile Security Framework

Enterprise Application Security Workshop Series

How To Customize An Orgsync App On Anorus Mobile Security Suite On A Microsoft Ipad Oracle 2.5 (Ios) On A Pc Orca 2.2 (Iphone) On An Android Orca2 (Ip

Covering the global threat landscape

Table of Contents 7 8

Android & ios Application Vulnerability Assessment & Penetration Testing Training. 2-Day hands on workshop on VAPT of Android & ios Applications

Android Environment SDK

Android ( ) Frank Ducrest

Transcription:

Android reverse engineering: understanding third-party applications OWASP EU Tour 2013 June 5, 2013. Bucharest (Romania) Vicente Aguilera Díaz OWASP Spain Chapter Leader Co-founder of Internet Security Auditors vicente.aguilera@owasp.org Twitter: @vaguileradiaz www.vicenteaguileradiaz.com Copyright The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP Foundation http://www.owasp.org

Who I am? VICENTE AGUILERA DÍAZ Co-founder of Internet Security Auditors OWASP Spain Chapter Leader More info: www.vicenteaguileradiaz.com OWASP 2

Agenda Reverse engineering: definition and objectives Application analysis workflow Malware identification in Android apps OWASP 3

Reverse engineering: definition and objectives Definition Refers to the process of analyzing a system to identify its components and their interrelationships, and create representations of the system in another form or a higher level of abstraction. [1] Objetives The purpose of reverse engineering is not to make changes or to replicate the system under analysis, but to understand how it was built. OWASP 4

Application analysis workflow Original APK Analyze Decompress and Dissassemble Rebuild APK Scope of this presentation Modify Modified APK OWASP 5

Application analysis workflow App Name SaveAPK Astro File Manager Real APK Leecher apktool APK radare2 unzip AndroidManifest.xml apktool.yml /assets /res /smali.smali baksmali /lib /META-INF /res resources.arsc AXMLPrinter2.jar AndroidManifest.xml Human-readable XML classes.dex dex2jar radare2 Disasm Debug Analyze Manipulate Static Analysis.class jd-gui.java Static Analysis Understand Dexter grep OWASP 6

Application analysis workflow Static Analysis Tools for Android Apps TOOL DESCRIPTION URL Dexter Static android application analysis tool https://dexter.bluebox.com/ Androguard Analysis tool (.dex,.apk,.xml,.arsc) https://code.google.com/p/androguard/ smali/baksmali Assembler/disassembler (dex format) https://code.google.com/p/smali/ apktool Decode/rebuild resources https://code.google.com/p/android-apktool/ JD-GUI Java decompiler http://java.decompiler.free.fr/?q=jdgui Dedexer Disassembler tool for DEX files http://dedexer.sourceforge.net/ AXMLPrinter2.jar Prints XML document from binary XML http://code.google.com/p/android4me/ dex2jar Analysis tool (.dex and.class files) https://code.google.com/p/dex2jar/ apkinspector Analysis functions https://code.google.com/p/apkinspector/ Understand Source code analysis and metrics http://www.scitools.com/ Agnitio Security code review http://sourceforge.net/projects/agnitiotool/ OWASP 7

Application analysis workflow Others (necessary) tools TOOL DESCRIPTION URL Android SDK Tools to build, test, and debug apps http://developer.android.com/sdk/index.html --- emulator Virtual mobile device developer.android.com/tools/help/emulator.html --- adb Android debug bridge developer.android.com/tools/help/adb.html A.R.E. Android Reverse Engineering VM https://redmine.honeynet.org/projects/are/wiki OWASP 8

Malware definition Malware is a piece of code which changes the behavior of either the operating system kernel or some security sensitive applications, without a user consent and in such a way that it is then impossible to detect those changes using a documented features of the operating system or the application.[2] A malware is any malicious code or piece of software that is designed to perform functions without the consent of the user. OWASP 9

Techniques for introducing malware Exploit any vulnerability in the web server hosting the official store Use the official store to post apps containing malware Install not malicious app that, at some point, install malicious code Use alternatives[3] to official stores to post apps containing malware OWASP 10

A practical example Some considerations The analyzed app are in the Play Store The published application does not exploit (supposedly) any vulnerability, but can contains malicious code that exploits the user's trust[4] We will only use static analysis We will analyze Java source code We will use the Android Emulator[5] OWASP 11

What do we need? and motivation! OWASP 12

Let's see an example OWASP 13

Identify a possible malicious application App with unnecessary permissions A wallpaper that requires SEND SMS MESSAGES A calculator that requires DIRECTLY CALL PHONE NUMBERS Google: +"send sms messages" + wallpaper +site: play.google.com OWASP 14

Identify a possible malicious application Example: Pipe Mania Droid Lite https://play.google.com/store/apps/details?id=bridge.pipe.lite OWASP 15

Obtaining the APK file Using the SaveAPK tool (requires IO File Manager) OWASP 16

Decompress the APK file unzip Pipe\ Mania\ Droid\ Lite.apk Verify the permissions and receivers java jar AXMLPrinter2.jar AndroidManifest.xml > out OWASP 17

Convert from Dalvik EXecutable to Java classes d2j-dex2jar.sh pipe.apk Decompile Java classes and download source code jd-gui pipe-dex2jar.jar OWASP 18

Decompress the source code unzip pipe-dex2jar-src.zip Search sensitive strings grep i telephonymanager r * Analyze the code With tools Manually Identifies malicious code OWASP 19

Understand tool OWASP 20

Dexter online service OWASP 21

virustotal.com online service OWASP 22

References [1] Reverse Engineering and Design Recovery: A Taxonomy. Elliot J. Chikofsky, James H. Cross. [2] Introducing Stealth Malware Taxanomy. J. Rutkowska. [3] Alternative markets to the Play Store. http://alternativeto.net/software/android-market/ [4] Security features provided by Android. http://developer.android.com/guide/topics/security/permiss ions.html [5] Using the Android Emulator. http://developer.android.com/tools/devices/emulator.html OWASP 23

References [6] Android malware database http://code.google.com/p/androguard/wiki/databaseandroi dmalwares OWASP 24

Thank s! Vicente Aguilera Díaz @vaguileradiaz www.vicenteaguileradiaz.com OWASP 25