Skip to content

zinzied/Packets-Analyzer-with-GUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Packets-Analyzer-with-GUI

This script is a Python-based network packet sniffer with a graphical user interface (GUI) built using PyQt5. It captures and analyzes network packets in real-time, displaying relevant information such as source and destination IP addresses, protocols, and payload data for TCP and UDP packets. The script also logs packet information to a text file and saves captured packets to a PCAP file.

Key Features:

  1. GUI Interface: The application provides a user-friendly GUI for starting and stopping the packet sniffer, filtering packets by source IP and protocol, and displaying captured packet details.
  2. Packet Filtering: Users can filter packets by source IP address and protocol (TCP or UDP).
  3. Packet Logging: Captured packet information is logged to a text file (packet_log.txt).
  4. Packet Capture: Captured packets are saved to a PCAP file (captured_packets.pcap).
  5. Payload Display: The application attempts to decode and display the payload of TCP and UDP packets.

Usage Instructions:

  1. Clone the Repository:
    git clone https://github.com/zinzied/Packets-Analyzer-with-GUI.git
  2. Navigate to the Project Directory:
    cd Packets-Analyzer-with-GUI
  3. Install the Required Dependencies:
    pip install scapy PyQt5
    Need To install Npcap for windows from here: https://npcap.com/dist/npcap-1.79.exe
  4. Run the Packet Sniffer Script:
    sudo python Packets Analyser.py

GUI Components:

  • Source IP Filter: A text input for filtering packets by source IP address.
  • Protocol Filter: A text input for filtering packets by protocol (6 for TCP, 17 for UDP).
  • Start Sniffing Button: Starts the packet sniffing process.
  • Stop Sniffing Button: Stops the packet sniffing process.
  • Clear Packets Button: Clears the list of captured packets.
  • Packet List: Displays a list of captured packets. Clicking on a packet shows its details in a new window.

How It Works:

  1. Initialization: The PacketSnifferApp class initializes the GUI and sets up the necessary components.
  2. Start Sniffing: When the "Start Sniffing" button is clicked, a new SnifferThread is created and started. This thread captures packets using Scapy's sniff function.
  3. Packet Callback: The packet_callback method processes each captured packet, applying the specified filters and displaying relevant information in the GUI.
  4. Stop Sniffing: When the "Stop Sniffing" button is clicked, the sniffer thread is stopped.
  5. Clear Packets: The "Clear Packets" button clears the list of captured packets.
  6. Show Packet Details: Clicking on a packet in the list opens a new window displaying detailed information about the packet.

This script provides a comprehensive tool for network packet analysis with a focus on ease of use and real-time data display.

About

Packets pcap analyser ip Filter protocol UDP TCP

Resources

Stars

Watchers

Forks

Languages