Giter Site home page Giter Site logo

marirs / ole-rs Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 2.0 3.33 MB

Parser to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents.

License: Apache License 2.0

Rust 99.75% Shell 0.25%
ole olefile oletools coumpund-document rust rust-lang rust-library rust-crate

ole-rs's Introduction

OLE

Linux Arm7 Linux x86_64 macOS Windows

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] <filename> 

Options

--file: The filepath to the file to process.

Library Usage

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] <filename> 

Options

--file: The filepath to the file to process.

3. Ole-Common

Example Usage

  • add dependency (default feature is to use async)
[dependencies]
ole-common = { git = "https://github.com/marirs/ole-rs.git", branch = "master" }
  • example code
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
[dependencies]
ole-common = { git = "https://github.com/marirs/ole-rs.git", branch = "master", default-features = false, features = ["blocking"] }
  • example code
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
cargo r --example ole_cli --features="blocking" data/oledoc1.doc_

License: MIT or Apache

ole-rs's People

Contributors

clementwanjau avatar marirs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.