open-detect

Crates.ioopen-detect
lib.rsopen-detect
version0.1.1
created_at2025-10-24 12:02:17.469619+00
updated_at2026-01-01 23:03:47.004485+00
descriptionStatic malware detection engine with YARA rule support and automatic archive extraction for security researchers
homepage
repositoryhttps://github.com/secana/open-detect
max_upload_size
id1898353
size214,584
Stefan Hausotte (secana)

documentation

https://docs.rs/open-detect

README

Open Detect

A fast, flexible malware detection engine with YARA rule support and automatic archive extraction for security researchers.

Crates.io Documentation

Disclaimer: This project is still in early development and should not be used for production purposes.
The API is subject to change without notice.

Features

  • YARA-based detection - Leverage the power of YARA rules for pattern-based malware detection
  • Automatic archive extraction - Recursively scans ZIP, TAR, GZ, BZ2 archives without manual extraction
  • Thread-safe - Scanner is both Send and Sync for concurrent scanning operations

Quick Start

use open_detect::{Scanner, SigSet, ScanResult};
use std::path::Path;

// Load YARA signatures from a directory
let sig_set = SigSet::new()
    .with_sig_dir_recursive(Path::new("signatures"))
    .expect("Failed to load signatures");

// Create scanner with default settings
let scanner = Scanner::new(sig_set);

// Scan a file
match scanner.scan_file(Path::new("suspicious.exe")).unwrap() {
    ScanResult::Clean => println!("File is clean"),
    ScanResult::Malicious(detections) => {
        println!("Threats detected:");
        for detection in detections {
            println!("  - {}", detection.name);
        }
    }
}

For more examples and detailed usage, please refer to the documentation.

Related Projects

This crate is built on top of excellent open-source projects:

  • YARA-X - Next-generation YARA engine written in Rust by VirusTotal. Provides the core pattern matching capabilities.
  • YARA - The original pattern matching tool for malware researchers. YARA-X is a modern reimplementation.
  • archive - Archive extraction library supporting multiple formats.
  • infer - File type detection from magic numbers.
Commit count: 0

cargo fmt