FarzadSec/wRecon
GitHub: FarzadSec/wRecon
一款面向安全研究人员的广域侦察自动化工具包,整合多种被动数据源实现子域名枚举、URL 收集及存活探测。
Stars: 4 | Forks: 0
# wRecon
**广域侦察工具包** — 多来源子域名枚举、被动 URL 收集、参数提取和存活探测。
```
██╗ ██╗██████╗ ███████╗ ██████╗ ██████╗ ███╗ ██╗
██║ ██║██╔══██╗██╔════╝██╔════╝██╔═══██╗████╗ ██║
██║ █╗ ██║██████╔╝█████╗ ██║ ██║ ██║██╔██╗ ██║
██║███╗██║██╔══██╗██╔══╝ ██║ ██║ ██║██║╚██╗██║
╚███╔███╔╝██║ ██║███████╗╚██████╗╚██████╔╝██║ ╚████║
╚══╝╚══╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝
wreck the target. systematically.
```
## 📋 概述
**wRecon** 通过将多个被动和主动来源整合到一个工作流程中,实现了侦察阶段的自动化。它可以处理来自 8 个以上来源的子域名枚举,收集历史 URL,提取参数,并探测存活主机 —— 所有这些都具备范围外(Out-of-Scope)过滤、持久化配置和具备检查点感知的恢复功能。
非常适合那些需要进行全面侦察但又不想一直盯守工具的 Bug Bounty 猎人、渗透测试人员和安全研究人员。
## ✨ 功能
### 🔍 **多来源子域名枚举**
- **8个被动来源**:subfinder、assetfinder、amass、crt.sh、Shodan、Wayback Machine、AlienVault OTX、HackerTarget
- 自动去重和合并
- 每个来源的归因(JSON 报告)
### 🌐 **被动 URL 收集**
- **waybackurls** — Internet Archive 历史 URL
- **gau**(GetAllUrls)— 聚合多个来源
- 对静态文件(图像、字体、CSS、JS)进行智能过滤
### 🔧 **参数提取**
- **unfurl** — 提取所有 URL 参数键
- 可用于识别注入点
### 🚀 **存活探测**
- **httpx** — 快速 HTTP 探测与技术检测
- **dnsx** — DNS 解析
- 可自定义线程和超时
### 🛡️ **范围外(Out-of-Scope)过滤**
- 支持通配符 (`*.internal.example.com`)
- 应用于所有阶段(子域名、URL、主动探测)
- 为过滤掉的项目提供单独的输出文件
### 💾 **持久化配置**
- 将 API 密钥、项目偏好和设置保存到 `~/.config/wrecon/`
- 无需每次重新输入 Shodan 密钥或 OOS 文件
### 🖥️ **tmux 集成**
- 使用 `--tmux` 在命名的 tmux 会话中运行
- 会话在 SSH 断开连接后依然存活
- 如果会话已存在:附加、终止并重启,或退出
- 会话命名为 `wrecon_`,便于识别
### 🧠 **检查点记录**
- 在项目文件夹内的 `.wrecon_state.json` 中跟踪已完成的阶段
- 重新运行时,跳过已完成的阶段,并在重新运行前询问
- 启动时显示上次运行摘要(阶段、结果数量、时间戳)
- 使用 `--force` 覆盖并重新运行所有内容
- 使用 `--status` 检查检查点状态而不运行任何内容
### 🔧 **交互模式 + CLI 模式**
- **交互式菜单**(默认)— 引导式设置,非常适合首次使用
- **CLI 模式** — 可编写脚本,支持自动化
### 🛠️ **内置安装程序**
- 检查依赖项,提供安装缺失工具的选项
- 始终安装最新稳定版的 Go(从 go.dev 获取)
- amass:首先尝试 `go install`,若失败则回退到二进制发布版本
## 📦 安装
### 快速安装(推荐)
```
git clone https://github.com/yourusername/wrecon.git
cd wrecon
chmod +x install.sh
sudo ./install.sh
```
这将:
- 安装包括 **tmux** 在内的系统软件包
- 自动获取并安装**最新稳定版的 Go**
- 安装所有基于 Go 的侦察工具
- 安装 amass(通过 `go install`,以二进制发布版本作为备选)
- 将 `wrecon` 放入 `/usr/local/bin/` 并实现全局访问
### 手动安装
```
# 1. 安装系统依赖(包含 tmux)
sudo apt install wget curl git unzip python3 python3-pip tmux
# 2. 安装 Python 依赖
pip3 install requests
# 3. 安装最新版 Go
GO_LATEST=$(curl -fsSL 'https://go.dev/dl/?mode=json' | \
python3 -c "import sys,json; d=json.load(sys.stdin); print(next(r['version'] for r in d if r['stable']))")
curl -fsSL "https://go.dev/dl/${GO_LATEST}.linux-amd64.tar.gz" -o /tmp/go.tgz
sudo tar -C /usr/local -xzf /tmp/go.tgz
echo 'export PATH=/usr/local/go/bin:$HOME/go/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# 4. 安装 Go 工具
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest
go install github.com/tomnomnom/assetfinder@latest
go install github.com/tomnomnom/waybackurls@latest
go install github.com/lc/gau/v2/cmd/gau@latest
go install github.com/tomnomnom/unfurl@latest
# 5. 安装 amass
go install -v github.com/owasp-amass/amass/v4/...@latest
# 6. 使 wrecon 全局可用
sudo cp wrecon.py /usr/local/bin/wrecon
sudo chmod +x /usr/local/bin/wrecon
```
## 🚀 使用方法
### 交互模式(默认)
```
wrecon
```
您将获得以下引导:
- 依赖项检查(仅首次运行)
- 项目名称和目标域名
- 范围外(Out-of-Scope)文件路径
- API 密钥(Shodan — 保存供以后使用)
- 阶段选择
- tmux 会话选项
**所有设置都会被保存** — 下次运行 `wrecon` 时,只需按 Enter 键即可使用默认设置。
### CLI 模式
#### 基本用法
```
# 运行所有阶段
wrecon -d example.com --all
# 带 out-of-scope 过滤
wrecon -d example.com --oos oos.txt --all
# 仅运行特定阶段
wrecon -d example.com --subs --passive --active
```
#### tmux 模式
```
# 在持久化 tmux 会话中启动
wrecon -d example.com --oos oos.txt --all --tmux
# 附加到正在运行的会话
tmux attach -t wrecon_example
# 列出所有 wrecon 会话
tmux ls | grep wrecon
# 停止某个会话
tmux kill-session -t wrecon_example
```
#### 检查点 / 恢复
```
# 检查哪些阶段已完成
wrecon -d example.com -p example --status
# 恢复 —— 跳过已完成的阶段,重新运行前会进行询问
wrecon -d example.com --all
# 强制重新运行所有内容,忽略 checkpoint
wrecon -d example.com --all --force
```
#### 多目标
```
wrecon -i targets.txt --all --tmux
```
#### 高级选项
```
wrecon -d example.com \
-p my_project \
-o ~/recon_output \
--oos targets/example_oos.txt \
--threads 50 \
--resolvers custom_resolvers.txt \
--subs --passive --params --active \
--tmux
```
## 📂 输出结构
所有输出均保存至 `//`:
```
~/hunt/example/
├── subdomains.txt # In-scope subdomains only
├── subdomains_oos.txt # Filtered out-of-scope subdomains
├── all_subdomains.txt # All discovered (pre-filter)
├── subdomains_by_source.json # Per-source attribution
├── passive.txt # In-scope URLs (waybackurls + gau)
├── passive_oos.txt # Filtered OOS URLs
├── passive_params.txt # Extracted parameter keys
├── passiveplus.txt # httpx results on passive URLs (optional)
├── active.txt # dnsx + httpx live probing results
└── .wrecon_state.json # Checkpoint: completed stages + timestamps
```
## 🔧 配置
### 范围外(Out-of-Scope)文件格式
```
# example_oos.txt
*.internal.example.com
*.db.example.com
staging.example.com
test-*.example.com
```
以 `#` 开头的行是注释。支持通配符模式 (`*`)。
### API 密钥
#### Shodan
```
export SHODAN_API_KEY="your_key_here"
```
或者直接运行 `wrecon` —— 它会询问一次并保存到 `~/.config/wrecon/config.json`。
#### subfinder(可选,但推荐)
```
subfinder -d example.com # creates config on first run
nano ~/.config/subfinder/provider-config.yaml
```
```
shodan:
- your_shodan_key
virustotal:
- your_virustotal_key
securitytrails:
- your_securitytrails_key
github:
- your_github_token
```
## 🎯 支持的阶段
| 阶段 | 标志 | 描述 |
|-------|------|-------------|
| **子域名枚举** | `--subs` | 8来源被动子域名发现 |
| **被动 URL 收集** | `--passive` | waybackurls + gau |
| **参数提取** | `--params` | 使用 unfurl 提取 URL 参数键 |
| **PassivePlus** | `--passiveplus` | 使用 httpx 探测被动 URL |
| **主动探测** | `--active` | 在已发现的子域名上执行 dnsx + httpx pipeline |
使用 `--all` 运行所有阶段。
## 🛠️ 所有标志
| 标志 | 描述 |
|------|-------------|
| `-d DOMAIN` | 单个目标域名 |
| `-i FILE` | 包含域名列表的文件 |
| `-p NAME` | 项目名称 |
| `-o DIR` | 基础输出目录(默认:`~/hunt`) |
| `--oos FILE` | 范围外模式文件 |
| `--threads N` | httpx 线程数(默认:25) |
| `--resolvers FILE` | 自定义 DNS 解析器文件 |
| `--all` | 运行所有阶段 |
| `--subs` | 仅子域名枚举 |
| `--passive` | 仅被动 URL 收集 |
| `--params` | 仅参数提取 |
| `--passiveplus` | 仅 PassivePlus 探测 |
| `--active` | 仅主动探测 |
| `--tmux` | 在命名的 tmux 会话中运行 |
| `--force` | 忽略检查点,重新运行所有阶段 |
| `--status` | 显示检查点状态并退出 |
| `--install-deps` | 运行依赖项安装程序并退出 |
| `--reset-config` | 删除已保存的配置并退出 |
## 🔥 示例工作流
```
# 1. 克隆并安装
git clone https://github.com/yourusername/wrecon.git
cd wrecon && sudo ./install.sh
source ~/.bashrc
# 2. 设置 Shodan API key(仅需一次)
export SHODAN_API_KEY="your_key_here"
# 3. 创建 out-of-scope 文件
cat > fivetran_oos.txt << EOF
*.db.fivetran.com
testing-datalake.fivetran.com
shop.fivetran.com
status.fivetran.com
support.fivetran.com
community-stage.fivetran.com
trust.fivetran.com
EOF
# 4. 在 tmux 内运行完整侦察
wrecon -d fivetran.com \
-p fivetran \
--oos fivetran_oos.txt \
--all \
--tmux
# 5. 附加以查看进度
tmux attach -t wrecon_fivetran
# 6. 稍后检查状态(无需重新运行)
wrecon -d fivetran.com -p fivetran --status
# 7. 中断后恢复(跳过已完成的阶段)
wrecon -d fivetran.com -p fivetran --oos fivetran_oos.txt --all
```
## 📜 许可证
MIT 许可证 — 详情请参阅 [LICENSE](LICENSE)。
## ⚠️ 免责声明
本工具仅供授权的安全测试和研究使用。在扫描目标之前,请务必确保您已获得明确的许可。未经授权的侦察在您所在的司法管辖区可能属于违法行为。
标签:GitHub, 侦察工具, 子域名枚举, 实时处理, 密码管理, 应用安全, 日志审计, 病毒分析, 系统安全, 网络安全, 规则库, 逆向工具, 隐私保护