Om-Fulsundar/phishguard-X

GitHub: Om-Fulsundar/phishguard-X

PhishGuard X 是一个钓鱼邮件调查平台,通过自动化的多信号分析流程帮助安全分析师快速研判可疑邮件并生成可解释的调查报告。

Stars: 0 | Forks: 0

# PhishGuard X **粘贴一封可疑邮件。几秒钟内获取完整的威胁调查报告。** [![Python](https://img.shields.io/badge/Python-3.10+-3776AB?style=flat&logo=python&logoColor=white)](https://python.org) [![Next.js](https://img.shields.io/badge/Next.js-14-000000?style=flat&logo=next.js)](https://nextjs.org) [![Flask](https://img.shields.io/badge/Flask-3.x-000000?style=flat&logo=flask)](https://flask.palletsprojects.com) [![LinkedIn](https://img.shields.io/badge/LinkedIn-Om%20Fulsundar-0077B5?style=flat&logo=linkedin)](https://www.linkedin.com/in/om-fulsundar737) [![GitHub](https://img.shields.io/badge/GitHub-Om--Fulsundar-181717?style=flat&logo=github)](https://github.com/Om-Fulsundar) [![Email](https://img.shields.io/badge/Email-om.fulsundar.7370%40gmail.com-D14836?style=flat&logo=gmail)](mailto:om.fulsundar.7370@gmail.com)
大多数钓鱼工具只给你一个结论,除此之外什么都没有。PhishGuard X 会展示每一条被触发的规则、每一个未通过认证的域名、每一个被标记的可疑 URL —— 对它们进行评分、解释,并导出为 PDF 报告。 作为安全毕业设计项目构建。旨在像真正的专业工具一样运行。 ## 适用人群 - 负责分类处理上报钓鱼邮件的安全分析师 - 在决定是否升级事件之前,调查可疑信息的 IT 团队 - 任何收到可疑邮件并想了解其中具体包含什么内容的人 ## 功能说明 粘贴一封原始邮件(包括邮件头),平台将通过完整的分析 pipeline 对其进行处理: - 解析邮件头 —— From、Reply-To、Return-Path、Message-ID、Received 链 - 从邮件正文中提取所有的 URL、IP、域名和电子邮件地址 - 运行实时的 SPF、DKIM 和 DMARC 查询,并检查 Reply-To 域名是否不匹配 - 分析每个 URL 的启发式危险信号,并与 VirusTotal v3 进行交叉比对 - 结合地理定位和 ASN 信息,将发件 IP 与 AbuseIPDB 进行比对检查 - 通过加权多信号引擎对所有内容进行评分,并返回判定结果 - 生成专业的 PDF 报告并按次调查进行保存 完整的输出示例和评分逻辑演练位于 [`/docs`](docs/) 中。 ## 判定标准 | 评分 | 判定结果 | |-------|---------| | 0 – 30 | CLEAN (安全) | | 31 – 60 | SUSPICIOUS (可疑) | | 61 – 100 | MALICIOUS (恶意) | 没有任何单一信号会直接得出 MALICIOUS 的结论。该引擎需要多个信号相互印证。 ## 技术栈 | 层级 | 技术 | |-------|------| | Frontend | Next.js, TypeScript, Tailwind CSS, shadcn/ui | | Backend | Python 3.10+, Flask | | Database | SQLite + SQLAlchemy 2.x (WAL 模式) | | DNS | dnspython | | PDF | ReportLab | | Threat Intel | VirusTotal v3, AbuseIPDB | ## 安装说明 ### 后端 ``` git clone https://github.com/Om-Fulsundar/phishguard-x cd phishguard-x/backend python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt cp .env.example .env ``` 打开 `.env` 并添加你的 API key: ``` VIRUSTOTAL_API_KEY=your_key_here ABUSEIPDB_API_KEY=your_key_here ``` 两者的免费额度都可以使用。VirusTotal 每天 500 次请求;AbuseIPDB 每天 1,000 次检查。 ``` python app.py # 运行于 http://127.0.0.1:5000 ``` ### 前端 ``` cd ../frontend npm install npm run dev # 运行于 http://localhost:3000 ``` ## API ``` POST /api/analyze # Run analysis on a raw email GET /api/investigations # List all past investigations GET /api/investigations/ # Fetch a single investigation GET /api/report/ # Download the PDF report GET /api/health # Health check ``` 完整的请求/响应 schema 位于 [`/docs`](docs/) 中。 ## 项目结构 ``` phishguard-x/ │ ├── backend/ │ ├── app.py <- Flask app + all API routes │ ├── requirements.txt │ ├── .env.example │ │ │ ├── modules/ │ │ ├── email_parser.py <- Header + body extraction │ │ ├── ioc_extractor.py <- URL / IP / domain / email pulling │ │ ├── dns_checker.py <- Live SPF / DKIM / DMARC checks │ │ ├── url_analyzer.py <- Heuristics + VirusTotal v3 │ │ ├── ip_analyzer.py <- Geolocation + AbuseIPDB │ │ ├── risk_engine.py <- Weighted multi-signal scoring │ │ └── pdf_generator.py <- ReportLab report generator │ │ │ ├── database/ │ │ └── models.py <- SQLAlchemy ORM (SQLite WAL) │ │ │ ├── reports/ <- Generated PDFs live here │ │ │ └── samples/ │ ├── paypal_phishing.txt │ ├── microsoft_phishing.txt │ └── legitimate_email.txt │ ├── frontend/ │ ├── app/ │ │ ├── page.tsx <- Home / analyze page │ │ └── results/page.tsx <- Investigation results page │ │ │ ├── components/ │ │ ├── analyze-form.tsx <- Email input + submit │ │ ├── results-view.tsx <- Full results display │ │ └── ui/ <- shadcn/ui components │ │ │ └── lib/ │ ├── analysis.ts <- Backend adapter + TypeScript types │ └── verdict.ts <- Verdict / severity display metadata │ ├── docs/ │ ├── screenshots/ │ ├── workflow_diagram.png │ ├── architecture_diagram.png │ └── sample_report.pdf │ ├── .gitignore └── README.md ``` ## 限制 - VirusTotal 免费版有速率限制;达到限制时,分析将回退为仅使用启发式算法 - DKIM 检查使用 `default` 选择器 —— 自定义选择器将返回 NONE - 仅支持基于粘贴的方式,无邮件网关集成 ## 作者 **Om Fulsundar** [![LinkedIn](https://img.shields.io/badge/LinkedIn-Om%20Fulsundar-0077B5?style=flat&logo=linkedin)](https://www.linkedin.com/in/om-fulsundar737) [![GitHub](https://img.shields.io/badge/GitHub-Om--Fulsundar-181717?style=flat&logo=github)](https://github.com/Om-Fulsundar) [![Email](https://img.shields.io/badge/Email-om.fulsundar.7370%40gmail.com-D14836?style=flat&logo=gmail)](mailto:om.fulsundar.7370@gmail.com)
标签:Flask, Python, 威胁情报, 安全运营, 开发者工具, 扫描框架, 无后门, 逆向工具, 钓鱼邮件分析