Skip to content
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

Not detecting windows when applying tar loader #970

Open
AlonHaviv1 opened this issue Dec 9, 2024 · 2 comments
Open

Not detecting windows when applying tar loader #970

AlonHaviv1 opened this issue Dec 9, 2024 · 2 comments

Comments

@AlonHaviv1
Copy link

I've encountered an issue where windows OS plugin wouldn't load when loading from tar.
Following my investigation I have found the issue is resulting of confusion between the loader and windows os plugin:

def detect(cls, target: Target) -> Filesystem | None:
for fs in target.filesystems:
if fs.exists("/windows/system32") or fs.exists("/winnt"):
return fs

The windows here is lower case, contrasting the real folder name, which is Windows.

In tar loader, when the tar is not from acquire the filesystem will load with case_sensitive=True flag:

if not member.name.startswith(("/fs/", "fs/", "/sysvol/", "sysvol/")):
# Not an acquire tar
if "/" not in volumes:
vol = filesystem.VirtualFilesystem(case_sensitive=True)
vol.tar = self.tar
volumes["/"] = vol
target.filesystems.add(vol)

Therefore, there is a contradiction between those.

I would love to open a PR to fix that, but I'm not sure if any change will break other loaders that rely on that condition.

@Miauwkeru
Copy link
Contributor

Hello @AlonHaviv1 thanks for bringing this issue to us.
I have looked into it, and think that changing the default to case_sensitive=False inside the tar loader wouldn't be the best solution as it would also impact those tar files that need to be case sensitive. E.g. information that was on a unix like filesystem.
The reason we use lower case for most windows systems, is because their filesystems are usually case insensitive.
I couldn't quickly identify another workaround within the dissect tooling, so this will be taken up when time allows.

You could however untar it, move everything under a fs/sysvol directory and tar it again. If you do that, the target-* tooling should pick it up.

If you have another suggestion or question please feel free to share.

@AlonHaviv1
Copy link
Author

AlonHaviv1 commented Dec 11, 2024

Could you give an example where changing the detection of windows to "Windows" would break loaders?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants