Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

Packet-Sniffer

> 测试质量
Open source

A Network Packet Sniffing tool developed in Python 3.

786 stars0 likes1 views
WebsiteGitHub

About

A Network Packet Sniffing tool developed in Python 3.

RootWire

A network traffic monitor for GNU/Linux — formerly known as Packet-Sniffer. Frames are captured from one or more network interfaces with a raw socket, timestamped by the kernel itself, decoded layer by layer with the NETProtocols library, and rendered live, written to nanosecond-precision pcap, or streamed as JSON:

[>] Frame #4 at 15:42:07 (wlan0, 74 bytes)
    [+] Ethernet 3c:7c:3f:1a:be:22 -> 9c:1e:95:aa:01:5f
        EtherType: IPv4
    [+] IPv4 192.168.1.96 -> 142.250.79.78
        TTL: 64 | Flags: Don't fragment (DF) | Total Length: 60 | ID: 39754
        Protocol: TCP | Checksum: 0x2b51
    [+] TCP 51888 -> 443
        Flags: 0x002 (SYN) | Seq: 3598801521 | Ack: 0
        Window: 64240 | Checksum: 0x2008
        Options: Maximum Segment Size (1460), SACK Permitted, Timestamps (3644437524, 0), No-Operation, Window Scale (7)

The decoder covers Ethernet (802.1Q VLAN tags, including nested QinQ tagging), ARP, IPv4 (decoded options and fragments), IPv6 including extension headers (an MLD report renders its full Hop-by-Hop chain) and Neighbor Discovery (a Router/Neighbor Solicitation or Advertisement shows its target address and link-layer options), ICMPv4/v6, TCP (options-aware payload offsets, decoded options) and UDP. Every IPv4/ICMPv4/ICMPv6/TCP/UDP checksum is verified against a recomputation, flagging a mismatch inline (Checksum: 0x0000 [!] mismatch (expected 0x1a2b)) — a real signal for corrupted or spoofed traffic, silent for a non-reassembled fragment, where the wire checksum covers a datagram RootWire never rebuilds. Malformed or truncated frames are diagnosed instead of crashing the capture, unknown protocols end the chain gracefully, and a 16-layer cap keeps crafted extension-header stacks from amplifying — the capture survives whatever the network delivers.

Installation

pipx install rootwire        # or: uv tool install rootwire

Or run from a clone with uv:

bash
git clone https://github.com/EONRaider/RootWire.git
cd RootWire
uv sync

Usage

…

Capture statistics — frames, bytes, frames/s, malformed/truncated counts, per-protocol tallies — are reported on stderr when the capture ends, whether that's Ctrl-C, SIGTERM, or (for -r) end of file: all three trigger the same clean shutdown. Some favorite combinations:

bash
sudo rootwire -i eth0 -w session.pcap             # capture and keep the evidence
sudo rootwire -i eth0 --filter tcp                # drop non-TCP in the kernel
sudo rootwire -i eth0 --filter "tcp and port 80"  # kernel-side filter expression
sudo rootwire -i eth0 -i wlan0                    # merge two interfaces into one stream
rootwire -r session.pcap                          # inspect it later, no root
rootwire -r session.pcap --json | jq .            # machine-readable analysis

Live capture needs a raw socket, which on Linux means root (sudo rootwire -i eth0) or granting the interpreter the CAP_NET_RAW capability. Replaying files with -r never needs privileges. From a clone, run it as sudo .venv/bin/python -m rootwire.

How it works

capture.py's capture_async() yields raw frames — merged from one AF_PACKET socket per interface, each timestamped by the kernel itself at arrival (SO_TIMESTAMPNS, not a userspace clock read) — as (bytes, timestamp, interface) triples; replaying from a file with -r adapts pcap.py's frames into that same shape before either source reaches decoder.py, which walks each frame's protocol chain into an immutable DecodedFrame. Outputs — the screen renderer, the NDJSON stream, the pcap writer, the statistics collector — consume every frame through one small Output interface. The full tour, including why memory stays flat during long captures and how to add an output, is in ARCHITECTURE.md.

Everything except the raw socket runs on any OS, so the test suite — which includes a 65-frame corpus of real captured traffic replayed through the whole pipeline — needs neither root nor Linux:

uv run pytest

Contributing

Bug reports and pull requests are welcome. CONTRIBUTING.md covers the development setup, the checks CI runs, and what a good pull request looks like here.

Legal Disclaimer

The use of code contained in this repository, either in part or in its totality, for engaging targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws.

Developers assume no liability and are not responsible for misuses or damages caused by any code contained in this repository in any event that, accidentally or otherwise, it comes to be utilized by a threat agent or unauthorized entity as a means to compromise the security, privacy, confidentiality, integrity, and/or availability of systems and their associated resources. In this context the term "compromise" is henceforth understood as the leverage of exploitation of known or unknown vulnerabilities present in said systems, including, but not limited to, the implementation of security controls, human- or electronically-enabled.

The use of this code is only endorsed by the developers in those circumstances directly related to educational environments or authorized penetration testing engagements whose declared purpose is that of finding and mitigating vulnerabilities in systems, limiting their exposure to compromises and exploits employed by malicious agents as defined in their respective threat models.

License

AGPL-3.0

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonethical-hackingnetwork-programmingpacket-snifferpentesting-tools

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category测试质量
PricingOpen source

> Related tools

J
Jest
JavaScript 测试框架
P
Playwright
现代端到端测试框架
E
eslint-plugin-test-selectors
Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.