-
Notifications
You must be signed in to change notification settings - Fork 567
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
UnexpectedDataError: Unexpected value in Macros/VBA/dir for variable PROJECTDOCSTRING_Id #593
Comments
I see the same issue with several Malware files using the release version |
Your malware sample does not follow the specification. :-) BUT, there is a issue with this command line option, see issue #596 "command line option --relaxed not working" (and PR #595 "fixed command line option --relaxed") |
A similar issue has been reported with recent Emotet samples: |
Following is an issue with release version of File "olevba.py", line 3735, in detect_vba_stomping Would be great if a patch fix can be organised on 0.55 |
@ghanashyams this is a different issue, see #455. I'll try to fix both soon. |
I can confirm that this is actively being abused by malware senders at an alarming rate now. I run a spam filtering business and I see thousands of these each day. |
I made an workaround to avoid this issue and scan ok in my environment. As @gvdijnsen said, yes malware authors are really abusing this loophole. |
I am looking for a fix for this issue, but it's not straightforward. In the meantime, I enabled the option "relaxed" by default, which prevents the issue from being triggered. So please use the latest dev version from github if possible. |
I finally found the bug and fixed it: see #455 (comment) |
@decalage2 Instead of decoding using codepage 1252, how about finding the encoding of vba_code_bytes using chardet package and then decoding using correct encoding. chardet has very probability of finding the encoding. import chardet |
@ghanashyams I also thought about using chardet, but I'm hesitant to add yet another dependency, just for this corner case. I need to test it with several samples that trigger the bug and do not use code page 1252 (which is rare). |
@decalage2 Pl. see following stack and if this can be fixed too, sample 0078fae36152dda270609a143aa492798288c232c43f9331dfea29251569cdfe is available in VT.
|
@ghanashyams if this error is triggered with the latest dev version from github, then it's a different bug. Please open a separate issue, and attach the sample in a zip with password (I do not have VT access). Thanks! 👍 |
@decalage2 Yes error is triggered with latest dev version. I have created a separate issue, #619 |
…ge2#593), fixed detect_vba_macros to always return VBA code as unicode on Python 3 (issues decalage2#455, decalage2#477, decalage2#587, decalage2#593)
This issue is now fixed in oletools 0.56. |
Affected tool:
olevba
Describe the bug
UnexpectedDataError: Unexpected value in Macros/VBA/dir for variable PROJECTDOCSTRING_Id: expected 0005 but found 0051!
File/Malware sample to reproduce the bug
https://drive.google.com/file/d/1w3un-p-yPyqFYx30oInHVOo4su-kIJhr/view
password: oletools
How To Reproduce the bug
Run olevba 0.56dev6 on Python 3.8.2
Console output / Screenshots
Version information:
Additional context
might be related to #477
The text was updated successfully, but these errors were encountered: