A machine learning-powered phishing detector that analyzes email content and identifies suspicious patterns, including malicious URLs.
Built with 💻 Python, 🧠 scikit-learn, and 🌐 Flask.
- ✅ Detects phishing vs legitimate emails
- 🔗 Extracts and analyzes suspicious URLs
- 🧠 Machine learning model (TF-IDF + Random Forest)
- 🌐 Web interface with light/dark mode toggle
- 🎨 Interactive, modern UI
- 🧰 Easy to retrain with your own dataset
phishing_detector/ ├── app/ │ ├── detector_api.py # Flask web app │ └── templates/index.html # Frontend ├── data/ # Email datasets ├── models/ # Model + vectorizer (generated after training) ├── scripts/ │ ├── train_model.py # Train model │ ├── predict.py # Predict phishing or legit │ ├── preprocess.py # Load datasets │ ├── feature_extractor.py # TF-IDF vectorization │ └── url_analyzer.py # Suspicious URL detection ├── requirements.txt └── README.md
git clone https://github.com/hassanmajaro/phishing-email-detector.git
cd phishing-email-detectorpip install -r requirements.txtPlace your email in the data/ folder:
- phishing_emails.csv
- legit_emails.csv
python scripts/train_model.pypython app/detector_api.pyOpen in your browser: http://127.0.0.1:5000
Both .csv files should have at least:
subject,body,from
"URGENT: Account Warning", "Click here: http://phish.com", "noreply@fakebank.com"Pull requests are welcome!
If you have feature suggestions or want to help improve detection, feel free to open an issue or PR
Majaro Hassan
Cybersecurity Enthusiast
