Book Image

Mastering Python Forensics

Book Image

Mastering Python Forensics

Overview of this book

Digital forensic analysis is the process of examining and extracting data digitally and examining it. Python has the combination of power, expressiveness, and ease of use that makes it an essential complementary tool to the traditional, off-the-shelf digital forensic tools. This book will teach you how to perform forensic analysis and investigations by exploring the capabilities of various Python libraries. The book starts by explaining the building blocks of the Python programming language, especially ctypes in-depth, along with how to automate typical tasks in file system analysis, common correlation tasks to discover anomalies, as well as templates for investigations. Next, we’ll show you cryptographic algorithms that can be used during forensic investigations to check for known files or to compare suspicious files with online services such as VirusTotal or Mobile-Sandbox. Moving on, you’ll learn how to sniff on the network, generate and analyze network flows, and perform log correlation with the help of Python scripts and tools. You’ll get to know about the concepts of virtualization and how virtualization influences IT forensics, and you’ll discover how to perform forensic analysis of a jailbroken/rooted mobile device that is based on iOS or Android. Finally, the book teaches you how to analyze volatile memory and search for known malware samples based on YARA rules.
Table of Contents (14 chapters)

Android


The first mobile operating system that we will examine with the help of Python is Android. In the first subsection, we will demonstrate how to manually examine the smartphone, followed by an automatic approach using ADEL. Last but not least, we will demonstrate how to merge data from the analysis to create movement profiles.

Manual Examination

The first step is getting root access to the smartphone. This is required to circumvent internal system protections and get access to all data. Getting root access is different for most of the phones and strongly dependent on the OS version. The best way is creating your own recovery image and booting the phone through the built-in recovery mode.

After getting the root access, the next step is trying to get the screen lock in plain text as this secret is often used for different protections (for example, the screen lock can be used as an application password for an app on the phone). Breaking the screen lock for a PIN or password can be done with...