MouhBbt/BBTrecon
GitHub: MouhBbt/BBTrecon
一个基于 Python 异步架构的模块化侦察框架,用于渗透测试和 Bug Bounty 场景下的子域名枚举、HTTP 探测和历史 URL 发现。
Stars: 0 | Forks: 0
# BBTrecon
BBTrecon 是一个模块化的侦察框架,使用 Python 3.12+ 构建,适用于渗透测试、Bug Bounty 工作流程以及 HTB 风格的目标发现。
它专注于简洁的生产级架构,具备异步网络功能、结构化输出、可选的外部枚举工具集成,以及支持运行单个阶段或完整管道的简单 CLI。
## 功能特性
- 由 `asyncio` 和 `aiohttp` 驱动的异步侦察管道
- 通过 `crt.sh` 进行证书透明度枚举
- Wayback Machine CDX 枚举,用于被动主机发现
- 可选的外部工具支持:`subfinder` 和 `amass`
- 对发现的子域名进行 HTTP 和 HTTPS 解析
- 使用最新 3 个索引进行 Common Crawl 抓取
- 在 `output//` 下的结构化输出
- 用于下游自动化的 JSON 报告
- Rich 终端输出和基于文件的日志记录
- 模块化代码库,关注点分离清晰
## 侦察工作流
### 阶段 1:子域名枚举
BBTrecon 从以下来源收集子域名:
- `crt.sh`
- Wayback Machine CDX API
- `subfinder`(如果已安装)
- `amass`(如果已安装)
所有结果均经过标准化和去重处理,并保存至:
```
output//subdomains.txt
```
### 阶段 2:HTTP 解析
BBTrecon 使用异步请求通过 `https://` 和 `http://` 探测发现的子域名,以识别存活端点。
结果保存至:
```
output//alive.txt
```
### 阶段 3:Common Crawl URL 抓取
BBTrecon 查询最新的 3 个 Common Crawl 索引,收集目标范围内的存档 URL,并根据当前存活主机筛选结果。
结果保存至:
```
output//urls.txt
```
### 阶段 4:结构化报告
每次运行都会生成一份 JSON 报告,其中包含元数据、配置和产物位置:
```
output//report.json
```
## 项目结构
```
BBTrecon/
├── main.py
├── requirements.txt
├── README.md
└── bbtrecon/
├── core/
│ └── orchestrator.py
├── modules/
│ ├── subdomain.py
│ ├── resolver.py
│ └── commoncrawl.py
└── utils/
└── logger.py
```
## 环境要求
- Python 3.12+
- `pip`
- 可选:
- `subfinder`
- `amass`
## 安装说明
创建并激活虚拟环境:
```
python3 -m venv .venv
source .venv/bin/activate
```
安装依赖:
```
pip install -r requirements.txt
```
## 使用方法
### 显示帮助
```
python3 main.py -h
```
### 完整侦察
```
python3 main.py -d example.com --full
```
### 不使用外部工具的完整侦察
```
python3 main.py -d example.com --full --no-external
```
### 运行单独阶段
子域名枚举:
```
python3 main.py -d example.com --enum
```
HTTP 解析:
```
python3 main.py -d example.com --resolve
```
Common Crawl 抓取:
```
python3 main.py -d example.com --crawl
```
### 调整并发和超时
```
python3 main.py -d example.com --full --concurrency 20 --timeout 20
```
### 启用详细日志
```
python3 main.py -d example.com --full --verbose
```
## CLI 选项
```
-d, --domain Target domain
--enum Run subdomain enumeration
--resolve Run HTTP resolution
--crawl Run Common Crawl harvesting
--full Run the full pipeline
--no-external Disable subfinder/amass execution
--concurrency Maximum concurrent network tasks
--timeout HTTP timeout in seconds
--output-root Base output directory
--verbose Enable debug logging
```
## 输出布局
输出目录示例:
```
output/example.com/
├── alive.txt
├── bbtrecon.log
├── report.json
├── subdomains.txt
└── urls.txt
```
## `report.json` 示例
```
{
"tool": "BBTrecon",
"domain": "example.com",
"configuration": {
"run_enum": true,
"run_resolve": true,
"run_crawl": true
},
"results": {
"subdomains": {
"count": 42,
"file": "output/example.com/subdomains.txt"
},
"alive_endpoints": {
"count": 18,
"file": "output/example.com/alive.txt"
},
"archived_urls": {
"count": 137,
"file": "output/example.com/urls.txt"
}
}
}
```
## 注意事项
- 除非同时运行 `--enum` 或 `--full`,否则 `--resolve` 需要预先存在 `subdomains.txt`。
- 除非同时运行 `--resolve` 或 `--full`,否则 `--crawl` 需要预先存在 `alive.txt`。
- 只有在外部工具已安装且在 `PATH` 中可被发现时,才会使用它们。
- Common Crawl 的覆盖范围取决于目标范围内是否存在存档内容。
## 开发
基础语法验证:
```
python3 -m compileall main.py bbtrecon
```
## 法律与合规使用
请仅对您拥有或获得明确授权评估的系统使用 BBTrecon。您有责任遵守适用的法律、平台规则和项目范围。
## 许可证
在发布前在此处添加您首选的许可证,例如 `MIT`。
标签:CLI 工具, ESC6, GitHub, HTTP 探测, Python, Wayback Machine, 侦察框架, 历史 URL 获取, 反汇编, 子域名枚举, 实时处理, 密码管理, 异步编程, 无后门, 系统安全, 网络调试, 自动化, 计算机取证, 证书透明度, 逆向工具