oletools
Python tools to analyze security characteristics of MS Office and OLE files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), for Malware Analysis and Incident Response #DFIR
What it is and what it does
oletools is a forensic and malware analysis toolkit for inspecting Microsoft Office and OLE-based file formats. It provides command-line utilities (oleid, olevba, oleobj, rtfobj, msodde, pyxswf, olemeta, oletimes, oledir, olemap) and a Python API for programmatic access. The package specializes in detecting and extracting VBA macros, Excel 4 macros (XLM), DDE links, embedded Flash objects, and other potentially malicious content from Office documents and RTF files.
The toolkit depends on olefile for OLE2 parsing and includes optional integrations with pcodedmp and msoffcrypto-tool. It is widely used by security platforms and malware analysis services. Development is mature but infrequent; the last release (v0.60.2 on 2024-07-02) addressed Python 3.12 compatibility and parsing edge cases.
Use it for:
- Extract and analyze VBA macros from suspicious Office documents during incident response
- Detect DDE/DDEAUTO links and embedded Flash objects that may deliver malware
- Identify structural anomalies and risk indicators in OLE files using oleid
- Automate forensic analysis of Office metadata and timestamps in bulk processing
- Integrate macro detection into email security gateways or document sandboxes
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
oletools is a suite of Python tools to extract, analyze, and detect malicious content in Microsoft OLE2 files (Office 97-2003, MSI, Outlook) and OpenXML documents (Office 2007+, XPS, MSIX), focusing on VBA macros, embedded objects, DDE links, and Flash.
Yes, if you need to analyze Office documents for malware indicators or forensic investigation. The toolkit is mature, widely deployed in security platforms, and has no known vulnerabilities. The aging maintenance status (773 days since last release) is a minor concern for new features but does not affect core functionality. Install friction is low and the BSD license poses no restrictions.
Install
oletools on PyPI
pip
pip install oletoolsuv
uv add oletoolspoetry
poetry add oletoolsInstalling oletools
Before you install
Low install friction with a pure-Python wheel distribution. Maintenance status is aging—last release was 773 days ago (v0.60.2 on 2024-07-02)—but the repository remains active with a recent commit on 2026-02-14 and 3392 stars.
License in practice
BSD permissive license allows commercial and private use with minimal restrictions, suitable for integration into security tools and forensic workflows.
Quickstart
pip install oletools
from oletools.olevba import VBA_Parser
vba = VBA_Parser('document.docm')
for (filename, stream_path, vba_filename, vba_code) in vba.extract_macros():
print(vba_code)
Verify before relying
- Whether optional dependencies (XLMMacroDeobfuscator, xlrd2, pyxlsb2) are required for full macro analysis or are truly optional
- Current state of Python 2.7 support given classifiers list it but v0.60.2 fixed Python 3.12 compatibility
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — pyparsing, olefile, easygui, colorclass, pcodedmp, msoffcrypto-tool |
| Maintenance | aging — 773 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,684,690/month — #1,708 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oletools-0.60.2-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
msoffcrypto-toolDecrypts and encrypts Microsoft Office files…
permissive · top 5,000 on PyPI
olefileolefile parses, reads, and writes Microsoft…
permissive · top 1,000 on PyPI
pcodedmpDisassembles VBA p-code from Microsoft Office…
copyleft · top 5,000 on PyPI
pdfidAnalyzes PDF files to identify potentially…
permissive · top 15,000 on PyPI
maco-extractorMaco is a framework for standardizing malware…
permissive · top 15,000 on PyPI
compoundfilesReads and parses Microsoft Compound File Binary…
permissive · top 15,000 on PyPI
types-olefileProvides type annotations for the olefile…
permissive · top 15,000 on PyPI
docxCreates, reads, and writes Microsoft Office…
unclear · top 15,000 on PyPI
textractExtracts text from documents in multiple…
permissive · top 15,000 on PyPI
ezodfezodf creates, opens, and modifies OpenDocument…
permissive · top 15,000 on PyPI