A Python-based network packet sniffer built using Scapy that captures and analyzes live network traffic in real time.
Built as part of the CodeAlpha Cybersecurity Internship β Task 1
- Captures live network packets in real time
- Detects protocols: TCP, UDP, ICMP
- Displays source and destination IP addresses
- Shows port numbers for TCP and UDP
- Extracts and displays payload data
- Timestamps every captured packet
- Python 3.14
- Scapy 2.7.0
- Npcap (Windows packet capture driver)
git clone https://github.com/barath-css/CodeAlpha_NetworkSniffer.git cd CodeAlpha_NetworkSniffer
python -m venv venv .\venv\Scripts\Activate.ps1
python -m pip install scapy
Download from: https://npcap.com/#download Check "WinPcap API-compatible Mode" during installation.
Run PowerShell as Administrator, then: python network_sniffer.py
[14:23:01] Protocol: TCP SRC IP : 192.168.1.5 DST IP : 142.250.77.14 SRC Port: 52341 β DST Port: 443 TCP Flags: PA Payload : No payload
This tool is intended for educational purposes only. Run it only on your own network and devices. Unauthorized packet sniffing is illegal.
- Barath k
- CodeAlpha Cybersecurity Intern
- GitHub: https://github.com/barath-css
- LinkedIn: https://linkedin.com/in/barath-k-11461633b