Rust-lang 中内置的高度可配置的多线程数据包监听器和解析器。
A highly configurable multi-threaded packet sniffer and parser build in rust-lang.
the Json file is generated like given below :
[{
"Ok": {
"len": 11,
"timestamp": "1234567890.123456",
"headers": [{
"Tls": {
...
}
},
{
"Tcp": {
...
}
}, {
"Ipv4": {
...
}
}, {
"Ether": {
...
}
}
],
"remaining": [...]
}
},
...
]
Ensure that you have libpcap-dev (ubuntu) or the corresponding package installed on your system.
Run the following commands in the command line inside the folder :
cargo install snoopyTo Capture packets and print them onto the console :
…Capture packets and save them to Pcap files :
➜ sudo snoopy capture run --timeout 10000 --savefile captured.pcapNote: For capturing packets the user needs root user permissions to capture network packets.
Parse Pcap files and print to console:
➜ snoopy parse ./Sample/captured.pcapParse Pcap files and print to console (with filters):
➜ snoopy parse ./Sample/captured.pcap --filter "tcp port 443"The above command will print all TCP packets with source/destination port 443.
Parse Pcap files and save to JSON file:
➜ snoopy parse ./Sample/captured.pcap --savefile ./parsed.jsonAll commands and sub-commands are listed below :
USAGE:
snoopy [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
capture Capture packets from interfaces.
help Prints this message or the help of the given subcommand(s)
parse Parse pcap files.
USAGE:
snoopy capture [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
list List all interfaces.
run Start capturing packets.…USAGE:
snoopy parse [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-f, --filter Set filter to the capture using the given BPF program string.
-s, --savefile Parse the packets into JSON and save them to memory.
ARGS:
Note: The filters can be defined according to the syntax specified here.
Run the following commands in the command line inside the folder :
docker build -t snoopy .
docker container run -it snoopyRun the following command in the command line inside the folder :
cargo buildThis project is under the MIT license.
暂无开放 Issues,或尚未同步最近议题。