PhishDetector is a lightweight Chrome extension (Manifest V3) that analyzes email text and returns a phishing probability score with a short explanation.
Built as an Information Security course team project to explore how LLMs can help users spot suspicious emails faster.
- Phishing probability score (e.g., Low / Medium / High)
- Explanation of signals (urgent tone, credential requests, suspicious links, impersonation cues, etc.)
- Simple UI (popup) for quick copy/paste analysis
- Uses OpenAI API via a small helper module (
gpt.js)
PhishDetector/
├─ images/ # Extension icons / UI assets
├─ index.html # Popup UI
├─ style.css # Popup styling
├─ content.js # Content script (if used for page/email extraction)
├─ gpt.js # OpenAI request + scoring logic
├─ config.js # Configuration (API key / model / prompt settings)
└─ manifest.json # Chrome extension manifest (MV3)git clone <YOUR_REPO_URL>
cd PhishDetectorThis project uses config.js for configuration.
Open config.js and set your API key (example):
export const OPENAI_API_KEY = "YOUR_KEY_HERE";✅ Recommended (safer) approach
Instead of hardcoding, you can:
- keep
config.jsas a local-only file, and - add it to
.gitignoreso it never gets committed.
Create a .gitignore file (if you don’t have one):
config.jsIf you already committed your API key once, rotate it immediately in your OpenAI dashboard.
- Go to:
chrome://extensions - Enable Developer mode (top right)
- Click Load unpacked
- Select the
PhishDetectorproject folder
- Open an email in your email client
- Copy the email body text (and suspicious links if possible)
- Click the PhishDetector extension icon
- Paste the text into the popup
- Click Analyze
- Review the phishing score + explanation
- User provides email text through the popup UI (
index.html). - The extension sends the text to OpenAI (via
gpt.js). - The model returns a structured response (score + reasoning).
- The UI displays the result.
- API key exposure risk: calling OpenAI directly from a Chrome extension means the key can be extracted by a determined attacker.
- Cannot reliably analyze text inside embedded images (e.g., screenshots of invoices) without OCR.
- Results are probabilistic: the score is an assistive signal, not a guarantee.
- Move OpenAI calls to a backend proxy (server/API route) so the extension never stores a secret key.
- Add URL extraction and basic checks (punycode, mismatched domains, shortened URLs).
- Optionally add OCR for images (with user permission).
- Backend proxy for API calls (remove API key from client)
- URL detection + warning highlights
- Better structured output (strict JSON parsing + UI formatting)
- Optional OCR support for screenshot-based phishing
- Kisang Hwang
- Jordan Fung
- Quang Le