skillfed

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

oletools v0.60.2 7.7M downloads/30d#1,708 on PyPI3,392
Permissive license BSD AGING released

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 oletools

uv

uv add oletools

poetry

poetry add oletools

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: SecurityTopic :: Software Development :: Libraries :: Python Modules

Tags

extract vba macros from office documentsanalyze ole2 compound filesdetect malicious office macrosparse microsoft office filesmalware analysis office documentsrtf object extractiondde link detection office
malware-analysisforensicsoffice-documents

More Python Modules packages