PhishGuard is a comprehensive phishing detection system that uses Machine Learning to identify malicious URLs in real-time. It includes a Web Dashboard, a REST API, and a Chrome Extension for active browsing protection.
- Real-Time Analysis: Scans URLs instantly using a trained XGBoost model.
- Chrome Extension: Protects you while you browse by showing warning banners on suspicious sites.
- Web Dashboard: Manually check URLs via a clean web interface.
- High Accuracy: Trained on over 65,000 verified phishing and benign URLs.
- Python 3.8+
- Node.js & npm (for the web dashboard)
The API handles the machine learning inference.
-
Install Python dependencies:
pip install flask flask-cors pandas joblib scikit-learn xgboost
-
Navigate to the backend directory and start the API server:
cd backend python api.pyThe API will start on http://127.0.0.1:5000. Keep this terminal open.
The dashboard allows you to test URLs manually.
-
Install Node.js dependencies:
npm install
-
Start the web server:
npm run serve-web
The dashboard will open at http://localhost:5500.
Enable real-time protection in your browser.
- Open Chrome and navigate to
chrome://extensions/. - Toggle Developer mode (top right).
- Click Load unpacked.
- Select the
extensionfolder located in this repository. - The PhishGuard icon should appear in your toolbar.
The system uses an XGBoost Classifier trained on linguistic and structural features of URLs (e.g., length, special characters, IP usage).
-
Training: To retrain the model with the provided dataset:
cd backend python train_model.pyThis will generate a new
phishing_detector_model.pklfile. -
Prediction (CLI): To test a URL from the command line:
cd backend python predict.py "http://suspect-url.com"
backend/: Contains API server, ML models, and database.api.py: Flask API server.phishing_detector_model.pkl: Trained XGBoost model.users.db: SQLite database for user data.
frontend/: Contains the web dashboard (HTML/CSS/JS).index.html: Main landing page.url_detection.html,qr_detection.html: Specialized tool pages.
extension/: Source code for the Chrome Extension (manifest, scripts, popup).
This project is for educational and research purposes. While highly accurate, no anti-phishing tool is 100% perfect. Always verify URLs carefully.