All work

PhishGuard — Final Year Project

Detecting phishing URLs with machine learning—and explaining why they were flagged. I'm building it alone as my final-year project, together with a safe phishing-awareness simulation.

My role
Sole Developer
Project
Final Year Project
Timeline
Aug 2026 – present
Status
Prototype: user testing still to come
URL detection on a test address, with its top five reasons. One example result, not a measure of accuracy.

Overview

Phishing works because a convincing message reaches someone at a busy moment. Organisations try two things against it: teaching people what to look for, and flagging risky links. These usually live in separate tools, and detection tools rarely say why they flagged something.

PhishGuard puts both in one place. An administrator can run a controlled awareness exercise, follow up with short training and a quiz, and check a suspicious URL with a model that explains its answer. Every part is designed to stay safe: the simulation never collects passwords, and URL checks never contact the link being checked.

Python · Flask · SQLAlchemy · PostgreSQL · React · Vite · scikit-learn · SHAP · GitHub Actions

My role

PhishGuard is a solo project, so the whole thing is mine: every commit in the repository is my own.

  • Scope and planning: split the project into seven phases, from setup to testing, and tracked each one against a feature checklist.
  • Back end: the Flask API, database models, sign-in, campaigns, tracking and email delivery.
  • Machine learning: URL feature extraction, model training, the prediction API and SHAP explanations.
  • Front end: the React admin workspace, dashboard and detection screens.
  • Quality: automated tests, CI, security checks and written guides for each phase.

Main features

Everything below is built and runs today, unless it's marked as partial or planned.

URL detection

A Random Forest model scores a URL as phishing or legitimate using 18 features taken from the text of the URL, such as its length, number of subdomains, unusual characters and suspicious words. It never visits, looks up or downloads the address, so checking a dangerous link is safe. Only signed-in administrators can use it.

SHAP explanations

Every result lists the five features that pushed the score most, with how strongly and in which direction. The interface presents this as decision support rather than a final verdict.

Awareness simulation

Administrators approve users, create a campaign from a template, and give each person a unique tracking link. What happens next:

  1. The participant opens the linkPhishGuard records the click and shows a clearly labelled practice page.
  2. They choose to continue, or notThe page has no real form fields and never asks for a password. Only the choice is recorded.
  3. Training and a quiz followFive checks to use before trusting a message, then a five-question quiz.

Also built

  • Dashboard: campaign results, training completion, quiz scores, and a risk score per user that shows exactly how it was calculated.
  • Safe email delivery: test emails go to a local inbox by default. An optional Gmail profile is encrypted, sends only to approved users, is capped per hour, and needs a typed confirmation.
  • Email inspection (partial): reads a pasted email's headers, flags warning signs, and checks its links with the URL model. There is no trained email model yet.

How it's built

A React front end talks to a Flask API over JSON, with sign-in handled by JSON Web Tokens. SQLAlchemy stores the data in PostgreSQL. The participant pages are served by Flask itself, so they work without the admin app. Docker currently runs only the local test inbox; packaging the whole app with Docker and Nginx is planned, not built.

Key decisions

  • Read the URL, never visit it. No web requests or DNS lookups, so analysing a malicious link can't trigger it.
  • Left out the HTTPS feature. In my training data almost every legitimate URL used HTTPS, so the model could learn where a URL came from rather than whether it was phishing. It's still shown to the user, but never used to score.
  • A practice page that can't capture passwords. Its form has no named fields, and the server doesn't read what was sent.
  • Explain links on request. SHAP took about half a second per link, so email inspection scores all links in one batch and explains a link only when asked.
  • A risk score anyone can check. Fixed points for clicking, continuing, unfinished training and quiz gaps, with the weights shown in the interface.

The interface

Screens recorded from a local build of the app, using made-up test data and reserved test addresses. The URL detection demo is at the top of this page.

Campaigns screen with a form to create a campaign and choose a template and delivery method, next to a list holding one completed test campaign.
Creating a campaign. New campaigns start as drafts and send nothing.
Email inspection of an invented test email. A banner reads: partial implementation, not a trained email classifier. Panels show sender details, SPF, DKIM and DMARC marked unknown, and two rule-based warning signs.
Email inspection on an invented test email. This part is still partial.
Practice page on a phone titled Verify your account, with one button, I would continue, and a note that the page never asks for or accepts credentials.
The practice page a participant reaches, on a phone.
Training page: This was a simulation. No credentials were captured or stored. Below it, five checks, starting with inspect the sender and inspect the link destination.
The training that follows. The participant is fictional test data.

Challenges, testing and limits

Keeping the model honest

The first models could pick up shortcuts in the data rather than real phishing signals, like the HTTPS pattern above. I recorded what is known about each dataset's source, separated phishing URLs by date, and wrote the final evaluation plan before opening the test data, so the test couldn't be tuned to.

Making a phishing tool safe to use

A simulation tool could be misused. I added limits at every step: approved recipients only, a "[SECURITY SIMULATION]" subject label, a preview with typed confirmation, hourly caps, and nothing that ever stores a password.

Testing

  • 362 back-end tests passing with 93% code coverage (26 Nov 2026). The build fails below 85%.
  • Front-end tests, linting and a production build run alongside them in GitHub Actions on every change.
  • Security checks cover sign-in protection, password hashing, restricted cross-origin access, security headers, and the password-free practice page.

Current limitations

  • The model reads URL text only. It can miss phishing links and flag safe ones, so its result is a prompt to look closer, not a guarantee.
  • Email inspection is partial: there is no trained email classifier yet.
  • Usability testing with real participants hasn't happened yet. The study plan and questionnaire are ready.

What's next

Running the usability study with six to eight participants, then training an email classifier so email inspection can give a full result.