x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/information-gathering/tools/httpx.md
View on GitHub# httpx-toolkit
- **Category**: Information Gathering / Web Analysis
- **Risk Level**: 🟢
---
## 描述
httpx 是 ProjectDiscovery 开发的快速多用途 HTTP 工具包。它使用 retryablehttp 库对目标主机运行多种探测。常用于侦察阶段的批量 HTTP 探测,识别存活主机、收集响应元数据(状态码、标题、技术栈),并根据各种条件过滤结果。
在 Kali Linux 上,二进制文件命名为 `httpx-toolkit`,以避免与 Python `httpx` 包(`python3-httpx`)冲突。
## 安装
```bash
sudo apt install httpx-toolkit
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `-l`, `-list` | 包含待处理主机列表的输入文件 |
| `-u`, `-target` | 输入目标主机进行探测 |
| `-p`, `-ports` | 探测的端口(如 `-p 80,443,8080,8443`) |
| `-sc`, `-status-code` | 显示响应状态码 |
| `-cl`, `-content-length` | 显示响应内容长度 |
| `-ct`, `-content-type` | 显示响应内容类型 |
| `-title` | 显示页面标题 |
| `-server`, `-web-server` | 显示服务器名称 |
| `-td`, `-tech-detect` | 显示使用的技术(wappalyzer 数据集) |
| `-ip` | 显示主机 IP 地址 |
| `-cname` | 显示主机 CNAME 记录 |
| `-cdn` | 显示使用的 CDN/WAF |
| `-ss`, `-screenshot` | 启用页面截图保存 |
| `-mc`, `-match-code` | 匹配指定状态码的响应(如 `-mc 200,302`) |
| `-ms`, `-match-string` | 匹配包含指定字符串的响应 |
| `-mr`, `-match-regex` | 匹配符合指定正则的响应 |
| `-fc`, `-filter-code` | 过滤指定状态码的响应(如 `-fc 403,401`) |
| `-fs`, `-filter-string` | 过滤包含指定字符串的响应 |
| `-fe`, `-filter-regex` | 过滤符合指定正则的响应 |
| `-o`, `-output` | 写入输出结果的文件 |
| `-j`, `-json` | 以 JSONL(ines) 格式写入输出 |
| `-csv` | 以 CSV 格式写入输出 |
| `-sr`, `-store-response` | 将 HTTP 响应保存到输出目录 |
| `-srd`, `-store-response-dir` | 将 HTTP 响应保存到自定义目录 |
| `-threads` | 使用的线程数(默认:50) |
| `-rl`, `-rate-limit` | 每秒最大请求数(默认:150) |
| `-rlm`, `-rate-limit-minute` | 每分钟每主机最大请求数 |
| `-H`, `-header` | 随请求发送的自定义 HTTP 头 |
| `-http-proxy`, `-proxy` | 用于请求的 HTTP 代理 |
| `-fr`, `-follow-redirects` | 跟随 HTTP 重定向 |
| `-timeout` | 超时秒数(默认:10) |
| `-retries` | 失败请求的重试次数 |
| `-random-agent` | 启用随机 User-Agent(默认:true) |
| `-version` | 显示 httpx 版本 |
| `-v`, `-verbose` | 详细模式 |
| `-silent` | 静默模式 |
| `-nc`, `-no-color` | 禁用输出颜色 |
## 常用命令
### Scenario 1: 探测单个目标的基本信息
```bash
httpx-toolkit -u https://example.com -sc -title -td -server
```
### Scenario 2: 从文件批量探测主机
```bash
httpx-toolkit -l hosts.txt -sc -title -ip -o results.txt
```
### Scenario 3: 过滤 403/404 响应,仅显示存活页面
```bash
cat subdomains.txt | httpx-toolkit -sc -title -fc 403,404
```
### Scenario 4: 仅匹配特定状态码
```bash
httpx-toolkit -l targets.txt -mc 200,301,302 -title -server
```
### Scenario 5: 技术检测并输出 JSON
```bash
httpx-toolkit -l hosts.txt -td -cdn -json -o tech-results.json
```
### Scenario 6: 与 subfinder 管道联用
```bash
subfinder -d example.com -silent | httpx-toolkit -sc -title -td
```
### Scenario 7: 对存活主机截图
```bash
httpx-toolkit -l hosts.txt -ss -sc -title -o live-hosts.txt
```
### Scenario 8: 通过代理进行限速扫描
```bash
httpx-toolkit -l targets.txt -sc -title -proxy http://127.0.0.1:8080 -rl 10 -threads 5
```
## 注意事项
1. Kali 上的二进制文件为 `httpx-toolkit`,而非 `httpx`。运行 `httpx` 可能调用无关的 Python httpx 库。
2. httpx 接受 stdin 输入,非常适合与 `subfinder`、`amass` 或 `cat` 管道配合使用。
3. 使用 `-json` 输出便于程序化解析和与其他工具集成。
4. 将 `-td`(技术检测)与 `-cdn` 结合使用,可在侦察阶段快速识别受 WAF 保护的目标。
5. `-follow-redirects` 标志适用于捕获 HTTP 重定向到 HTTPS 或不同子域名的目标。
6. 默认线程数(50)和速率限制(150 req/s)较为激进;扫描敏感目标时应使用 `-threads` 和 `-rl` 降低。
7. 使用 `-store-response` 保存完整 HTTP 响应,用于离线分析或证据收集。
8. 随机 User-Agent 默认启用,有助于规避简单的机器人检测。
---
## 官方参考
- [httpx - GitHub](https://github.com/projectdiscovery/httpx)
- [httpx - ProjectDiscovery Documentation](https://docs.projectdiscovery.io/tools/httpx/overview)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |