SlideShare une entreprise Scribd logo
1  sur  47
Memory Analysis of the Dalvik (Android) Virtual Machine Andrew Case Digital Forensics Solutions
Who Am I? Security Analyst at Digital Forensics Solutions Also perform wide ranging forensics investigations Volatility Developer Former Blackhat and DFRWS speaker 2
Agenda What is Dalvik / why do we care? Brief overview of memory forensics Extracting allocated and historical data from Dalvikinstances Target specific Android applications 3
What is Dalvik? Dalvik is the software VM for all Android applications Nearly identical to the Java Virtual Machine (JVM) [1] Open source, written in C / Java 4
Why do we care? Android-based phones leading in US mobile market Which makes for many phones to investigate Memory forensics capabilities against Android applications have numerous uses/implications Entire forensics community (LEO,  .gov, private firms) already urging development of such capabilities 5
Memory Forensics Introduction Memory forensics is vital to orderly recovery of runtime information Unstructured methods (strings, grep, etc) are brittle and only recover superficial info Structured methods allow for recovery of data structures, variables, and code from memory Previous work at operating system level led to recovery of processes, open files, network connections, etc [4,5] 6
Memory Analysis Process First, need to acquire memory  Acquisition depends on environment [6] Next, requires locating information in memory and interpreting it correctly Also requires re-implementing functionality offline Then it needs to be displayed in a useful way to the investigator 7
Dalvik Memory Analysis 8
Acquiring Memory – Approach 1 The normal method is to acquire a complete capture of physical RAM Works well when analyzing kernel data structures as their pages are not swapped out Allows for recovery of allocated and historical processes, open files, network connections, and so on 9
Approach 1 on Android Without /dev/mem support, need a LKM to read memory No current module works for Android (ARM) We developed our own (mostly by @jtsylve) Benefits of full capture: Can target any process (including its mappings) Can recover information from unmapped pages in processes 10
Acquiring Memory – Approach 2 Memory can be acquired on a per-process basis Ensures that all pages of the process will be acquired Easiest to perform with memfetch[8] After a few small changes, was statically compiled for ARM No unmapped pages will be recovered though Heap and GC don’t munmap immediately 11
Analyzing C vs Java Most previous forensics research has had the “luxury” of analyzing C Nearly 1:1 mapping of code/data to in-memory layout Declaration of a C “string” char buffer[] = “Hello World”; Memory Layout (xxd) 4865 6c6c 6f20 576f 726c 6400  Hello World. 12
A Dalvik String in Memory First, need the address of the “StringObject” Next, need the offsets of the “java/lang/String” value and byte offset members StringObject + value offset leads us to an “ArrayObject” ArrayObject + byte offset leads to an UTF-16 array of characters … finally we have the string (in Unicode) 13
Now for the memory analysis… The real goal of the research was to be able to locate arbitrary class instances and fields in memory Other goals included replicating commonly used features of the Android debugging framework 14
Locating Data Structures The base of Dalvik loads as a shared library (libdvm.so) Contains global variables that we use to locate classes and other information Also contains the C structures needed to parse and gather evidence we need 15
Gathering libdvm’s Structures Grab the shared library from the phone (adb) 	2) Use Volatility’s dwarfparse.py: ,[object Object]
Records offsets of global variables3) Example structure definition 'ClassObject': [ 0xa0, {		Class name and size 	'obj': [0x0, ['Object']],	 member name, offset, 				and type 16
Volatility Plugin Sample ,[object Object],intval = obj.Object(“int”, offset=intOffset, ..) ,[object Object],	o = obj.Object("Object", offset=objectAddress, ..) 	c = obj.Object("ClassObject", offset=o.clazz, …) desc = linux_common.get_string(c.descriptor) 17
gDvm gDvm is a global structure of type DvmGlobals Holds info about a specific Dalvik instance Used to locate a number of structures needed for analysis 18
Locating Loaded Classes gDvm.loadedClasses is a hash table of ClassObjectsfor each loaded class Hash table is stored as an array Analysis code walks the backing array and handles active entries Inactive entries are NULL or have a pointer value of 0xcbcacccd 19
Information Per Class Type and (often) name of the source code file Information on backing DexFile DexFilestores everything Dalvik cares about for a binary Data Fields Static Instance Methods Name and Type Location of Instructions 20
Static Fields Stored once per class (not instance) Pre-initialized if known Stored in an array with element type StaticField Leads directly to the value of the specific field 21
Instance Fields Per instance of a Class Fields are stored in an array of element type InstField Offset of each field stored in byteOffsetmember Relative offset from ClassObjectstructure 22
Listing Instance Members Source file: ComposeMessageActivity.java  Class: Lcom/android/mms/ui/ComposeMessageActivity; Instance Fields: 	name:        m_receiver signature:  Landroid/content/BroadcastReceiver;  name:        m_filter signature: Landroid/content/IntentFilter; 	name:        mAppContext signature:  Landroid/content/Context;  name:       mAvailableDirPath signature: Ljava/lang/String;  23
Analyzing Methods We can enumerate all methods (direct, virtual) and retrieve names and instructions Not really applicable to this talk Can be extremely useful for malware analysis though If .apk is no longer on disk or if code was changed at runtime 24
Methods in Memory vs on Disk Dalvik makes a number of runtime optimizations [1] Example: When class members are accessed (iget, iput) the field table index is replaced with the direct byte offset Would likely need to undo some of the optimizations to get complete baksmali output  25
Analyzing Specific Applications 26
Recovery Approach Best approach seems to be locating data structures of UI screens UI screens represented by uniform (single type) lists of displayed information Data for many views are pre-loaded 27
Finding Data Structures Can save substantial time by using adb’slogcat(next slide) Shows the classes and often methods involved in handling UI events Otherwise, need to examine source code Some applications are open source Others can be “decompiled” with baksmali [9] 28
logcat example The following is a snippet of output when clicking on the text message view: D/ConversationList(12520): onResume Start D/ComposeMessageActivity(12520): onConatctInfoChange D/RecipientList(12520): mFilterHandler not null D/RecipientList(12520): get recipient: 0 D/RecipientList(12520): r.name: John Smith D/RecipientList(12520): r.filter() return result D/RecipientList(12520): indexOf(r)0 D/RecipientList(12520): prepare set, index/name: 0/John Smith 29
Phone Call History Call history view controlled through a DialerContactCard$OnCardClickListener Each contact stored as a DialerContactCard Contains the name, number, convo length, and photo of contact 30
Per Contact Call History Can (sometimes) retrieve call history per-contact Requires the user to actually view a contact’s history before being populated 31
Text Messages Recovery through ComposeMessageActivity & TextMessageView Complete conversations can be recovered  Not pre-populated 32
Voicemail Audio file is open()’ed Not mapped contiguously into the process address space No method to recover deleted voicemails.. 33
Browser (Opera Mini) Opera Mini is the most used mobile browser Can recover some session information The history file is always mapped in memory (including information from current session) HTTP requests and page information is (possibly) recoverable Can recover <title> information Stored in Opera Binary Markup Language Not publicly documented?  34
Recovering Wireless Information Screenshot on the right shows results of a scan for wireless networks Recovery of this view provides the SSID, MAC address, and enc type for routers found Recovery of “Connected” routers show which were associated with 35
Other Wireless Information Potentially interesting information: Wireless keys Connection stats These are not controlled by Dalvik Keys only initially entered through Dalvik, but then saved Stored by the usual Linux applications wpa_supplicant, dhcpd, in-kernel stats 36
Location Recovery Associating location & time not always important But makes for better slides *hint* Interesting for a number of reasons Forensics & Privacy concerns Not part of a “standard” forensics investigation 37
Google Maps Did not do source code analysis Most phones won’t be using Google Maps while being seized Wanted to find ways to get historical data cleanly Found two promising searches mTime=TIME,mLatitude=LAT,mLongitude=LON point: LAT,LON … lastFix: TIME TIME is the last location, extra work needed to verify 38
“Popular” Weather Application The weather application uses your location to give you relevant information http://vendor.site.com/widget/search.asp? lat=LAT&lon=LON&nocache=TIME 39
More GPS Fun All of the following applications do not clear GPS data from memory, and all send their lat/lon using GET with HTTP Urban Spoon Weather Channel WeatherBug Yelp Groupon Movies 40
Implementation Recovery code written as Volatility [7] plugins Most popular memory analysis framework Has support for all Windows versions since XP and 2.6 Intel Linux Now also supports ARM Linux/Android Makes rapid development of memory analysis capabilities simple Also can be used for analyzing other binary formats 41
Testing Tested against a HTC EVO 4G No phone-specific features used in analysis Only a few HTC-specific packages were analyzed Visually tested against other Dalvik versions No drastic changes in core Dalvik functionality  42
Research Applications Memory forensics (obviously) Testing of privacy assurances Malware analysis Can enumerate and recover methods and their instructions 43
Future Avenues of Research Numerous applications with potentially interesting information Too much to manually dig through  Need automation Baksmali/Volatility/logcat integration? Automated determination of interesting evidence across the whole system Combing work done in [2] and [3] 44
Questions/Comments? andrew@digdeeply.com @attrc 45
References - 1 [1] http://bit.ly/dalvikvsjava [2] Brendan Dolan-Gavitt, et al, “Virtuoso: Narrowing 	the Semantic Gap in Virtual Machine 	Introspection”, IEEE Security and Privacy, 2011 [3] TaintDroid, http://www.appanalysis.org/ [4] http://bit.ly/windowsmemory  [5] http://bit.ly/linuxmem  [6] http://bit.ly/memimaging [7] http://code.google.com/p/volatility/ [8] http://lcamtuf.coredump.cx/soft/memfetch.tgz 46

Contenu connexe

Tendances

Hunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory ForensicsHunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory ForensicsAndrew Case
 
Malware analysis using volatility
Malware analysis using volatilityMalware analysis using volatility
Malware analysis using volatilityYashashree Gund
 
Dfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopDfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopTamas K Lengyel
 
Memory forensics
Memory forensicsMemory forensics
Memory forensicsSunil Kumar
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensicsINSIGHT FORENSIC
 
Workshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with VolatilityWorkshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with VolatilityAndrew Case
 
Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)Andrew Case
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisTakahiro Haruyama
 
I Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXI Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXTakahiro Haruyama
 
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]RootedCON
 
REMnux tutorial-2: Extraction and decoding of Artifacts
REMnux tutorial-2: Extraction and decoding of ArtifactsREMnux tutorial-2: Extraction and decoding of Artifacts
REMnux tutorial-2: Extraction and decoding of ArtifactsRhydham Joshi
 
Detect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory Access
Detect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory AccessDetect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory Access
Detect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory AccessIgor Korkin
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseTakahiro Haruyama
 
44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell
44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell
44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell44CON
 
44CON London 2015: NTFS Analysis with PowerForensics
44CON London 2015: NTFS Analysis with PowerForensics44CON London 2015: NTFS Analysis with PowerForensics
44CON London 2015: NTFS Analysis with PowerForensicsJared Atkinson
 
Applying Memory Forensics to Rootkit Detection
Applying Memory Forensics to Rootkit DetectionApplying Memory Forensics to Rootkit Detection
Applying Memory Forensics to Rootkit DetectionIgor Korkin
 
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documentsREMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documentsRhydham Joshi
 
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
Remnux tutorial-1  Statically Analyse Portable Executable(PE) FilesRemnux tutorial-1  Statically Analyse Portable Executable(PE) Files
Remnux tutorial-1 Statically Analyse Portable Executable(PE) FilesRhydham Joshi
 
Forensics of a Windows System
Forensics of a Windows SystemForensics of a Windows System
Forensics of a Windows SystemConferencias FIST
 

Tendances (20)

Hunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory ForensicsHunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory Forensics
 
Malware analysis using volatility
Malware analysis using volatilityMalware analysis using volatility
Malware analysis using volatility
 
Dfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopDfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshop
 
Memory forensics
Memory forensicsMemory forensics
Memory forensics
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensics
 
Workshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with VolatilityWorkshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with Volatility
 
Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic Analysis
 
I Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXI Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugX
 
Winnti Polymorphism
Winnti PolymorphismWinnti Polymorphism
Winnti Polymorphism
 
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
 
REMnux tutorial-2: Extraction and decoding of Artifacts
REMnux tutorial-2: Extraction and decoding of ArtifactsREMnux tutorial-2: Extraction and decoding of Artifacts
REMnux tutorial-2: Extraction and decoding of Artifacts
 
Detect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory Access
Detect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory AccessDetect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory Access
Detect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory Access
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident Response
 
44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell
44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell
44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell
 
44CON London 2015: NTFS Analysis with PowerForensics
44CON London 2015: NTFS Analysis with PowerForensics44CON London 2015: NTFS Analysis with PowerForensics
44CON London 2015: NTFS Analysis with PowerForensics
 
Applying Memory Forensics to Rootkit Detection
Applying Memory Forensics to Rootkit DetectionApplying Memory Forensics to Rootkit Detection
Applying Memory Forensics to Rootkit Detection
 
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documentsREMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
 
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
Remnux tutorial-1  Statically Analyse Portable Executable(PE) FilesRemnux tutorial-1  Statically Analyse Portable Executable(PE) Files
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
 
Forensics of a Windows System
Forensics of a Windows SystemForensics of a Windows System
Forensics of a Windows System
 

Similaire à Memory Analysis of Dalvik VM Reveals Android Application Data

DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet IntroductionWei Sun
 
Daniel Krasner - High Performance Text Processing with Rosetta
Daniel Krasner - High Performance Text Processing with Rosetta Daniel Krasner - High Performance Text Processing with Rosetta
Daniel Krasner - High Performance Text Processing with Rosetta PyData
 
Interview Question of Aspdotnet
Interview Question of AspdotnetInterview Question of Aspdotnet
Interview Question of AspdotnetMohitKumar1985
 
Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Wei Sun
 
Debugging With Id
Debugging With IdDebugging With Id
Debugging With Idguest215c4e
 
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Emery Berger
 
Java Hates Linux. Deal With It.
Java Hates Linux.  Deal With It.Java Hates Linux.  Deal With It.
Java Hates Linux. Deal With It.Greg Banks
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaIsuru Perera
 
20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)LeClubQualiteLogicielle
 
Bangladesh Bank Assistant Maintenance Engineer Question Solution.
Bangladesh Bank Assistant Maintenance Engineer Question Solution.Bangladesh Bank Assistant Maintenance Engineer Question Solution.
Bangladesh Bank Assistant Maintenance Engineer Question Solution.Engr. Md. Jamal Uddin Rayhan
 
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingDDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingJaime Martin Losa
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)Netcetera
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Bugs Ex Ante by Kristaps Dzonsons
Bugs Ex Ante by Kristaps DzonsonsBugs Ex Ante by Kristaps Dzonsons
Bugs Ex Ante by Kristaps Dzonsonseurobsdcon
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3Diane Allen
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsNational Cheng Kung University
 
Eclipse Memory Analyzer
Eclipse Memory AnalyzerEclipse Memory Analyzer
Eclipse Memory Analyzernayashkova
 
Organizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsOrganizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsAndreas Schreiber
 
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...DevOpsDays Tel Aviv
 

Similaire à Memory Analysis of Dalvik VM Reveals Android Application Data (20)

Lect1.pptx
Lect1.pptxLect1.pptx
Lect1.pptx
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introduction
 
Daniel Krasner - High Performance Text Processing with Rosetta
Daniel Krasner - High Performance Text Processing with Rosetta Daniel Krasner - High Performance Text Processing with Rosetta
Daniel Krasner - High Performance Text Processing with Rosetta
 
Interview Question of Aspdotnet
Interview Question of AspdotnetInterview Question of Aspdotnet
Interview Question of Aspdotnet
 
Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02
 
Debugging With Id
Debugging With IdDebugging With Id
Debugging With Id
 
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
 
Java Hates Linux. Deal With It.
Java Hates Linux.  Deal With It.Java Hates Linux.  Deal With It.
Java Hates Linux. Deal With It.
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in Java
 
20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)
 
Bangladesh Bank Assistant Maintenance Engineer Question Solution.
Bangladesh Bank Assistant Maintenance Engineer Question Solution.Bangladesh Bank Assistant Maintenance Engineer Question Solution.
Bangladesh Bank Assistant Maintenance Engineer Question Solution.
 
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingDDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
Bugs Ex Ante by Kristaps Dzonsons
Bugs Ex Ante by Kristaps DzonsonsBugs Ex Ante by Kristaps Dzonsons
Bugs Ex Ante by Kristaps Dzonsons
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation Systems
 
Eclipse Memory Analyzer
Eclipse Memory AnalyzerEclipse Memory Analyzer
Eclipse Memory Analyzer
 
Organizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsOrganizing the Data Chaos of Scientists
Organizing the Data Chaos of Scientists
 
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
 

Plus de Source Conference

iBanking - a botnet on Android
iBanking - a botnet on AndroidiBanking - a botnet on Android
iBanking - a botnet on AndroidSource Conference
 
I want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUICI want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUICSource Conference
 
From DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and BobsFrom DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and BobsSource Conference
 
Extracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus DerivativesExtracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus DerivativesSource Conference
 
How to Like Social Media Network Security
How to Like Social Media Network SecurityHow to Like Social Media Network Security
How to Like Social Media Network SecuritySource Conference
 
Wfuzz para Penetration Testers
Wfuzz para Penetration TestersWfuzz para Penetration Testers
Wfuzz para Penetration TestersSource Conference
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSource Conference
 
Securty Testing For RESTful Applications
Securty Testing For RESTful ApplicationsSecurty Testing For RESTful Applications
Securty Testing For RESTful ApplicationsSource Conference
 
Men in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the BrowserMen in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the BrowserSource Conference
 
Advanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done ItAdvanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done ItSource Conference
 
Adapting To The Age Of Anonymous
Adapting To The Age Of AnonymousAdapting To The Age Of Anonymous
Adapting To The Age Of AnonymousSource Conference
 
Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?Source Conference
 
Advanced (persistent) binary planting
Advanced (persistent) binary plantingAdvanced (persistent) binary planting
Advanced (persistent) binary plantingSource Conference
 
Legal/technical strategies addressing data risks as perimeter shifts to Cloud
Legal/technical strategies addressing data risks as perimeter shifts to CloudLegal/technical strategies addressing data risks as perimeter shifts to Cloud
Legal/technical strategies addressing data risks as perimeter shifts to CloudSource Conference
 
Who should the security team hire next?
Who should the security team hire next?Who should the security team hire next?
Who should the security team hire next?Source Conference
 
The Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime LawThe Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime LawSource Conference
 
How To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security SpendHow To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security SpendSource Conference
 

Plus de Source Conference (20)

Million Browser Botnet
Million Browser BotnetMillion Browser Botnet
Million Browser Botnet
 
iBanking - a botnet on Android
iBanking - a botnet on AndroidiBanking - a botnet on Android
iBanking - a botnet on Android
 
I want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUICI want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUIC
 
From DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and BobsFrom DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and Bobs
 
Extracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus DerivativesExtracting Forensic Information From Zeus Derivatives
Extracting Forensic Information From Zeus Derivatives
 
How to Like Social Media Network Security
How to Like Social Media Network SecurityHow to Like Social Media Network Security
How to Like Social Media Network Security
 
Wfuzz para Penetration Testers
Wfuzz para Penetration TestersWfuzz para Penetration Testers
Wfuzz para Penetration Testers
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on Rails
 
Securty Testing For RESTful Applications
Securty Testing For RESTful ApplicationsSecurty Testing For RESTful Applications
Securty Testing For RESTful Applications
 
Esteganografia
EsteganografiaEsteganografia
Esteganografia
 
Men in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the BrowserMen in the Server Meet the Man in the Browser
Men in the Server Meet the Man in the Browser
 
Advanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done ItAdvanced Data Exfiltration The Way Q Would Have Done It
Advanced Data Exfiltration The Way Q Would Have Done It
 
Adapting To The Age Of Anonymous
Adapting To The Age Of AnonymousAdapting To The Age Of Anonymous
Adapting To The Age Of Anonymous
 
Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?Are Agile And Secure Development Mutually Exclusive?
Are Agile And Secure Development Mutually Exclusive?
 
Advanced (persistent) binary planting
Advanced (persistent) binary plantingAdvanced (persistent) binary planting
Advanced (persistent) binary planting
 
Legal/technical strategies addressing data risks as perimeter shifts to Cloud
Legal/technical strategies addressing data risks as perimeter shifts to CloudLegal/technical strategies addressing data risks as perimeter shifts to Cloud
Legal/technical strategies addressing data risks as perimeter shifts to Cloud
 
Who should the security team hire next?
Who should the security team hire next?Who should the security team hire next?
Who should the security team hire next?
 
The Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime LawThe Latest Developments in Computer Crime Law
The Latest Developments in Computer Crime Law
 
JSF Security
JSF SecurityJSF Security
JSF Security
 
How To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security SpendHow To: Find The Right Amount Of Security Spend
How To: Find The Right Amount Of Security Spend
 

Dernier

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Memory Analysis of Dalvik VM Reveals Android Application Data

  • 1. Memory Analysis of the Dalvik (Android) Virtual Machine Andrew Case Digital Forensics Solutions
  • 2. Who Am I? Security Analyst at Digital Forensics Solutions Also perform wide ranging forensics investigations Volatility Developer Former Blackhat and DFRWS speaker 2
  • 3. Agenda What is Dalvik / why do we care? Brief overview of memory forensics Extracting allocated and historical data from Dalvikinstances Target specific Android applications 3
  • 4. What is Dalvik? Dalvik is the software VM for all Android applications Nearly identical to the Java Virtual Machine (JVM) [1] Open source, written in C / Java 4
  • 5. Why do we care? Android-based phones leading in US mobile market Which makes for many phones to investigate Memory forensics capabilities against Android applications have numerous uses/implications Entire forensics community (LEO, .gov, private firms) already urging development of such capabilities 5
  • 6. Memory Forensics Introduction Memory forensics is vital to orderly recovery of runtime information Unstructured methods (strings, grep, etc) are brittle and only recover superficial info Structured methods allow for recovery of data structures, variables, and code from memory Previous work at operating system level led to recovery of processes, open files, network connections, etc [4,5] 6
  • 7. Memory Analysis Process First, need to acquire memory Acquisition depends on environment [6] Next, requires locating information in memory and interpreting it correctly Also requires re-implementing functionality offline Then it needs to be displayed in a useful way to the investigator 7
  • 9. Acquiring Memory – Approach 1 The normal method is to acquire a complete capture of physical RAM Works well when analyzing kernel data structures as their pages are not swapped out Allows for recovery of allocated and historical processes, open files, network connections, and so on 9
  • 10. Approach 1 on Android Without /dev/mem support, need a LKM to read memory No current module works for Android (ARM) We developed our own (mostly by @jtsylve) Benefits of full capture: Can target any process (including its mappings) Can recover information from unmapped pages in processes 10
  • 11. Acquiring Memory – Approach 2 Memory can be acquired on a per-process basis Ensures that all pages of the process will be acquired Easiest to perform with memfetch[8] After a few small changes, was statically compiled for ARM No unmapped pages will be recovered though Heap and GC don’t munmap immediately 11
  • 12. Analyzing C vs Java Most previous forensics research has had the “luxury” of analyzing C Nearly 1:1 mapping of code/data to in-memory layout Declaration of a C “string” char buffer[] = “Hello World”; Memory Layout (xxd) 4865 6c6c 6f20 576f 726c 6400 Hello World. 12
  • 13. A Dalvik String in Memory First, need the address of the “StringObject” Next, need the offsets of the “java/lang/String” value and byte offset members StringObject + value offset leads us to an “ArrayObject” ArrayObject + byte offset leads to an UTF-16 array of characters … finally we have the string (in Unicode) 13
  • 14. Now for the memory analysis… The real goal of the research was to be able to locate arbitrary class instances and fields in memory Other goals included replicating commonly used features of the Android debugging framework 14
  • 15. Locating Data Structures The base of Dalvik loads as a shared library (libdvm.so) Contains global variables that we use to locate classes and other information Also contains the C structures needed to parse and gather evidence we need 15
  • 16.
  • 17. Records offsets of global variables3) Example structure definition 'ClassObject': [ 0xa0, { Class name and size 'obj': [0x0, ['Object']], member name, offset, and type 16
  • 18.
  • 19. gDvm gDvm is a global structure of type DvmGlobals Holds info about a specific Dalvik instance Used to locate a number of structures needed for analysis 18
  • 20. Locating Loaded Classes gDvm.loadedClasses is a hash table of ClassObjectsfor each loaded class Hash table is stored as an array Analysis code walks the backing array and handles active entries Inactive entries are NULL or have a pointer value of 0xcbcacccd 19
  • 21. Information Per Class Type and (often) name of the source code file Information on backing DexFile DexFilestores everything Dalvik cares about for a binary Data Fields Static Instance Methods Name and Type Location of Instructions 20
  • 22. Static Fields Stored once per class (not instance) Pre-initialized if known Stored in an array with element type StaticField Leads directly to the value of the specific field 21
  • 23. Instance Fields Per instance of a Class Fields are stored in an array of element type InstField Offset of each field stored in byteOffsetmember Relative offset from ClassObjectstructure 22
  • 24. Listing Instance Members Source file: ComposeMessageActivity.java Class: Lcom/android/mms/ui/ComposeMessageActivity; Instance Fields: name: m_receiver signature: Landroid/content/BroadcastReceiver; name: m_filter signature: Landroid/content/IntentFilter; name: mAppContext signature: Landroid/content/Context; name: mAvailableDirPath signature: Ljava/lang/String; 23
  • 25. Analyzing Methods We can enumerate all methods (direct, virtual) and retrieve names and instructions Not really applicable to this talk Can be extremely useful for malware analysis though If .apk is no longer on disk or if code was changed at runtime 24
  • 26. Methods in Memory vs on Disk Dalvik makes a number of runtime optimizations [1] Example: When class members are accessed (iget, iput) the field table index is replaced with the direct byte offset Would likely need to undo some of the optimizations to get complete baksmali output 25
  • 28. Recovery Approach Best approach seems to be locating data structures of UI screens UI screens represented by uniform (single type) lists of displayed information Data for many views are pre-loaded 27
  • 29. Finding Data Structures Can save substantial time by using adb’slogcat(next slide) Shows the classes and often methods involved in handling UI events Otherwise, need to examine source code Some applications are open source Others can be “decompiled” with baksmali [9] 28
  • 30. logcat example The following is a snippet of output when clicking on the text message view: D/ConversationList(12520): onResume Start D/ComposeMessageActivity(12520): onConatctInfoChange D/RecipientList(12520): mFilterHandler not null D/RecipientList(12520): get recipient: 0 D/RecipientList(12520): r.name: John Smith D/RecipientList(12520): r.filter() return result D/RecipientList(12520): indexOf(r)0 D/RecipientList(12520): prepare set, index/name: 0/John Smith 29
  • 31. Phone Call History Call history view controlled through a DialerContactCard$OnCardClickListener Each contact stored as a DialerContactCard Contains the name, number, convo length, and photo of contact 30
  • 32. Per Contact Call History Can (sometimes) retrieve call history per-contact Requires the user to actually view a contact’s history before being populated 31
  • 33. Text Messages Recovery through ComposeMessageActivity & TextMessageView Complete conversations can be recovered Not pre-populated 32
  • 34. Voicemail Audio file is open()’ed Not mapped contiguously into the process address space No method to recover deleted voicemails.. 33
  • 35. Browser (Opera Mini) Opera Mini is the most used mobile browser Can recover some session information The history file is always mapped in memory (including information from current session) HTTP requests and page information is (possibly) recoverable Can recover <title> information Stored in Opera Binary Markup Language Not publicly documented? 34
  • 36. Recovering Wireless Information Screenshot on the right shows results of a scan for wireless networks Recovery of this view provides the SSID, MAC address, and enc type for routers found Recovery of “Connected” routers show which were associated with 35
  • 37. Other Wireless Information Potentially interesting information: Wireless keys Connection stats These are not controlled by Dalvik Keys only initially entered through Dalvik, but then saved Stored by the usual Linux applications wpa_supplicant, dhcpd, in-kernel stats 36
  • 38. Location Recovery Associating location & time not always important But makes for better slides *hint* Interesting for a number of reasons Forensics & Privacy concerns Not part of a “standard” forensics investigation 37
  • 39. Google Maps Did not do source code analysis Most phones won’t be using Google Maps while being seized Wanted to find ways to get historical data cleanly Found two promising searches mTime=TIME,mLatitude=LAT,mLongitude=LON point: LAT,LON … lastFix: TIME TIME is the last location, extra work needed to verify 38
  • 40. “Popular” Weather Application The weather application uses your location to give you relevant information http://vendor.site.com/widget/search.asp? lat=LAT&lon=LON&nocache=TIME 39
  • 41. More GPS Fun All of the following applications do not clear GPS data from memory, and all send their lat/lon using GET with HTTP Urban Spoon Weather Channel WeatherBug Yelp Groupon Movies 40
  • 42. Implementation Recovery code written as Volatility [7] plugins Most popular memory analysis framework Has support for all Windows versions since XP and 2.6 Intel Linux Now also supports ARM Linux/Android Makes rapid development of memory analysis capabilities simple Also can be used for analyzing other binary formats 41
  • 43. Testing Tested against a HTC EVO 4G No phone-specific features used in analysis Only a few HTC-specific packages were analyzed Visually tested against other Dalvik versions No drastic changes in core Dalvik functionality 42
  • 44. Research Applications Memory forensics (obviously) Testing of privacy assurances Malware analysis Can enumerate and recover methods and their instructions 43
  • 45. Future Avenues of Research Numerous applications with potentially interesting information Too much to manually dig through Need automation Baksmali/Volatility/logcat integration? Automated determination of interesting evidence across the whole system Combing work done in [2] and [3] 44
  • 47. References - 1 [1] http://bit.ly/dalvikvsjava [2] Brendan Dolan-Gavitt, et al, “Virtuoso: Narrowing the Semantic Gap in Virtual Machine Introspection”, IEEE Security and Privacy, 2011 [3] TaintDroid, http://www.appanalysis.org/ [4] http://bit.ly/windowsmemory [5] http://bit.ly/linuxmem [6] http://bit.ly/memimaging [7] http://code.google.com/p/volatility/ [8] http://lcamtuf.coredump.cx/soft/memfetch.tgz 46
  • 48. References - 2 [9] baksmali - http://code.google.com/p/smali/ 47