PhishGuardian - Keep you e-mails safe!
Go to file
2024-05-31 23:04:52 +02:00
backend Adding license and readme files 2024-05-31 22:59:47 +02:00
extension Moving the project to the final repository 2024-05-31 22:49:37 +02:00
LICENSE Adding license and readme files 2024-05-31 22:59:47 +02:00
README.md Updating the Readme file with the correct information 2024-05-31 23:04:52 +02:00

PhishGuardian

PhishGuardian is a browser extension designed to detect and manage phishing emails. It uses machine learning to identify potential phishing emails and provides options to mark them as safe or move them to the trash. The extension is built using Flask for the backend and JavaScript for the frontend.

Features

  • Detects phishing emails using machine learning
  • Allows users to mark emails as safe
  • Allows users to move phishing emails to the trash
  • Provides notifications for detected phishing emails

Installation

Prerequisites

  • Python 3.6+
  • Flask
  • scikit-learn
  • Chrome browser

Backend Setup

  1. Clone the repository:

    git clone https://your-repository-url
    cd PhishGuardian/backend
    
  2. Install the required Python packages:

    pip install -r requirements.txt
    
  3. Run the Flask backend:

    python backend.py
    

Extension Setup

  1. Open Chrome and go to chrome://extensions/
  2. Enable "Developer mode" by toggling the switch in the top right corner.
  3. Click on "Load unpacked" and select the PhishGuardian directory.

Usage

  1. Click on the PhishGuardian extension icon in the Chrome toolbar.
  2. Login with your email credentials. For now only credentials to wp.pl mailing service are supported (this will change in the future).
  3. Use the "Check Mail" button to scan for phishing emails.
  4. If a phishing email is detected, a notification will appear with options to mark the email as safe or move it to the trash.

Code Overview

Backend (backend.py)

  • Uses Flask to handle HTTP requests.
  • Uses IMAP to connect to the email server and fetch emails.
  • Uses scikit-learn to classify emails as phishing or not based on the subject and sender.
  • Provides endpoints for login, checking mail, marking emails as safe, and moving emails to trash.

Frontend

  • popup.html: The main interface of the extension.
  • popup.js: Handles interactions in the popup, such as login, checking mail, and handling responses.
  • background.js: Listens for messages from the popup and handles notifications.
  • notification.html & notification.js: The interface and logic for the notification popup.

API Endpoints

  • POST /login: Login with email credentials.
  • GET /check_mail: Check for new emails and classify them.
  • POST /logout: Logout from the email account.
  • POST /mark_safe/<email_id>: Mark an email as safe.
  • POST /move_trash/<email_id>: Move an email to the trash.