Skip to main content
skill CX Codex

disk-forensics — Claude Code skill: analyze disk images

A skill for working through disk images, file systems and memory captures: deleted file recovery, timeline building, artifact hunting. Built for investigations and CTF work.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add briiirussell/cybersecurity-skills --skill disk-forensics -a claude-code
Open on GitHub

What disk-forensics does

The skill gives the agent a fixed order of operations. First image format and hash verification, then partition layout, then a read-only mount and a survey of the file system. Sleuth Kit does the heavy lifting: fsstat, fls, icat list files and pull them out by inode. Deleted entries show up with an asterisk, so recovery follows inodes instead of guesswork.

Unallocated space goes to foremost or scalpel, which carve files by header signatures. Hidden data gets its own pass: NTFS alternate data streams, HFS+ resource forks, and image checks with exiftool, binwalk and steghide. Artifacts come from browser history, system logs, Windows registry hives, prefetch files and the $UsnJrnl change journal. Timestamps are merged into one timeline with mactime, and bulk_extractor pulls emails, URLs and card numbers out of the raw image.

Before anything runs, the skill asks you to confirm a lawful basis: a scoped internal investigation, court-ordered work, a signed IR engagement, your own machine, or a CTF lab. If that is unclear, the agent asks first. It works on copies, mounts read-only and leaves source timestamps alone, so decide up front where the original lives and who holds it. There are cross-references to incident-triage for the bit-for-bit capture and to breach-patterns for turning findings into controls.

What it helps with

  • recover deleted files by inode from an image
  • merge file timestamps and logs into one timeline
  • carve files out of unallocated space by signature
  • check an image for steganography and metadata
  • trace USB device history and prefetch execution records

Example prompts for the agent

  • work through evidence.dd: verify the hash, show the partition layout and list deleted files
  • build a timeline from this image and flag timestamps that predate the OS install
  • run bulk_extractor over the image and collect every email address and URL it finds

How to install disk-forensics

1Skills CLI (Vercel)

npx skills add briiirussell/cybersecurity-skills --skill disk-forensics -a claude-code

2Manually: put the files in place

~/.claude/skills/disk-forensics/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/disk-forensics/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about disk-forensics

How do I install disk-forensics in Claude?

Run npx skills add briiirussell/cybersecurity-skills --skill disk-forensics -a claude-code. The skill file lands at ~/.claude/skills/disk-forensics/SKILL.md.

What does disk-forensics do?

It walks the agent through forensic steps: image identification and hash check, partition layout, read-only mounting, file system analysis with Sleuth Kit, deleted file recovery, artifact collection and timeline construction.

What is required before the analysis starts?

A confirmed lawful basis for handling the image: a scoped internal investigation, court-ordered work, a signed IR engagement, your own system, or a CTF. If that is unclear, the skill asks before running commands.

Source text

SKILL.md · MIT
---
name: disk-forensics
description: "Analyze disk images, file systems, and memory captures for digital evidence recovery in forensic investigations and CTF challenges. Use when the user mentions 'disk forensics,' 'forensic analysis,' 'disk image,' 'file carving,' 'deleted files,' 'evidence recovery,' 'timeline analysis,' 'memory forensics,' 'volatility,' 'autopsy,' 'sleuthkit,' 'plaso,' 'log2timeline,' 'artifact analysis,' 'chain of custody,' or needs to examine a forensic image."
allowed-tools: Bash, Read, Write, Grep, Glob
---

# Disk Forensics — Digital Evidence Analysis

Analyze disk images and file systems to recover evidence, reconstruct timelines, and identify artifacts.

Cross-references: `incident-triage` for the upstream containment phase that captures the image this skill analyzes — that skill makes the bit-for-bit copy; this skill analyzes it. `breach-patterns` for translating the forensic findings into preemptive controls so the same root cause doesn't recur.

## Authorization Check

Before analyzing any image, confirm:
1. **Lawful basis** — the user has authorization for this analysis (internal investigation with documented scope, court-ordered work, signed IR engagement, your own system, CTF / lab environment)
2. **Chain of custody is preserved** — the image and its hashes were captured in a way that survives evidentiary scrutiny, OR the scope is explicitly non-evidentiary (CTF, internal triage where chain-of-custody is not the goal)
3. **Privacy scope** — the analysis stays within what was authorized; personal data outside the scope is not pulled, analyzed, or reported

If lawful basis is unclear, ask before proceeding. Never analyze an image you cannot confirm the user is authorized to possess.

## Evidence Handling Principles

- Always work on copies, never originals
- Verify image integrity with hash comparison before analysis
- Mount everything read-only
- Document every command and finding
- Preserve timestamps — never modify source evidence

## Methodology

### Step 1: Image Identification and Integrity

Identify the image format and verify integrity:

```bash
file <image>                    # Identify format (E01, dd/raw, VMDK, VHD)
sha256sum <image>               # Compare to provided hash
```

For E01 images, use `ewfinfo` to extract metadata.

### Step 2: Partition Layout

Examine the partition structure:

```bash
fdisk -l <image>                # Partition table
mmls <image>                    # Sleuth Kit partition layout
```

Calculate mount offsets: `sector_start × sector_size`

### Step 3: Mount and Explore

Mount read-only and survey the file system:

```bash
mount -o ro,loop,offset=<bytes> <image> /mnt/evidence
ls -laR /mnt/evidence
```

For encrypted volumes, identify the encryption type and request the key/passphrase.

### Step 4: File System Analysis (Sleuth Kit)

```bash
fsstat -o <offset> <image>              # File system details
fls -r -o <offset> <image>             # Full file listing (deleted files marked with *)
icat -o <offset> <image> <inode>       # Extract specific file by inode
```

### Step 5: Artifact Recovery

**Deleted files:** Use `fls` to find (marked with `*`), `icat` to extract by inode.

**File carving:** Run `foremost` or `scalpel` on unallocated space to recover files by header signatures.

**Hidden data:**
- NTFS alternate data streams
- HFS+ resource forks
- Check image files for steganography: `exiftool`, `binwalk`, `steghide`

**System artifacts:**
- Browser history: `~/.mozilla`, `~/Library/Safari`, `AppData\Local\Google`
- System logs: `/var/log/*`, Windows Event Logs
- Registry hives (Windows): SAM, SYSTEM, SOFTWARE, NTUSER.DAT
- Recently accessed files, USB device history, prefetch files

### Step 6: Metadata and Timestamps

```bash
exiftool <file>                 # EXIF, XMP, IPTC metadata
stat <file>                     # MAC times (Modified, Accessed, Changed)
```

For NTFS: examine `$MFT` timestamps and `$UsnJrnl` for change journal entries.

Use `mactime` (Sleuth Kit) to generate a unified timeline from body files.

### Step 7: Keyword Search

```bash
strings <image> | grep -i <keyword>    # Raw string search across image
```

Use `bulk_extractor` for automated extraction of emails, URLs, credit card numbers, and other structured data.

### Step 8: Timeline Construction

Collect all timestamps into a unified timeline. Cross-reference file events with log entries. Flag anomalies:
- Timestamps before the OS install date
- Future-dated files
- Gaps in otherwise continuous log sequences
- Timestamps inconsistent with timezone settings

## Output Format

```markdown
# Forensic Analysis Report
## Case: [identifier]
## Image: [filename] — SHA256: [hash]
## Date of Analysis: [date]

### Image Integrity
- Hash verified: [yes/no]
- Algorithm: [SHA256]

### Partition Layout
| # | Type | Start | Size | File System |
|---|------|-------|------|-------------|

### Key Findings
#### Finding 1: [Title]
- **Evidence:** [file path or artifact]
- **Content:** [description]
- **Timestamp:** [UTC]
- **Significance:** [why this matters]

### Recovered Files
| File | Source | Recovery Method | SHA256 | Significance |
|------|--------|-----------------|--------|-------------|

### Timeline
| Timestamp (UTC) | Event | Source | Notes |
|-----------------|-------|--------|-------|

### Conclusions
[Summary of findings and their implications]
```

## Boundaries

- Work only on provided images and files
- Maintain read-only access at all times
- Document chain of custody for real investigations
- For CTF challenges, focus on finding flags and solving the challenge
- Never modify evidence or suggest evidence tampering
- Refuse requests involving unauthorized device access

## References

- NIST SP 800-86: Guide to Integrating Forensic Techniques
- The Sleuth Kit documentation
- SANS Digital Forensics cheat sheets

© briiirussell · MIT · briiirussell/cybersecurity-skills

Similar skills

Everything for Security →

From the same set25

osint-recon Gathers and correlates public intelligence across domains, organizations, and metadata. Helps map attack surfaces and document open-source findings. CX Codex +1 386installs prompt-injection This skill audits apps with AI features for prompt injection, permission bypass and system prompt leaks. Useful once an LLM or agent lands in your codebase. CX Codex +1 372installs incident-triage Guides rapid security incident triage and containment using the NIST SP 800-61 methodology. Useful when handling breaches, malware, or suspicious activity. CX Codex +1 361installs finding-triage Evaluates a single security finding from a scanner or audit to establish reachability, contextual severity, and a ticket-ready disposition. CX Codex +1 360installs privacy-engineering A skill that helps your AI agent implement and audit privacy controls in code and infrastructure: GDPR, CCPA/CPRA, LGPD, PIPEDA. CX Codex +1 352installs crypto-audit Reviews how cryptography is implemented in your code: cipher modes, KDF parameters, IV and nonce handling, signature checks. Useful when the code looks right but still leaks. CX Codex +1 353installs iam-audit Audits cloud and IdP access policies, designs greenfield RBAC models, and plans identity migrations. Useful when untangling privilege creep or moving to SSO. CX Codex +1 351installs cloud-audit This skill checks AWS, GCP and Azure configurations for misconfigurations, excessive permissions and public exposure. Useful before a release or after an incident. CX Codex +1 352installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor