Pentesting Android Apps. Sneha Rajguru (@Sneharajguru)



Similar documents
Bypassing SSL Pinning on Android via Reverse Engineering

AppUse - Android Pentest Platform Unified

The OWASP Foundation

Hacking your Droid ADITYA GUPTA

Beginners Guide to Android Reverse Engineering

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

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

Android Application Repackaging

Android Programming and Security

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

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

Pentesting Android Mobile Application

Penetration Testing Android Applications

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

Mobile Application Security and Penetration Testing Syllabus

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

Lab 4 In class Hands-on Android Debugging Tutorial

OWASP NZ Day 2011 Testing Mobile Applications

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

Advanced ANDROID & ios Hands-on Exploitation

Mercury User Guide v1.1

Mobile Application Security Testing ASSESSMENT & CODE REVIEW

Forensics II. Android reverse engineering Logs [repetition]

Android Geek Night. Application framework

Malware Analysis for Android Operating

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

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

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Running a Program on an AVD

An Introduction to Android

Developing In Eclipse, with ADT

Introduction to Android

Introduction to Android

Introduction to Android. CSG250 Wireless Networks Fall, 2008

ABSTRACT' INTRODUCTION' COMMON'SECURITY'MISTAKES'' Reverse Engineering ios Applications

Reversing Android Malware

Deep Dive: PenTesting the Android and iphone

Introduction to Android Development. Jeff Avery CS349, Mar 2013

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

ANDROID SECURITY ATTACKS AND DEFENSES ABHISHEK DUBEY I ANMOL MISRA. ( r öc) CRC Press VV J Taylor & Francis Group ^ "^ Boca Raton London New York

Penetration Testing for iphone Applications Part 1

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Graduate presentation for CSCI By Janakiram Vantipalli ( Janakiram.vantipalli@colorado.edu )

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

Технологии Java. Android: Введение. Кузнецов Андрей Николаевич. Санкт-Петербургский Государственный Политехнический Университет

Android 多 核 心 嵌 入 式 多 媒 體 系 統 設 計 與 實 作

The power of root on Android emulators

Android Development. Marc Mc Loughlin

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

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

Android Security Evaluation Framework

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

Smartphone market share

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)

Creating and Using Databases for Android Applications

A Practical Guide to creating, compiling and signing an Android Application using Processing for Android.

Mobile Application Security: Who, How and Why

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

OpenCV on Android Platforms

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

CS378 -Mobile Computing. Android Overview and Android Development Environment

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

Security Issues in Android Custom ROMs

Messing with the Android Runtime

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

Android Programming: Installation, Setup, and Getting Started

Tutorial on Basic Android Setup

Fahim Uddin 1. Java SDK

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

The Behavioral Analysis of Android Malware

Mobile Application Security

Running Android Applications on BlackBerry 10 developer.blackberry.com/android

Android Environment SDK

Jordan Jozwiak November 13, 2011

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

Popular Android Exploits

Android Environment SDK

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

Version 7.7 PREEMPTIVE SOLUTIONS DASHO. User Guide

As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.

Introduction to Android

Mobile Application Development 2014

How To Develop Android On Your Computer Or Tablet Or Phone

Programming with Android

AppConnect FAQ for MobileIron Technology Partners! AppConnect Overview

Android malware analysis InfoSec Institute IT Training and Information Security Resources

Performance Analysis of Android Platform

-Android 2.3 is the most used version of Android on the market today with almost 60% of all Android devices running 2.3 Gingerbread -Winner of

WebView addjavascriptinterface Remote Code Execution 23/09/2013

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

Pentesting Mobile Applications

Sandy. The Malicious Exploit Analysis. Static Analysis and Dynamic exploit analysis. Garage4Hackers

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

JAVA 2 Network Security

Mobile Security Framework

Android Basics. Xin Yang

Lecture 1 Introduction to Android

Android Tutorial. Larry Walters OOSE Fall 2011

Transcription:

Pentesting Android Apps Sneha Rajguru (@Sneharajguru)

About Me Penetration Tester Web, Mobile and Infrastructure applications, Secure coding ( part time do secure code analysis), CTF challenge writer (at HackIM- Nullcon & Winja), A wannabe guitarist!...

What are we talking about... Pentesting Environment setup Arsenal App Analysis With #Respect to the Developers!!

Pentesting Environment setup So, you have a choice to select from A. Physical Device B. Android SDK Emulator C. Android x86 (VM).

Pentesting Environment setup If a physical device is used, remember root is needed. Also, check allow from unknown sources You may install Cydia substrate; Also, AndroidSSLTrustKiller by isec Partners Install any proxy app / or setup the connection with Burp proxy, fiddler or any of your choice..

Arsenal dex2jar JD-GUI Smali/Baksmali keytool zipalign SignAPK Introspy jarsigner

Arsenal Android SDK Software Development Kit containing api libraries and developer tools to build, test and debug Android apps. Well what we need the most are : adb,aapt,ddms and the emulator. http://developer.android.com/sdk/

Arsenal adb Command-line tool to communicate with emulator instance or connected physical/virtual device. Most needed commands : adb connect adb devices adb install adb push adb pull adb shell

DDMS Dalvik debug monitor server Debugging tool that provides port-forwarding, screen capture, heap dump, logcat, file manager and many other features. http://developer.android.com/sdk/

Arsenal dex2jar Converts from dex to smali or dex2jar- an approximate representation of the original source code.

Arsenal jd-gui standalone graphical utility that displays Java source codes of.class files.

Smali/Baksmali Assembler/disassembler for the Dex format used by Dalvik.

Arsenal Introspy Tool to analyze app behavior during runtime and help to identify potential security issues. Tool to Generate HTML reports based on the database generated by Introspy-Android. https://github.com/isecpartners/introspy-android

Tool to bypass SSL certificate pinning for most applications * To get this install ; Cydia substrate + AndroidSSLTrustKiller Well this can be done manually as well!!

Certificates and validating the pinnig Proxy server CA certificate Make use of burp, generate a host machine certificate

Arsenal Burp suite Integrated platform for security testing of web applications. The most interesting part is to generate the certificate and intercept and inspect the requests and responses between the app and its backend...inshort uncovering the treasure

Arsenal Security testing framework, great to determine app attack surface and interact with it. https://www.mwrinfosecurity.com/products/drozer/

App Analysis - The apk components Activity: represents a single screen with a user interface. Service: No user interface, runs in background. Content provider: manages a shared set of application data. Eg access google contacts. Broadcast receiver: responds to system-wide broadcast announcements. Many broadcasts originate from the system. Intent filter: messaging object used to request an action from another app component, describes the activity to start and carries any necessary data. AndroidManifest.xml names the Java package for the application (unique identifier) describes the components of the application declares which permissions the application must have in order to access protected parts of the API and interact with other applications. declares the permissions that others are required to have in order to interact with the application's components. the minimum level of the Android API.

Anatomy of android application An extended.jar file..which is converted to a simple zip file and then renamed as.apk (extension) App resource Signatures Manifest (The binary XML) Then comes binary code, dalvik compilation, more binaries... Lets target!! Can be found at /data/app

Stick to the basics... First thing first : Rename the <apk-name>.apk to <apk-name>.zip & then decompress it to any folder. classes.dex This contains the compiled vm codes Lets disassemble it!! Lets get Baksmali to work!

Unzip yahoo.apk classes.dex java -jar baksmali-2.0.6.jar./classes.dex -o humlaout We get a path humlaout/com/yahoo/mobile/client... Open and check all the.smali files

AndroidManifest.xml Provides information about the app to the system. Defines the app permissions Defines the app components

App Analysis - shared prefs XML format file with key-value pairs. App settings.

App Analysis -sqlite database Single file relational database used to store application data and settings.

For the Developers #Respect Thank you so much for making an attackers life so easy!!!

For the developers Insecure Data Storage - Shared Preferences without MODE_WORLD_READABLE. Sensitive information should not be stored. If needed, should be encrypted from derivation of user Password/PIN and not with hardcoded encryption keys. Still vulnerable to offline brute-force. Enforce strong password policy.

InsufficientTransport Layer Protection Apply SSL/TLS transport in channels that the app transmits sensitive information to the backend. Implement Certificate Pinning if very sensitive information is transmitted.

Client Side Injection Only export components(activities,services, Broadcast Receivers,Content Providers) that make sense and that cannot bypass access controls and leak Internal information.

Lack of Binary Protection Obfuscate your code, at minimum with ProGuard.