Repository navigation
Walk an acquisition's filesystems, and carve only what a walk cannot reach - #47
Merged
Merged
Conversation
An E01 of a computer holds filesystems, so its files have names, paths and dates of their own. GLEAPP carved it instead, which threw all of that away and returned offsets. Measured on a 238.5 GiB Windows acquisition, walking found 44,884 media files with paths and timestamps in 11 seconds. Carving the same image took about 40 minutes to return 384,386 hits with no names, and splitting those against every allocated extent on the volume: 7.7% sat inside a media file the walk already had, 90.2% inside another live file (icons in DLLs, browser caches), and 2.1% in space no file claimed. That last 2.1% is what carving is uniquely for, so carving stays, as a pass that is asked for rather than the way an image is read. qnxprobe 1.18 is vendored beside ewfprobe and mediacarve for the reading. Volumes are found through its GPT and MBR parsers and its identify_fs, and each is walked with its media registered under <volume>/<path>. A volume the reader cannot open is recorded in the case meta and the others still register. A walked row records the volume and the walker's node, not a byte offset, because a walked file can be fragmented across extents, can be compressed, and on NTFS can be resident with its bytes inside its own MFT record and no extent at all. The node is stored as JSON because it is not always a number: an MFT record and an APFS object id are, and a FAT directory entry is (cluster, size, is_dir). An origin column says whether a row was walked or carved, so a report can state it rather than infer it from a name. Nothing false is recorded for a filesystem whose dates this reader does not read. FAT keeps a local time with no zone, and reading one as though it were UTC would place every file wrong by the offset, so the column is left empty rather than filled with 1970. Validated against real acquisitions: 46,386 rows in 27 seconds from the Windows image, 14,108 from a Big Sur image including its sealed system volume, and 0 from an ADS test image that holds 26 files and no media. 40 files pulled back through the case were byte-identical to an independent read of the same image. Co-Authored-By: Claude Opus 5 <[email protected]>
Walking an acquisition reports the files its filesystems still list. Carving reads the disk itself, so it also reaches what was deleted, and that is the reason to run it. Which of those an examiner wants is their call, and it can be made after the fact rather than only at ingest. `gleapp source carve <name>` scans an image source that has already been ingested and adds what it finds, marked as carved. The pipeline runs over just the new rows, because process() already takes a where clause. Two limits are stated rather than implied, because the counts are large enough to matter. It scans the whole disk, not only the space no file claims, so on a used drive most of what it returns is resources embedded inside live files: 384,386 hits on a 238.5 GiB acquisition, of which 8,154 lay in unclaimed space. Scoping that needs a volume's free space, which the reader cannot report yet. And a hit is skipped only when the same source was already carved at that offset, so re-running adds nothing; a hit whose bytes are also a walked file is still added, because a walked row records a node and not an offset and the two cannot be compared directly. Those pairs share a sha256, so the case grades them as the exact duplicates they are. Co-Authored-By: Claude Opus 5 <[email protected]>
A signature found inside an allocated run belongs to a file the directory tree already names. Only the space a volume reports free can hold something a walk cannot reach, so `source carve --unallocated-only` reads that and nothing else. Measured on a 238.5 GiB Windows acquisition: 149.0 GiB scanned instead of 238.5, 8.3 minutes instead of about 40, and 7,233 hits instead of 384,386. What it drops is the 90.2% that were resources embedded inside live files. A volume that cannot report its free space drops the scope for the whole image rather than being skipped. Reading part of a disk while reporting the carve as finished is worse than reading all of it, and only NTFS can answer so far, so the fallback is the common case rather than a corner. When the scope is used, the case meta records how many runs and how many bytes were scanned, so a report can say what was covered. The test for that fallback needs TWO volumes, one that answers and one that does not: with a single volume, skipping the quiet one and dropping the scope produce the same empty answer, so the control passed against a deliberately broken build until the fixture grew a second volume. Co-Authored-By: Claude Opus 5 <[email protected]>
The rules described walking an acquisition but stopped at "scoping a carve to unallocated space needs free-space reporting the reader does not have", which is no longer where this stands. Records what `source carve` and `--unallocated-only` do and what they cost, that a volume unable to report its free space drops the scope for the whole image rather than being skipped, and that the copy vendored here cannot report it yet, so the fallback is what happens today rather than a corner case. Also records why the test for that needs two volumes. Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An E01 of a computer holds filesystems, so its files have names, paths and dates of their own. GLEAPP carved it instead, which threw all of that away and returned offsets.
Measured on a 238.5 GiB Windows acquisition:
Splitting the whole-disk carve against every allocated extent: 7.7% sat inside a media file the walk already had, 90.2% inside another live file (icons in DLLs, browser caches), 2.1% in space no file claimed. So walking is how an image is read, and carving is for the part a walk cannot reach.
Three ways to ask:
"carve": trueat ingest, orgleapp source carve <name>afterwards on a source already ingested, so the choice can be made once the case is open--unallocated-onlyto read only the space a volume reports freeSafety choices worth naming:
(cluster, size, is_dir).originsays whether a row was walked or carved.Validated on real acquisitions: 46,386 rows in 27 s from the Windows image, 14,108 from a Big Sur image including its sealed system volume, 0 from an ADS test image holding 26 files and no media. 40 files read back through the case were byte-identical to an independent read.
Tests build a FAT32 volume and wrap it in an E01. Controls: removing the walk turns 7 of 8 red; making a quiet volume skip instead of dropping the scope turns the two-volume test red. That last fixture needs two volumes, because with one the two behaviours produce the same empty answer and the control passed against a build I had deliberately broken.
Needs qnxprobe #27 re-vendored for
--unallocated-onlyto do anything; until then it falls back to the whole image, which the tests cover.🤖 Generated with Claude Code