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

Watch for disconnection events in DeviceRedirectionMITM #309

Merged
merged 2 commits into from
Apr 1, 2021

Conversation

xshill
Copy link
Collaborator

@xshill xshill commented Mar 31, 2021

Watch for disconnection events and make sure to close files when either the client or server disconnects.

This should help with #265.

Copy link
Member

@obilodeau obilodeau left a comment

Choose a reason for hiding this comment

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

Looks good. Just one question.

def onDisconnection(self, reason):
if not self.file.closed:
self.file.close()
Path(self.file.name).unlink(missing_ok=True)
Copy link
Member

Choose a reason for hiding this comment

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

why are we removing files on disconnection? Is it because they would be incomplete?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, if they were complete the finalize function would have been called and self.file.closed would be True.

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't we want to keep partial transfers? Maybe label them as such. Let's say we are monitoring a session where someone uploads a large zip or a VMDK. We could still extract intel from the file even if it's incomplete. Just a thought.

class FileMappingTest(unittest.TestCase):
class X224MITMTest(unittest.TestCase):
Copy link
Member

Choose a reason for hiding this comment

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

🦶 🪲 ✔️

@obilodeau obilodeau added this to the v1.1.0 milestone Mar 31, 2021
@xshill xshill merged commit 64a3ab4 into master Apr 1, 2021
@obilodeau obilodeau deleted the fix-filemapping-disconnect branch August 6, 2021 17:15
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.

None yet

2 participants