This project is a TCP Packet Analyzer designed to:
- Analyze TCP three-way handshake (SYN, SYN-ACK, ACK) during client-server communication.
- Provide a graphical user interface (GUI) to simulate and analyze TCP connections.
- Integrate Scapy for real-time packet sniffing (optional).
- Allow users to load and analyze PCAP files (captured via Wireshark or Scapy) to inspect all TCP messages.
This tool is ideal for understanding and visualizing TCP communications, including 3-way handshakes, and analyzing packet details in both real-time and offline modes.
-
Client-Server TCP Handshake Analysis:
- GUI-based simulation of a TCP three-way handshake (SYN, SYN-ACK, ACK).
- Logging and visualization of handshake completion.
-
PCAP File Analyzer:
- Load and analyze TCP messages from a saved PCAP file.
-
Real-Time Packet Sniffing (Optional):
- Utilize Scapy to sniff TCP packets in real-time.
- Eliminates the need for Wireshark for live packet analysis.
-
User-Friendly Interface:
- Interactive GUI for both client-server and packet analysis tools.
- Easy-to-use buttons for starting/stopping sniffing and loading files.
Ensure the following software is installed on your machine:
- Python (>= 3.8)
- Python Libraries:
tkinter(for GUI)scapy(for packet sniffing)pyshark(for PCAP file analysis)
- Wireshark (optional, for capturing PCAP files if Scapy is not used)
Install required Python libraries using:
pip install scapy pyshark- Clone the repository
git clone https://github.com/KrishnenduMR/TCP-Connection-Analyzer.git
cd TCP-Connection-Analyzer
cd src- Open wireshark
- Select appropriate network interface
- Filter the connection using
tcp.port == <port>- Start capturing
- Run the main app
python main.py- Start server
- Start client
- Communicate between client and server
- Close connection
- Exit the tab
-
Stop capturing in wireshark file -> save as -> filename.pcap
-
open pcap analyzer Select the pcap file and view details
-
Connection analyze using scapy(optional)
- Select scapy analyzer
- Start capturing
- View details
- Stop capturing
Documents/
└── src/
├── __pycache__/
├── analyzer.py
├── client.py
├── main.py
├── server.py
└── usingscapy.py
README.md
- Log SYN, SYN-ACK, and ACK packets between client and server.
- Extract all TCP packets from a PCAP file, including non-handshake messages.
- Monitor live traffic for SYN, SYN-ACK, ACK, FIN, or custom TCP packets.
- Avoid sharing captured PCAP files into public as they may contain sensitive data.
- Ensure Scapy sniffing runs with appropriate privileges (e.g.,
sudoon Linux).
This project is licensed under the Apache License 2.0.
