An AI-powered educational tool for generating and analyzing phishing emails to help improve cybersecurity awareness. Built with Next.js, OpenAI, and modern frontend best practices.
PhishGen & PhishBuster lets you:
- Generate realistic phishing emails for training and awareness.
- Analyze any email (manual paste, IMAP, or simulation) for phishing risk, red flags, and technical signals.
- Learn about phishing tactics and how to spot them, with detailed, actionable reports.
- Generate realistic phishing emails using AI.
- Paste any email content for instant analysis—no account connection required.
- Get detailed security reports with actionable insights and educational breakdowns.
- Connect to your email account (Gmail, Outlook, Yahoo, etc.) via IMAP.
- Analyze real emails for phishing attempts using OpenAI's GPT-4.
- Get comprehensive reports: link reputation, sender domain, header checks, content patterns, and more.
- Run autonomous phishing simulations with multiple rounds.
- Customize target company, simulation speed, and other parameters.
- Review interactive logs and round-by-round analysis.
- On the Manual Email Analysis page, select Sophisticated Agentic Analysis and enable the Smart LLM Parse checkbox.
- The pasted email is parsed using both a regex-based parser and an LLM-powered parser (OpenAI GPT-4o).
- Results are merged: LLM fields are preferred, regex is used as fallback.
- If required fields (
from,subject,date,body) are missing, the UI prompts you to fill them in before analysis proceeds. - The parsed/merged object is shown in the UI for transparency and debugging.
- Endpoint:
POST /api/llm-email-parse - Request body:
{ raw: <pasted email string> } - Uses a robust prompt (with examples) to extract sender, recipient, date, body, headers, and links—even from informal or headerless emails.
- Returns a JSON object with all required fields, filling in "unknown" if a field cannot be inferred.
- Example output:
{ "from": "Chloe Okereke", "to": "me", "subject": "unknown", "date": "2025-04-26T07:18:00", "body": "Hi Jeevan,\n\nSorry – was it the Rattan's you wanted?!\n...", "headers": {}, "links": ["https://dukeanddexter.com/pages/returns"] }
- Paste any email (with or without headers) into the Manual Analysis page.
- Enable Smart LLM Parse (optional, but recommended for informal emails).
- The system parses the email with both regex and LLM.
- Merging: LLM results are used where available; regex fills in gaps.
- If any required fields are missing, you are prompted to fill them in manually.
- The final, complete email object is sent to the backend agent for analysis.
- The LLM prompt is designed to handle both standard and informal emails, and includes explicit examples to guide the model.
- If the LLM or regex parser cannot extract all required fields, the UI will prompt the user to fill them in manually.
- The backend agent will always receive a valid, complete email object, ensuring robust analysis and no more "Failed to analyze email" errors due to missing fields.
- You can further tune the LLM prompt or add more examples in
src/app/api/llm-email-parse/route.ts. - The parsing/merging logic is in
src/components/ManualEmailAnalyzer.tsx.
- Go to Manual Analysis.
- Paste any email (with or without headers).
- Select Sophisticated Agentic Analysis and (optionally) enable Smart LLM Parse.
- Click Analyze. If required fields are missing, fill them in when prompted.
- View the parsed object and analysis results.
- OpenAI API key (set as
OPENAI_API_KEYin your environment)
- 2024-06: Added LLM-powered parsing, robust merging, and UI fallback for missing fields.
- Clone the repository:
git clone https://github.com/yourusername/phishing-app.git cd phishing-app - Install dependencies:
npm install
- Create a
.envfile in the root directory and add your API keys:OPENAI_API_KEY=your_openai_api_key_here # (Optional) GEMINI_API_KEY=your_gemini_api_key_here
- Gemini key is needed for some of the non-agent features, the agent features are used with openai
- Run the development server:
npm run dev
- Open http://localhost:3000 in your browser.
This tool is designed for educational purposes only. It helps users:
- Understand common phishing tactics
- Learn to identify suspicious emails
- Develop better security awareness
- Practice email analysis skills
Do not use this tool for malicious purposes or to create actual phishing campaigns.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.