10/12 free views
Library/SDK
Library
Malware Analysis

oletools

by decalage2

3.2Kstars
587forks
96watchers
Updated 5 months ago
About

oletools is a comprehensive Python library for analyzing Microsoft OLE2 and Office documents to detect malware, perform forensics, and aid debugging.

oletools - python tools to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents, for malware analysis, forensics and debugging.

Primary Use Case

oletools is primarily used by malware analysts, forensic investigators, and security researchers to detect and analyze malicious content embedded in Microsoft Office documents and related file formats. It helps extract and analyze VBA macros, OLE objects, Excel 4 macros, and other embedded threats within legacy and modern Office files.

Key Features
  • Analysis of Microsoft OLE2 files including Office 97-2003 documents, MSI files, and Outlook messages
  • Detection and extraction of VBA macros, OLE objects, Excel 4 macros (XLM), and DDE links
  • Support for modern Office Open XML (OOXML) formats such as Office 2007+ documents, XPS, and MSIX files
  • Integration with the olefile parser for structured storage analysis
  • Tools for analyzing RTF files and identifying file formats with ftguess
  • Detection of known vulnerabilities such as CVE-2021-40444 initial stage
  • Deobfuscation support for Excel 4 macros using XLMMacroDeobfuscator
  • Improved logging and Python 3.12 compatibility

Installation

  • Ensure Python is installed on your system
  • Install oletools via pip using: pip install oletools
  • Verify installation by running oletools commands or importing the library in Python

Usage

>_ olevba <file>

Extracts and analyzes VBA macros from OLE and OpenXML files

>_ oleobj <file>

Extracts and analyzes embedded OLE objects within documents

>_ rtfobj <file>

Analyzes RTF files and extracts embedded objects and URLs

>_ ftguess <file>

Identifies file formats and containers, including MSI, PNG, PowerPoint, XPS, and XLSB

>_ oleid <file>

Provides indicators and risk levels for OLE files, calling ftguess and olevba for macro analysis

Security Frameworks
Discovery
Collection
Defense Evasion
Execution
Initial Access
Usage Insights
  • Integrate oletools into automated malware triage pipelines to accelerate detection of malicious Office documents.
  • Use oletools in purple team exercises to simulate and analyze document-based attack vectors and improve detection rules.
  • Combine oletools output with SIEM and EDR tools for enhanced forensic investigations and alerting on suspicious Office file behaviors.
  • Leverage oletools’ macro deobfuscation capabilities to educate blue teams on emerging obfuscation techniques used by adversaries.
  • Deploy oletools as part of endpoint forensic toolkits to enable rapid on-demand analysis of suspicious Office documents during incident response.

Docs Take 2 Hours. AI Takes 10 Seconds.

Ask anything about oletools. Installation? Config? Troubleshooting? Get answers trained on real docs and GitHub issues—not generic ChatGPT fluff.

3 free chats per tool • Instant responses • No credit card

Security Profile
Red Team70%
Blue Team80%
Purple Team75%
Details
LicenseOther
LanguagePython
Open Issues658
Topics
python
python-library
olefile
malware-analysis
ms-office-documents
compound
rtf
forensics
ole-files
security