G4MEOVER18/web-recon-toolkit
GitHub: G4MEOVER18/web-recon-toolkit
一款零外部依赖的Python Web侦察工具包,集成技术指纹、目录扫描、邮箱收集、DNS枚举和Wayback查询五大模块。
Stars: 0 | Forks: 0
# web-recon-toolkit
一款模块化的 Python-3 工具,无外部依赖,专为 Web 应用渗透测试的初始侦察阶段设计。每个模块都可以单独运行,也可以使用 `--all` 参数组合运行。结果可以导出为 JSON 格式,以便集成到更庞大的工具链中。
[](https://www.python.org/)
[](LICENSE)
[]()
## 法律声明 / 免责声明
**本工具仅用于授权的安全评估。**
在大多数司法管辖区,对您不拥有或未获得明确书面测试授权的目标运行侦察扫描是**违法的**。作者不对任何滥用行为承担责任。在使用本工具之前,请务必获得适当的授权。
## 目录
1. [安装](#installation)
2. [快速入门](#quick-start)
3. [模块参考](#modulreferenz)
- [--tech — 技术指纹识别](#--tech--technologie-fingerprinting)
- [--dirs — 目录暴力破解](#--dirs--directory-brute-force)
- [--emails — 电子邮件收集](#--emails--e-mail-harvesting)
- [--dns — DNS 枚举](#--dns--dns-enumeration)
- [--wayback — Wayback Machine](#--wayback--wayback-machine)
4. [CLI 参考](#cli-referenz)
5. [渗透测试工作流](#pentest-workflow)
6. [输出格式](#ausgabeformate)
7. [相关工具](#verwandte-tools)
8. [捐赠](#spenden)
## 安装
```
git clone https://github.com/G4MEOVER18/web-recon-toolkit.git
cd web-recon-toolkit
# 无需 pip install — 零外部依赖
python recon.py --help
```
前提条件:**Python 3.8+**,仅使用标准库。
在 Windows 上,默认可使用 `nslookup` 进行 DNS 查询。在 Linux/macOS 上,则使用 `dig` 或 `nslookup`。
## 快速入门
```
# 对目标运行所有模块
python recon.py example.com --all
# 仅对 technology stack 进行 fingerprint
python recon.py https://example.com --tech
# 使用 20 个线程和 5 秒超时进行 directory brute-force
python recon.py example.com --dirs --threads 20 --timeout 5
# 完整扫描,保存 JSON 输出
python recon.py example.com --all --json --out results.json
# 使用自定义 wordlist 进行 directory scanning
python recon.py example.com --dirs --wordlist /path/to/wordlist.txt
```
## 模块参考
### `--tech` — 技术指纹识别
获取目标页面和 HTTP 标头,并检测以下内容:
| 类别 | 检测方法 |
|---|---|
| Web 服务器 | HTTP 标头 `Server:` |
| 后端 | 标头 `X-Powered-By:` |
| CMS | Body 特征 (wp-content, Joomla!, sites/all/modules 等) |
| Generator | `` 标签 |
| JS 框架 | Script 的 `src` 属性 (React, Vue, Angular, jQuery, Next.js 等) |
| CDN | 标头:`cf-ray`, `x-akamai-*`, `x-amz-cf-id`, `x-varnish` 等 |
| WAF | 标头:`x-sucuri-id`, `cf-ray`, `x-fw-*`, `x-iinfo` 等 |
| Security Headers | 检查是否存在 HSTS, CSP, X-Frame-Options 等 |
**示例输出:**
```
[*] Technology Fingerprinting — https://example.com
Key Value
-------------------------- ----------------------------------------
Server nginx/1.24.0
X-Powered-By PHP/8.2.1
CMS WordPress
JS Frameworks jQuery, React
CDN Cloudflare
WAF Cloudflare WAF
Security Headers:
strict-transport-security max-age=31536000; includeSubDomains
content-security-policy MISSING
x-frame-options SAMEORIGIN
```
### `--dirs` — 目录暴力破解
向内置的包含** 100 多个常见路径**的列表发送并发的 HEAD 请求,并报告所有未返回 404 的结果。使用 `ThreadPoolExecutor`,并支持配置线程数量 (`--threads`)。
**包含的路径(部分示例):**
- 管理面板:`/admin`, `/wp-admin`, `/phpmyadmin`, `/console`, `/manager`
- API 端点:`/api`, `/api/v1`, `/swagger`, `/openapi.json`, `/graphql`
- 敏感文件:`/.env`, `/.git/HEAD`, `/backup.zip`, `/db.sql`, `/web.config`
- 配置文件:`/config.yml`, `/config.json`, `/.htaccess`, `/.htpasswd`
- 信息端点:`/server-status`, `/actuator/env`, `/phpinfo.php`
- 安全文件:`/robots.txt`, `/security.txt`, `/.well-known/security.txt`
报告的 HTTP 状态码:`200`(已找到),`301/302/307/308`(重定向),`403/401`(禁止访问/需要身份验证 —— 表明目标存在)。
**示例输出:**
```
[*] Directory Brute-force — https://example.com
200 https://example.com/robots.txt
403 https://example.com/.git/HEAD
301 https://example.com/admin → https://example.com/admin/
200 https://example.com/wp-login.php
Found 4 interesting path(s).
```
使用 `--wordlist /path/to/list.txt` 添加自定义字典(每行一个路径,使用 `#` 进行注释)。
### `--emails` — 电子邮件收集
获取目标的多个页面(首页、`/robots.txt`、`/sitemap.xml`、`/contact`、`/about`、`/impressum`),并通过正则表达式提取电子邮件地址。还会搜索 **HTML 注释**,其中有时会包含开发人员或管理员的联系邮箱。
**示例输出:**
```
[*] Email Harvesting — https://example.com
Found 3 email(s):
admin@example.com
support@example.com
webmaster@example.com
```
### `--dns` — DNS 枚举
解析目标域名的所有常见 DNS 记录类型,并检查邮件安全配置:
| 检查项 | 详细信息 |
|---|---|
| A / AAAA | IPv4 和 IPv6 地址 |
| MX | 邮件服务器记录 |
| NS | 名称服务器记录 |
| TXT | 所有 TXT 记录 |
| CNAME | 别名记录 |
| SPF | 从 TXT 记录中提取 (`v=spf1`) |
| DMARC | 查询 `_dmarc.` |
| DKIM | 查询 `default._domainkey.` |
**示例输出:**
```
[*] DNS Enumeration — https://example.com
A 93.184.216.34
AAAA 2606:2800:220:1:248:1893:25c8:1946
MX 10 mail.example.com.
NS a.iana-servers.net.
TXT "v=spf1 include:_spf.google.com ~all"
SPF: v=spf1 include:_spf.google.com ~all
DMARC: v=DMARC1; p=reject; rua=mailto:dmarc@example.com
DKIM: default._domainkey not found (selector unknown)
```
### `--wayback` — Wayback Machine
查询 Internet Archive 以获取历史快照:
1. **可用性检查** — 通过 `archive.org/wayback/available` 查找最新的快照时间戳和 URL
2. **CDX 索引查询** — 通过 CDX API 获取最多 20 个最近归档的 URL,包括归档时的时间戳和 HTTP 状态码
可用于查找:
- 不再存在的旧管理面板或隐藏端点
- 早期公开访问的敏感文件(`.env`、备份等)
- 较旧的 API 版本
**示例输出:**
```
[*] Wayback Machine — https://example.com
Snapshot available: 2024-11-01 14:22 → https://web.archive.org/web/20241101142201/https://example.com/
Timestamp Code URL
----------------- ------ --------------------------------------------------
2024-11-01 200 https://example.com/
2024-10-15 200 https://example.com/admin-old/
2024-09-22 200 https://example.com/backup-2024.zip
```
## CLI 参考
| 标志 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| `target` | 位置参数 | — | 目标 URL 或主机名 |
| `--tech` | 标志 | — | 执行技术指纹识别 |
| `--dirs` | 标志 | — | 执行目录暴力破解 |
| `--emails` | 标志 | — | 执行电子邮件收集 |
| `--dns` | 标志 | — | 执行 DNS 枚举 |
| `--wayback` | 标志 | — | 执行 Wayback Machine 模块 |
| `--all` | 标志 | — | 执行所有模块 |
| `--threads N` | int | `10` | 并发线程数(用于 `--dirs`) |
| `--timeout N` | int | `8` | HTTP 请求超时时间(秒) |
| `--user-agent STR` | str | Chrome UA | 自定义 User-Agent 字符串 |
| `--wordlist FILE` | 路径 | — | 用于目录扫描的额外字典(配合 `--dirs`) |
| `--json` | 标志 | — | 以 JSON 格式输出 |
| `--out FILE` | 路径 | — | 将结果保存到文件 |
## 渗透测试工作流
Web 应用渗透测试的典型侦察流程:
```
# 步骤 1 — 被动 Recon:在接触服务器之前进行 DNS + Wayback
python recon.py target.com --dns --wayback --json --out step1-passive.json
# 步骤 2 — 主动 Fingerprinting
python recon.py target.com --tech --out step2-tech.txt
# 步骤 3 — 使用更大的 Wordlist 进行 Directory Discovery
python recon.py target.com --dirs --threads 25 --wordlist ~/wordlists/raft-medium-directories.txt --out step3-dirs.txt
# 步骤 4 — 为 OSINT / Phishing-Simulation 进行 E-Mail-Harvesting
python recon.py target.com --emails
# 步骤 5 — 用于报告的完整组合扫描
python recon.py target.com --all --json --out final-report.json
```
**结合相关工具以实现更深度的覆盖:**
```
# 首先枚举 Subdomains
python ~/tools/subdomain-takeover-scanner/scanner.py target.com
# 然后对每个活动的 Subdomain 应用 web-recon-toolkit
for sub in $(cat live-subs.txt); do
python recon.py $sub --tech --dirs --out "$sub.txt"
done
# 检查来自 Responses 的 JWT-Tokens
python ~/tools/jwt-pwn/jwt_pwn.py --token
# 详细审计 HTTP-Security-Header
python ~/tools/http-header-auditor/auditor.py target.com
# 测试 CORS-Fehlkonfigurationen
python ~/tools/cors-scanner/cors_scan.py target.com
```
## 输出格式
### 控制台(默认)
带有 ANSI 颜色代码的彩色、人类可读输出。
### JSON (`--json`)
用于脚本编写和报告流水线的结构化输出:
```
{
"meta": [{"target": "https://example.com", "scan_time": "2026-05-22T10:00:00Z", "modules": ["tech", "dns"]}],
"tech": [{"Server": "nginx/1.24.0", "CMS": "WordPress", ...}],
"dns": [{"A": ["93.184.216.34"], "MX": ["mail.example.com"], ...}],
"dirs": [{"path": "/wp-login.php", "code": 200, "url": "https://example.com/wp-login.php"}]
}
```
### 文件输出 (`--out`)
每种格式都可以保存到文件中。结合 `--json` 使用以获得机器可读的输出:
```
python recon.py target.com --all --json --out report.json
python recon.py target.com --all --out report.txt # plain text
```
## 相关工具
[G4MEOVER18](https://github.com/G4MEOVER18) 的所有工具:
| 工具 | 描述 |
|---|---|
| [subdomain-takeover-scanner](https://github.com/G4MEOVER18/subdomain-takeover-scanner) | 识别孤立的 DNS 记录和子域名接管漏洞 |
| [jwt-pwn](https://github.com/G4MEOVER18/jwt-pwn) | JWT 安全测试:alg:none、RS256→HS256、弱密钥暴力破解 |
| [cors-scanner](https://github.com/G4MEOVER18/cors-scanner) | 检测 CORS 配置错误 |
| [http-header-auditor](https://github.com/G4MEOVER18/http-header-auditor) | 全面分析 HTTP 安全标头 |
| [stm32-usb-fuzzer](https://github.com/G4MEOVER18/stm32-usb-fuzzer) | 通过 STM32 微控制器进行 USB 协议 Fuzzing |
标签:GitHub, Python, Web安全, 实时处理, 密码管理, 无后门, 蓝队分析