oletools - python tools to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents, for malware analysis, forensics and debugging.
For the record, the snippet of code above won't be flagged by olevba as malicious, but does manage to import a VBA module even if "trust access to the vba project object model" is disabled!
I recently found this question on Stack Overflow, it shows how to import a new code module in VBA using the
Modules
object.Here's a simplified snippet that illustrates how it works:
I always thought you had to use
VBComponents.Import
, but turns out there is this undocumented method as well.