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

Oleobj preserve file extension #451

Merged

Conversation

christian-intra2net
Copy link
Contributor

Encountered malware samples where "Filename" of an embedded file was " " (just a space), but "Source Path" and "Temp Path" contained a proper filename. Seems to be enough for windows to recognize the file type. So extract file name (in particular: the file extension) from paths if "Filename" is not helpful.

Realized that lots of things can go wrong creating filenames: collisions with other files, extremely long names, different path separators ("/" vs ""). Address these issues, too.

@christian-intra2net
Copy link
Contributor Author

Rebased onto current master

@christian-intra2net
Copy link
Contributor Author

Rebased to keep up-to-date.

@christian-intra2net
Copy link
Contributor Author

Rebased onto current master

Sofar we have only looked at the `filename` attribute but in malware
samples the path has been empty and windows used src_path or tmp_path
to determine dumped file type.

Look at all 3 filenames/paths, try to preserve suffix but still limit
length of resulting file name. Deal with multiple objects of same
resulting filename by offering random file names
@christian-intra2net
Copy link
Contributor Author

Rebased onto current master. Added the unittest fix commit from #761 so I can run branch unittests

@decalage2 decalage2 merged commit cb41b34 into decalage2:master May 9, 2022
@decalage2 decalage2 modified the milestones: oletools 0.55, oletools 0.60 May 9, 2022
@decalage2 decalage2 self-assigned this May 9, 2022
@christian-intra2net christian-intra2net deleted the oleobj-preserve-suffix branch May 25, 2022 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants