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 - Bug in filename extraction causing file overwrite #326

Open
malware-kitten opened this issue Jun 18, 2018 · 0 comments
Open

oleobj - Bug in filename extraction causing file overwrite #326

malware-kitten opened this issue Jun 18, 2018 · 0 comments
Assignees
Milestone

Comments

@malware-kitten
Copy link

When oleobj is run against a doc where the filenames can't be properly extracted, it's causing an output file to be overwritten.

Example run:

$ oleobj b2c07bb5ba4123dbd4ef3a3ff7d704c884fda5f59230a6d4913d1acd26e3b0b0.doc

Which produces the following output

oleobj 0.52.4 - http://decalage.info/oletools
THIS IS WORK IN PROGRESS - Check updates regularly!
Please report any issue at https://github.com/decalage2/oletools/issues

-------------------------------------------------------------------------------
File: 'b2c07bb5ba4123dbd4ef3a3ff7d704c884fda5f59230a6d4913d1acd26e3b0b0.doc'
extract file embedded in OLE object from stream 'ObjectPool/_1116929867/\x01Ole10Native':
Parsing OLE Package
Filename = "�#"
Source path = ""
Temp path = "("
saving to file b2c07bb5ba4123dbd4ef3a3ff7d704c884fda5f59230a6d4913d1acd26e3b0b0.doc___
WARNING  Wanted to read 4096, got 908
extract file embedded in OLE object from stream 'ObjectPool/_1130848458/\x01Ole10Native':
Parsing OLE Package
Filename = "�¾"
Source path = ""
Temp path = "("
saving to file b2c07bb5ba4123dbd4ef3a3ff7d704c884fda5f59230a6d4913d1acd26e3b0b0.doc___
WARNING  Wanted to read 4096, got 3596

And checking the contents of the directory after running oleobj

$ ls -l
total 152
-rw-r--r-- 1 user admin 104448 Jun 14 18:57 b2c07bb5ba4123dbd4ef3a3ff7d704c884fda5f59230a6d4913d1acd26e3b0b0.doc
-rw-r--r-- 1 user admin  48652 Jun 18  2018 b2c07bb5ba4123dbd4ef3a3ff7d704c884fda5f59230a6d4913d1acd26e3b0b0.doc___

Only the original sample and a single output file are displayed, where there should be 2 output files.

Just a suggestion, but if no filename could be found or no printable characters are found after sanitizing the filename just use the hash of the stream as an ID?

Unfortunately this is not in a shareable sample, but I hope this issue is enough to help tighten down on the bug.

@decalage2 decalage2 self-assigned this Jun 18, 2018
@decalage2 decalage2 added this to the oletools 0.54 milestone Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants