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

last check in calculation method issues #435

Open
xspeed1989 opened this issue Dec 17, 2024 · 10 comments
Open

last check in calculation method issues #435

xspeed1989 opened this issue Dec 17, 2024 · 10 comments

Comments

@xspeed1989
Copy link

My mythic server is run at a vm machine, The difference between the virtual machine and the physical machine is 20 seconds.
The last checkin value on the web UI is the actual value plus 20 seconds. I think the last checkin should be calculated uniformly using server time.

@its-a-feature
Copy link
Owner

I just made a new tagged version of Mythic, if you could update to that one and give it a try.

In general, having the server calculate the offset for every callback for every user is too much of a burden on the server, and in order for that to realistically be pushed to all the operator's interfaces, it would have to be written to disk each time an agent checked in.

Instead, with this update, what I did was have the server send its current UTC time when you log in from a browser or fresh your session. Then, in your browser, you can locally see the offset between your current UTC time and the server's UTC time then just add/subtract that offset.

@xspeed1989
Copy link
Author

xspeed1989 commented Dec 18, 2024

I just made a new tagged version of Mythic, if you could update to that one and give it a try.

In general, having the server calculate the offset for every callback for every user is too much of a burden on the server, and in order for that to realistically be pushed to all the operator's interfaces, it would have to be written to disk each time an agent checked in.

Instead, with this update, what I did was have the server send its current UTC time when you log in from a browser or fresh your session. Then, in your browser, you can locally see the offset between your current UTC time and the server's UTC time then just add/subtract that offset.

@its-a-feature

I set the host time to be 2 minutes faster than the guest and then tested

Due to the time difference, the information on the WEBUI will not be refreshed in time, such as callback lists and issued tasks. These problems exist before and after the update.
In addition, if I pause the agent, the last checkin still displays a few seconds.

@its-a-feature
Copy link
Owner

ahh, I was thinking this was just in the callback last checkin time, but I see the extent of what you're talking about now. I have a few spots where I stream data from the server, but I only stream new data. That "newness" is via timestamp from the browser's current UTC time, which, in your case, is going to be skewed, so you won't see that "newness" ever or not for a long time.

I think this same principal applies, I just need to apply to those places as well. I'll keep that in mind for the next version.

@xspeed1989
Copy link
Author

ahh, I was thinking this was just in the callback last checkin time, but I see the extent of what you're talking about now. I have a few spots where I stream data from the server, but I only stream new data. That "newness" is via timestamp from the browser's current UTC time, which, in your case, is going to be skewed, so you won't see that "newness" ever or not for a long time.

I think this same principal applies, I just need to apply to those places as well. I'll keep that in mind for the next version.

I will test it next version,thanks to your job for this case

@its-a-feature
Copy link
Owner

I just pushed a new release, if you can pull it down and see if your time skew issues are resolved? You'll have to log out and log back in, but then the current time skew from the server should be calculated for you locally and applied to all the things within the UI

@xspeed1989
Copy link
Author

image
I keep getting this prompt, but I don’t know if it’s caused by the modification time.
@its-a-feature

@xspeed1989
Copy link
Author

image I keep getting this prompt, but I don’t know if it’s caused by the modification time. @its-a-feature

I have confirmed that this is caused by the time difference

@its-a-feature
Copy link
Owner

When you say you keep getting it, what do you mean? It doesn't go away ever? Every notification is duplicated? Or?

@xspeed1989
Copy link
Author

xspeed1989 commented Dec 25, 2024

it will appear again after disappearing

@xspeed1989
Copy link
Author

xspeed1989 commented Dec 27, 2024

browser time is 2 minutes faster than the server

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