A rust implementation of a packet capture analyzer, built from scratch without relying on external libraries. This program parses pcap files and prints information about the Ethernet header, IP header, and header data of TCP, UDP, or ICMP packets.
To run the PCAP analyzer program, you need to have Rust installed on your system.
$ cd packet_analyzer
/packet_analyzer $ cargo build
$ cargo run -r [filename]
$ cargo run -r [filename] [filter]
- host
- port
- ip
- icmp
- tcp
- udp
- net
To analyze the test.pcap
file and filter the packets based on the TCP protocol, run the following command:
$ cargo run -r test.pcap tcp
This command will parse the test.pcap
file, print information about the Ethernet header, IP header, and header data of
TCP packets, and display only the filtered results based on the TCP protocol.