π‘οΈ Advanced machine learning system for real-time phishing URL detection with browser extension and web interface
TrapEye is a comprehensive cybersecurity solution that combines machine learning algorithms with user-friendly interfaces to detect and prevent phishing attacks. The system provides real-time URL analysis through multiple access points:
- Chrome Extension: Browser-level protection that automatically scans URLs as you browse
- React Web Interface: Standalone web application with detailed analysis and educational resources
- WhatsApp Integration: Specialized extension for detecting malicious links in WhatsApp Web
- Backend API: RESTful API powered by FastAPI serving machine learning models
graph TB
A[User Interfaces] --> B[Backend API]
B --> C[Machine Learning Model]
A --> D[Chrome Extension]
A --> E[React Web App]
A --> F[WhatsApp Extension]
B --> G[FastAPI Server]
C --> H[Random Forest Classifier]
style A fill:#4CAF50,stroke:#388E3C
style B fill:#2196F3,stroke:#0D47A1
style C fill:#FF9800,stroke:#E65100
-
Start the Backend Server
python backend/main.py
-
Option 1: Use Chrome Extension
- Navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
chrome-extensionfolder
- Navigate to
-
Option 2: Run React Web Interface
cd react-frontend npm install npm run devThen visit
http://localhost:5173 -
Option 3: Use WhatsApp Extension
- Navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
trapeye-whatsappfolder - Visit WhatsApp Web to see automatic link analysis
- Navigate to
The system uses a Random Forest Classifier trained on a comprehensive dataset with 39 features extracted from URLs:
- Accuracy: 100% on test data
- Features: Domain analysis, URL structure, lexical features, and more
- Explainability: Detailed reasoning for each prediction
- Performance: Real-time analysis with minimal latency
The FastAPI backend serves as the core of the system, providing endpoints for URL analysis:
GET /health- System health checkPOST /predict- Analyze URL for phishing riskGET /demo- Retrieve demo URLs for testingGET /docs- Interactive API documentation
curl -X POST "http://localhost:8002/predict" \
-H "Content-Type: application/json" \
-d '{"url": "http://paypal-secure-login.com"}'The browser extension provides seamless protection while browsing:
- Real-time URL analysis
- Visual warnings for high-risk sites
- Desktop notifications
- Analysis history
- Customizable settings
- Ensure backend is running
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select
chrome-extensionfolder
Modern web application built with React and TypeScript featuring:
- URL Analyzer: Real-time phishing detection with detailed reports
- Cybersecurity Information: Educational resources for Indian users
- AI Chat: Interactive security assistant
- Vibrant, responsive design with smooth animations
- Detailed risk scoring and feature impact analysis
- Comprehensive cybersecurity information for India
- Demo URLs for quick testing
Specialized extension for WhatsApp Web that automatically detects and analyzes links in chats:
- Automatic link detection in WhatsApp messages
- Real-time analysis with color-coded indicators
- Floating panel for overview of analyzed links
- Privacy-focused (only URLs sent, no message content)
Multiple test scripts are available to verify system functionality:
# Test the enhanced model
python test_enhanced_model.py
# Test API integration
python test_api.py
# Evaluate model performance
python training/evaluate.py- Port: 8002 (configurable in
backend/main.py) - Model:
models/phish_model.joblib
- Port: 5173 (Vite default)
- Build tool: Vite
- Backend URL:
http://localhost:8002(configurable in extension settings)
- Python 3.8+
- Node.js 14+
- pip for Python package management
- npm for Node.js package management
pip install -r requirements.txtcd react-frontend
npm installβββ backend/ # FastAPI server and ML components
β βββ main.py # API server
β βββ url_features.py # Feature extraction
β βββ model_utils.py # Model utilities
βββ chrome-extension/ # Chrome browser extension
βββ trapeye-whatsapp/ # WhatsApp Web extension
βββ react-frontend/ # React web interface
βββ training/ # Model training and evaluation
βββ models/ # Trained ML models
βββ tools/ # Diagnostic and utility scripts
- All processing happens locally on your machine
- Only URLs are sent to the analysis server (no personal data)
- No external tracking or data collection
- History tracking is optional and stored locally
# Check if backend is running
curl http://localhost:8002/health
# If port is busy
netstat -ano | findstr :8002- Verify backend is running
- Check Chrome console for errors (F12 β Console)
- Reload extension in
chrome://extensions/
# Clear cache and reinstall dependencies
cd react-frontend
rm -rf node_modules package-lock.json
npm install- RUN_SYSTEM.md - Complete system running guide
- ENHANCED_MODEL_REPORT.md - Detailed ML model documentation
- TRAINING_SUMMARY.md - Model training results
- Individual component READMEs in each directory
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a pull request
This project is for educational and research purposes. See individual components for specific licensing information.
- Built with FastAPI, React, and scikit-learn
- Inspired by the need for better phishing protection
- Thanks to all contributors and the open-source community