PhishGuardian - Keep you e-mails safe!
backend | ||
extension | ||
Dokumentacja Konserwacyjna.pdf | ||
Dokumentacja Użytkowa.pdf | ||
LICENSE | ||
README.md |
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
-
Clone the repository:
git clone https://your-repository-url cd PhishGuardian/backend
-
Install the required Python packages:
pip install -r requirements.txt
-
Run the Flask backend:
python backend.py
Extension Setup
- Open Chrome and go to
chrome://extensions/
- Enable "Developer mode" by toggling the switch in the top right corner.
- Click on "Load unpacked" and select the
PhishGuardian
directory.
Usage
- Click on the PhishGuardian extension icon in the Chrome toolbar.
- Login with your email credentials. For now only credentials to wp.pl mailing service are supported (this will change in the future).
- Use the "Check Mail" button to scan for phishing emails.
- 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
¬ification.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.