hash-089/the_SubHunter

GitHub: hash-089/the_SubHunter

面向 Kali Linux 的全自动化子域名枚举与存活检测工具,集成多款主流工具实现零配置一键侦察。

Stars: 0 | Forks: 0

# Auto Subdomain Hunter 🔍

Version Kali Linux License PRs Welcome Stars

适用于 Kali Linux 的全自动化子域名枚举与存活主机检测工具
零配置 —— 全部自动安装!

## 📋 描述 **Auto Subdomain Hunter** 是一款专为 Kali Linux 设计的强大 bash 脚本,可自动化执行子域名枚举和存活主机检测的全过程。与其他需要手动安装依赖项的工具不同,该脚本**在首次运行时会自动安装所有内容**。它结合了多种行业标准工具以提供全面的结果,检查哪些子域名实际上处于活跃状态,并生成多种格式的详细报告。 无论您是 Bug 赏金猎人、渗透测试人员还是安全研究人员,这款工具都能通过完全自动化侦察阶段来节省大量手动工作时间。 ## ✨ 特性 | 特性 | 描述 | |---------|-------------| | 🔄 **自动安装** | 首次运行时自动安装所有依赖项 | | 🛠️ **多工具集成** | 使用 6+ 种工具:assetfinder, subfinder, findomain, sublist3r, amass, httpx | | 🌐 **存活检测** | 识别活跃的子域名,包含 HTTP 状态码、网页标题和服务器信息 | | 📊 **丰富报告** | 自动生成 TXT, JSON 和 CSV 格式的报告 | | 🎯 **零配置** | 直接运行即可 —— 适用于全新安装的 Kali 系统 | | ⚡ **高速** | 使用 100 个并发线程进行多线程存活检测 | | 📁 **结构清晰** | 结构化的输出,分别为原始数据、处理结果和日志设置独立文件夹 | | 🔧 **降级方案** | 即使部分工具安装失败,仍可继续运行 | | 🚨 **错误处理** | 全面的错误日志记录和优雅的故障处理 | | 📈 **进度追踪** | 为所有阶段提供实时进度指示器 | ## 🚀 快速开始 ``` # 一条命令完成所有操作 git clone https://github.com/hash-089/auto-subdomain-hunter.git cd auto-subdomain-hunter chmod +x auto_subdomain_hunter.sh ./auto_subdomain_hunter.sh example.com ``` 就是这样!脚本将自动安装所有依赖项并开始扫描。 ## 📦 安装 ### 方法 1:克隆仓库(推荐) ``` # 克隆仓库 git clone https://github.com/hash-089/auto-subdomain-hunter.git # 进入目录 cd auto-subdomain-hunter # 赋予脚本执行权限 chmod +x auto_subdomain_hunter.sh # 运行它(自动安装所有依赖!) ./auto_subdomain_hunter.sh example.com ``` ### 方法 2:直接下载 ``` # 下载脚本 wget https://raw.githubusercontent.com/hash-089/auto-subdomain-hunter/main/auto_subdomain_hunter.sh # 赋予执行权限 chmod +x auto_subdomain_hunter.sh # 运行它 ./auto_subdomain_hunter.sh example.com ``` ### 方法 3:一行命令安装 ``` curl -s https://raw.githubusercontent.com/hash-089/auto-subdomain-hunter/main/install.sh | bash ``` ## 🎯 用法 ### 基本命令 ``` # 基础扫描 ./auto_subdomain_hunter.sh example.com # 指定自定义输出目录扫描 ./auto_subdomain_hunter.sh example.com ./my_results # 显示帮助 ./auto_subdomain_hunter.sh -h ``` ### 高级示例 ``` # 从文件扫描多个域名 for domain in $(cat domains.txt); do ./auto_subdomain_hunter.sh $domain done # 针对大型域名的后台扫描 nohup ./auto_subdomain_hunter.sh largecompany.com > scan.log 2>&1 & # 扫描并通过邮件发送结果 ./auto_subdomain_hunter.sh example.com && \ mail -s "Scan Results for example.com" youremail@domain.com < $(ls -d example.com_*/)/final_report.txt # 扫描后快速统计 cd example.com_*/ echo "Live hosts: $(cat processed/live_subs.txt | wc -l)" echo "HTTP 200: $(grep -c "200" processed/live_with_http.txt)" ``` ## 📁 输出结构 运行后,您将获得如下组织的目录结构: ``` example.com_20240101_120000/ ├── raw/ │ └── all_subs.txt # Raw results from all tools combined ├── processed/ │ ├── unique_subs.txt # Unique subdomains after deduplication │ ├── live_subs.txt # Just the live host URLs │ └── live_with_http.txt # Live hosts with HTTP status, title, server ├── logs/ │ └── error.log # Error logs for troubleshooting ├── final_report.txt # Detailed human-readable report ├── results.json # JSON format for automation └── results.csv # CSV format for spreadsheets ``` ## 📊 输出示例 ``` ╔════════════════════════════════════════════════════════════╗ ║ AUTO SUBDOMAIN HUNTER ║ ║ Version 2.0 ║ ║ Complete Automated Solution for Kali ║ ╚════════════════════════════════════════════════════════════╝ [+] Phase 1: Installing all required tools... [*] Installing Go... [*] Installing Python and pip... [*] Installing main tools from Kali repositories... [✓] findomain installed [✓] assetfinder installed [✓] subfinder installed [✓] httpx-toolkit installed [+] Phase 2: Subdomain enumeration... [*] Running assetfinder... [✓] [*] Running subfinder... [✓] [*] Running findomain... [✓] [*] Running sublist3r... [✓] [*] Running amass... [✓] [+] Total unique subdomains found: 157 [+] Phase 3: Live subdomain checking... [*] Probing subdomains with httpx-toolkit (100 threads)... [✓] Found 43 live subdomains [+] Preview (first 10 live subdomains): http://mail.example.com [200] [Mail Server] [nginx] https://blog.example.com [200] [WordPress] [Apache] https://api.example.com [401] [Unauthorized] [nginx] http://dev.example.com [403] [Forbidden] [Apache] https://admin.example.com [200] [Login Page] [nginx] [+] Phase 4: Generating reports... [✓] Report saved to: example.com_20240101_120000/final_report.txt [✓] JSON saved: results.json [✓] CSV saved: results.csv ════════════════════════════════════════════════════════════ SCAN COMPLETE! ════════════════════════════════════════════════════════════ Workspace: example.com_20240101_120000 Total unique: 157 Live hosts: 43 Report: example.com_20240101_120000/final_report.txt JSON: example.com_20240101_120000/results.json CSV: example.com_20240101_120000/results.csv ════════════════════════════════════════════════════════════ ``` ## 🛠️ 使用的工具 该脚本会自动安装并使用以下行业标准工具: | 工具 | 用途 | GitHub | |------|---------|--------| | **assetfinder** | 子域名发现 | [tomnomnom/assetfinder](https://github.com/tomnomnom/assetfinder) | | **subfinder** | 被动子域名枚举 | [projectdiscovery/subfinder](https://github.com/projectdiscovery/subfinder) | | **findomain** | 快速子域名发现 | [Findomain/Findomain](https://github.com/Findomain/Findomain) | | **sublist3r** | 基于 Python 的枚举 | [aboul3la/Sublist3r](https://github.com/aboul3la/Sublist3r) | | **amass** | 深度枚举 | [OWASP/Amass](https://github.com/OWASP/Amass) | | **httpx** | 存活主机检测 | [projectdiscovery/httpx](https://github.com/projectdiscovery/httpx) | | **anew** | 去重处理 | [tomnomnom/anew](https://github.com/tomnomnom/anew) | ## 💻 系统要求 - **操作系统:** Kali Linux(或任何基于 Debian 的 Linux 发行版) - **权限:** Sudo 权限(用于自动安装) - **网络:** 安装和扫描需要网络连接 - **存储:** 约 500MB 可用空间用于存放工具 - **内存:** 建议 1GB 以上 RAM - **时间:** 根据域名大小而异(通常 2-10 分钟) ## ⚙️ 配置 ### 添加 API 密钥(以获得更好的结果) 为了获得增强的结果,您可以将 API 密钥添加到配置文件中: ``` # 对于 subfinder nano ~/.config/subfinder/config.yaml # 添加您的 API 密钥:SecurityTrails, Censys, Shodan 等 # 对于 findomain nano ~/.config/findomain/findomain.conf # 添加您的 API 密钥:SecurityTrails, Virustotal 等 ``` ### API 配置示例 ``` # ~/.config/subfinder/config.yaml securitytrails: ["your-api-key"] shodan: ["your-api-key"] censys: ["your-api-key"] virustotal: ["your-api-key"] ``` ## 🔧 故障排除 ### 常见问题与解决方案 | 问题 | 解决方案 | |-------|----------| | **工具无法安装** | 先手动运行 `sudo apt update` | | **未发现子域名** | 域名可能较小;请尝试使用 API 密钥 | | **权限被拒绝** | 运行 `chmod +x auto_subdomain_hunter.sh` | | **扫描缓慢** | 在脚本中降低线程数 | | **HTTP 错误** | 检查网络连接 | ### 检查错误日志 ``` # 查看错误日志 cat example.com_*/logs/error.log # 扫描期间实时监控 tail -f example.com_*/logs/error.log ``` ## 📝 更新日志 ### 版本 2.0(当前) - ✅ 自动安装所有依赖项 - ✅ JSON 和 CSV 输出格式 - ✅ 多线程存活检测(100 线程) - ✅ 各阶段进度指示器 - ✅ 更好的错误处理和日志记录 - ✅ 工具缺失时的降级方案 - ✅ 改进的输出目录结构 ### 版本 1.0 - ✅ 基础子域名枚举 - ✅ 存活主机检测 - ✅ 文本报告生成 ## 🐛 已知问题 - 某些工具可能在非 Kali 系统上安装失败 - 针对超大域名,速率限制可能会影响结果 - 需要配置 API 密钥以获得最佳结果 - 首次运行因需要安装而耗时较长 ## 📜 许可证 基于 MIT 许可证分发。有关更多信息,请参阅 `LICENSE`。 ``` MIT License Copyright (c) 2024 hash-089 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files... ``` ## 🙏 致谢 - **TomNomNom** ([@tomnomnom](https://github.com/tomnomnom)) 提供 assetfinder 和 anew - **ProjectDiscovery** ([@projectdiscovery](https://github.com/projectdiscovery)) 提供 subfinder 和 httpx - **OWASP** 提供 Amass - **aboul3la** 提供 Sublist3r - **Findomain** 团队提供其出色的工具 - 整个 InfoSec 社区提供的灵感 ## 📞 联系方式 **GitHub:** [hash-089](https://github.com/hash-089) **项目链接:** [https://github.com/hash-089/auto-subdomain-hunter](https://github.com/hash-089/auto-subdomain-hunter) **问题反馈:** [https://github.com/hash-089/auto-subdomain-hunter/issues](https://github.com/hash-089/auto-subdomain-hunter/issues) ## 🔗 相关项目 - [Nuclei](https://github.com/projectdiscovery/nuclei) - 漏洞扫描器 - [Waybackurls](https://github.com/tomnomnom/waybackurls) - 历史URL获取 - [FFuF](https://github.com/ffuf/ffuf) - Web 模糊测试 - [Aquatone](https://github.com/michenriksen/aquatone) - 可视化检查

用 ❤️ 为 Kali Linux 社区打造
祝狩猎愉快!🏴‍☠️

Last Commit Issues Forks

标签:ASM, Attack Surface Management, GitHub, Httpx, 子域名挖掘, 子域名枚举, 存活探测, 密码管理, 应用安全, 日志审计, 白盒审计, 系统安全, 网络安全, 自动化侦察, 运行时操纵, 逆向工具, 隐私保护