Aditya-Sec/CyberShield-AI

GitHub: Aditya-Sec/CyberShield-AI

CyberShield AI 是一个基于 Flask 的双模块安全扫描器,通过规则评分和 VirusTotal/PhishThumb 数据增强来检测钓鱼 URL 和恶意文件并生成 PDF 威胁报告。

Stars: 0 | Forks: 0

# 🛡️ CyberShield AI **一个轻量级的钓鱼 URL 和恶意软件文件扫描器 —— Flask 后端,基于规则的评分机制,VirusTotal/PhishTank 数据增强,以及 PDF 威胁报告。** ![Python](https://img.shields.io/badge/Python-0d1012?style=flat-square&logo=python&logoColor=4dd4e8&labelColor=0d1012) ![Flask](https://img.shields.io/badge/Flask-0d1012?style=flat-square&logo=flask&logoColor=4dd4e8&labelColor=0d1012) ![VirusTotal](https://img.shields.io/badge/VirusTotal-0d1012?style=flat-square&logo=virustotal&logoColor=4dd4e8&labelColor=0d1012) ![License](https://img.shields.io/badge/License-MIT-0d1012?style=flat-square&labelColor=0d1012&color=4dd4e8)

## 功能简介 CyberShield AI 是一个双模块安全扫描器,带有 Flask Web 前端: - **钓鱼模块** — 从提交的 URL 中提取 13 个特征(HTTPS 支持、可疑关键词、TLD 信誉、子域名中的品牌假冒、IP 字面量 URL 等),使用基于规则的引擎对它们进行评分,然后通过实时的 **VirusTotal** 和 **PhishTank** 查询来增强判定结果。 - **恶意软件模块** — 对上传的文件计算哈希值(SHA256/MD5),在适用时解析 PE 头(导入表、可疑的 Windows API 调用、用于加壳/加密二进制文件的节区熵值),提取可疑字符串,并将该哈希值与 **VirusTotal** 进行交叉比对。 - **报告模块** — 使用 `fpdf2` 根据最新的扫描结果生成格式化的 PDF 威胁报告。
## 项目结构 ``` cybershield/ ├── app.py # Flask routes and app entrypoint ├── module1_phishing/ │ └── scanner.py # URL feature extraction + scoring + API enrichment ├── module2_malware/ │ └── scanner.py # File hashing + PE analysis + VirusTotal hash lookup ├── module3_report/ │ └── generator.py # PDF report generation (fpdf2) ├── templates/ │ └── index.html # Front-end UI ├── requirements.txt ├── .env.example # Copy to .env and fill in your own keys └── .gitignore ```
## 环境配置 ``` git clone https://github.com/Aditya-Sec/CyberShield-AI.git cd CyberShield-AI python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt cp .env.example .env # then fill in your own VirusTotal/PhishTank keys python app.py # 打开 http://127.0.0.1:5000 ``` 请在 [virustotal.com/gui/join-us](https://www.virustotal.com/gui/join-us) 获取一个免费的 VirusTotal API 密钥 —— 即使没有密钥程序也能运行,但 VirusTotal 的数据增强功能将会被跳过。
## 关于演示模式的说明 恶意软件扫描器包含了一组**基于文件名的演示响应**(文件名中包含 `eicar`、`ransomware`、`trojan`、`invoice`、`macro` 或 `suspicious` 的文件将返回预设的判定结果)—— 这个功能的存在是为了在没有真实恶意软件样本的情况下也能演示该工具,这对于作品集/展示场景来说是特意设计的,并非刻意隐瞒。其他任何文件名都将真实地执行哈希计算、PE 分析和 VirusTotal 处理流程。
## 为什么做出这些设计选择 - **优先采用基于规则的评分而非机器学习** — 这种特征评分方法是透明且可解释的(增加的每一分都有明确的理由),在 SOC 场景下,这比黑盒模型更重要,尤其是在初次尝试时。 - **优雅降级** — VirusTotal/PhishTank 的调用都经过了封装,因此密钥缺失、超时或速率限制永远不会导致扫描崩溃;应用程序始终会返回结果。 - **PE 分析安全降级** — 如果 `pefile` 无法解析某个文件(非 PE 格式、文件头损坏),扫描器仍然会运行基于字符串和基于哈希的检查,而不是直接报错失败。
## 许可证 MIT — 详见 [LICENSE](LICENSE)。
标签:DNS 反向解析, Flask, Go语言工具, Python, 威胁情报, 开发者工具, 恶意软件扫描, 无后门, 逆向工具, 钓鱼检测