andriod pentesting and malware analysis

33

Upload: nu-the-open-security-community

Post on 22-Apr-2015

1.803 views

Category:

Education


2 download

DESCRIPTION

null Hyderabad Chapter January 2013 Meet

TRANSCRIPT

Page 1: Andriod Pentesting and Malware Analysis
Page 2: Andriod Pentesting and Malware Analysis

Srinivasa Rao

Independent Security Researcher

Working for TCS

Co-Author of the book “HACKING S3CRETS”

Page 3: Andriod Pentesting and Malware Analysis

What we discuss?

Android OS Basics

Understanding APK

Android Security Model

A Brief look into android malwares

Reversing android malwares

Pentesting on Android platform

Demos

Android Rooting

Android Architechture

Page 4: Andriod Pentesting and Malware Analysis

What is Android?

It is initially developed by Android Inc in 2003 and later acquired by Google in 2005. 2007 – OHA(Open Handset Alliance)

Largest market share

HTC Dream – the first commercially available mobile phone based on android based operating system.

Android is a software stack for mobile devices. The stack consists of An Operating System, Middleware and Key mobile applications

Page 5: Andriod Pentesting and Malware Analysis

Why Android?

Open source

Anyone can develop apps! No restrictions like Iphone

Runs on Linux 2.6.X kernel

Wherever you go it follows you!! (Tablets, mobile phones, TVs)

Uses SQLITE databases

Official market containing over 7,00,000 apps

Page 6: Andriod Pentesting and Malware Analysis
Page 7: Andriod Pentesting and Malware Analysis
Page 8: Andriod Pentesting and Malware Analysis

Understanding the APK

Nothing but a zip file

Can be extracted with winrar or winzip.

Composed of components such as activities, services,

Broadcast Receivers etc.

Every app contains the extension .APK

Written in Java, with native libraries in C/C++

Page 9: Andriod Pentesting and Malware Analysis

Understanding the APK

Page 10: Andriod Pentesting and Malware Analysis

Understanding the APK

Page 11: Andriod Pentesting and Malware Analysis
Page 12: Andriod Pentesting and Malware Analysis

Components

Activity Screen to let users interact – Buttons, text view, image view etc.

Service Performs the work in the back ground – playing music

Broadcast receiver Receives and Responds to broadcast announcements

Intents

Content Providers

Binds individual components at runtime

Stores and retrieves the application data – SQLITE databases

Page 13: Andriod Pentesting and Malware Analysis
Page 14: Andriod Pentesting and Malware Analysis

Permissions – They Suck!!

Declared in AndroidManifest.xml

XML file contains all the components and permissions

App can only use the declared permissions

Page 15: Andriod Pentesting and Malware Analysis

Permissions

ACCESSS_COARSE_LOCATION

ACCESS_FINE_LOCATION

CALL_PHONE

CAMERA

CHANGE_WIFI_STATE

READ_CALL_LOG

READ_CONTACTS READ_SMS

Page 16: Andriod Pentesting and Malware Analysis

Android Security Model

Application 1 UID : 1000 Dalvik VM

Application 2 UID : 1001 Dalvik VM

Application 3 UID : 1002 Dalvik VM

Application 4 UID : 1003 Dalvik VM

Application 5 UID : 1004 Dalvik VM

SYSTEM PROCESS (UID : SYSTEM)

LINUX KERNEL

Page 17: Andriod Pentesting and Malware Analysis
Page 18: Andriod Pentesting and Malware Analysis

Dalvik Virtual Machine

It’s a virtual System to run the android apps

Register based instead of stack based

It runs the dex (Dalvik Executables) files

Created by Dan Bornstein

Page 19: Andriod Pentesting and Malware Analysis
Page 20: Andriod Pentesting and Malware Analysis

Some popular android malwares

Droid dream

Trojan fake player

iCalender

Geniemi

Page 21: Andriod Pentesting and Malware Analysis
Page 22: Andriod Pentesting and Malware Analysis

Making the APK

.java .class .dex .apk

Page 23: Andriod Pentesting and Malware Analysis

Reversing the APK

.apk .dex .class .java

Page 24: Andriod Pentesting and Malware Analysis

Reversing tools…

Tools used

APK TOOL. BAKSMALI

DEX2JAR.

JDGUI.

Page 25: Andriod Pentesting and Malware Analysis
Page 26: Andriod Pentesting and Malware Analysis
Page 27: Andriod Pentesting and Malware Analysis

File System Access

•Android Debug Bridge (adb) command

Access a shell. Pull/push files.

Many more.

Page 28: Andriod Pentesting and Malware Analysis
Page 29: Andriod Pentesting and Malware Analysis
Page 30: Andriod Pentesting and Malware Analysis
Page 31: Andriod Pentesting and Malware Analysis
Page 32: Andriod Pentesting and Malware Analysis