Analysis Tools
- Genymotion Android 9 Virtual Machine (Google Pixel 3)
- Android Studio for macOS
- Sample Android app, by Dheeraj Andra, that uses a Realm database to store and display user generated values.
- Blog post link. https://medium.com/mindorks/realm-with-android-acf50ea68ece
- Github link for the project: https://github.com/asdheeraj/Realm
- Realm Studio for macOS
What is a Realm database?
Some time ago I was made aware of a popular app that all of a sudden was not being properly supported by our usual forensic tools. When one of my colleagues told me that the data was contained within a Realm database I had no idea what he was talking about. A quick Google search lead me to the developer's webpage, realm.io.
Alternative to SQLite. Interesting... |
Sample app that uses a Realm database
Usually I work on apps from the Google Play store to illustrate the extraction and parsing of data. In this case I used a simple Android project whose only purpose is to illustrate the input and output of data from a Realm database. Sadly the generation and extraction of sample data using a fully working app takes time and effort that I currently don't have. Using this simple project and an Android virtual machine I could do the generation an extraction of data in minutes for illustration purposes.
The Android project was made by Dheeraj Andra and it is a simple app that takes as input a name and age. These values are shown to the user on screen after being saved in the realm database. Links to the project are included above. To generate the APK needed to run the app in my Genymotion virtual machine I used Android Studio. With the APK in hand I ran it on my virtual machine. The following is an image of the app in use:
Sample Realm app |
Storage location
As any Android app the data of relevance is contained within the application directory. With SQLite databases the data is usually contained in the databases directory. By contrast this Realm app, as well as others I have come across lately, has no databases directory.
Where is the databases folder? |
Get the .realm file! |
How to view Realm database contents
What do we do with the file after extracted? The database developers have a free tool called Realm Studio. Open the .real file with Realm Studio and you will be able to browse the contents.
Values |
In the previous image the bottom part of the screen shows the contents of the sample realm database while the upper part is the same data in JSON format.
Recently (November 19, 2019) Cellebrite announced that their Database viewer tool product had Realm database support.
I expect other vendors in the space to follow suit. This is important because I forsee Realm databases, as well as JSON and protobuf, to be common in the near future as mobile app data stores.This is pretty neat. Already seeing apps using Realm and protobuf data stores. Well done @Cellebrite_UFED. https://t.co/kES8plrVx3 pic.twitter.com/1BWKWruqZM— Brigs 🦃 (@AlexisBrignoni) November 19, 2019
Last but not least remember that having multiple ways of looking at a data set is important for validation purposes.
As always I can be reached on twitter @AlexisBrignoni and via email 4n6[at]abrignoni[dot]com.