decalage2 / oletools

oletools - python tools to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents, for malware analysis, forensics and debugging.
http://www.decalage.info/python/oletools
Other
2.9k stars 563 forks source link

olevba: Excel Macros (.xls & .xlsm) falsely flag as containing Hex Strings & Suspicious Keywords #502

Open CanIPhish opened 4 years ago

CanIPhish commented 4 years ago

Affected tool: olevba

Describe the bug olevba flags excel macro-enabled documents (.xls & .xlsm) as containing suspicious hex strings and suspicious keywords on any document scanned - using olevba 0.55.dev3 or 0.54.2 on Python 3.7.4

How To Reproduce the bug

  1. Create an excel macro with nothing other than the below function: Private Sub Workbook_Open() MsgBox "This is fun" End Sub

  2. Run olevba '--decode' shows the Hex Strings being flagged, '--triage' shows Hex Strings and Suspicious Keywords being flagged olevba --decode olevba --triage

Console output / Screenshots image

image

Version information:

SREEKANTHS1991 commented 4 years ago

olevba error

1, While running olevba.py script getting above error and using updated oletools version , is the fix available ?

or any way to fix this issue ?

decalage2 commented 4 years ago

Hi, the hex strings detection is not perfect and it can often trigger false positives when there are large numbers somewhere in the code. Quite often, this is due to numbers that appear in the VBA attributes at the beginning of a macro, and those attributes are hidden by default. Please run this command to confirm if this is the case: olevba --attr --decode <your file>

SREEKANTHS1991 commented 4 years ago

--attr --decode

Thanks for your reply , as I have created simple macro enabled file and output below as requested.

olevba error 1

recreator66 commented 11 months ago

Any update on this issue @decalage2?

I am receiving the same output. In addition, the Base64 decoding incorrectly shows the sheet name as suspicious.

image

Version information: OS: Ubuntu OS Version: 22.04.3 LTS Python version: 3.10.12 oletools version: 0.60.1