An AI-driven application designed to detect phishing URLs using machine learning. It features a Python-based Flask backend API and an interactive HTML/CSS/JavaScript frontend for real-time analysis. This project addresses the challenge of identifying deceptive URLs to protect users from cyber threats.
- Advanced AI Model – Uses an ensemble of ML models: Random Forest, XGBoost, LightGBM.
- Feature-Rich Analysis – Extracts and analyzes over 87 lexical and host-based features.
- RESTful Backend API – Flask-based API that serves the ML model for easy integration.
- Interactive Frontend – Modern interface (HTML/CSS/JS) for real-time URL safety checks.
- Fallback Mechanism – Includes a basic client-side analysis engine if the backend API is unavailable.
- Modular Codebase – Separate scripts for model training and backend server.
- Backend: Python, Flask, Pandas, Scikit-learn, XGBoost, LightGBM, tldextract
- Frontend: HTML, CSS, JavaScript
- Dataset:
dataset_phishing.csv
- Python 3.7+
pip(Python package manager)
Ensure all files are in your project directory:
phishing_dataset.py→ Model training scriptflask_backend_api.py→ Backend API serverPhishing Detection App.html→ Frontend applicationdataset_phishing.csv→ Training dataset
# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install Flask Flask-Cors pandas numpy scikit-learn xgboost lightgbm tldextractGenerate the ML model (phishing_model_predefined.pkl):
python phishing_dataset.pyRun the Flask server (keep this terminal window open):
python flask_backend_api.pyDouble-click:
Phishing Detection App.html
➡️ The status indicator will show “AI Model Connected” once the backend is running. You can now begin analyzing URLs.
You can integrate the backend API with a Chrome/Edge extension for seamless real-time protection.
-
Open your browser’s extension management page:
- Chrome:
chrome://extensions/ - Edge:
edge://extensions/
- Chrome:
-
Enable Developer mode (toggle switch).
-
Click Load unpacked.
-
Select the phishing-detector project folder.
-
The
Phishing Detector extensionwill now appear in your extensions list.- Pin it to your toolbar for quick access.