Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion acquire/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,14 @@ def _run(cls, target: Target, cli_args: argparse.Namespace, collector: Collector
filenames = [
"$MFT",
"$Boot",
"$Secure:$SII",
"$Secure:$SDS",
"$LogFile",
]

sii_fh = fs.ntfs.mft.get("$Secure").index("$SII")._index_stream
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing it like this, wouldn't the following work too?

sii_fh = fs.ntfs.mft.get("$Secure").open("$SII", attr_type=...)

Requires less knowledge about the internals of the internal ntfs structure.


collector.output.write(fsutil.join(main_mountpoint, "$Secure:$SII"), sii_fh)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be better to use collector.write_bytes assuming the stream isn't that large. Otherwise, maybe add a collector.write that writes the file header to it. E.g. something like this:

class Collector:
    ...
    def write(self, destination_path: str, fh: BinaryIO) -> None:
        self.output.write(destination_path, fh)
        self.report.add_file_collected(self.bound_module_name, destination_path)

Then we can at least keep track that the file was collected. Besides that, the destination path would need to be joined with collector.base to be placed in /fs/ properly.


for filename in filenames:
if main_mountpoint is not None:
path = fsutil.join(main_mountpoint, filename)
Expand Down