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/shodan.md
View on GitHub# shodan (CLI)
- **Category**: Information Gathering / Network Asset Intelligence
- **Risk Level**: 🟢 Low
---
## 描述
Shodan 是互联网上最大的设备搜索引擎,索引了全球暴露在公网的设备信息(端口、服务、banner、证书、漏洞等)。CLI 工具允许直接从命令行查询 Shodan 数据库,无需发送任何流量到目标。需要 API 密钥。
## 安装
```bash
pip install shodan
# 初始化(需要 Shodan API Key)
shodan init YOUR_API_KEY
```
## 参数说明
### CLI 主要子命令
| 参数 | 说明 |
|--------|------|
| `shodan init KEY` | 初始化 API 密钥 |
| `shodan search QUERY` | 搜索设备 |
| `shodan host IP` | 查询指定 IP 的详细信息 |
| `shodan count QUERY` | 统计匹配数量 |
| `shodan download FILE QUERY` | 下载搜索结果 |
| `shodan parse FILE` | 解析已下载的结果文件 |
| `shodan info` | 查询账户配额信息 |
| `shodan domain DOMAIN` | 查看域名的所有可用信息 |
| `shodan myip` | 打印你的外部 IP 地址 |
| `shodan stats QUERY` | 提供搜索查询的摘要信息 |
| `shodan scan IP/NETBLOCK` | 使用 Shodan 扫描 IP/网段 |
| `shodan honeyscore IP` | 检查 IP 是否为蜜罐 |
| `shodan alert create` | 创建实时监控告警 |
| `shodan alert list` | 列出所有告警 |
### 常用搜索过滤器
| 过滤器 | 说明 | 示例 |
|--------|------|------|
| `hostname:` | 按主机名过滤 | `hostname:target.com` |
| `org:` | 按组织过滤 | `org:"Target Corp"` |
| `port:` | 按端口过滤 | `port:3389` |
| `country:` | 按国家过滤 | `country:CN` |
| `ssl.cert.subject.cn:` | 按 SSL 证书 | `ssl.cert.subject.cn:*.target.com` |
| `vuln:` | 按 CVE 过滤 | `vuln:CVE-2021-44228` |
| `product:` | 按产品过滤 | `product:"Apache httpd"` |
## 常用命令
```bash
# 搜索目标相关资产
shodan search "hostname:target.com"
shodan search "org:Target Corporation"
shodan search "ssl.cert.subject.cn:target.com"
# 查询特定 IP 详情
shodan host 203.0.113.1 # 替换为实际目标 IP
# 下载搜索结果
shodan download /tmp/results "hostname:target.com"
# 解析下载的结果
shodan parse /tmp/results.json.gz
# 查询你的账户信息
shodan info
# 统计数据
shodan count "apache"
# 搜索特定漏洞(CVE)
shodan search "vuln:CVE-2021-44228"
# 搜索特定端口
shodan search "port:6379 country:CN" # Redis
# 实时监控
shodan alert create "target" 203.0.113.0/24 # 替换为实际目标 CIDR
shodan alert list
```
### 实用搜索语法
```bash
# 查找目标的所有子域名对应 IP
shodan search "ssl.cert.subject.cn:*.target.com" --fields ip_str,port
# 查找默认密码的摄像头
shodan search "default password" --limit 10
# 查找目标的开放 RDP
shodan search "org:TargetCorp port:3389"
```
## 注意事项
1. 免费 Shodan API 密钥查询限制较多;付费会员可解锁更多结果、过滤器和实时告警——是深度资产侦察的必要条件。
2. 使用 `ssl.cert.subject.cn:*.target.com` 可发现所有提供目标域名 TLS 证书的主机——常能找到影子 IT 和被遗忘的子域名。
3. `shodan download` 将结果保存为 gzip 压缩的 JSON 文件,便于离线分析;配合 `shodan parse` 可提取特定字段。
4. Shodan 查询完全被动——不向目标发送任何流量,在授权确认前的早期 OSINT 阶段使用非常安全。
5. `vuln:` 过滤器(需要付费会员)可定位存在已知 CVE 的主机——与 `org:` 结合可快速优先处理范围内的高危资产。
---
## 官方参考
- [Shodan CLI](https://help.shodan.io/command-line-interface/0-installation)
- [Shodan 开发者 API](https://developer.shodan.io/api)
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 |