From 8909c2c3610fd1136b67f38e09d958b8c1f7f334 Mon Sep 17 00:00:00 2001 From: Alicja Date: Fri, 31 May 2024 23:04:52 +0200 Subject: [PATCH] Updating the Readme file with the correct information --- README.md | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1318fd6..353e9a0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,76 @@ # PhishGuardian -PhishGuardian - Keep you e-mails safe! \ No newline at end of file +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: + ```sh + git clone https://your-repository-url + cd PhishGuardian/backend + ``` + +2. Install the required Python packages: + ```sh + pip install -r requirements.txt + ``` + +3. Run the Flask backend: + ```sh + 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/`: Mark an email as safe. +- `POST /move_trash/`: Move an email to the trash. + +