A Python-based network packet sniffer built using Scapy to capture and inspect live network traffic for networking and cybersecurity learning.
Basic Network Sniffer is an educational Python application that captures live network packets and displays useful information such as source and destination IP addresses, protocols, ports, and packet payloads. It provides hands-on experience with packet sniffing, protocol analysis, and network monitoring while helping users understand how data travels across a network.
- 📡 Live packet capture
- 🌐 Source & destination IP detection
- 🔍 TCP, UDP, ICMP and ARP packet identification
- 🌍 DNS packet analysis
- 📦 Packet payload inspection
- 📊 Real-time packet statistics
- 💾 Export captured data to JSON and TXT
- 📁 Analyze PCAP files
- 🎨 Colorized command-line interface
- 🖥️ Network interface detection
- ⚡ Lightweight and beginner-friendly
| Main Menu |
|---|
🔒 Authentication
User: admin Pass: elitejod
git clone https://github.com/JOD7777/-CodeAlpha_Basic-Network-Sniffer.git
cd -CodeAlpha_Basic-Network-Sniffer
ls
cd Source
ls
python sniffer.py
python3 -m venv venv
source venv/bin/activateRun the sniffer:
# Interactive menu
sudo python3 sniffer.py
# Direct capture
sudo python3 sniffer.py --capture eth0
# Analyze existing PCAP
python3 sniffer.py --analyze capture.pcap
# List interfaces
sudo python3 sniffer.py --interfacesBasic-Network-Sniffer/
│
├── assets/
│ ├── banner.png
│ ├── demo.gif
│ └── screenshots/
│
├── src/
│ ├── main.py
│ ├── sniffer.py
│ ├── analyzer.py
│ └── utils.py
│
├── requirements.txt
├── README.md
├── LICENSE
├── .gitignore
└── docs/
[TCP ] 192.168.1.5 → 142.250.183.78
Port: 51234 → 443
[DNS ] 192.168.1.5 → 8.8.8.8
Query: github.com
Capture Summary
-------------------------
Total Packets : 1245
TCP : 910
UDP : 201
DNS : 78
ICMP : 56
- Python 3
- Scapy
- Socket Programming
- Colorama
- JSON
- Logging
- Packet filtering
- Save captures as PCAP
- CSV export
- IPv6 support
- Improved protocol parsing
- Simple GUI interface
- HTTP/HTTPS request visualization
- Traffic graphs
- Search and filter packets
- Geo-IP lookup
- Packet replay
- Cross-platform enhancements
Contributions are welcome! Feel free to fork the repository, improve the project, and submit a pull request.
This project is licensed under the MIT License.
This project is intended for educational purposes and authorized network monitoring only. Capture and analyze traffic only on networks you own or have explicit permission to test. Unauthorized packet interception may violate applicable laws or organizational policies.
Supriyo Malik
Advanced Networking & Cyber Security Student
⭐ If you found this project helpful, please consider starring the repository.


