Lecture- 11 Common Tools for Packet Analysis
Lecture- 11 Common Tools for Packet Analysis
Packet Analysis
1-Introduction
to Packet
Analysis Tools
•Packet analysis tools
capture, inspect, and
analyze network traffic
to help identify and
resolve issues or detect
malicious activities.
These tools vary in
functionality, from basic
packet capture to
advanced intrusion
detection, and can be
tailored to specific tasks.
2. Overview
of Common
Tools
•1. tcpdump
• What It Is:
• A command-line packet
capture tool available on
Linux/Unix systems.
• Lightweight and efficient for
capturing live traffic and
filtering packets based on
criteria.
• Key Features:
• Supports Berkeley Packet
Filter (BPF) syntax for precise
filtering.
• Captures packets to a file
(.pcap) for later analysis with
other tools like Wireshark.
When to Use:
Copy code
Example Command:
2. Tshark bash
Copy code
tshark -r capture.pcap -Y 'http.request.method
== "GET"'
Filters HTTP GET requests from a .pcap file.
3. Snort
• What It Is:
• An open-source intrusion detection and prevention system (IDS/IPS).
• Analyzes packets in real time to detect known threats using signature-based rules.
• Key Features:
• Alerts on suspicious traffic based on custom or community-developed rules.
• Can operate in three modes:
• Sniffer Mode: Reads and displays network traffic.
• Packet Logger Mode: Saves packets to files.
• IDS Mode: Detects and alerts on malicious patterns.
3. Snort
• When to Use:
• In-Depth Analysis: Investigating complex network issues or
reconstructing events.
• Learning and Demonstration: Intuitive GUI makes it ideal for
training.
• Packet Decoding: Analyze raw packets to understand protocol
behavior.
• Example Use:
• Load a .pcap file captured by tcpdump for detailed inspection.
5. Zeek (formerly Bro)
• What It Is:
• A network analysis framework that converts raw packets into detailed logs and metadata.
• Key Features:
• Focuses on metadata rather than payloads for privacy-conscious analysis.
• Detects anomalies and performs behavioral analysis.
• Supports scripting for custom monitoring.
• When to Use:
• Incident Response: Analyze metadata for signs of compromise.
• Large-Scale Networks: Efficiently handles high traffic volumes.
• Policy Enforcement: Monitor for deviations from expected behavior.
6. Suricata
• What It Is:
• A high-performance IDS/IPS and network security monitoring engine.
• Key Features:
• Multi-threaded for faster processing.
• Performs deep packet inspection (DPI) and application-layer analysis.
• Integrates with tools like Kibana for visualization.
• When to Use:
• Advanced Threat Detection: Identify both known and unknown threats with DPI.
• Integration with SIEM: Combine with Elastic or Splunk for centralized threat management.
• Real-Time Blocking: Use IPS mode to prevent malicious traffic.
3. When to Use Each Tool
•
Wireshark is a powerful packet analysis tool, and its advanced
features enable users to extract deeper insights from network
traffic. By using filters, coloring rules, and export
functionalities, analysts can enhance their workflow, focus on
critical data, and share findings efficiently.
2. Filters in Wireshark
•Filters are one of Wireshark's most valuable features, allowing users to isolate specific packets based
on criteria like protocols, IP addresses, ports, or packet content.
• Display Filters:
• Refine which packets are shown in the Wireshark interface.
• Examples:
• ip.addr == 192.168.1.1: Displays packets involving the IP 192.168.1.1.
• tcp.port == 80: Displays HTTP traffic.
• http.request.method == "GET": Displays only HTTP GET requests.
• dns && (dns.qry.name contains "example.com"): Filters DNS queries for the domain
example.com.
Filters
• Applied when capturing traffic to limit the packets saved.
• Examples:
• host 192.168.1.1: Captures packets to or from a specific IP address.
• port 443: Captures only HTTPS traffic.
• net 10.0.0.0/24: Captures packets from a specific subnet.
• Tips for Using Filters:
• Combine filters using logical operators:
• &&: AND (e.g., tcp && ip.addr == 192.168.1.1).
• ||: OR (e.g., tcp || udp).
• !: NOT (e.g., !arp excludes ARP packets).
• Use Wireshark’s autocomplete feature to find filter syntax.
3. Coloring Rules for Enhanced
Analysis
•Wireshark allows users to save and export captured data for further analysis or sharing.
• Saving Packet Captures:
• Save entire packet captures in .pcap or .pcapng format.
• Steps:
• Go to File > Save As.
• Choose the file name and format.
• Use Case: Share captures with colleagues or analyze them later in other tools (e.g., Snort, Zeek).
• Exporting Filtered Results:
• Export only selected or filtered packets to focus on specific data.
• Steps:
• Apply a display filter.
• Go to File > Export Specified Packets.
• Choose to save all displayed packets or only marked packets.
• Use Case: Create smaller capture files for targeted analysis.
Exporting Packet
Summaries:
Export packet summaries in plain text, CSV, or XML formats for reporting.
Steps:
• Apply a display filter.
• Go to File > Export Packet Dissections > As CSV/XML/Plain Text.
• Choose the fields to include in the export.
Use Case: Generate reports with selected packet details for presentations or
documentation.
Reconstructing Packet Streams: