Capturing packets via CLI with Dumpcap
- Dumpcap super helpful on CLI-only environments
- Linux servers, etc.
- Dumpcap on Windows
- Dumpcap gets installed with Wireshark along with several other tools
> cd C:\Program Files\Wireshark
- rawshark.exe, tshark.exe, dumpcap.exe
- Add folder to path
- Control Panel>System>Advanced System Settings>Environment Variables
- Add path to Wireshark folder
- Dumpcap commands
dumpcap -help
- Shows list of all possible commands
dumpcap -D
- List all available interfaces to capture from
dumpcap -i <interface number>
- Begin dumpcap targeting the interface you want to capture
dumpcap -w <pcap file>
- Enter the pcap file and directory you want to write to
dumpcap -b <ring-buffer options>
- Configure the pcap options
- duration:NUM - switch to next file after NUM secs
- filesize:NUM - switch to next file after NUM kB
- files:NUM - ringbuffer: replace after NUM files
- packets:NUM - ringbuffer: replace after NUM packets
- interval:NUM - switch to next file when the time is an exact multiple of NUM secs
- printname:FILE - print filename to FILE when written (can use 'stdout' or 'stderr')