Initialization vectors: python
Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Wednesday, February 7, 2024

What is cacheV0.db and why are there only images in it?

Last week the awesome Heather Charpentier (my co-host on the Digital Forensics Now Podcast) and myself were working on building a parser for Google Chats in iOS. As we were looking for the location where images were share via the chat we came across a SQLite database called cacheV0.db in the /private/var/mobile/Data/Application/GUID/Library/Caches/com.google.Dynamite/ImageFetcherCache/ directory.

The cacheV0.db file in context.


Even though we found the images tied to the chats somewhere else in the application directory, this database had a smaller resolution copy of all the files that were sent via the chats to include user avatars that were not shared via user attributable action. The database also contained images that were from deleted chats that did not remain in the folder where the chat images are kept.

It seems this database is similar in function to the Glide Image Manager Cache functionality found in some Android apps where this functionality generates and keeps a thumbnail of every image that has been rendered by the app's interface. In this context rendering means showing the image to the user within the interface of the application. You can watch a video detailing the Glide Image Manager Cache functionality and forensic significance here: https://youtu.be/Rlp-h9V6FI0

The cacheV0.db is comprised of only one table called cache that contains only two fields called id and data. The id field is of integer type and it is sequentially incremented starting at number one. The data field is of blob type and contains the thumbnail like images mentioned previously.

The cache table.

Some details about how the database is implemented per our observations:

  • We were not able to find any direct connection between the images in the database and the database that contains the chats. It seems it behaves like Glide were the images in the database are used by the application for rendering purposes but are separate from the actual images being send and received in chat interactions.
  • We knew deleted images where in the database because Heather had created the dataset and had extensive documentation of her process. We knew what images we were missing form the main image directory and we found those copies in the database.
  • We found another cacheV0.db database in the Google Voice app in iOS. It would seem this is a Google used image rendering managing process. We have not seen this database, so far, outside of Google apps.

In summary it seems this database:

  • Is used to keep and manage images used by the application for rendering to the user.
  • Keeps copies of images after the source files have been deleted.
  • It is used by Google applications.

If anyone comes across additional implementations of this database do share your findings.
In order to automate the parsing of these databases in iOS I have created the Image CacheV0 parser in iLEAPP.

iLEAPP parser for cacheV0.db

iLEAPP is a free, Python based, open-source, community driven platform for the parsing of iOS extractions for digital forensics. You can find the tool here: https://github.com/abrignoni/iLEAPP

For questions or comments find me on all social media here: https://linqapp.com/abrignoni



Sunday, July 26, 2020

DFIR Python Study Group Syllabus Part 2

Greetings! Below is a list of assignments from recent classes.

Reminder: Assignments listed below indicate what to complete before class; make sure that you are signed in to Discord in order to access the practice files

🐍

Class 10 on 06/25/2020
  • No homework / study hall

Class 11 on 06/30/2020
  • No homework / study hall

Class 12 on 07/02/2020
  • Conduct online research of argparse and make a script that takes two arguments and prints them to screen
  • Research dunders for name and main
  • Kik_Discord_Parser.py: review for argparse and main() implementations

Class 13 on 07/07/2020
  • Ch. 5 pp. 195-211 until “There Are No Dumb Questions”
  • json_in_sqlite.zip: Download for class

Class 14 on 07/09/2020
  • Slack_Messages.sql: Add to query to parse fields from the Slack database from previous class

Class 15 on 07/14/2020
  • Ch. 6 pp. 243-264 until “Test Drive”
  • LastBuildInfo.plist: Write script that pulls out every key and value

Class 16 on 07/21/2020
  • Ch. 6 pp. 265-280 until “Chapter 6’s Code”
  • nskeyedarchive_files.zip: Look for UNNotificationUserInfo and pull out screen_name, full_name, and video url using the Deserializer library

Class 17 on 07/23/2020

Class 18 on 07/30/2020
  • Ch. 8 pp. 309-334 “Chapter 8’s Code” / blank page

Tuesday, June 30, 2020

DFIR Python Study Group Syllabus

Interested in learning Python? Here's the syllabus from our DFIR Python Study Group course. Follow along by getting the book, doing the homework, and watching the YouTube videos.

Note: Assignments listed below indicate what to complete before class; make sure that you are signed in to Discord in order to access the exercises via the links

Textbook: Head First Python: A Brain-Friendly Guide, 2nd edition

🐍

Class 0 on 05/21/2020
  • Ch. 1 pp. 1-19 until “What We Already Know”


Class 1 on 05/26/2020
  • Ch. 1 pp. 20-46 until “Chapter 1’s Code”
 

Class 2 on 05/28/2020
  • Ch. 2 pp. 47-55 until “Creating Lists Literally”
 

Class 3 on 06/02/2020
  • Ch. 2 pp. 56-94 until “Chapter 2’s Code, 2 of 2” / blank page


Class 4 on 06/04/2020
  • build.prop
    • Open and read file using a for loop
    • Use if and elif to select interesting items in the file
    • Select the values to the right of = using start, stop, step, or split()
    • Write the extracted data to a text file
 

Class 5 on 06/09/2020
  • Ch. 3 pp. 95-121 until “Test Drive”
    • Note: p. 98 is outdated and new info can be found here


Class 6 on 06/11/2020
  • Ch. 3 pp. 122-144 until “Chapter 3’s Code, 2 of 2”
  • discord.json
    • Pull the chats (content key) and user identifiers


Class 7 on 06/16/2020
  • Ch. 4 pp. 145-169 until “Test Drive”


Class 8 on 06/18/2020


Class 9 on 06/23/2020
  • homework_files.zip: Create a script that does the following
    • Calls a function that selects timestamp, partner_jid, and body from the messagesTable in the Kik database; prints them to screen; and calls a function to generate a text file report
    • Calls a function that extracts the timestamp, author, and content from the Discord JSON file; prints them to screen; and calls a function to generate a text file report


Class 10 on 06/25/2020
  • No homework / study hall


Class 11 on 06/30/2020
  • No homework / study hall


Class 12 on 07/02/2020
  • Research information online about argparse
  • Research information online about dunders for name and main
  • Make a script that takes two arguments and prints them to screen