百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

snoopy

> 编程语言
开源

Rust-lang 中内置的高度可配置的多线程数据包监听器和解析器。

179 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Rust-lang 中内置的高度可配置的多线程数据包监听器和解析器。

Snoopy

A highly configurable multi-threaded packet sniffer and parser build in rust-lang.

Features

  • Capturing packets and encoding them to Pcap files, or print them onto console.
  • While capturing packets, various configuration parameters can be specified.
  • Parse Pcap files and print them to console, or extract more verbose information from each packet and store them to JSON file.
  • Multi-threaded parsing of packets.
  • Filter packets while parsing and capturing.
  • Currently supports the following protocols :
    • Ethernet
    • Ipv4
    • Ipv6
    • Arp
    • Tcp
    • Udp
    • Dns
    • Tls

the Json file is generated like given below :

json

[{
  "Ok": {
    "len": 11,
    "timestamp": "1234567890.123456",
    "headers": [{
        "Tls": {
          ...
        }
      },
      {
        "Tcp": {
          ...
        }
      }, {
        "Ipv4": {
          ...
        }
      }, {
        "Ether": {
          ...
        }
      }
    ],
    "remaining": [...]
  }
},
...
]

Installation

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 :

bash
cargo install snoopy

Quick-Start

To Capture packets and print them onto the console :

…

Capture packets and save them to Pcap files :

bash
➜ sudo snoopy capture run --timeout 10000 --savefile captured.pcap

Note: For capturing packets the user needs root user permissions to capture network packets.

Parse Pcap files and print to console:

bash
➜ snoopy parse ./Sample/captured.pcap

Parse Pcap files and print to console (with filters):

bash
➜ 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:

bash
➜ snoopy parse ./Sample/captured.pcap --savefile ./parsed.json

Documentation

All commands and sub-commands are listed below :

bash
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.
bash
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.
…
bash
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.

Docker

Run the following commands in the command line inside the folder :

bash
docker build -t snoopy .
docker container run -it snoopy

Build

Run the following command in the command line inside the folder :

bash
cargo build

Todo

  • Benchmarking
  • Support for other protocols

License

This project is under the MIT license.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustcommand-line-toolpacket-capturepacket-parsingpacket-sniffer

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言