πŸš€ Building a Phishing Email Detector using Machine Learning

Krithick RajKrithick Raj
2 min read

πŸ“Œ 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 β†’ Legitimate

  • 1 β†’ 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:

  1. Paste an email message

  2. Click "Check"

  3. 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

0
Subscribe to my newsletter

Read articles from Krithick Raj directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Krithick Raj
Krithick Raj