View Stats with -q
In this step, we'll explore how to analyze network traffic statistics using Wireshark's command-line tool tshark. The -q (quiet) option is particularly useful because it hides individual packet details and focuses solely on statistical summaries, making it easier to analyze overall traffic patterns.
Before we begin, let's make sure we're in the correct working directory where our capture file is stored:
cd ~/project
Now let's start with basic statistics. This command gives us an overview of the capture file contents without showing every single packet:
tshark -r smb_capture.pcapng -q
To understand how different network protocols are distributed in our capture, we use protocol hierarchy statistics. This shows what percentage of traffic belongs to each protocol:
tshark -r smb_capture.pcapng -qz io,phs
Since we're working with SMB traffic, we can specifically analyze SMB service response times. This helps identify how quickly the server responds to client requests:
tshark -r smb_capture.pcapng -qz smb,srt
Next, we'll examine endpoint statistics to see which IP addresses are generating or receiving the most traffic:
tshark -r smb_capture.pcapng -qz endpoints,ip
To understand communication patterns between hosts, we use conversation statistics. This shows traffic volumes between specific IP pairs:
tshark -r smb_capture.pcapng -qz conv,ip
It's often helpful to save statistics for later analysis. Here we save the protocol hierarchy to a text file:
tshark -r smb_capture.pcapng -qz io,phs > protocol_stats.txt
Finally, we can view the saved statistics to verify our output:
cat protocol_stats.txt