Skip to content

evtx_dump: support reading EVTX from stdin#271

Merged
omerbenamram merged 2 commits intomasterfrom
issue-236-stdin
Dec 21, 2025
Merged

evtx_dump: support reading EVTX from stdin#271
omerbenamram merged 2 commits intomasterfrom
issue-236-stdin

Conversation

@omerbenamram
Copy link
Owner

@omerbenamram omerbenamram commented Dec 21, 2025

Fixes #236

Problem

evtx_dump -o jsonl /dev/stdin fails with Illegal seek because EVTX parsing requires Read + Seek (header/chunk offsets, stream length).

Solution

  • Accept - (and common Unix stdin aliases like /dev/stdin, /dev/fd/0) as input.
  • Buffer stdin into an anonymous temp file, rewind, then parse normally.

Extras

  • Add an integration test asserting stdin vs file input parity for a selected record.
  • Fix a clap value type mismatch for --events that could panic.
  • Serialize the pty-based interactive CLI tests to avoid flakiness under parallel test execution.

Usage

cat security.evtx | evtx_dump -o jsonl -

Note

Add stdin support to evtx_dump by buffering to a tempfile, fix --events parser, and add tests/docs.

  • CLI (evtx_dump)
    • Add stdin input support: accept - and common stdin paths; buffer stdin to a tempfile and parse via EvtxParser::from_read_seek (open_parser, is_stdin_input).
    • Fix --events handling: parse into typed Ranges via a value parser to prevent panics.
    • Improve INPUT arg help and minor logging/messages.
  • Tests
    • New integration test asserting parity between file input and stdin (tests/test_cli.rs).
    • Serialize pty-based interactive tests with a global Mutex and separate module (tests/test_cli_interactive.rs).
  • Docs
    • README: add example piping EVTX via stdin using -o jsonl -.
  • Build/Deps
    • Add optional tempfile dep and include it in evtx_dump feature.
    • Add non-Windows dev-dep rexpect for interactive tests.

Written by Cursor Bugbot for commit 6feddae. This will update automatically on new commits. Configure here.

- Accept '-' and common stdin aliases (/dev/stdin, /dev/fd/0)

- Buffer stdin into a temp file to satisfy the parser's Read+Seek requirements

- Add a regression test for stdin parity (file vs stdin)

- Fix --events clap value type mismatch that could panic

\nFixes #236
Rexpect/pty-based tests are flaky when run concurrently under the default Rust test harness; lock them to run one-at-a-time.
@omerbenamram omerbenamram merged commit f44e0b5 into master Dec 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Passing a file via stdin?

1 participant