0zsh4d0w/Sub_crack

GitHub: 0zsh4d0w/Sub_crack

基于 Bash 的子域名枚举聚合工具,将十余种主动工具与被动 API 的结果自动合并去重并可选探测存活,专为安全侦察阶段简化多工具协作流程而设计。

Stars: 0 | Forks: 0

# Sub Crack — 子域名发现工具 ![Bash](https://img.shields.io/badge/Made%20with-Bash-1f425f.svg?logo=gnu-bash&logoColor=white) ![Platform](https://img.shields.io/badge/Platform-Linux-success.svg?logo=linux&logoColor=white) ![License](https://img.shields.io/badge/License-MIT-red.svg) ![Status](https://img.shields.io/badge/Status-Active-brightgreen.svg) ![Purpose](https://img.shields.io/badge/Built%20for-Bug%20Bounty%20%26%20Pentesting-orange.svg) Sub Crack 是一个基于 Bash 的子域名枚举包装工具,专为 Bug Bounty 狩猎和渗透测试侦察而构建。它针对目标域名运行多个主动 CLI 工具和被动 Web 源,将所有结果合并为一个去重后的列表,并(可选)检查发现的子域名中哪些是实际存活的。 无需手动运行十个不同的工具并手动组合输出,Sub Crack 只需一条命令即可完成,并为你提供一个干净整洁的文件以供后续处理。 ``` ____ _ ____ _ / ___| _ _| |__ / ___|_ __ __ _ ___| | __ \___ \| | | | '_ \| | | '__/ _` |/ __| |/ / ___) | |_| | |_) | |___| | | (_| | (_| < |____/ \__,_|_.__/ \____|_| \__,_|\___|_|\_\ Subdomain Discovery & Aggregation Tool ``` ## 功能 - **在单次运行中聚合 10+ 个来源** — 结合了主动工具和被动 API。 - **自动去重** — 合并时不区分大小写,因此由三个工具找到的同一个子域名只会出现一次。 - **优雅降级** — 如果未安装某个工具,Sub Crack 会显示清晰的跳过信息和安装提示,而不是直接崩溃。 - **存活检查(可选)** — 使用 `httpx`(或 `curl` 回退)探测每个发现的子域名,查看哪些子域名会实际响应。 - **保留原始输出** — 每个来源未经处理的输出会单独保存在 `raw/` 目录下,方便你查看每个工具具体贡献了什么。 - **可选的主动暴力破解模式** — `amass -brute`、`gobuster dns` 以及完整的 `bbot` 主动预设默认处于关闭状态(因为它们速度慢且噪音大),仅在明确启用时才会运行。 - **集成 bbot** — bbot 是目前最全面的开源侦察框架之一,得益于其变异和关联引擎,已知它比单一用途的工具能发现显著更多的子域名,特别是在面对大型目标时。 ## 使用的来源 | 类型 | 工具 / API | 要求 | |---|---|---| | 🟢 主动 CLI | [subfinder](https://github.com/projectdiscovery/subfinder) | Go install | | 🟢 主动 CLI | [assetfinder](https://github.com/tomnomnom/assetfinder) | Go install | | 🟢 主动 CLI | [amass](https://github.com/owasp-amass/amass)(被动模式) | apt / snap | | 🟢 主动 CLI | [Sublist3r](https://github.com/aboul3la/Sublist3r) | Python3 + pip | | 🟢 主动 CLI | [findomain](https://github.com/Findomain/Findomain) | 二进制发布版 | | 🟢 主动 CLI | [bbot](https://github.com/blacklanternsecurity/bbot)(被动 subdomain-enum 预设) | pipx | | 🟢 主动 CLI | [chaos](https://github.com/projectdiscovery/chaos-client) | Go install + API key | | 🔵 被动 API | [crt.sh](https://crt.sh/)(证书透明度日志) | curl + jq | | 🔵 被动 API | [AlienVault OTX](https://otx.alienvault.com/) Passive DNS | curl + jq | | 🔵 被动 API | [urlscan.io](https://urlscan.io/) | curl + jq | | 🔵 被动 API | [Wayback Machine](https://web.archive.org/) CDX API | curl + jq | | 🔴 暴力破解(`-a` 标志) | `amass enum -brute`、`gobuster dns`、`bbot`(完整主动预设) | 需要字典 | | 🟡 存活检查(`-c` 标志) | [httpx](https://github.com/projectdiscovery/httpx) 或 curl 回退 | Go install(可选) | Sub Crack 会在运行每个工具之前使用 `command -v` 进行检查。如果缺少某个工具,它会打印出跳过信息及确切的安装命令 — 脚本绝不会因为缺少依赖而失败。 ## 要求 运行被动 Web 源的最低要求(即使未安装任何额外工具也可运行): ``` sudo apt install curl jq ``` 为了获得完整的覆盖范围,请安装你所需的任意主动工具: ``` # 基于 Go 的工具 go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest go install github.com/tomnomnom/assetfinder@latest go install github.com/projectdiscovery/httpx/cmd/httpx@latest go install github.com/projectdiscovery/chaos-client/cmd/chaos@latest # amass sudo snap install amass # bbot pipx install bbot # Sublist3r git clone https://github.com/aboul3la/Sublist3r cd Sublist3r && pip3 install -r requirements.txt # gobuster sudo apt install gobuster ``` 你并不需要安装所有这些工具。Sub Crack 只会使用你系统上可用的工具。 ## 安装 ``` git clone https://github.com/0zsh4d0w/Sub_crack.git cd Sub_crack chmod +x sub_crack.sh ``` ## 用法 ``` ./sub_crack.sh -d [options] ``` ### 选项 | 标志 | 描述 | |---|---| | `-d ` | 目标域名(必填),例如 `example.com` | | `-o ` | 输出目录(默认:`./results/`) | | `-a` | 同时运行主动暴力破解工具(`amass -brute`、`gobuster dns`、完整的 `bbot` 主动预设)。速度慢 — 默认关闭。 | | `-c` | 检查发现的子域名是否存活(HTTP 探测) | | `-w ` | gobuster 的字典(默认:`/usr/share/wordlists/subdomain_megalist.txt`) | | `-h` | 显示帮助 | ### 示例 使用被动源和任何已安装的主动工具进行基本扫描: ``` ./sub_crack.sh -d example.com ``` 扫描并检查哪些子域名是存活的: ``` ./sub_crack.sh -d example.com -c ``` 包括缓慢的主动暴力破解模块的完整扫描,并使用自定义字典: ``` ./sub_crack.sh -d example.com -a -c -w /usr/share/wordlists/dns.txt ``` 将输出保存到自定义目录: ``` ./sub_crack.sh -d example.com -o /home/user/recon/example ``` ## 输出 每次运行都会创建以下结构: ``` results/example.com/ ├── all_subdomains.txt # Final deduplicated list — the main deliverable ├── alive_subdomains.txt # Only present if -c was used └── raw/ ├── subfinder.txt ├── assetfinder.txt ├── amass_passive.txt ├── findomain.txt ├── bbot.txt ├── crtsh.txt ├── alienvault.txt ├── urlscan.txt ├── wayback.txt └── ... (one file per source that ran) ``` `all_subdomains.txt` 是你通常会输入到侦察流水线下一阶段(端口扫描、屏幕截图、nuclei 模板等)的文件。 ## 去重原理 来自每个来源的所有原始输出会被合并,然后通过以下流水线进行处理: ``` grep -Eo "([a-zA-Z0-9_-]+\.)+example.com" # keep only valid hostnames for the target domain | tr '[:upper:]' '[:lower:]' # normalize case | sed 's/\.$//' # strip trailing dots | sort -u # remove exact duplicates ``` 这意味着来自三个不同工具的 `WWW.example.com`、`www.example.com.` 和 `www.example.com` 都会被合并为单独的一行:`www.example.com`。 ## 关于可选 API Key 的说明 - `chaos` 需要从 [ProjectDiscovery](https://chaos.projectdiscovery.io/) 获取免费的 API key。在运行之前导出它: export CHAOS_KEY="your_api_key_here" 如果未设置 `CHAOS_KEY`,Sub Crack 会自动跳过此来源。 ## 免责声明 此工具仅供授权的安全测试、Bug Bounty 项目和教育用途使用。在针对域名运行枚举或主动暴力破解模块之前,请始终确保你已获得明确的测试许可。作者不对滥用行为负责。 ## 作者 **Prakash K** GitHub: [@0zsh4d0w](https://github.com/0zsh4d0w)
标签:Bash, GitHub, 子域名枚举, 实时处理, 密码管理, 应用安全, 日志审计, 系统安全, 运行时操纵, 进程管理, 逆向工具