Reversing Android Malware



Similar documents
The OWASP Foundation

Hacking your Droid ADITYA GUPTA

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

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

Pentesting Android Apps. Sneha Rajguru

Example of Standard API

Mobile Application Security: Who, How and Why

Bypassing SSL Pinning on Android via Reverse Engineering

Trend Micro Incorporated Research Paper Adding Android and Mac OS X Malware to the APT Toolbox

Beginners Guide to Android Reverse Engineering

Introduction to Android

How Attackers are Targeting Your Mobile Devices. Wade Williamson

Tutorial on Smartphone Security

Android Application Repackaging

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

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

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

An Introduction to Android

Advanced ANDROID & ios Hands-on Exploitation

Android Programming and Security

The Behavioral Analysis of Android Malware

AppUse - Android Pentest Platform Unified

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

Storm Worm & Botnet Analysis

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

Forensics II. Android reverse engineering Logs [repetition]

Android malware analysis InfoSec Institute IT Training and Information Security Resources

ANDROID BASED MOBILE APPLICATION DEVELOPMENT and its SECURITY

Android Malware Past, Present, and Future

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

Network and Incident monitoring

Malware Analysis for Android Operating

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

WebView addjavascriptinterface Remote Code Execution 23/09/2013

Defending Behind The Device Mobile Application Risks

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

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

Mobile Application Security Testing ASSESSMENT & CODE REVIEW

Security A to Z the most important terms

UNMASKCONTENT: THE CASE STUDY

Kaspersky Fraud Prevention: a Comprehensive Protection Solution for Online and Mobile Banking

Integrated Approach to Network Security. Lee Klarich Senior Vice President, Product Management March 2013

Smartphone Pentest Framework v0.1. User Guide

Lecture 17: Mobile Computing Platforms: Android. Mythili Vutukuru CS 653 Spring 2014 March 24, Monday

Android Geek Night. Application framework

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

Programming the Android Platform. Logistics

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

Android Basics. Xin Yang

Android Security Joshua Hodosh and Tim Leek

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Penetration Testing Android Applications

Parasitics: The Next Generation. Vitaly Zaytsev Abhishek Karnik Joshua Phillips

FORENSIC ANALYSIS Aleš Padrta

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

This is DEEPerent: Tracking App behaviors with (Nothing changed) phone for Evasive android malware

Performance Analysis of Android Platform

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

WHITE PAPER. Understanding How File Size Affects Malware Detection

Hong Kong Information Security Outlook 2015 香 港 資 訊 保 安 展 望

Android Security - Common attack vectors

All Your Code Belongs To Us Dismantling Android Secrets With CodeInspect. Steven Arzt Secure Software Engineering Group Steven Arzt 1

Introduction to Android

Overview of CS 282 & Android

How To Develop Android On Your Computer Or Tablet Or Phone

Studying Security Weaknesses of Android System

Analysis of advanced issues in mobile security in android operating system

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

From Georgia, with Love Win32/Georbot. Is someone trying to spy on Georgians?

Agenda. Taxonomy of Botnet Threats. Background. Summary. Background. Taxonomy. Trend Micro Inc. Presented by Tushar Ranka

Running a Program on an AVD

The Top Web Application Attacks: Are you vulnerable?

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

Legal notices. Legal notices. For legal notices, see

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

Android Architecture. Alexandra Harrison & Jake Saxton

Android Development. Marc Mc Loughlin

Frameworks & Android. Programmeertechnieken, Tim Cocx

Introduction to the Mobile Access Gateway

FIREEYE THREAT INTELLIGENCE HAMMERTOSS: Stealthy Tactics Define a Russian Cyber Threat Group JULY 2015 SECURITY REIMAGINED

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

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

Getting Ahead of Malware

White Paper. Anywhere, Any Device File Access with IT in Control. Enterprise File Serving 2.0

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

Pentesting Mobile Applications

HoneyBOT User Guide A Windows based honeypot solution

Securing your Mobile Applications. Karson Chan Security Consultant

Creating and Using Databases for Android Applications

Transcription:

Reversing Android Malware The Honeynet Project 10 th Annual Workshop ESIEA PARIS.FR 2011-03-21 MAHMUD AB RAHMAN (MyCERT, CyberSecurity Malaysia) Copyright 2011 CyberSecurity Malaysia

MYSELF Mahmud Ab Rahman MyCERT, CyberSecurity Malaysia Lebahnet(honeynet), Botnet, Malware Copyright 2011 CyberSecurity Malaysia 2

Agenda Intro Malware and Android Reversing Android Malware Android Malware Cases study: o SMS.Trojan o Geinimi o DreamDroid Challenge and Issues Outro/Conclusion Copyright 2011 CyberSecurity Malaysia 3

INTRO Android malware Cases Study Conclusion Intro Reversing Android Issues Copyright 2011 CyberSecurity Malaysia

INTRO : Android 101 Copyright 2011 CyberSecurity Malaysia 5

INTRO : Android 101 Android architecture: o Run on top of Linux kernel o Use proprietary VM (Dalvik VM) as oppose to Java VM o Mutiple layers for different purpose - Application layer - Driver layer - Kernel layer Copyright 2011 CyberSecurity Malaysia 6

INTRO : Android 101 Android architecture Copyright 2011 CyberSecurity Malaysia 7

INTRO : APK 101 Android package format o Bundle a few files into a file (.apk) o Just a zip file o Classes.dex is core file compiled java classes. Copyright 2011 CyberSecurity Malaysia 8

INTRO : Dalvik VM 101 Run userspace Android applications Designed by Dan Bornstein Register based: o Faster than stack based register Run dalvik bytecode instead of Java bytecode Use DX tool to convert Java *.class to Dalvik bytecode http://android.git.kernel.org/?p=platform/dalvik.git;a=tree. Copyright 2011 CyberSecurity Malaysia 9

INTRO : Dalvik VM 101 Dalvik VM vs Java VM (Mark schoenefeld,2009) Copyright 2011 CyberSecurity Malaysia 10

INTRO : Dalvik VM 101 Java *.classes to.dex file Copyright 2011 CyberSecurity Malaysia 11

INTRO : DEX 101 Executable format for Android platform DEX process flow DX Copyright 2011 CyberSecurity Malaysia 12

INTRO : DEX 101 DEX file format *.odex o Optimized DEX Copyright 2011 CyberSecurity Malaysia 13

INTRO :Android Apps Building Process Copyright 2011 CyberSecurity Malaysia 14

ANDROID MALWARE Android malware Cases Study Conclusion Intro Reversing Android Issues Copyright 2011 CyberSecurity Malaysia

Android Malware Copyright 2011 CyberSecurity Malaysia 16

Android Malware Malicious piece of codes. Infection methods: o Infecting legitimate apps - Mod app with malicious codes (Geinimi, DreamDroid,ADDR) - Upload to Market or 3 rd party hosting o Exploiting Android s (core/apps) bugs o Fake apps - DreamDroid s removal tool Copyright 2011 CyberSecurity Malaysia 17

Android Malware Infection methods (cont): o Remote install?. - Victim s gmail credential is required - Browse Market and pass gmail info - Market will install app into victim s phone REMOTELY http://www.net-security.org/article.php?id=1556 Copyright 2011 CyberSecurity Malaysia 18

REVERSING ANDROID MALWARE Android malware Cases Study Conclusion Intro Reversing Android Issues Copyright 2011 CyberSecurity Malaysia

Reversing Android Malware ANDROID REVERSING Copyright 2011 CyberSecurity Malaysia 20

Reversing Android Malware Source Of Files o APK file - Can extract.dex file - Reversing and interactive debugging is possible ADB o DEX file - Only reversing is possible - Files for res + asset + etc are missing. Copyright 2011 CyberSecurity Malaysia 21

Reversing Android Malware Building Process Copyright 2011 CyberSecurity Malaysia 22

Reversing Android Malware Reversing Process *.java *.class (java) *.dex class Decompiler: Jad/Dava Disassembler: Baksmali/Dedexer/undx Copyright 2011 CyberSecurity Malaysia 23

Reversing Android Malware Tools o Disassembler- to dump Dalvik VM bytecode to assembly-like syntax - Dedexer - Baksmali - Undx - Dexdump dumping *.dex file (from Android SDK) o Assembler- to convert to original Dalvik VM bytecode - Smali Copyright 2011 CyberSecurity Malaysia 24

Reversing Android Malware Tools (cont) o Text Editor viewing the code - Use a decent one with baksmali/dedexer output highlighter UltraEdit Emacs - Notepad is fine. :-) o dex2jar - If you prefer Java than assembly-like output - Easy way to avoid complexity of Dalvik VM bytecode - May have errors interpreting Dalvik VM bytecode Copyright 2011 CyberSecurity Malaysia 25

Reversing Android Malware Check on AndroidManifest.XML o Permission request o Entry point RE is solving a puzzle o Start with names/strings - NET - CRYPTO - SERVER - IO o Check on suspicious Android API - Location API, SMS API, Phone API, Mail API, Network API Copyright 2011 CyberSecurity Malaysia 26

Reversing Android Malware Tracing function calls: o Browsing the codes and trace function call chains ( XREF ) Copyright 2011 CyberSecurity Malaysia 27

CASE STUDY Android malware Cases Study Conclusion Intro Reversing Android Issues Copyright 2011 CyberSecurity Malaysia

CASE STUDY ANDROID MALWARE HAPPY FAMILY Copyright 2011 CyberSecurity Malaysia 29

CASE #1: SMS.Trojan Oldest android malware (public) Very simple (follow HelloWorld Android SDK) Social engineering. It s by nature is malicious app Perform toll SMS fraud to Russia (premium shortcode) o Toll charges to enduser o Send to shartcode number 3353 and 3354 A good reason for AV on mobile ; ) Copyright 2011 CyberSecurity Malaysia 30

CASE #2: Geinimi Nice way to celebrate new year o Discovered close to new year eve! Modus Operandi o Infecting legitimate software - MonkeyJump2, Sex Positions, etc.etc Features: o Encryption- DES o C&C Servers o Info stealer o Bot capability o Encrypted communication Copyright 2011 CyberSecurity Malaysia 31

CASE #2: Geinimi (cont) Encryption- DES o Encrypted C&C and Data o DES with 01020304050608 key KEY DATA Copyright 2011 CyberSecurity Malaysia 32

CASE #2: Geinimi (cont) Encryption- DES o Encrypted C&C and Data o DES with 01234568 key Copyright 2011 CyberSecurity Malaysia 33

CASE #2: Geinimi (cont) Reversing DES encryption Copyright 2011 CyberSecurity Malaysia 34

CASE #2: Geinimi (cont) Encryption- DES (result)) DECRYPTED DATA Copyright 2011 CyberSecurity Malaysia 35

CASE #2: Geinimi (cont) Info stealer o Steal info and pass to C&C Server o Encrypted data o Steal data: - IMEI,IMSI - GEOLocation (lat,long) - SMS - Contacts list - Installed apps list Copyright 2011 CyberSecurity Malaysia 36

CASE #2: Geinimi (cont) Bot capability o Received commands from C&C server - dsms Delete SMS(es) - Smsrecord steal sms record and pass to C&C - showurl Open browser with URL - Call make a call to number - Install install apps o State for bot - Start, download,parse, transact,idle Copyright 2011 CyberSecurity Malaysia 37

CASE #2: Geinimi (cont) Encrypted communication o Every data receive/sent are encrypted o Embeded into params parameter for sending encrypted data Copyright 2011 CyberSecurity Malaysia 38

CASE #2: Geinimi (cont) Backdoor o TCP socket on ports 5432, 4501 or 6543 o Another back door on port 8791 - Send a "hi,xiaolu response message to listener - Send a hi,liqian response message to request - Run at loopback interface. ; ) Copyright 2011 CyberSecurity Malaysia 39

CASE #3: ADDR Tagged Image File Format (abbreviated TIFF) file format for storing images it is under the control of Ad(0day)be Systems (2009) widely supported by image-manipulation application Copyright 2011 CyberSecurity Malaysia 40

CASE #3: DreamDroid Latest addition to android malware family Modus Operandi o Infecting legitimate software o Hosted at Market o 53 software infected Bundled with exploits to root the Android o Exploid (CVE-2009-1185) o Rageagaintsthecage (CVE-2010-EASY) Bot capability Copyright 2011 CyberSecurity Malaysia 41

CASE #3: DreamDroid (cont) Features: o Encrypted communication (XOR) o Encrypted data o Bot capability o Two stage payloads - 1 st Payload - Infected app Rooted device Install 2 nd payload (DownloadProviderManager) - 2 nd Payload - DownloadProviderManager Sqllite.db (original filename) Receive instructions from C&C Send info to C&C Silently install itself (copy to /system/app directory) Copyright 2011 CyberSecurity Malaysia 42

CASE #3: DreamDroid (cont) Encryption o XOR operation - KEY= 6^)(9-p35a%3#4S!4S0)$Yt%^&5(j.g^&o(*0)$Yv!#O@6GpG@=+3j.&6^)(0- =1.getBytes() - DATA= 9442938832952138511219112519102302419997621102222611139125244801090511910 011960487794252 o Revealed C&C server - http://184.105.245.17:8080/gmserver/gmservlet Send IMEI,IMSI, Device Model, SDK Version to C&C server Copyright 2011 CyberSecurity Malaysia 43

CASE #3: DreamDroid (cont) Encryption XOR Operation Copyright 2011 CyberSecurity Malaysia 44

CHALLENGES AND ISSUES Android malware Cases Study Conclusion Intro Reversing Android Issues Copyright 2011 CyberSecurity Malaysia

Challenges and Issues Typical Reverse engineering challenges o Code obfuscation - Obfuscation on data o Encryption - Make it harder - Eventually will be broken (as for current sample) o Code optimizing - Code for device, painful for RE Tools is not yet mature o IDA PRO like RE suite o XREF Copyright 2011 CyberSecurity Malaysia 46

Challenges and Issues Spotting the malicious apps o Not RE problem but how do you spot the malicious app?. Remote Install via Market would be interesting to observe Copyright 2011 CyberSecurity Malaysia 47

CONCLUSION Android malware Cases Study Conclusion Intro Reversing Android Issues Copyright 2011 CyberSecurity Malaysia

Conclusion Android malware is interesting topic o More complex android malware are expected o More exploits on Android platform are expected o More powerful hardware will change the landscape! It is possible to reverse engineering Android malware o A lot of free tools to reverse engineering android apps/malware o Solving a puzzle. PERIOD Reversing tools are there, but yet to mature Copyright 2011 CyberSecurity Malaysia 49

Q&A Copyright 2011 CyberSecurity Malaysia

THANKS Email: mahmud@cybersecurity.my Web: http://www.cybersecurity.my Web: http://www.mycert.org.my Web: www.cybersafe.my Report Incident: mycert@mycert.org.my Copyright 2011 CyberSecurity Malaysia