-
Notifications
You must be signed in to change notification settings - Fork 51
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
Plugin for teamviewer incoming connections #701
base: main
Are you sure you want to change the base?
Conversation
@R3dP1ll thank you for your contribution! As this is your first code contribution, please read the following Contributor License Agreement (CLA). If you agree with the CLA, please reply with the following information:
Contributor License Agreement
Contribution License AgreementThis Contribution License Agreement ("Agreement") governs your Contribution(s) (as defined below) and conveys certain license rights to Fox-IT B.V. ("Fox-IT") for your Contribution(s) to Fox-IT"s open source Dissect project. This Agreement covers any and all Contributions that you ("You" or "Your"), now or in the future, Submit (as defined below) to this project. This Agreement is between Fox-IT B.V. and You and takes effect when you click an “I Accept” button, check box presented with these terms, otherwise accept these terms or, if earlier, when You Submit a Contribution.
|
@DissectBot agree [company="default"] |
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.
Can you also run the linter with tox -e fix
?
("string", "tv_user_host"), | ||
("string", "tv_user_host"), | ||
("datetime", "start_time"), | ||
#("string","host"), |
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.
Can this be removed?
@@ -11,7 +12,23 @@ | |||
("string", "description"), | |||
], | |||
) | |||
|
|||
RemoteAccessIncomingConnectionRecord = TargetRecordDescriptor( |
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.
This seems pretty specific to TeamViewer right now, so perhaps just place this in teamviewer.py
and call it TeamViewerIncomingConnectionRecord
.
Could you also put the start_time
and end_time
at the top?
@@ -1,11 +1,12 @@ | |||
import re | |||
from datetime import datetime | |||
|
|||
#import datetime |
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.
#import datetime |
|
||
def __init__(self, target): | ||
super().__init__(target) | ||
|
||
self.logfiles = [] | ||
|
||
self.incoming_logfiles = [] |
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.
self.incoming_logfiles = [] | |
self.incoming_logfiles = [] | |
# Check service globs | ||
user = None | ||
for log_glob in self.GLOBS: | ||
for logfile in self.target.fs.glob(log_glob): | ||
self.logfiles.append([logfile, user]) | ||
|
||
for log_glob in self.INCOMING_GLOBS: | ||
|
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.
|
||
logfile = self.target.fs.path(logfile) | ||
|
||
with logfile.open("rt",encoding='latin-1') as file: |
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.
with logfile.open("rt",encoding='latin-1') as file: | |
with logfile.open("rt") as file: |
Does this not work?
while True: | ||
try: | ||
line = file.readline() | ||
|
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.
|
||
# End of file, quit while loop | ||
if not line: | ||
|
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.
fields = line.split('\t') | ||
if len(fields) < 7: | ||
print("Line does not contain enough fields:", line) | ||
continue |
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.
continue | |
continue | |
|
||
fields = line.split('\t') | ||
if len(fields) < 7: | ||
print("Line does not contain enough fields:", line) |
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.
print("Line does not contain enough fields:", line) | |
self.target.log.debug("Line does not contain enough fields: %s", line) |
No description provided.