LibreOffice
File Types
ODT
The ODT file type is the default document format used by LibreOffice Writer and other OpenDocument-compatible applications. It belongs to the OpenDocument Text (ODT) standard, which defines how word processing documents are structured, stored, and exchanged across different platforms. Internally, an ODT file is a compressed ZIP archive that contains multiple XML-based files and directories. These components define the document’s content, formatting, metadata, and embedded elements such as images or macros. Because of this structure, an ODT can be unpacked with standard archive utilities and examined directly, making it easier to analyze or manipulate at a granular level.
ODS
ODS files are spreadsheets created with LibreOffice Calc. They support macros written in LibreOffice Basic, Python, or JavaScript, which can be triggered by events such as opening the document, activating a sheet, or changing cell contents.
Macros
When there is upload functionality on a webserver accepting .odt files, macros can be leveraged to achieve RCE. Simple payloads, like pingbacks and GET requests, can used as a test:
Create a basic macro (1) under the document's name (2).
Try some testing payloads first, such as pingbacks and
GETrequests (3).Make the macro execute as soon as the document opens (4 & 5).

Basic:
More robust:
Powershell-based:
Check if the ping/request reaches the attacking host:
Once the test payloads are validated, they can be mofidied as desired:
An HTA (HTML Application) file is a Windows application executed by mshta.exe. It contains HTML and scripts (VBScript or JavaScript) that run with the full privileges of the current user, allowing direct execution of system commands and payloads. HTAs are commonly used in pentesting to deliver payloads that run immediately when opened.
Convert the long string into smaller chunks:
VBA has a 255-character limit for literal strings, but this restriction does not apply to strings stored in variables.
The Malicious Macro Generator LibreOffice (MMG-LO) can be used to automate the process:
Last updated
Was this helpful?