SlideShare a Scribd company logo
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
  Dalvik instances
• 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
1) Grab the shared library from the phone (adb)
2) Use Volatility’s dwarfparse.py:
   • Builds a profile of C structures along with
     members, types, and byte offsets
   • Records offsets of global variables
3) Example structure definition
  'ClassObject': [ 0xa0, {        Class name and size
      'obj': [0x0, ['Object']],   member name, offset,
                                  and type

                                                         16
Volatility Plugin Sample
• Accessing structures is as simple as knowing
  the type and offset
    intval = obj.Object(“int”, offset=intOffset, ..)
• Volatility code to access ‘descriptor’ of an
  ‘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
  ClassObjects for 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
  – DexFile stores 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 byteOffset
  member
  – Relative offset from ClassObject structure




                                                  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’s
  logcat (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$OnCard
  ClickListener
• 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
References - 2
[9] baksmali - http://code.google.com/p/smali/




                                                 47

More Related Content

What's hot

(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
INSIGHT FORENSIC
 
Workshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with VolatilityWorkshop - Linux Memory Analysis with Volatility
Workshop - Linux Memory Analysis with Volatility
Andrew Case
 
Memory forensics
Memory forensicsMemory forensics
Memory forensics
Sunil Kumar
 
Malware analysis using volatility
Malware analysis using volatilityMalware analysis using volatility
Malware analysis using volatility
Yashashree Gund
 
Dfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopDfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshop
Tamas K Lengyel
 
Hunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory ForensicsHunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory Forensics
Andrew Case
 
Memory Forensic - Investigating Memory Artefact
Memory Forensic - Investigating Memory ArtefactMemory Forensic - Investigating Memory Artefact
Memory Forensic - Investigating Memory Artefact
Satria Ady Pradana
 
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
Takahiro Haruyama
 
Live Memory Forensics on Android devices
Live Memory Forensics on Android devicesLive Memory Forensics on Android devices
Live Memory Forensics on Android devices
Nikos Gkogkos
 
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 Analysis
Takahiro Haruyama
 
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
Rhydham Joshi
 
Winnti Polymorphism
Winnti PolymorphismWinnti Polymorphism
Winnti Polymorphism
Takahiro Haruyama
 
Forensics of a Windows System
Forensics of a Windows SystemForensics of a Windows System
Forensics of a Windows System
Conferencias FIST
 
Ntfs forensics
Ntfs forensicsNtfs forensics
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
Jared Atkinson
 
Leveraging NTFS Timeline Forensics during the Analysis of Malware
Leveraging NTFS Timeline Forensics during the Analysis of MalwareLeveraging NTFS Timeline Forensics during the Analysis of Malware
Leveraging NTFS Timeline Forensics during the Analysis of Malware
tmugherini
 
Autopsy Digital forensics tool
Autopsy Digital forensics toolAutopsy Digital forensics tool
Autopsy Digital forensics tool
Sreekanth Narendran
 
Disk forensics
Disk forensicsDisk forensics
Disk forensics
Chiawei Wang
 
File carving tools
File carving toolsFile carving tools
File carving tools
Marco Alamanni
 

What's hot (20)

(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
 
Memory forensics
Memory forensicsMemory forensics
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
 
Hunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory ForensicsHunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory Forensics
 
Memory Forensic - Investigating Memory Artefact
Memory Forensic - Investigating Memory ArtefactMemory Forensic - Investigating Memory Artefact
Memory Forensic - Investigating Memory Artefact
 
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
 
Live Memory Forensics on Android devices
Live Memory Forensics on Android devicesLive Memory Forensics on Android devices
Live Memory Forensics on Android devices
 
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
 
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
 
Winnti Polymorphism
Winnti PolymorphismWinnti Polymorphism
Winnti Polymorphism
 
Forensics of a Windows System
Forensics of a Windows SystemForensics of a Windows System
Forensics of a Windows System
 
Ntfs forensics
Ntfs forensicsNtfs forensics
Ntfs forensics
 
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
 
Leveraging NTFS Timeline Forensics during the Analysis of Malware
Leveraging NTFS Timeline Forensics during the Analysis of MalwareLeveraging NTFS Timeline Forensics during the Analysis of Malware
Leveraging NTFS Timeline Forensics during the Analysis of Malware
 
Autopsy Digital forensics tool
Autopsy Digital forensics toolAutopsy Digital forensics tool
Autopsy Digital forensics tool
 
Disk forensics
Disk forensicsDisk forensics
Disk forensics
 
File carving tools
File carving toolsFile carving tools
File carving tools
 

Viewers also liked

Memory management in Android
Memory management in AndroidMemory management in Android
Memory management in Android
Keyhan Asghari
 
Android Multimedia Support
Android Multimedia SupportAndroid Multimedia Support
Android Multimedia Support
Jussi Pohjolainen
 
Memory management for_android_apps
Memory management for_android_appsMemory management for_android_apps
Memory management for_android_apps
Bin Shao
 
Memory management in Andoid
Memory management in AndoidMemory management in Andoid
Memory management in Andoid
Monkop Inc
 
Android memory fundamentals
Android memory fundamentalsAndroid memory fundamentals
Android memory fundamentals
Taras Leskiv
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devices
Droidcon Berlin
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual MachineUnderstanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
National Cheng Kung University
 

Viewers also liked (7)

Memory management in Android
Memory management in AndroidMemory management in Android
Memory management in Android
 
Android Multimedia Support
Android Multimedia SupportAndroid Multimedia Support
Android Multimedia Support
 
Memory management for_android_apps
Memory management for_android_appsMemory management for_android_apps
Memory management for_android_apps
 
Memory management in Andoid
Memory management in AndoidMemory management in Andoid
Memory management in Andoid
 
Android memory fundamentals
Android memory fundamentalsAndroid memory fundamentals
Android memory fundamentals
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devices
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual MachineUnderstanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
 

Similar to Memory Analysis of the Dalvik (Android) Virtual Machine

Dynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open ChallengesDynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open Challenges
bcantrill
 
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtugVk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
ketan_patel25
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
Prashant Rane
 
Mac Memory Analysis with Volatility
Mac Memory Analysis with VolatilityMac Memory Analysis with Volatility
Mac Memory Analysis with Volatility
Andrew Case
 
Oxford Common File Layout (OCFL)
Oxford Common File Layout (OCFL)Oxford Common File Layout (OCFL)
Oxford Common File Layout (OCFL)
Simeon Warner
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
Don Demcsak
 
Omfw 2013
Omfw 2013Omfw 2013
Omfw 2013
504ensics
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
Ryan Cuprak
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introduction
jyoti_lakhani
 
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
South Tyrol Free Software Conference
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
Kelwin Yang
 
CS8392 OOP
CS8392 OOPCS8392 OOP
Everything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in KubernetesEverything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 
Surge2012
Surge2012Surge2012
Surge2012
davidapacheco
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
Jim Driscoll
 
Secure container: Kata container and gVisor
Secure container: Kata container and gVisorSecure container: Kata container and gVisor
Secure container: Kata container and gVisor
Ching-Hsuan Yen
 
06.1 .Net memory management
06.1 .Net memory management06.1 .Net memory management
06.1 .Net memory management
Victor Matyushevskyy
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
sureshkumara29
 

Similar to Memory Analysis of the Dalvik (Android) Virtual Machine (20)

Dynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open ChallengesDynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open Challenges
 
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtugVk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
 
Mac Memory Analysis with Volatility
Mac Memory Analysis with VolatilityMac Memory Analysis with Volatility
Mac Memory Analysis with Volatility
 
Oxford Common File Layout (OCFL)
Oxford Common File Layout (OCFL)Oxford Common File Layout (OCFL)
Oxford Common File Layout (OCFL)
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
 
Omfw 2013
Omfw 2013Omfw 2013
Omfw 2013
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introduction
 
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
Everything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in KubernetesEverything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in Kubernetes
 
Surge2012
Surge2012Surge2012
Surge2012
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
Secure container: Kata container and gVisor
Secure container: Kata container and gVisorSecure container: Kata container and gVisor
Secure container: Kata container and gVisor
 
06.1 .Net memory management
06.1 .Net memory management06.1 .Net memory management
06.1 .Net memory management
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 

More from Andrew Case

Proactive Measures to Defeat Insider Threat
Proactive Measures to Defeat Insider ThreatProactive Measures to Defeat Insider Threat
Proactive Measures to Defeat Insider Threat
Andrew Case
 
OMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with VolatlityOMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
Andrew Case
 
Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...
Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...
Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...
Andrew Case
 
Hunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory ForensicsHunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory Forensics
Andrew Case
 
My Keynote from BSidesTampa 2015 (video in description)
My Keynote from BSidesTampa 2015 (video in description)My Keynote from BSidesTampa 2015 (video in description)
My Keynote from BSidesTampa 2015 (video in description)
Andrew Case
 
Investigating Cooridinated Data Exfiltration
Investigating Cooridinated Data ExfiltrationInvestigating Cooridinated Data Exfiltration
Investigating Cooridinated Data Exfiltration
Andrew Case
 

More from Andrew Case (6)

Proactive Measures to Defeat Insider Threat
Proactive Measures to Defeat Insider ThreatProactive Measures to Defeat Insider Threat
Proactive Measures to Defeat Insider Threat
 
OMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with VolatlityOMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
 
Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...
Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...
Memory Forensics: Defeating Disk Encryption, Skilled Attackers, and Advanced ...
 
Hunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory ForensicsHunting Mac Malware with Memory Forensics
Hunting Mac Malware with Memory Forensics
 
My Keynote from BSidesTampa 2015 (video in description)
My Keynote from BSidesTampa 2015 (video in description)My Keynote from BSidesTampa 2015 (video in description)
My Keynote from BSidesTampa 2015 (video in description)
 
Investigating Cooridinated Data Exfiltration
Investigating Cooridinated Data ExfiltrationInvestigating Cooridinated Data Exfiltration
Investigating Cooridinated Data Exfiltration
 

Recently uploaded

Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
zjhamm304
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Ukraine
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
manji sharman06
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
Sease
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 
ScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking ReplicationScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking Replication
ScyllaDB
 
AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)
HarpalGohil4
 

Recently uploaded (20)

Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
Call Girls Chandigarh🔥7023059433🔥Agency Profile Escorts in Chandigarh Availab...
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 
ScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking ReplicationScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking Replication
 
AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)
 

Memory Analysis of the Dalvik (Android) Virtual Machine

  • 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 Dalvik instances • 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. Gathering libdvm’s Structures 1) Grab the shared library from the phone (adb) 2) Use Volatility’s dwarfparse.py: • Builds a profile of C structures along with members, types, and byte offsets • Records offsets of global variables 3) Example structure definition 'ClassObject': [ 0xa0, { Class name and size 'obj': [0x0, ['Object']], member name, offset, and type 16
  • 17. Volatility Plugin Sample • Accessing structures is as simple as knowing the type and offset intval = obj.Object(“int”, offset=intOffset, ..) • Volatility code to access ‘descriptor’ of an ‘Object’: o = obj.Object("Object", offset=objectAddress, ..) c = obj.Object("ClassObject", offset=o.clazz, …) desc = linux_common.get_string(c.descriptor) 17
  • 18. 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
  • 19. Locating Loaded Classes • gDvm.loadedClasses is a hash table of ClassObjects for 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
  • 20. Information Per Class • Type and (often) name of the source code file • Information on backing DexFile – DexFile stores everything Dalvik cares about for a binary • Data Fields – Static – Instance • Methods – Name and Type – Location of Instructions 20
  • 21. 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
  • 22. Instance Fields • Per instance of a Class • Fields are stored in an array of element type InstField • Offset of each field stored in byteOffset member – Relative offset from ClassObject structure 22
  • 23. 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
  • 24. 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
  • 25. 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
  • 27. 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
  • 28. Finding Data Structures • Can save substantial time by using adb’s logcat (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
  • 29. 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
  • 30. Phone Call History • Call history view controlled through a DialerContactCard$OnCard ClickListener • Each contact stored as a DialerContactCard • Contains the name, number, convo length, and photo of contact 30
  • 31. 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
  • 32. Text Messages • Recovery through ComposeMessageActivity & TextMessageView • Complete conversations can be recovered • Not pre-populated 32
  • 33. Voicemail • Audio file is open()’ed • Not mapped contiguously into the process address space • No method to recover deleted voicemails.. 33
  • 34. 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
  • 35. 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
  • 36. 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
  • 37. 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
  • 38. 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
  • 39. “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
  • 40. 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
  • 41. 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
  • 42. 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
  • 43. Research Applications • Memory forensics (obviously) • Testing of privacy assurances • Malware analysis – Can enumerate and recover methods and their instructions 43
  • 44. 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
  • 46. 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
  • 47. References - 2 [9] baksmali - http://code.google.com/p/smali/ 47