VladimirRamirez07/osint-security-scanner

GitHub: VladimirRamirez07/osint-security-scanner

OSINT安全扫描器,用于分析域名邮件安全配置和HTTP头部,生成专业PDF报告以辅助安全评估。

Stars: 0 | Forks: 0

# 🔍 OSINT 安全扫描器 ![Python](https://img.shields.io/badge/Python-3.10+-3776AB?style=flat-square&logo=python&logoColor=white) ![License](https://img.shields.io/badge/License-MIT-22c55e?style=flat-square) ![Legal](https://img.shields.io/badge/100%25-Legal-22c55e?style=flat-square) ![Status](https://img.shields.io/badge/Status-Active-22c55e?style=flat-square) ![DNS](https://img.shields.io/badge/DNS-SPF%20%7C%20DKIM%20%7C%20DMARC-58A6FF?style=flat-square) ![Security](https://img.shields.io/badge/Security-HTTP%20Headers-F85149?style=flat-square&logo=hackthebox&logoColor=white) ![OSINT](https://img.shields.io/badge/OSINT-Subdomain%20Takeover-D29922?style=flat-square) ![ReportLab](https://img.shields.io/badge/Reports-PDF%20ReportLab-EC1C24?style=flat-square&logo=adobeacrobatreader&logoColor=white) ![Threading](https://img.shields.io/badge/Threading-Parallel%20Scanning-8B5CF6?style=flat-square) ![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20Mac-0D1117?style=flat-square&logo=windows&logoColor=white) ![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/22deb14d01111200.svg) ## 📸 示例结果 | 域名 | DNS 评分 | HTTP 评分 | 子域名评分 | 总分 | |------------|-----------|------------|-----------|-------------| | apple.com | 90/100 | 100/100 | 100/100 | **97/100 ✅** | | netflix.com| 65/100 | 100/100 | 100/100 | **88/100 ✅** | ## 🧠 它分析什么? ### 📧 邮件安全 (DNS) - **SPF** — 验证域名是否授权了合法的邮件服务器 - **DKIM** — 检测加密邮件签名(测试 8 个常用选择器) - **DMARC** — 验证防钓鱼策略(`none` / `quarantine` / `reject`) ### 🌐 HTTP 安全头部 | 头部 | 防护内容 | |-----------------------------------|------------------------| | `Strict-Transport-Security` | 降级攻击、中间人攻击 | | `Content-Security-Policy` | XSS、代码注入 | | `X-Frame-Options` | 点击劫持 | | `X-Content-Type-Options` | MIME 类型嗅探 | | `Referrer-Policy` | 数据泄露 | | `Permissions-Policy` | 浏览器 API 滥用 | | `X-XSS-Protection` | 传统 XSS | ### 🔎 子域名枚举 - 使用 `ThreadPoolExecutor` 并行检查 **40 个常用子域名** - 检测带有 IP 地址和 HTTP 状态码的活动子域名 - 跨 GitHub Pages、Heroku、AWS S3、Netlify 等服务识别 **子域名接管** 漏洞 ## 📄 PDF 报告 每次扫描会生成一份专业的 PDF 报告,包含: - 整体域名安全评分 (0–100) - DNS 记录表格及可视化状态指示器 - 存在和缺失的 HTTP 头部完整列表 - 活跃子域名地图及接管风险标志 - 扫描元数据页脚 ## 🧪 CI/CD 本项目使用 **GitHub Actions** 进行持续集成。每次推送到 `main` 分支会自动: - ✅ 安装所有依赖项 - ✅ 使用 `pytest` 运行完整的单元测试套件 - ✅ 报告 `scanner/` 和 `report/` 目录的测试覆盖率 - ✅ 运行 `flake8` 代码风格检查 ## 🚀 安装 ``` # 克隆仓库 git clone https://github.com/VladimirRamirez07/osint-security-scanner.git cd osint-security-scanner # 创建虚拟环境 python -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows # 安装依赖项 pip install -r requirements.txt ``` ## ⚡ 使用方法 ``` # 扫描单个域名 python main.py apple.com # 一次性扫描多个域名 python main.py apple.com netflix.com google.com ``` ### 预期输出 ``` 🎯 Target: apple.com ── 📧 DNS Security (SPF / DKIM / DMARC) ── SPF : ✓ v=spf1 include:icloud.com ... DKIM : ✓ Found DMARC: ✓ v=DMARC1; p=quarantine ... DNS Score: 90/100 [GOOD] ── 🌐 HTTP Security Headers ── HTTPS : ✓ Enabled Headers present (6): HSTS, CSP, X-Frame-Options... HTTP Score: 100/100 [GOOD] ── 🔎 Subdomain Enumeration ── Found: 10 active subdomains Subdomain Score: 100/100 [GOOD] ── 📊 Overall Score ── apple.com: 97/100 [GOOD] ✓ Report saved: sample_reports/apple_com_security_report.pdf ``` ## 🧪 运行测试 ``` # 安装测试依赖项 pip install pytest pytest-cov # 运行所有测试 pytest tests/ -v # 运行并生成覆盖率报告 pytest tests/ -v --cov=scanner --cov=report --cov-report=term-missing ``` ## 🗂️ 项目结构 ``` osint-security-scanner/ │ ├── .github/ │ └── workflows/ │ └── ci.yml # GitHub Actions CI/CD pipeline │ ├── scanner/ │ ├── dns_checker.py # SPF, DKIM, DMARC via dnspython │ ├── http_checker.py # HTTP security headers analysis │ └── subdomain_checker.py # Parallel subdomain + takeover detection │ ├── report/ │ └── pdf_generator.py # Professional PDF reports with ReportLab │ ├── tests/ │ ├── test_dns.py # Unit tests for DNS module │ ├── test_http.py # Unit tests for HTTP module │ └── test_subdomains.py # Unit tests for subdomain module │ ├── sample_reports/ # Generated PDF reports (examples) ├── main.py # CLI entry point └── requirements.txt ``` ## 📦 依赖项 ``` dnspython==2.7.0 requests==2.32.3 reportlab==4.4.1 colorama==0.4.6 urllib3==2.4.0 pytest==8.3.5 pytest-cov==6.1.0 ``` ## ⚖️ 法律与道德 (此部分原文为空) ## 👤 作者 **Vladimir Ramirez** — [@VladimirRamirez07](https://github.com/VladimirRamirez07)
标签:DKIM, DMARC, DNS安全, HTTP安全头, meg, PDF报告, Python, ReportLab, SPF, Web安全, 信息安全, 反取证, 域名安全, 大型域名, 子域接管, 安全扫描, 安全评估, 并行扫描, 报告工具, 无后门, 时序注入, 网络安全, 网络调试, 自动化, 蓝队分析, 逆向工具, 邮件安全, 配置分析, 隐私保护