This repository contains the end-to-end solution for detecting phishing websites using advanced machine learning techniques. The project was developed as part of the CodeB Data Science Integrated Internship at IT Vedant.
🚀 Live App: website-phishing-detection.streamlit.app
Phishing websites trick users into revealing sensitive information by mimicking legitimate domains. This project builds a machine learning classification model to detect whether a website is phishing or legitimate, based on URL and HTML/JS behavior features. It also explains predictions using LIME and SHAP.
- Source: Provided by the institute (CSV format)
- Shape:
11430 rows × 89 columns - Target column:
status— (legitimate: 0,phishing: 1)
- Dropped irrelevant columns (
url) - Balanced classes → no oversampling needed
- Performed correlation filtering and skewness handling
- Applied robust scaling and Yeo-Johnson transformation
- Feature Engineering:
url_complexity,tag_to_link_ratio,domain_numeric_intensity,path_word_complexity
- Final Features Selected: ✅ 28 (via Correlation, ANOVA, RFE, Random Forest Importance, VIF)
- Trained multiple models: Logistic Regression, KNN, SVM, Decision Tree, Random Forest, XGBoost, ANN
- ✅ Best Model: XGBoostClassifier
- Hyperparameter tuning via
GridSearchCV - ROC-AUC: 0.990, F1 Score: 95.86%
| Component | Tool/Library |
|---|---|
| Data Processing | Pandas, NumPy |
| Visualization | Matplotlib, Seaborn |
| ML Models | Scikit-learn, XGBoost |
| Explainability | SHAP, LIME |
| Frontend | Streamlit |
| Deployment | Streamlit Cloud |
| Version Control | Git, DVC |
| Containerization | Docker |
| CI/CD | GitHub Actions |
phishing-detector/
├── app.py # Streamlit frontend
├── feature_scrapper.py # URL feature extraction
├── model.pkl # Trained model
├── explainer.pkl # Optional LIME/SHAP objects
├── .env # API keys
├── Dockerfile # Docker container setup
├── requirements.txt # Python dependencies
├── dvc.yaml # DVC pipeline
├── .github/
│ └── workflows/
│ └── deploy.yml # GitHub Actions workflow
├── data/
│ └── dataset_phishing.csv
└── model/
└── xgb_pipeline.pkl
- Local explanation for individual predictions
- Interactive
.htmlvisualizations - Top influential features:
google_index,page_rank,phish_hints,ratio_intHyperlinks
- Global feature importance and summary plots
- SHAP bar plot aligns with domain intuition:
- Low trust scores → phishing
- Legitimate indicators (title-domain match, indexing) → non-phishing
| Metric | Value |
|---|---|
| Accuracy | 95.83% |
| Precision | 95.46% |
| Recall | 96.23% |
| F1 Score | 95.86% |
| ROC-AUC | 0.990 |
- Confusion Matrix Heatmap
- ROC Curve
- Precision-Recall Curve
URL: http://secure-login-info.confirmupdate.biz
Prediction: Phishing
Top Contributors:
google_index = 0→ +0.31phish_hints = 1→ +0.22page_rank = 1→ +0.18
git clone https://github.com/<your-username>/phishing-detector.git
cd phishing-detector
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Add .env file
echo "GOOGLE_API_KEY=your_key
PAGERANK_API_KEY=your_key" > .env
# Launch app
streamlit run app.pydocker build -t phishing-detector .
docker run -p 8501:8501 phishing-detector- Push code to GitHub
- Connect repo to streamlit.io
- Add secrets for
GOOGLE_API_KEYandPAGERANK_API_KEY - Click Deploy
dvc pull # Downloads model and dataset filesTracked:
data/dataset_phishing.csvmodel/model.pkl
MIT License © 2025 Gaurav Jadhav
GitHub | Portfolio | LinkedIn
- SHAP, LIME, OpenPageRank API, Google CSE API
- IT Vedant – CodeB Data Science Internship
- Streamlit & GitHub Actions team