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.
npx skills add briiirussell/cybersecurity-skills --skill disk-forensics -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/disk-forensics/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/disk-forensics/
1Skills CLI (Vercel)
npx skills add briiirussell/cybersecurity-skills --skill disk-forensics -a codex2Manually: put the files in place
.agents/skills/disk-forensics/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add briiirussell/cybersecurity-skills --skill disk-forensics -a cursor2Manually: put the files in place
.cursor/skills/disk-forensics/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install briiirussell/cybersecurity-skills disk-forensics2Manually: put the files in place
.github/skills/disk-forensics/SKILL.md1Skills CLI (Vercel)
npx skills add briiirussell/cybersecurity-skills --skill disk-forensics -a gemini-cli2Platform CLI
gemini skills install https://github.com/briiirussell/cybersecurity-skills --path skills/disk-forensicsManually: put the files in place
.devin/skills/disk-forensics/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add briiirussell/cybersecurity-skills --skill disk-forensics -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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