Kuboid
Open Luck·Kuboid.in

Solving the Lover, Stalker, Killer Murder with Strings, Grep, and Perl

DEFCONConference2,594 views21:56over 1 year ago

This talk demonstrates the application of digital forensics and incident response (DFIR) techniques to solve a complex criminal case involving digital evidence. The speaker details the process of collecting, parsing, and correlating massive amounts of data from various sources, including emails, text messages, and GPS logs, to identify a perpetrator. The presentation highlights the effectiveness of using simple, open-source command-line tools like grep, strings, and custom Perl scripts for large-scale data analysis in forensic investigations. The speaker also introduces a custom tool, 'DEX', designed for indexing and correlating disparate forensic data sources.

Solving Complex Crimes with Grep, Strings, and Custom Perl Scripts

TLDR: This talk breaks down how to handle massive, disparate datasets in digital forensics by moving away from bloated, crash-prone commercial tools. By leveraging simple command-line utilities like grep, strings, and custom Perl scripts, investigators can efficiently parse and correlate evidence across thousands of files. The speaker introduces a custom tool, DEX, designed to index and correlate forensic data, proving that minimalist, open-source workflows often outperform expensive, proprietary alternatives.

Digital forensics often feels like a race against the clock, but the real enemy is usually the sheer volume of data. When you are staring down terabytes of physical media, thousands of emails, and half a million IP address records, the last thing you need is a commercial forensic suite that crashes every time it hits a complex file structure. The reality of modern investigations is that you rarely have the luxury of a clean, indexed environment. You have to build your own path through the noise.

The Problem with Bloated Tooling

Commercial forensic tools are often sold on the promise of "all-in-one" convenience. In practice, they frequently fail when faced with the scale of modern data. They lack granular control, they are prone to memory leaks, and they rarely offer the flexibility needed to pivot when a case takes an unexpected turn. During the investigation of the "Lover, Stalker, Killer" case, the sheer volume of evidence—over 80GB of textual legal responses and terabytes of physical media—made standard GUI-based tools a liability.

When you are dealing with 100,000+ emails and IMs, you need a workflow that is resilient. If a tool crashes, you lose your progress. If it doesn't support save points, you start over. This is why the most effective forensic researchers I know have stopped relying on "black box" software and started writing their own parsers.

Building a Minimalist Forensic Pipeline

The core of this approach is to treat forensic data as a stream of text. By using strings to extract raw data from binary images and grep to filter for relevant patterns, you can perform triage in seconds rather than hours. The speaker’s approach relies on a simple, repeatable pipeline:

  1. Acquire: Use xmount to mount forensic images in a read-only, safe environment.
  2. Triage: Run strings on the image to extract text, then pipe the output through grep to find specific timestamps or keywords.
  3. Carve: Use scalpel to recover deleted files based on their headers and footers.

The real power comes from the custom tool, DEX, which acts as a bridge between these disparate data sources. DEX is a MariaDB-backed database that indexes the output of these triage steps. It allows you to correlate an IP address found in an email header with a specific timestamp from a GPS log, effectively mapping out a timeline that would be invisible in a standard forensic report.

# Basic triage command to extract strings and filter for specific years
strings -tx image.E01 | grep -E "2012|2013" > triage_results.txt

This isn't about reinventing the wheel; it's about building a wheel that doesn't break under pressure. Perl is particularly well-suited for this because of its native support for regular expressions. When you are dealing with 60 to 80 different sources of information, each with its own proprietary format, you need a language that can handle text manipulation without the overhead of a full application stack.

Why This Matters for Pentesters

You might think this is only relevant to law enforcement, but that is a mistake. If you are performing a red team engagement or a deep-dive penetration test, you are often dealing with the same data-hoarding problems. When you gain access to a target's machine, you are not just looking for a single flag. You are looking for the breadcrumbs that lead to the next stage of the attack.

The ability to quickly parse logs, correlate user activity across multiple services, and identify patterns in a sea of data is a force multiplier. If you can write a quick script to index the contents of a compromised server, you can find the "smoking gun" evidence—like a hardcoded credential or a misconfigured service—long before your automated scanners finish their first pass.

The Defensive Reality

Defenders should take note of how easily an attacker can pivot through a network once they have access to these logs. If your organization is not centralizing and securing its logs, you are essentially handing an attacker the keys to your entire history. Implement robust log rotation and, more importantly, ensure that your logs are being ingested into a system that allows for rapid, complex queries. If your SIEM is too slow to handle a simple grep equivalent, it is not helping you; it is just adding latency to your response.

Forensics is not about the tools you buy; it is about the questions you ask and how quickly you can get the data to answer them. Stop relying on tools that promise to do the thinking for you. Learn the command line, understand how to manipulate raw data, and build a pipeline that works for you, not against you. The next time you are stuck in a massive dataset, remember that the most complex problems often have the simplest, most elegant solutions.

Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in