Advanced Machine Learning-Based ARP Spoofing Detection System
π Network Security | π€ Machine Learning | π― 96.70% Accuracy | β‘ Real-time Detection
SafeLink is an intelligent network defense system that detects ARP spoofing attacks using a multi-layered machine learning approach. It combines Deterministic Finite Automaton (DFA) pre-filtering with Random Forest classification to achieve 96.70% detection accuracy with only 2.11% false positive rate.
- β Real-time ARP Packet Monitoring - Captures and analyzes Layer 2 traffic
- β Machine Learning Detection - Random Forest classifier with 96.70% accuracy
- β 3-Layer Detection Architecture - DFA + ANN + Random Forest fusion
- β Web-Based Dashboard - React frontend for real-time monitoring
- β Continuous Learning - Automated model retraining capability
- β Threat Intelligence - Integration with AbuseIPDB
- β RESTful API - FastAPI backend with WebSocket support
- β Alert Management - Comprehensive logging and archiving
Windows:
# Run as Administrator
.\start_development.ps1Linux/Mac:
sudo ./start_development.shThis will:
- Create virtual environment
- Install dependencies
- Initialize database
- Start backend (http://localhost:8000)
- Start frontend (http://localhost:5173)
See DEPLOYMENT_GUIDE.md for comprehensive production deployment instructions.
Quick production start (Linux):
sudo ./start_production.shWindows:
# Run as Administrator
.\start_production.ps1SafeLink/
βββ π Backend/
β βββ SafeLink_Backend/
β βββ api.py # FastAPI application
β βββ main.py # CLI entry point
β βββ train_rf.py # Random Forest trainer
β βββ evaluate_models.py # Model evaluator
β βββ requirements.txt # Python dependencies
β βββ config/ # Configuration modules
β βββ core/ # Core detection logic
β βββ data/ # Datasets & database
β βββ models/ # Trained ML models
β βββ logs/ # Application logs
β βββ tests/ # Test suite
β βββ utils/ # Utility scripts
β
βββ π Frontend/
β βββ src/
β β βββ App.jsx # Main React component
β β βββ components/ # Reusable components
β β βββ views/ # Page views
β β βββ lib/ # API client
β βββ package.json # npm dependencies
β βββ vite.config.js # Vite configuration
β
βββ π docs/ # Documentation files
βββ π paper_details/ # Research paper details
β
βββ π DEPLOYMENT_GUIDE.md # Production deployment guide
βββ π README.md # This file
βββ π start_development.sh # Dev startup (Linux)
βββ π start_development.ps1 # Dev startup (Windows)
βββ π start_production.sh # Production startup (Linux)
βββ π start_production.ps1 # Production startup (Windows)
- OS: Ubuntu 20.04+ / Windows 10/11
- CPU: 4 cores @ 2.5 GHz
- RAM: 8 GB
- Storage: 20 GB
- Network: Gigabit Ethernet
- OS: Ubuntu 22.04 LTS Server
- CPU: 8 cores @ 3.0 GHz
- RAM: 16 GB
- Storage: 100 GB SSD
- Network: 10 Gbps
Ubuntu/Linux:
sudo apt update
sudo apt install python3.11 python3.11-venv python3.11-dev -y
sudo apt install nodejs npm libpcap-dev -yWindows:
- Install Python 3.11.9
- Install Node.js 20.x LTS
- Install Npcap (with WinPcap compatibility)
- Clone the repository:
git clone <repository-url>
cd coreproject- Configure environment:
cd Backend/SafeLink_Backend
cp .env.example .env
# Edit .env file with your configuration- Install backend dependencies:
python3.11 -m venv venv
source venv/bin/activate # Linux
# OR .\venv\Scripts\Activate.ps1 # Windows
pip install -r requirements.txt- Initialize database:
python Scripts/setup_db.py- Install frontend dependencies:
cd ../../Frontend
npm install- Start the application:
# Development mode
cd ..
sudo ./start_development.sh # Linux
# OR .\start_development.ps1 # Windows (as Admin)Development Mode:
- Backend auto-reloads on code changes
- Debug logging enabled
- Single worker process
- Access at: http://localhost:8000 (API) and http://localhost:5173 (UI)
Production Mode:
- Multiple workers (4)
- Info-level logging
- Optimized for performance
- Access at: https://your-domain.com
- Open browser:
http://localhost:5173(development) orhttps://your-domain.com(production) - Login with credentials (create account on first run)
- Navigate through:
- Dashboard - Real-time system status and recent alerts
- Alerts - Complete alert history with filtering
- Attackers - Threat intelligence and attacker profiles
- Continuous Learning - Model training and performance
- Mitigation - Manual response actions
Interactive API documentation available at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
- Accuracy: 96.70%
- Precision: 95.98%
- Recall: 97.89%
- F1-Score: 96.93%
- ROC-AUC: 99.38%
- False Positive Rate: 2.11%
- False Negative Rate: 4.66%
- Inference Time: ~2ms per packet
- Throughput: 1,000 packets/second
- Detection Latency: 0.2-0.5 seconds
- Memory Usage: 4-6 GB (typical)
- CPU Usage: 40-75% (under load)
Run the test suite:
cd Backend/SafeLink_Backend
source venv/bin/activate
pytest tests/Test coverage:
pytest tests/ --cov=. --cov-report=html- HTTPS Required: Use SSL/TLS in production (see deployment guide)
- Strong Secrets: Generate secure SECRET_KEY (32+ characters)
- Rate Limiting: Enable API rate limiting to prevent brute force
- Firewall Rules: Block direct access to backend port (8000)
- Regular Updates: Keep dependencies updated monthly
- Backup Strategy: Daily database backups recommended
- Deployment Guide - Production deployment
- Vercel Deployment - Deploy to Vercel
- Git Deployment Checklist - Pre-deployment checklist
- Architecture Details - System architecture
- Tech Stack - Complete technology breakdown
- Model Results - Detailed model evaluation
- Formulas - Mathematical formulas
- Limitations - Known limitations
Real-time network monitoring and threat detection
Comprehensive alert history with detailed analysis
Attacker profiling with AbuseIPDB integration
Screenshots coming soon - Deploy and see it in action!
Want to see SafeLink in action?
-
Quick Local Demo:
git clone https://github.com/Nagarohit29/Safelink.git cd Safelink # Windows .\start_development.ps1 # Linux/Mac sudo ./start_development.sh
Then open: http://localhost:5173
-
Deploy Your Own:
- See VERCEL_DEPLOYMENT.md for setup instructions
- π GitHub Actions - CI/CD Status
- π Issues - Report bugs or request features
- π Pull Requests - Contribute to the project
- π Wiki - Additional documentation
- π Star this repo - Show your support!
This is a research project. For contributions:
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Research & Development Team
- Network Security Laboratory
- scikit-learn - Random Forest implementation
- FastAPI - Modern Python web framework
- React - Frontend library
- Scapy - Packet manipulation
- Vite - Frontend build tool
Having issues or questions?
- π Report a Bug
- π‘ Request a Feature
- π Documentation
- π¬ Discussions
For security vulnerabilities: Please email: security@safelink-project.com (Do not create public issues)
- Fix ANN model performance
- Implement functional mitigation actions
- Add HTTPS support
- SIEM integration (Splunk, ELK)
- IPv6 support (NDP spoofing detection)
- Cloud deployment support (AWS, Azure, GCP)
- Distributed architecture
- Mobile application
- Advanced reporting and analytics
- Machine learning model marketplace
| Metric | Status |
|---|---|
| Version | 1.0.0 |
| Status | β Production Ready |
| Build | |
| Deployment | |
| Last Updated | October 31, 2025 |
| Stability | Stable |
| Maintenance | π’ Active |
If you find this project useful, please consider giving it a star! β
Built with β€οΈ for network security
π Homepage β’ π Documentation β’ π Report Bug β’ β¨ Request Feature