> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/forensics/disk/timeline1.md).

# Disk Forensics Writeup

The goal was to analyze a **disk image** and recover hidden or suspicious data using forensic tools.

***

## 🔧 Step 1: Extract the Disk Image

Initially, the disk image was compressed:

```bash
gzip -d partition4.img.gz
```

This decompresses the file and gives us:

```
partition4.img
```

***

## 📂 Step 2: Generate File Listing

We recursively list all files in the filesystem using:

```bash
fls -r -m / partition4.img > body.txt
```

* `-r` → recursive
* `-m /` → sets root directory
* Output saved to `body.txt`

***

## ⏱️ Step 3: Create Timeline

We generate a timeline of file activity:

```bash
mactime -b body.txt -d > timeline.csv
```

This gives us:

* File timestamps
* Metadata
* File paths

We inspect it:

```bash
head timeline.csv
```

This helps identify **suspicious files or activity patterns**.

***

## 🔍 Step 4: Locate Interesting File (Inode)

From the timeline or file listing, we identify a suspicious inode:

```
32716
```

***

## 📦 Step 5: Extract File Using `icat`

We extract the file content directly from the disk image:

```bash
icat partition4.img 32716
```

Output:

```
NTczNDE3aDEzcl83aDRuXzdoM18xNDU3XzU4NTI3YmIyMjIK
```

***

## 🔐 Step 6: Decode the Data

The output looks like **Base64**, so we decode it:

```bash
echo "NTczNDE3aDEzcl83aDRuXzdoM18xNDU3XzU4NTI3YmIyMjIK" | base64 -d
```

***

## 🎯 Final Output

```
picoCTF{...}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/forensics/disk/timeline1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
