the-cybercaptain/dns-harvest

GitHub: the-cybercaptain/dns-harvest

一个用 Python 编写的模块化 DNS 侦察与 OSINT 信息收集工具,帮助安全专业人员自动化发现子域名、收集邮箱地址并审计 DNS 安全性。

Stars: 0 | Forks: 0

# 🚀 DNS 收获
[![GitHub stars](https://img.shields.io/github/stars/the-cybercaptain/dns-harvest?style=for-the-badge&logo=github)](https://github.com/the-cybercaptain/dns-harvest/stargazers) [![GitHub forks](https://img.shields.io/github/forks/the-cybercaptain/dns-harvest?style=for-the-badge&logo=github)](https://github.com/the-cybercaptain/dns-harvest/network) [![GitHub issues](https://img.shields.io/github/issues/the-cybercaptain/dns-harvest?style=for-the-badge&logo=github)](https://github.com/the-cybercaptain/dns-harvest/issues) [![GitHub license](https://img.shields.io/github/license/the-cybercaptain/dns-harvest?style=for-the-badge)](https://github.com/the-cybercaptain/dns-harvest/blob/main/LICENSE) [![Python version](https://img.shields.io/badge/Python-3.x-blue?style=for-the-badge&logo=python)](https://www.python.org/) **一款功能强大的模块化 Python DNS 侦察与 OSINT 信息收集工具。** 🔍⚡ 执行自动化子域名发现、电子邮件挖掘、高级 DNS 审计和灵活的数据导出。
## 📖 概述 DNS Harvest 是一款复杂的命令行界面(CLI)工具,专为网络安全专业人员、渗透测试人员和研究人员设计,用于执行全面的 DNS 侦察和开源情报(OSINT)收集。该工具采用模块化架构,自动化识别子域名、提取电子邮件地址、执行深度 DNS 记录分析以及检测高级 DNS 漏洞(如欺骗和通配符配置)的过程。 该工具注重效率和灵活性,支持多种数据导出格式,并对其收集和审计功能提供精细控制。它旨在通过细致分析组织的 DNS 足迹来提供可操作的情报。 ## ✨ 功能特性 - 🎯 **自动化子域名发现**:利用多种技术(如暴力破解、搜索引擎抓取、证书透明度日志)发现大量子域名列表。 - 📧 **电子邮件地址收集**:扫描网页和其他来源,提取公开可用的电子邮件地址用于 OSINT 目的。 - 🔬 **高级 DNS 审计**: - **DNS 记录枚举**:查询和分析各种 DNS 记录类型(A、AAAA、MX、NS、TXT、SPF、SRV、CNAME)。 - **DNS 欺骗检测**:识别潜在的 DNS 缓存投毒或响应操纵。 - **通配符 DNS 检测**:精确定位配置了通配符 DNS 记录的域名。 - 🌐 **WHOIS 信息检索**:执行查询以收集域名注册详情。 - 💻 **操作系统检测**:尝试根据 DNS/网络特征推断发现主机的操作系统。 - 📦 **多格式数据导出**:将侦察结果保存为各种格式,如 CSV、JSON 或纯文本,以便进一步分析或集成。 - ⚡ **异步操作**:利用 `asyncio` 和 `aiohttp` 实现高性能并发网络请求。 - 🎨 **丰富的终端输出**:使用 `rich` 和 `colorama` 享受用户友好的命令行体验,支持彩色输出和进度指示器。 - 🧩 **模块化设计**:易于扩展的架构,允许集成新的侦察模块。 ## 🛠️ 技术栈 **运行时:** [![Python](https://img.shields.io/badge/Python-3.x-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/) **核心库:** - [![requests](https://img.shields.io/badge/requests-HTTP_Library-000000?style=for-the-badge&logo=python&logoColor=white)](https://requests.readthedocs.io/en/latest/) - [![dnspython](https://img.shields.io/badge/dnspython-DNS_Tools-blueviolet?style=for-the-badge&logo=python&logoColor=white)](https://www.dnspython.org/) - [![BeautifulSoup4](https://img.shields.io/badge/BeautifulSoup4-Web_Scraping-green?style=for-the-badge&logo=python&logoColor=white)](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) - [![python-whois](https://img.shields.io/badge/python--whois-WHOIS_Lookup-informational?style=for-the-badge&logo=python&logoColor=white)](https://pypi.org/project/python-whois/) - [![httpx](https://img.shields.io/badge/httpx-Async_HTTP-purple?style=for-the-badge&logo=python&logoColor=white)](https://www.python-httpx.org/) - [![aiohttp](https://img.shields.io/badge/aiohttp-Async_Client-brightgreen?style=for-the-badge&logo=python&logoColor=white)](https://aiohttp.readthedocs.io/en/stable/) - [![asyncio](https://img.shields.io/badge/asyncio-Concurrency-blue?style=for-the-badge&logo=python&logoColor=white)](https://docs.python.org/3/library/asyncio.html) **CLI 和工具:** - [![Rich](https://img.shields.io/badge/Rich-Terminal_UI-8B008B?style=for-the-badge&logo=python&logoColor=white)](https://rich.readthedocs.io/en/latest/) - [![Colorama](https://img.shields.io/badge/Colorama-Terminal_Colors-orange?style=for-the-badge&logo=python&logoColor=white)](https://pypi.org/project/colorama/) - [![tqdm](https://img.shields.io/badge/tqdm-Progress_Bars-5F9EA0?style=for-the-badge&logo=python&logoColor=white)](https://github.com/tqdm/tqdm) - [![PyYAML](https://img.shields.io/badge/PyYAML-YAML_Parser-C6A664?style=for-the-badge&logo=yaml&logoColor=white)](https://pyyaml.org/) - `argparse`(Python 标准库,用于命令行解析) ## 🚀 快速开始 ### 前置条件 - **Python 3.8+**:确保已安装兼容的 Python 版本。 python --version - **pip**:Python 的包安装器,通常随 Python 一起提供。 ### 安装 1. **克隆仓库** git clone https://github.com/the-cybercaptain/dns-harvest.git cd dns-harvest 2. **安装依赖** pip install -r requirements.txt ### 用法 `main.py` 脚本是所有操作的主要入口点。 #### 基本用法 查看所有可用命令和全局选项: ``` python main.py --help ``` 获取特定命令的帮助(例如 `subdomain`): ``` python main.py subdomain --help ``` #### 可用命令 | 命令 | 描述 | 选项(常用) | | :------ | :---------- | :--------------- | | `subdomain` | 发现目标域名的子域名。 | `--domain `、`--wordlist `、`--recursive`、`--engine `、`--output `、`--format ` | | `email` | 从目标域名收集电子邮件地址。 | `--domain `、`--output `、`--format ` | | `dns-audit` | 执行高级 DNS 记录审计。 | `--domain `、`--check-spoofing`、`--check-wildcard`、`--dns-server `、`--output `、`--format ` | | `full-harvest` | 运行全面的收集,包括子域名和电子邮件发现。 | `--domain `、`--wordlist `、`--recursive`、`--output `、`--format ` | | `os-detect` | 尝试检测发现主机的操作系统。 | `--domain `、`--output `、`--format ` | #### 全局选项 | 选项 | 描述 | | :------------ | :------------------------------------------------ | | `--verbose`, `-v` | 增加输出详细程度。 | | `--quiet`, `-q` | 抑制大部分输出,仅显示结果。 | | `--threads ` | 并发线程/任务数量(适用于适用操作)。 | | `--timeout ` | 设置网络请求超时时间(秒)。 | | `--proxy ` | 为 HTTP 请求使用代理(例如 `http://127.0.0.1:8080`)。 | | `--output ` | 指定结果输出文件。 | | `--format `| 指定输出格式(例如 `json`、`csv`、`txt`)。| | `--config ` | 使用自定义配置文件。 | #### 示例 ``` # 使用默认方法发现 example.com 的子域名 python main.py subdomain --domain example.com # 使用自定义 wordlist 递归发现子域名并保存为 JSON python main.py subdomain --domain example.com --wordlist custom_words.txt --recursive --output subdomains.json --format json # 从 example.com 收集电子邮件地址 python main.py email --domain example.com # 执行完整收获并将结果保存为 CSV 文件 python main.py full-harvest --domain example.com --output full_results.csv --format csv # 审计 example.com 的 DNS 记录以检测欺骗和通配符 python main.py dns-audit --domain example.com --check-spoofing --check-wildcard # 对 example.com 发现的主机运行 OS 检测 python main.py os-detect --domain example.com --output os_results.txt ``` ## 📁 项目结构 ``` dns-harvest/ ├── advanced_features.py # Advanced DNS auditing functions (spoofing, wildcard, etc.) ├── config.py # Configuration settings and default values ├── dns_core.py # Core DNS querying and resolution logic ├── email_harvest.py # Functions for extracting email addresses ├── full_harvest.py # Orchestrates a comprehensive DNS and OSINT harvest ├── harvest_core.py # Generic harvesting utilities and helpers ├── main.py # Main entry point and command-line interface parser ├── os_detection.py # Logic for identifying operating systems of hosts ├── output_handlers.py # Handles formatting and exporting results to various formats ├── subdomain_discovery.py # Modules for discovering subdomains using various techniques ├── requirements.txt # List of Python dependencies ├── LICENSE # Project license file └── README.md ``` ## ⚙️ 配置 `config.py` 文件定义了工具各个方面的默认设置,如 API 密钥、超时值和词表路径。您可以直接在 `config.py` 中自定义这些默认值,或通过命令行参数覆盖特定设置。 例如,`config.py` 可能定义: ``` # config.py(示例片段) DEFAULT_WORDLIST = "wordlists/default.txt" TIMEOUT_SECONDS = 10 DNS_RESOLVERS = ["1.1.1.1", "8.8.8.8"] # ... ``` 您通常可以使用 `--config` 全局选项指定自定义配置文件,尽管具体实现可能有所不同。 ## 🔧 开发 ### 开发设置 1. 按照 [安装](#installation) 步骤操作。 2. 确保您有支持 Python 的代码编辑器(如 VS Code)。 ### 运行测试(TODO:如果检测到测试框架) *(从提供的结构中未检测到明确的测试框架或测试目录。此部分为未来添加的占位符。)* ## 📄 许可证 本项目采用 [MIT License](LICENSE) - 详情请参阅 [LICENSE](LICENSE) 文件。 ## 📞 支持与联系 - 🐛 问题反馈:[GitHub Issues](https://github.com/the-cybercaptain/dns-harvest/issues) - 如需进一步帮助或问题,请随时联系仓库所有者 `the-cybercaptain`。
**⭐ 如果您觉得此仓库对您的侦察需求有帮助,请为其加星!** 由 [the-cybercaptain](https://github.com/the-cybercaptain) 用 ❤️ 制作
标签:DNS footprint, DNSRecon, DNS侦察, DNS审计, DNS枚举, DNS欺骗检测, DNS漏洞检测, DNS记录分析, DNS配置审计, ESC4, GitHub, IP 地址批量处理, OSINT, PoC, Python, 信息侦察, 动态插桩, 域名侦查, 多格式数据导出, 子域名枚举, 安全测试, 实时处理, 密码管理, 开源安全工具, 开源库, 开源情报采集, 恶意代码分类, 插件系统, 搜索引擎爬虫, 攻击性安全, 数据导出, 无后门, 暴力破解, 检测规则, 模块化架构, 渗透测试框架, 电子邮件挖掘, 系统安全, 网络安全, 网络安全工具, 网络资产发现, 自动化渗透测试工具, 计算机取证, 证书透明度, 运行时操纵, 逆向工具, 逆向工程平台, 通配符检测, 防御, 隐私保护