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

Add support for deleted files in deleted RecycleBin directories #718

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DevJoost
Copy link
Contributor

Add support for deleted files in deleted RecycleBin directories

Also made some minor changes to variable names to make it more clear what function does what.

Resolves #638

dissect/target/plugins/os/windows/recyclebin.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/recyclebin.py Outdated Show resolved Hide resolved
@@ -125,6 +129,44 @@ def read_bin_file(self, bin_path: TargetPath) -> RecycleBinRecord:
_user=user,
)

def read_recycle_deleted_folder(self, folder_path: TargetPath) -> RecycleBinRecord:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def read_recycle_deleted_folder(self, folder_path: TargetPath) -> RecycleBinRecord:
def read_recycle_deleted_folder(self, path: TargetPath) -> RecycleBinRecord:

And rename accordingly.


user_details = self.target.user_details.find(sid=sid)
user = user_details.user if user_details else None
for parent_path, _, childs in folder_path.walk():
Copy link
Member

Choose a reason for hiding this comment

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

Maybe rglob works better for you? Then you don't have to do the nasty path construction at line 156 and 157.

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

Successfully merging this pull request may close these issues.

Iterate through all directories inside the recycle.bin folder
2 participants