NetGuard-AI is a Python-based network traffic monitoring and analysis framework designed to support the detection of anomalous and potentially malicious network behavior. The system combines real-time packet capture with heuristic and AI-assisted analysis techniques to enhance situational awareness and support proactive network security monitoring.
The project emphasizes modularity, extensibility, and clarity of design, making it suitable for research, prototyping, and controlled enterprise or laboratory environments.
netguard-ai/
├── src/
│ ├── __init__.py
│ ├── sniffer.py # Traffic capture logic
│ └── analyzer.py # Logic Analysis (heuristic/AI)
├── logs/ # Folder for recording events
├── main.py # Entry point
├── requirements.txt # Dependencies
└── README.md # Documentation[ Network Interface ]
↓
[ Packet Capture Module ]
↓
[ Traffic Analysis Module ]
↓
[ Event Logging Subsystem ]- Real-time Sniffing: Capturing IP/TCP packets using the Scapy library.
- Threat Detection: Detection of signs of port scanning and use of non-standard ports (backdoors).
- Security Logging: Log rotation and saving events in a format suitable for SIEM systems.
- Extensibility: Easy connection of classifiers based on PyTorch/TensorFlow.
sniffer.pylistens to network traffic and collects packet data.
-
Captured packets are passed to
analyzer.py -
Detection
logicevaluates traffic patterns and flags anomalies.
-
Suspicious events are recorded in the
logs/directory. -
Future versions may include real-time alerts or dashboards.
- Language: Python 3.12
- Networking: Scapy
- DevOps: Docker, GitHub Actions (CI/CD)
- Monitoring: ELK Stack (integration via logs)
- Clone the repository:
git clone github.com/mscbuild/netGuard-AI-scanner.git cd netGuard-AI-scanner
Install dependencies:
pip install -r requirements.txtRun the analyzer (requires administrator rights to access the network interface)
sudo python main.py --interface eth0- Add a payload entropy analysis module (for detecting encrypted control channels).
- Integration with the Telegram Bot API for instant alerts.
- Export data in JSON format for visualization in Grafana.
-
Network intrusion detection (basic IDS)
-
Security research and experimentation
-
Learning network traffic analysis and AI-assisted detection
-
Monitoring internal or lab networks
The project is regularly checked for vulnerabilities using automated tools:
- Checking with Bandit (Code Analysis)
pip install bandit
bandit -r . -f txt- Checking with Snyk (Dependency Analysis and Docker)
snyk testTool Status Findings Bandit No critical issues. Scapy usage marked as intentional. Snyk 0 vulnerabilities in 4 dependencies.
-
Network security monitoring and intrusion detection research
-
Traffic behavior analysis in controlled enterprise or laboratory networks
-
Educational use in cybersecurity, networking, and applied AI courses
-
Prototyping and evaluation of anomaly detection
-
Integration of supervised and unsupervised machine learning models
-
Development of visualization and reporting dashboards
-
Real-time alerting and notification mechanisms
-
Support for offline analysis using PCAP data
-
Detection accuracy is dependent on the quality of heuristics and training data (if AI models are used).
-
High-throughput environments may require optimization or distributed deployment.
-
Encrypted traffic limits the depth of observable information.
This software is created solely for educational purposes and for use in sanctioned ethical hacking. The author assumes no liability for unauthorized use.
Distributed under the MIT License. Details in the LICENSE file.