mcpField
S
shodan-reconnaissance

shodan-reconnaissance

github.com/sickn33安全48.7k159 次安装今天更新
代码仓库

关于 shodan-reconnaissance

用于通过 Shodan 搜索互联网暴露主机并评估授权目标的安全侦察技能。强调先确认授权与范围,未获确认时仅提供只读指导,并提醒扫描限制和数据时效。

主要功能

  1. 01Shodan 主机与服务搜索
  2. 02基础设施统计与数据下载
  3. 03漏洞和设备发现
  4. 04SSL/TLS 证书搜索
  5. 05授权及命令确认关卡
  6. 06速率限制与数据时效提示

适用场景

  1. 01盘点授权组织暴露的基础设施
  2. 02查找与已知漏洞相关的服务
  3. 03发现暴露的 IoT 和工业设备
  4. 04检查授权主机的证书属性

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/sickn33/agentic-awesome-skills --skill shodan-reconnaissance

安装后在 Claude Code 中输入/shodan-reconnaissance确认已加载。

附带文件references/detailed-guide.md

详细介绍

⚠️ 仅限授权使用 此技能仅用于教育目的或经授权的安全评估。 使用此工具前,必须取得系统所有者的明确书面许可。 滥用此工具属于违法行为,严禁滥用。

强制确认关卡 在运行任何会探测、利用、修改、在目标上建立持久驻留、从目标提取数据或尝试获取目标凭据的命令之前:

  1. 请用户说明确切的目标 URL、IP、账户或资源。
  2. 请用户确认已取得书面授权,并说明许可范围。
  3. 展示确切的命令,并说明其预期效果。
  4. 等待用户在当前对话中明确确认。

未获得上述确认时,只能执行只读操作,并仅提供防御性指导。优先使用沙箱、一次性 VM 或受控实验室。

Shodan 侦察与渗透测试

详细指南

执行此技能前,请阅读详细指南。其中保留了完整流程和参考资料。必须遵守其中的安全要求、前置条件和验证要求。进行专项工作时,请加载相关章节;进行端到端工作时,请完整阅读指南。

约束和限制

操作边界
  • 检查当前端点/账户的速率限制,并遵循重试指引
  • 扫描结果不会立即返回(异步)
  • 是否具备重新扫描的资格取决于当前账户和端点策略
  • 免费账户的额度有限
  • 部分数据需要付费订阅
数据时效性
  • Shodan 持续爬取数据,但数据可能已有数天或数周之久
  • 按需扫描可提供最新数据,但会消耗额度
  • 付费方案可获取历史数据
法律要求
  • 仅对已获授权的目标进行侦察
  • 被动侦察通常合法,但请核实司法管辖区的相关规定
  • 主动扫描(提交扫描任务)需要获得授权
  • 记录所有侦察活动

示例

示例 1:组织侦察
# Find all hosts belonging to target organization
shodan search 'org:"Target Company"'

# Get statistics on their infrastructure
shodan stats --facets port,product,country 'org:"Target Company"'

# Download detailed data
shodan download target_data.json.gz 'org:"Target Company"'

# Parse for specific info
shodan parse --fields ip_str,port,product target_data.json.gz
示例 2:发现易受攻击的服务
# Find hosts vulnerable to BlueKeep (RDP CVE)
shodan search 'vuln:CVE-2019-0708 country:US'

# Find Elasticsearch banner candidates; absence of an authentication keyword does not prove no auth
shodan search 'product:elastic port:9200 -authentication'

# Find Log4j vulnerable systems
shodan search 'vuln:CVE-2021-44228'
示例 3:发现 IoT 设备
# Find exposed webcams
shodan search 'webcam has_screenshot:true country:US'

# Find industrial control systems
shodan search 'port:502 product:modbus'

# Find exposed printers
shodan search '"HP-ChaiSOE" port:80'

# Find smart home devices
shodan search 'product:nest'
示例 4:SSL/TLS 证书分析
# Find hosts with specific SSL cert
shodan search 'ssl.cert.subject.cn:*.example.com'

# Find expired certificates
shodan search 'ssl.cert.expired:true org:"Company"'

# Find self-signed certificates
# Inspect issuer/subject and verify signature; issuer CN text alone cannot establish self-signing.
示例 5:Python 自动化脚本
#!/usr/bin/env python3
import shodan
import json
import os

API_KEY = os.environ["SHODAN_API_KEY"]
api = shodan.Shodan(API_KEY)

def recon_organization(org_name):
    """Perform reconnaissance on an organization"""
    try:
        # Search for organization
        query = f'org:"{org_name}"'
        results = api.search(query)
        
        print(f"[*] Found {results['total']} matching banners; this response is one page")
        
        # Collect unique IPs and ports
        hosts = {}
        for result in results['matches']:
            ip = result['ip_str']
            port = result['port']
            product = result.get('product', 'unknown')
            
            if ip not in hosts:
                hosts[ip] = []
            hosts[ip].append({'port': port, 'product': product, 'transport': result.get('transport', 'unknown')})
        
        # Output findings
        for ip, services in hosts.items():
            print(f"\n[+] {ip}")
            for svc in services:
                print(f"    - {svc['port']}/{svc['transport']} ({svc['product']})")
        
        return hosts
        
    except shodan.APIError as e:
        print(f"Error: {e}")
        return None

if __name__ == '__main__':
    recon_organization("Target Company")
示例 6:网络范围评估
# Scan a /24 network range
shodan search 'net:203.0.113.0/24'

# Get port distribution
shodan stats --facets port 'net:203.0.113.0/24'

# Find specific vulnerabilities in range
shodan search 'net:203.0.113.0/24 vuln:CVE-2021-44228'

# Export all data for range
shodan download network_scan.json.gz 'net:203.0.113.0/24'

适用场景

此技能适用于执行概述中描述的工作流或操作。

评论

支持 Markdown