Skip to content

Updated mitm6.py to include logging capabilities#28

Open
altjx wants to merge 2 commits intodirkjanm:masterfrom
altjx:master
Open

Updated mitm6.py to include logging capabilities#28
altjx wants to merge 2 commits intodirkjanm:masterfrom
altjx:master

Conversation

@altjx
Copy link

@altjx altjx commented May 2, 2022

Added an option (-o) to allow outputting the results of mitm6 into a log file. I find this to be very useful for my scenario since tee'ing the output of mitm6 doesn't seem to actually do anything until mitm6 closes. For my use case, I need to monitor mitm6's output in realtime and terminate it depending on conditions.

@Zamanry
Copy link

Zamanry commented Jan 4, 2023

image
I had to modify line 32 to say if config.outfile is not None:. And then add line 53 area to be:

else:
    self.outfile = None

@Zamanry
Copy link

Zamanry commented Jan 4, 2023

You may consider adding a UTC timestamp by default into the outfile. I prefer %Y-%M-%DT%h:%m:%sZ (e.g., 2022-08-11T12:04:01Z) which is ISO 8601 compliant. This way if someone were to pushback on what time/date something happened, I can provide the exact timeline for them. I used to previously do the below until I realized tee doesn't work with mitm6 (but works with other tools):

(date && sudo mitm6 ...) 2>&1 | tee -a 'mitm6.txt'

@altjx
Copy link
Author

altjx commented Jun 5, 2024

You may consider adding a UTC timestamp by default into the outfile. I prefer %Y-%M-%DT%h:%m:%sZ (e.g., 2022-08-11T12:04:01Z) which is ISO 8601 compliant. This way if someone were to pushback on what time/date something happened, I can provide the exact timeline for them. I used to previously do the below until I realized tee doesn't work with mitm6 (but works with other tools):

(date && sudo mitm6 ...) 2>&1 | tee -a 'mitm6.txt'

Exactly. Thanks for this information and the change above. I've made updated my local copy as well to include this.

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.

3 participants