https://github.com/marirs/ole-rs
Parser to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents.
https://github.com/marirs/ole-rs
coumpund-document ole olefile oletools rust rust-crate rust-lang rust-library
Last synced: about 1 year ago
JSON representation
Parser to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents.
- Host: GitHub
- URL: https://github.com/marirs/ole-rs
- Owner: marirs
- License: apache-2.0
- Created: 2022-02-11T02:24:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-17T05:05:14.000Z (almost 4 years ago)
- Last Synced: 2025-04-18T08:39:36.860Z (about 1 year ago)
- Topics: coumpund-document, ole, olefile, oletools, rust, rust-crate, rust-lang, rust-library
- Language: Rust
- Homepage:
- Size: 3.25 MB
- Stars: 10
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-Apache
Awesome Lists containing this project
README
# OLE
[](https://github.com/marirs/ole-rs/actions/workflows/linux_arm.yml)
[](https://github.com/marirs/ole-rs/actions/workflows/linux_x86_64.yml)
[](https://github.com/marirs/ole-rs/actions/workflows/macos.yml)
[](https://github.com/marirs/ole-rs/actions/workflows/windows.yml)
A set of OLE parsers and tools to deal with OLE files.
### Requirements
- Rust 1.56+ (edition: 2021)
### Tools
- **OleId** : A tool to analyze OLE files such as MS Office documents (e.g. Word,
Excel), to detect specific characteristics that could potentially indicate that
the file is suspicious or malicious, in terms of security (e.g. malware).
- **OleObj** : A tool to parse OLE objects and files stored into various MS Office file formats (doc, xls, ppt, docx, xlsx, pptx, etc).
- **Ole-Common** : A crate that reads and parses OLE files.
## 1. OleId
This is a tool to analyze MS Office documents(eg. Word, Excel) to detect specific characteristics common in malicious files.
### CLI Usage
```
oleid [options]
Options
--file: The filepath to the file to process.
```
### Library Usage
```rust
use oleid::oleid::OleId;
pub fn main() {
let mut oleid = OleId::new(file_path);
let indicators = oleid.check();
println!("{:#?}", indicators);
}
```
## 2.OleObj
This is a tool to parse OLE objects and files stored into various MS Office file formats (doc, xls, ppt, docx, xlsx, pptx, etc).
### Usage
```
oleobj [options]
Options
--file: The filepath to the file to process.
```
## 3. Ole-Common
### Example Usage
- add dependency (default feature is to use async)
```toml
[dependencies]
ole-common = { git = "https://github.com/marirs/ole-rs.git", branch = "master" }
```
- example code
```rust
use ole::OleFile;
fn main() {
let file = "data/oledoc1.doc_";
let res = OleFile::from_file(file).await.expect("file not found");
println!("{:#?}", &res);
println!("entries: {:#?}", res.list_streams());
}
```
- dependency with blocking
```toml
[dependencies]
ole-common = { git = "https://github.com/marirs/ole-rs.git", branch = "master", default-features = false, features = ["blocking"] }
```
- example code
```rust
use ole::OleFile;
fn main() {
let file = "data/oledoc1.doc_";
let res = OleFile::from_file_blocking(file).expect("file not found");
println!("{:#?}", &res);
println!("entries: {:#?}", res.list_streams());
}
```
- Running the Example Code
```bash
cargo r --example ole_cli --features="blocking" data/oledoc1.doc_
```
---
License: MIT or Apache