π Building a Phishing Email Detector using Machine Learning

π Introduction
Cybersecurity is one of the most critical concerns in the digital era, and phishing attacks remain a major threat. As a final-year Cybersecurity student, I wanted to apply my skills and create something practical and relevant. Thatβs how this Phishing Email Detector project was born.
π Problem Statement
Phishing emails trick users into revealing sensitive information by mimicking trusted sources. Manual detection is time-consuming and error-prone. My goal was to automate this process using machine learning.
π οΈ Tech Stack
Python
Flask (for web app)
Scikit-learn (ML modeling)
Pickle (model storage)
HTML/CSS (Frontend)
GitHub (Version control)
π Dataset
The dataset contains labeled emails:
0
β Legitimate1
β Phishing
Each email text was preprocessed and vectorized using TF-IDF to extract meaningful features.
π€ Model Training
Model: Logistic Regression
Achieved 100% Accuracy on test data (small sample for prototype)
Tools:
train_model.py
script handled preprocessing, training, evaluation, and model saving.
πΎ Output
Model and vectorizer were saved as:
model/phishing_model.pkl
model/tfidf_vectorizer.pkl
π Web Interface
Built a simple yet functional web interface using Flask and HTML.
Users can:
Paste an email message
Click "Check"
Get immediate result: Phishing or Not
π¦ GitHub Repository
Hereβs the full source code:
π github.com/itz-krithick-raj/phishing-detector
π Future Improvements
Use deep learning with LSTM models
Expand dataset for higher reliability
Add email header analysis
Implement real-time scanning from inboxes
π§ What I Learned
End-to-end ML deployment
Flask web development
Git/GitHub workflows
Debugging and problem-solving during deployment
Subscribe to my newsletter
Read articles from Krithick Raj directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
