Book Image

Python Digital Forensics Cookbook

By : Chapin Bryce, Preston Miller
Book Image

Python Digital Forensics Cookbook

By: Chapin Bryce, Preston Miller

Overview of this book

Technology plays an increasingly large role in our daily lives and shows no sign of stopping. Now, more than ever, it is paramount that an investigator develops programming expertise to deal with increasingly large datasets. By leveraging the Python recipes explored throughout this book, we make the complex simple, quickly extracting relevant information from large datasets. You will explore, develop, and deploy Python code and libraries to provide meaningful results that can be immediately applied to your investigations. Throughout the Python Digital Forensics Cookbook, recipes include topics such as working with forensic evidence containers, parsing mobile and desktop operating system artifacts, extracting embedded metadata from documents and executables, and identifying indicators of compromise. You will also learn to integrate scripts with Application Program Interfaces (APIs) such as VirusTotal and PassiveTotal, and tools such as Axiom, Cellebrite, and EnCase. By the end of the book, you will have a sound understanding of Python and how you can use it to process artifacts in your investigations.
Table of Contents (11 chapters)

Digging deep to recover messages

Recipe Difficulty: Hard

Python Version: 3.5

Operating System: Any

Earlier in this chapter, we developed a recipe to identify missing records from a database. In this recipe, we will leverage the output from that recipe and identify recoverable records and their offset within a database. This is accomplished by understanding some internals of SQLite databases and leveraging that understanding to our advantage.

For a detailed description of the SQLite file internals, review https://www.sqlite.org/fileformat.html.

With this technique, we will be able to quickly triage a database and identify recoverable messages.

When a row from a database is deleted, similar to a file, the entry is not necessarily overwritten. This entry can still persist for some time based on database activity and its allocation algorithms. Our chances for data recovery decrease...