NiKeT972/phishguard

GitHub: NiKeT972/phishguard

面向印度的实时 AI 钓鱼与诈骗检测平台,结合 BERT 模型、正则规则和威胁情报,覆盖 URL、短信、邮件和 UPI ID 等多渠道诈骗识别。

Stars: 0 | Forks: 0

# 🛡️ PhishGuard — 印度的 AI 驱动诈骗防护盾 PhishGuard 是一个为印度打造的实时、AI 驱动的诈骗和钓鱼检测平台。它结合了微调的 BERT 模型、Google Safe Browsing、VirusTotal、WHOIS 查询以及针对印度特色的正则表达式模式,能够在几秒钟内捕获 KYC 欺诈、OTP 钓鱼、虚假奖品诈骗等。 ## 🎯 功能简介 | 功能 | 描述 | |---|---| | **URL 扫描器** | 通过 Safe Browsing、VirusTotal 检查链接,检查 SSL、域名年龄、仿冒域名检测 | | **短信 / 邮件扫描器** | AI (BERT) + 正则表达式,用于检测银行冒充、OTP 钓鱼、KYC 欺诈、求职诈骗 | | **UPI ID 检查器** | 验证格式,检查 UPI ID 中是否包含已知诈骗关键词 | | **Chrome 扩展程序** | 扫描每个页面上的所有链接,并使用 ⚠️/🚨 徽章突出显示可疑链接 | | **仪表板** | 印度实时诈骗热力图、饼图、最新诈骗动态 | | **诈骗百科全书** | 了解 6 种主要诈骗类型及其真实案例和应对方法 | | **印地语解释** | 使用印地语解释诈骗原因,以扩大受众范围 | ## 🏗️ 技术栈 **后端:** Python · FastAPI · HuggingFace Transformers (PhishBERT) · python-whois · httpx **前端:** React · Recharts · lucide-react · CSS Modules **扩展程序:** Chrome Extension Manifest V3 · Vanilla JS **AI 模型:** 来自 HuggingFace 的 `ealvaradob/bert-finetuned-phishing` **APIs:** Google Safe Browsing · VirusTotal · WHOIS ## 🚀 快速开始 ### 方式 1 — 自动化 (推荐) **Linux / Mac:** ``` chmod +x start.sh ./start.sh ``` **Windows:** ``` start.bat ``` ### 方式 2 — 手动 #### 后端 ``` cd backend pip install -r requirements.txt # 可选:将 API keys 添加到 .env uvicorn main:app --reload --port 8000 ``` #### 前端 ``` cd frontend npm install npm start # 在 http://localhost:3000 打开 ``` ## 🔑 API 密钥 (可选 — 无需密钥应用也可正常运行) 该应用在没有 API 密钥的情况下,通过 AI 模型 + 正则表达式检测即可完全运行。密钥可增加额外的准确性。 ### Google Safe Browsing (免费) 1. 前往 [Google 云控制台](https://console.cloud.google.com) 2. 启用 "Safe Browsing API" 3. 创建 API 密钥 4. 添加至 `backend/.env`:`GOOGLE_SAFE_BROWSING_KEY=your_key_here` ### VirusTotal (免费 — 4 次请求/分钟) 1. 在 [VirusTotal](https://www.virustotal.com) 注册 2. 前往 Profile → API Key 3. 添加至 `backend/.env`:`VIRUSTOTAL_KEY=your_key_here` ## 🔌 Chrome 扩展程序设置 1. 打开 Chrome 并访问 `chrome://extensions` 2. 启用 **Developer Mode** (右上角开关) 3. 点击 **"Load unpacked"** 4. 选择 `extension/` 文件夹 5. PhishGuard 盾牌图标将出现在您的工具栏中 6. 确保后端在 8000 端口上运行 ## 🧪 演示测试用例 在应用中尝试以下内容以获得完美演示: ### 已知诈骗 URL ``` http://sbi-kyc-update.com http://paytm-reward.net http://hdfc-account-verify.in http://amazon-prize.tk ``` ### 已知安全 URL ``` https://sbi.co.in https://paytm.com https://amazon.in https://google.com ``` ### 诈骗短信 ``` Dear customer your SBI account is blocked update KYC immediately click here: http://sbi-kyc.net Congratulations! You have won Rs 50000 in KBC lottery. Call 9876543210 to claim Your HDFC account will be suspended share OTP to verify ``` ### 诈骗 UPI ID ``` pm-relief@upi lottery@ybl prize-winner@paytm ``` ## 📡 API 参考 ### `POST /api/scan/url` ``` { "url": "http://suspicious-link.tk" } ``` 返回:`verdict`、`confidence`、`reasons`、`domain_age_days`、`ssl_valid`、`virustotal_detections` ### `POST /api/scan/text` ``` { "text": "Your SBI KYC is pending...", "type": "sms" } ``` 返回:`verdict`、`confidence`、`scam_type`、`reasons_english`、`reasons_hindi`、`extracted_urls` ### `POST /api/scan/upi` ``` { "upi_id": "pm-relief@upi" } ``` 返回:`verdict`、`confidence`、`reasons`、`upi_format_valid`、`suspicious_keywords_found` ### `GET /api/stats` 返回社区统计数据、诈骗分布、城市热力图数据、最新诈骗动态。 ## 🌐 端口 | 服务 | URL | |---|---| | 后端 API | http://localhost:8000 | | 前端应用 | http://localhost:3000 | | API 文档 | http://localhost:8000/docs | ## 📁 项目结构 ``` phishguard/ ├── backend/ │ ├── main.py # FastAPI app with all endpoints │ ├── requirements.txt │ └── .env # API keys (optional) ├── frontend/ │ ├── src/ │ │ ├── pages/ │ │ │ ├── Scanner.js # Main scan page │ │ │ ├── Dashboard.js # Stats & heatmap │ │ │ └── Learn.js # Scam encyclopedia │ │ ├── components/ │ │ │ ├── Layout.js # Nav + wrapper │ │ │ ├── VerdictCard.js # Result display │ │ │ └── Toast.js # Notifications │ │ └── App.js │ └── package.json ├── extension/ │ ├── manifest.json # MV3 manifest │ ├── popup.html/js/css # Extension popup │ ├── background.js # Service worker + context menus │ ├── content.js # Page link scanner │ └── icons/ ├── start.sh # Linux/Mac startup script ├── start.bat # Windows startup script └── README.md ``` ## 🤖 AI 模型详情 **模型:** `ealvaradob/bert-finetuned-phishing` PhishBERT 是一个基于钓鱼数据集微调的 BERT 模型。它能以极高的准确率将文本分类为 "phishing" 或 "legitimate"。PhishGuard 将此模型与 7 类针对印度特色的正则表达式模式相结合,以实现全面的检测。 该模型在首次运行时会自动下载并缓存在内存中。如果下载失败(无网络),系统将平滑回退至仅使用正则表达式进行检测。 ## 🚨 网络犯罪举报 如果您已被诈骗: - **在线举报:** [cybercrime.gov.in](https://cybercrime.gov.in) - **求助热线:** 1930 (24×7) - **电子邮件:** complaints@cybercrime.gov.in ## 👥 DATA MAVERICKS 团队 为 RAIT ACM 举办的 KLEOS 4.0 Hackathon 用 ❤️ 构建。 *"我们捕获的每一次诈骗,都在保护又一个印度家庭。"*
标签:AI安全, Ask搜索, AV绕过, BERT, Chat Copilot, FastAPI, Google安全浏览, HuggingFace, KYC欺诈, OTP钓鱼, PhishBERT, Python, React, SSL检查, Syscalls, UPU安全, VirusTotal, Web安全, WHOIS, 二元分类, 印度反诈, 反诈骗, 域名查询, 大屏仪表盘, 威胁情报, 安全教育, 实时检测, 开发者工具, 开源安全项目, 插件开发, 无后门, 深度学习, 短信过滤, 网址扫描, 网络安全, 自定义脚本, 蓝队分析, 逆向工具, 邮件安全, 钓鱼检测, 隐私保护