This Bash script leverages the power of tshark
for real-time network packet capture and analysis. Designed for network engineers and security professionals, it streamlines monitoring network traffic, detecting anomalies, and troubleshooting issues.
- Real-time Packet Capture: Capture packets on specified network interfaces for a user-defined duration.
- Detailed Analysis: Evaluate captured packets for retransmissions, resets, and other critical metrics.
- User-Friendly Interface: Interactive prompts make it easy to navigate, suitable for users of all skill levels.
- Efficient Reporting: Generates a concise summary of the captured data, highlighting key performance indicators.
run the script directly using wget
:
wget "https://raw.githubusercontent.com/FReak4L/packet-capture/main/packet_capture.sh" -O packet_captrue.sh && sed -i 's/\r$//' packet_captrue.sh && bash packet_captrue.sh
- Start the Script: The command fetches the script and pipes it directly into
bash
for execution. - User Inputs: You will be prompted to enter:
- The network interface (e.g.,
eth0
,wlan0
). - The capture duration in seconds.
- The maximum number of packets to capture.
- The network interface (e.g.,
- Packet Capture: Uses
tshark
to capture packets from the specified network interface based on user-defined parameters. - Data Analysis: After capturing, the script processes the data:
- Total Packets: Counts all captured packets.
- Retransmissions & Resets: Identifies and quantifies any retransmissions and TCP reset packets.
- Loss Rate Calculation: Placeholder values are set for lost packets and out-of-order calculations, laying the groundwork for advanced reporting.
With its intuitive interface and robust functionality, this packet capture script is an essential tool for diving deeper into network diagnostics and performance tuning. Whether you're troubleshooting connectivity issues, analyzing traffic patterns, or enhancing network security, this script is your go-to solution.
Harness the power of tshark
and elevate your network management strategy today!