Thegreatprabh/phishguard
GitHub: Thegreatprabh/phishguard
PhishGuard 是一款基于启发式规则的钓鱼检测工具包,用于识别可疑 URL、虚假登录页面和品牌冒充,并支持在 GitHub CI 工作流中自动化防护。
Stars: 0 | Forks: 0
# PhishGuard
PhishGuard 是一个轻量级的钓鱼检测工具包,用于检测可疑 URL、虚假社交媒体登录页面、GitHub 链接、品牌声明以及公司合法性检查。它专为 Kali Linux、Termux、GitHub Actions 和标准的 Python 3.9+ 环境构建,无需强制性的第三方依赖。
```
+-- PhishGuard Threat Console ------------------------------------------+
| URL risk engine : typosquats, punycode, shorteners, bait words |
| Fake login detector : password forms, OTP traps, brand spoofing |
| Company lookup : founder, parent company, domain, legitimacy |
| CI defense : scan GitHub issues, PRs, comments, docs |
+-----------------------------------------------------------------------+
```
## GitHub 仓库描述
将此作为简短的 GitHub 仓库描述:
```
PhishGuard - phishing URL, fake login page, and company/brand legitimacy lookup tool for Kali, Termux, and GitHub security workflows.
```
建议的 GitHub topics:
```
phishing cybersecurity osint termux kali-linux github-actions python security-tools url-scanner brand-lookup company-lookup fake-login-detector
```
## 关于本项目的介绍
PhishGuard 可帮助用户在打开或信任链接、消息、HTML 页面或公司声明之前,快速检查其是否可疑。它可以检测常见的钓鱼信号,例如虚假的社交登录页面、相似域名、密码/OTP 收集表单、可疑的 TLD、短链接、punycode 域名,以及诸如账户验证或安全警报等社会工程学诱饵。
此工具适用于:
- 学习网络安全和钓鱼检测的学生。
- 希望拥有简单的命令行扫描器的 Kali 和 Termux 用户。
- 希望通过 GitHub Action 在 issue、PR、文档或评论中捕获可疑链接的开发者。
- 需要公司/品牌查询详情(如创始人、母公司、官方域名、收入信息(如果有)以及合法性说明)的分析师。
- 任何希望获得具有明确证据的离线优先钓鱼风险评分的人。
## 功能
- URL 风险评分:针对可疑域名、typosquatting、punycode、IP 主机、短链接、异常端口、编码 payload 和诱饵关键字。
- 虚假社交媒体登录页面检测:适用于 Instagram、Facebook、Google、GitHub、X/Twitter、LinkedIn、Microsoft 和 Discord。
- HTML 表单分析:检测密码字段、OTP/token 收集、可疑的表单 action、隐藏输入框、混淆脚本以及品牌冒充。
- 文本扫描:适用于 GitHub PR、issue、markdown、代码注释、聊天记录导出以及类似邮件的内容。
- 公司和品牌查询:用于官方域名检查、创始人详情、母公司、收入信息(如果有)以及合法性信号。
- 用于自动化、脚本和 CI 的 JSON 输出。
- 内置 GitHub Action 工作流。
- 无需 API key 或付费的威胁情报服务即可运行。
## 检测矩阵
| 模块 | 检测内容 | 输出结果 |
| --- | --- | --- |
| URL 扫描器 | 短链接、可疑 TLD、punycode、相似域名、诱饵词 | `safe`、`suspicious`、`dangerous` |
| 虚假登录检测器 | 克隆的社交登录页面、密码表单、OTP/恢复码陷阱 | 品牌 + 证据 |
| 品牌冒充 | 在不受信任的域名上使用受信任品牌的文本 | 欺骗警告 |
| 公司查询 | 创始人、母公司、官方域名、收入信息(如果有) | 合法性说明 |
| GitHub 防护 | issue、PR、文档、评论中的可疑链接 | 遇危险即失败的 CI 模式 |
## 风险等级
- `safe`:未发现强烈的钓鱼信号。
- `suspicious`:发现警告信号;在信任之前请进行审查。
- `dangerous`:存在钓鱼、虚假登录或品牌冒充的强烈证据。
## 公司 / 品牌查询
PhishGuard 可以查询公司和品牌信息,以帮助验证网站、消息或商业声明是否看起来合法。
它可以显示:
- 官方公司或品牌名称
- 创始人信息
- 母公司
- 官方网站或域名
- 行业或类别
- 公开的收入信息(如果有)
- 合法性状态和风险提示
- 当可疑页面声称代表知名品牌时的不匹配警告
示例:
```
phishguard company "Instagram"
phishguard company-domain "instagram.com"
```
这有助于检测虚假品牌页面、诈骗商店、虚假支持页面、投资诈骗以及冒充真实公司的钓鱼页面。
## 在 Kali Linux 上安装
```
sudo apt update
sudo apt install python3 python3-pip git
git clone https://github.com/Thegreatprabh/phishguard.git
cd phishguard
python3 -m pip install .
phishguard --help
```
开发模式:
```
python3 -m pip install -e .
python3 -m unittest discover -v
```
## 在 Termux 上安装
```
pkg update && pkg upgrade
pkg install python git
git clone https://github.com/Thegreatprabh/phishguard.git
cd phishguard
python -m pip install .
phishguard --help
```
开发模式:
```
python -m pip install -e .
python -m unittest discover -v
```
如果 Termux 提示找不到 `phishguard` 命令,请运行:
```
python -m phishguard --help
```
## 基本用法
扫描 URL:
```
phishguard scan-url "https://example-login-security.com/instagram/verify"
```
扫描看起来像虚假的 GitHub 登录链接:
```
phishguard scan-url "https://github-login-security.example/verify"
```
扫描本地 HTML 页面:
```
phishguard scan-html suspicious.html --url "https://instagrarn-help.example/login"
```
扫描文本、消息、markdown 或复制的邮件内容:
```
phishguard scan-text message.txt
```
扫描多个文件,并在出现危险结果时返回失败:
```
phishguard scan-files README.md docs/*.md --fail-on dangerous
```
输出 JSON 格式:
```
phishguard scan-url "https://example.com" --json
```
获取并分析实时 HTML 内容:
```
phishguard scan-url "https://example.com/login" --fetch
```
## 示例输出
```
DANGEROUS score= 75 kind=url target=https://github-login-security.example/verify
category=brand_impersonation brand=GitHub
+10 risky_tld: Domain uses .xyz TLD often abused in phishing.
+12 bait_keywords: URL contains phishing bait words: login, security, verify.
+35 brand_on_untrusted_domain: GitHub terms found on non-official domain github-login-security.example.
+18 brand_bait_combo: GitHub impersonation appears with login or verification bait.
```
## GitHub Action
此仓库包含 `.github/workflows/phishguard.yml`。
它会扫描 GitHub 事件文本和仓库中的类文本文件,如果发现危险的钓鱼指标,则会导致工作流失败。
该工作流适用于:
- PR 描述
- issue 正文
- issue 评论
- markdown 文档
- 仓库文件中粘贴的链接
## 项目结构
```
phishguard/
brands.py Brand profiles for social/login impersonation checks
cli.py Command-line interface
github.py GitHub event scanner
html_analysis.py Fake login page and suspicious form detection
models.py Scan result and evidence models
scanner.py High-level scan functions
url_analysis.py URL and domain heuristics
tests/
test_phishguard.py
```
## 安全与道德准则
PhishGuard 是一款防御性工具。请仅将其用于教育、安全意识培训、链接审查、CI 检查,以及保护您拥有或获得授权测试的系统。它不会创建钓鱼页面、窃取凭证、绕过身份验证或利用网站漏洞。
PhishGuard 使用确定性启发式算法。它可能会产生误报或漏报,因此当决策至关重要时,请务必将结果与人工审核和受信任的威胁情报来源相结合。
标签:ESC4, GitHub Actions, OSINT, Python, 威胁情报, 开发者工具, 文档结构分析, 无后门, 网址扫描, 自动笔记, 逆向工具, 钓鱼检测