项目作者: kpcyrd

项目描述 :
Secure multithreaded packet sniffer
高级语言: Rust
项目地址: git://github.com/kpcyrd/sniffglue.git
创建时间: 2017-09-12T16:26:24Z
项目社区:https://github.com/kpcyrd/sniffglue

开源协议:GNU General Public License v3.0

下载


sniffglue Build Status Crates.io

sniffglue is a network sniffer written in rust. Network packets are parsed concurrently
using a thread pool to utilize all cpu cores. Project goals are that you can
run sniffglue securely on untrusted networks and that it must not crash
when processing packets. The output should be as useful as possible by default.

screenshot

Usage

  1. # sniff with default filters (dhcp, dns, tls, http)
  2. sniffglue enp0s25
  3. # increase the filter sensitivity (arp)
  4. sniffglue -v enp0s25
  5. # increase the filter sensitivity (cjdns, ssdp, dropbox, packets with valid utf8)
  6. sniffglue -vv enp0s25
  7. # almost everything
  8. sniffglue -vvv enp0s25
  9. # everything
  10. sniffglue -vvvv enp0s25

Installation

Packaging status

Arch Linux

  1. pacman -S sniffglue

Mac OSX

  1. brew install sniffglue

Debian/Ubuntu/Kali

First included in debian bullseye, ubuntu 21.04.

  1. apt install sniffglue

Alpine

  1. apk add sniffglue

Gentoo

  1. layman -a pentoo
  2. emerge --ask net-analyzer/sniffglue

NixOS

  1. nix-env -i sniffglue

GNU Guix

  1. guix install sniffglue

Fedora/RHEL/CentOS/CentOS Stream

  1. dnf copr enable atim/sniffglue -y
  2. dnf install sniffglue

From source

To build from source make sure you have libpcap and libseccomp installed. On
debian based systems:

  1. # install the dependencies
  2. sudo apt install libpcap-dev libseccomp-dev
  3. # install rust with rustup
  4. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  5. source $HOME/.cargo/env
  6. # install sniffglue and test it
  7. cargo install sniffglue
  8. sniffglue --help

Or you can build a Debian package via cargo-deb:

  1. cargo deb

Protocols

  • [X] ethernet
  • [X] ipv4
  • [X] ipv6
  • [X] arp
  • [X] tcp
  • [X] udp
  • [X] icmp
  • [X] http
  • [X] tls
  • [X] dns
  • [X] dhcp
  • [X] cjdns eth beacons
  • [X] ssdp
  • [X] dropbox beacons
  • [X] ppp
  • 802.11

Docker

You can build sniffglue as a docker image to debug container setups. The image
is currently about 11.1MB. It is recommended to push it to your own registry.

  1. docker build -t sniffglue .
  2. docker run -it --init --rm --net=host sniffglue eth0

Building documentation

  1. scdoc < docs/sniffglue.1.scd > docs/sniffglue.1

Security

To report a security issue please contact kpcyrd on ircs://irc.hackint.org.

Seccomp

To ensure a compromised process doesn’t compromise the system, sniffglue uses
seccomp to restrict the syscalls that can be used after the process started.
This is done in two stages, first at the very beginning (directly after
env_logger initialized) and once after the sniffer has been setup, but before
packets are read from the network.

Hardening

During the second stage, there’s also some general hardening that is applied
before all unneeded syscalls are finally disabled. Those are system specific,
so a configuration file is read from /etc/sniffglue.conf. This config
file specifies an empty directory for chroot and an unprivileged account
in user that is used to drop root privileges.

boxxy-rs

This project includes a small boxxy-rs based shell that can be used to
explore the sandbox at various stages during and after initialization. This is
also used by travis to ensure the sandbox actually blocks syscalls.

  1. cargo run --example boxxy

Reproducible builds

This project is tested using reprotest. Currently the following variations are
excluded:

  • -time - needed because the crates.io cert expires in the future
  • -domain_host - requires root for unshare(2) and has been excluded

Don’t forget to install the build dependencies.

  1. ci/reprotest.sh

Fuzzing

The packet processing of sniffglue can be fuzzed using cargo-fuzz.
Everything you should need is provided in the fuzz/ directory that is
distributed along with its source code. Please note that this program links
to libpcap which is not included in the current fuzzing configuration.

  1. cargo fuzz run read_packet

License

GPLv3+