Build Status crates.io

EVTX

This is a parser for the Windows EVTX format.

This parser is implemented using 100% safe rust - and works on all platforms supported by rust (that have stdlib).

The parser supports XML and JSON outputs, both being zero-copy and independent of each other.

For JSON this means that no conversion to textual XML is done. The JSON object is being directly built from the inner representation of the binary xml token tree.

Supported rust version is latest stable rust (minimum 1.34) or nightly.

Documentation

Python bindings are available as well at https://github.com/omerbenamram/pyevtx-rs (still experimental, will publish to PyPi soon)

Example usage (associated binary utility):

Note: by default, the library will try to utilize multithreading, this means that the records may be printed out of order.

To force single threaded usage (which will also ensure order), -t 1 can be passed.

Example usage (as library):

```rust use evtx::EvtxParser; use std::path::PathBuf;

fn main() { // Change this to a path of your .evtx sample. let fp = PathBuf::from(format!("{}/samples/security.evtx", std::env::var("CARGOMANIFESTDIR").unwrap()));

let mut parser = EvtxParser::from_path(fp).unwrap();
for record in parser.records() {
    match record {
        Ok(r) => println!("Record {}\n{}", r.event_record_id, r.data),
        Err(e) => eprintln!("{}", e),
    }
}

} ```

The parallel version is enabled when compiling with feature "multithreading" (enabled by default).

Benchmarking

Initial benchmarking I've performed indicate that this implementation is probably the fastest available 🍺.

I'm using a real world, 30MB sample which contains ~62K records.

This is benchmarked on my 2017 MBP.

Comparison with other libraries:

Caveats

If the parser errors out on any of these nodes, feel free to open an issue or drop me an email with a sample.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.