-
Notifications
You must be signed in to change notification settings - Fork 38
Fix collection of $Secure:$SII
#280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@Miauwkeru what is the correct way of doing this? This is the output of a tar archive. |
Miauwkeru
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One additional question, is $Secure:$SII inside the $MFT file itself and not on disk? Because if it is on disk, the method of getting $Secure:$SII will fail for those fs where mountpoint is None. E.g. unmounted ntfs filesystems
|
|
||
| sii_fh = fs.ntfs.mft.get("$Secure").index("$SII")._index_stream | ||
|
|
||
| collector.output.write(fsutil.join(main_mountpoint, "$Secure:$SII"), sii_fh) |
There was a problem hiding this comment.
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.
| "$LogFile", | ||
| ] | ||
|
|
||
| sii_fh = fs.ntfs.mft.get("$Secure").index("$SII")._index_stream |
There was a problem hiding this comment.
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.
No description provided.