wtmp_parser is a Rust program that processes wtmp files (binary files containing user login records) and outputs the data in a human-readable format.
To build the program, you'll need to have the Rust toolchain installed. You can install it from https://www.rust-lang.org/tools/install.
Once you have Rust installed, follow these steps:
- Clone this repository or download the source code.
- Navigate to the project directory.
- Build the release version of the program:
cargo build --release
This will compile the program and place the binary in the target/release directory.
wtmp_parser [-f wtmp_file]
- If no
-fflag is provided, the program will read from/var/log/wtmp. - If the
-fflag is provided, it should be followed by the path to the desiredwtmpfile.
./target/release/wtmp_parser
./target/release/wtmp_parser -f /path/to/your/wtmp/file
The program will output the records from the wtmp file in the following format:
<timestamp> <record_type> <username> <line/terminal> <hostname>
For example:
2023-04-10 10:12:34 Login alice tty1 example.com
2023-04-10 10:15:22 Normal bob pts/0 remote.host
2023-04-10 10:20:45 Term charlie tty2 localhost
This program uses the following external crate:
chrono(0.4.23): A crate for handling dates and times in Rust.