- A simple packet analyzer/sniffer , intercepts and log traffic that passes over a network.
- Supports live packet capture from multiple network interfaces (using goroutines) and packet filtering. You can also save the captured traffic to a file and analyze later using a program like wireshark.
- Why a packet sniffer ? Just another understanding computers(networking) exercise.
Available Commands:
capture Capture packets
help Help about any command
list_devices Listen network devices
Flags:
-h, --help help for root
Capture packets
Usage:
root capture [flags]
Flags:
-d, --devices stringArray Devices to capture on
-f, --file string Pcap file
-F, --filter string BPF filter
-h, --help help for capture
-N, --max_packets int Maximum number of packets to capture
- To capture traffic on
eth0
andwlan0
with BPF filtertcp and port 8000
and save to fileout.pcap
go run main.go capture -d wlan0 -d eth0 -f out.pcap - F 'tcp and port 8000'