Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evtx2bodyfile abort parsing when a single invalid evtx file found #67

Open
Bitbee0 opened this issue Feb 13, 2025 · 0 comments
Open

evtx2bodyfile abort parsing when a single invalid evtx file found #67

Bitbee0 opened this issue Feb 13, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Bitbee0
Copy link
Contributor

Bitbee0 commented Feb 13, 2025

When parsing a list of evtx files, the evtx2bodyfile tool aborts directly if a file is invalid.

Maybe we can use some sort of fallback mechanism, that the other valid evtx files in the directory can be parsed and just print out a warning when an invalid evtx file found

The name of the invalid evtx file in my case: Microsoft-Windows-Global\ Secure\ Access\ Client-Debug.evtx (I figure this out by trying to parse every single evtx file)

RUST_BACKTRACE=full evtx2bodyfile Windows/System32/winevt/logs/*.evtx
thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dfir-toolkit-0.11.2/src/bin/evtx2bodyfile/evtx_file.rs:65:46:
called `Result::unwrap()` on an `Err` value: An error occurred while trying to deserialize evtx stream.

Caused by:
    Invalid EVTX file header magic, expected `ElfFile0`, found `[ 0, 10,  0,  0,  0,  3,  0,  0]`

Stack backtrace:
   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
   1: evtx2bodyfile::evtx_file::EvtxFile::create_progress_bar
   2: evtx2bodyfile::evtx_file::EvtxFile::print_records
   3: evtx2bodyfile::main
   4: std::sys::backtrace::__rust_begin_short_backtrace
   5: std::rt::lang_start::{{closure}}
   6: std::rt::lang_start_internal
   7: main
   8: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
   9: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:360:3
  10: _start
stack backtrace:
   0:     0x62401dffda5a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h304520fd6a30aa07
   1:     0x62401e020e6b - core::fmt::write::hf5713710ce10ff22
   2:     0x62401dffadc3 - std::io::Write::write_fmt::hda708db57927dacf
   3:     0x62401dffed42 - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5
   4:     0x62401dffe9ae - std::panicking::default_hook::h81c8cd2e7c59ee33
   5:     0x62401dfff53f - std::panicking::rust_panic_with_hook::had2118629c312a4a
   6:     0x62401dfff2b7 - std::panicking::begin_panic_handler::{{closure}}::h7fa5985d111bafa2
   7:     0x62401dffdf39 - std::sys::backtrace::__rust_end_short_backtrace::h704d151dbefa09c5
   8:     0x62401dffef44 - rust_begin_unwind
   9:     0x62401de94ce3 - core::panicking::panic_fmt::h3eea515d05f7a35e
  10:     0x62401de95156 - core::result::unwrap_failed::h7c8d8bbbcf45dc13
  11:     0x62401deafc74 - evtx2bodyfile::evtx_file::EvtxFile::print_records::h1b5eab8be952337e
  12:     0x62401deab40c - evtx2bodyfile::main::h4b4b222bfd3e378e
  13:     0x62401dec4be3 - std::sys::backtrace::__rust_begin_short_backtrace::h6b48135d3dc80fc2
  14:     0x62401decf03d - std::rt::lang_start::{{closure}}::h096248ab05e27a03
  15:     0x62401dff3400 - std::rt::lang_start_internal::h4d90db0530245041
  16:     0x62401deab585 - main
  17:     0x7c139b82a1ca - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  18:     0x7c139b82a28b - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  19:     0x62401de95495 - _start
  20:                0x0 - <unknown>
@Bitbee0 Bitbee0 added the bug Something isn't working label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant