Skip to content

Switch getUnixTimestamp to cross platform code #2014

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dfte
Copy link
Contributor

@Dfte Dfte commented Aug 1, 2025

This PR switches the following line of code from the getUnixTime function:

return datetime.fromtimestamp(getUnixTime(int(str(self.fields[key]))))

To a cross platform independant oneliner:

return datetime(1601, 1, 1) + timedelta(microseconds=int(str(self.fields[key])) // 10)

It was mentionned as an issue on NetExec for people using it on Windows, which would be the same for people using Impacket on Windows:

Pennyw0rth/NetExec#827

And it mitigates it:

image

@gabrielg5 gabrielg5 self-assigned this Aug 7, 2025
@gabrielg5 gabrielg5 added the in review This issue or pull request is being analyzed label Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in review This issue or pull request is being analyzed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants