oletools is a Python package of command-line utilities for parsing Microsoft OLE2 and Office-related files. It supports malware analysis, forensics, and debugging of documents and messages.
Overview
oletools analyzes Microsoft OLE2 structured storage files, including legacy Office documents, MSI packages, and Outlook messages. The collection also covers RTF and OpenXML-based Office formats, XPS, and MSIX. It builds on the olefile parser and is aimed at security analysts who need to inspect suspicious attachments and embedded objects.
Specialized tools detect and extract VBA macros, Excel 4 (XLM) macros, DDE links, embedded OLE and Flash objects, and other indicators often seen in malicious documents. Companion utilities browse metadata, directory structures, timestamps, and low-level OLE layout. Some tools apply heuristics such as MacroRaptor for suspicious macro patterns and oleid for file traits associated with malware.
Installation is via pip, which registers commands such as olevba, mraptor, and rtfobj for use from the shell. An optional full install pulls additional dependencies for extended macro deobfuscation. The maintainers note the package is unrelated to a commercial product also named OLETools.
Many sandbox and malware-analysis platforms integrate oletools or its individual utilities. Analysts use it in pipelines to triage email attachments, document uploads, and forensic images without opening files in a full Office suite.
Key features
- VBA and XLM macro extraction
- DDE link detection
- Embedded OLE and RTF object parsing
- Malicious document heuristics
- Flash object extraction
- OLE structure and metadata viewers
- OpenXML format support
- Pip-installed CLI tools
Use cases
- Malware triage on Office attachments
- Forensic OLE structure inspection
- Macro and DDE analysis
- Sandboxes and email security pipelines
- Incident response document review