sudo ./target/debug/netsniff -i <interface> -c <count>Run without -i to see all available network interfaces:
sudo ./target/debug/netsniffsudo ./target/debug/netsniff -i wlan0
sudo ./target/debug/netsniff --interface wlan0-i and --interface are interchangeable.
sudo ./target/debug/netsniff -i wlan0 -c 50
sudo ./target/debug/netsniff -i wlan0 --count 50Default is 10 if -c is not specified.
sudo ./target/debug/netsniff -i wlan0 -c 00 means run forever. Use Ctrl+C to stop.
sudo ./target/debug/netsniff -i eth0 -c 100
sudo ./target/debug/netsniff --interface eth0 --count 100./target/debug/netsniff --help
./target/debug/netsniff --versionThese don't require sudo since they don't open any sockets.
For actual use — faster and more optimized than the debug build:
cargo build --release
sudo ./target/release/netsniff -i wlan0 -c 20| Interface | Description |
|---|---|
wlan0 |
WiFi |
eth0 |
Ethernet |
lo |
Loopback (localhost) |
tun0 |
VPN tunnel |
Run without
-ifirst to see exactly what's available on your machine.
- Raw packet capture requires root privileges on Linux. Always prefix with
sudo. libpcap-devmust be installed:sudo apt install libpcap-dev- Use
Ctrl+Cto stop unlimited captures (-c 0).