🦈 A web-based network analysis tool for real-time packet visualization on Linux gateways.
- 🚀 Simple Setup: Single binary written in Rust
- 📊 Real-time Visualization: Dynamic updates via WebSocket
- 🔍 tshark Integration: Uses Wireshark's tshark command
- 🎨 Beautiful UI: Modern web interface
- 📈 Statistics: Protocol-wise and source/destination statistics
- ⚡ High Performance: Compressed WebSocket communication
- 🔧 Flexible Filtering: tshark filter support and localhost toggle
- Linux OS (Ubuntu, CentOS, Debian, etc.)
- Rust 1.70+
- Wireshark (tshark command)
-
Install Wireshark:
# Ubuntu/Debian sudo apt update sudo apt install wireshark-common # CentOS/RHEL sudo yum install wireshark-cli # or sudo dnf install wireshark-cli
-
Set Permissions (Important):
# Add to wireshark group sudo usermod -a -G wireshark $USER # Or allow tshark to run without sudo sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/tshark
-
Install Rust (if needed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env
-
Build the project:
cargo build --release
-
Run:
# Run with administrator privileges (for network interface access) sudo ./target/release/webshark
-
Access via browser:
http://localhost:3000
- Access
http://localhost:3000
in your browser - Click "Start" button to begin packet capture
- Real-time packet information will be displayed
- Statistics are automatically updated
- IPv6 and ARP addresses are also detected. If no address information is present,
Unknown
will be displayed.
By default, all interfaces (any
) are monitored. To specify a particular interface,
modify line 129 of src/main.rs
:
.args(&[
"-i", "eth0", // Specific interface
// ...
])
To change the default port 3000, modify line 97:
let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await.unwrap();
Check with:
which tshark
Ensure the path is correct.
Run with:
sudo ./target/release/webshark
or perform the permission setup mentioned above.
Check available interfaces with:
ip link show
Ensure port 3000 is open in the firewall:
sudo ufw allow 3000
RUST_LOG=debug cargo run
cargo watch -x run
- This tool requires administrator privileges to run
- Set appropriate access restrictions in production environments
- Consider privacy when monitoring network traffic
BSD 4-Clause License
Please submit bug reports and feature requests via GitHub Issues.