360 Secure SkillHub
360 安全技能中心

Shodan Skill

通过 Python 脚本封装官方 Shodan 库,提供高级搜索与分面统计、主机详情、按需扫描、网络告警管理、DNS 与域名查询、账户信息、协议端口列表、保存查询、通知器、漏洞利用检索、实时流和过滤字段查询等功能,需要配置 Shodan API Key。

dmcmurrin4617
dmcmurrin4617
热度 83.59
最近更新 2026-05-11 17:31:42
分类:安全依赖:代码执行 / 第三方 API应用场景:研究 / API 集成 / 数据处理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add shodan-skill
Metadata
name
shodan-skill
description
Advanced Shodan API interactions including search, scan, alerts, and DNS.
read_when
["User wants to perform advanced Shodan searches with facets","User wants to scan specific IPs using Shodan (on-demand)","User wants to manage Shodan network alerts","User wants to lookup DNS or domain information"]
metadata
{"openclaw":{"emoji":"🔍","requires":{"bins":["python3","pip"]}}}

Shodan Skill

A comprehensive wrapper for the Shodan API using the official Python library.

Setup

  1. Install dependencies:

    pip install shodan
    
  2. Configure API Key:

    shodan init <YOUR_API_KEY>
    

Usage

1. Search (Advanced)

Search with limits, pages, and facets (statistics).

python3 {baseDir}/scripts/shodan_skill.py search "<QUERY>" --limit <LIMIT> --page <PAGE> --facets <FACETS>
  • --facets: Comma separated, e.g., country:5,org:5 (top 5 countries and orgs).

2. Count (Statistics)

Get the total count of results without consuming query credits for full details.

python3 {baseDir}/scripts/shodan_skill.py count "<QUERY>" --facets <FACETS>

3. Host Details

Get details for an IP.

python3 {baseDir}/scripts/shodan_skill.py host <IP> [--history] [--minify]

4. On-Demand Scan

Request Shodan to scan a network (consumes Scan Credits).

python3 {baseDir}/scripts/shodan_skill.py scan <IPs>
  • <IPs>: Single IP, CIDR, or comma-separated list.

5. Network Alerts

Monitor your networks for exposure.

  • List Alerts: python3 {baseDir}/scripts/shodan_skill.py alert_list
  • Create Alert: python3 {baseDir}/scripts/shodan_skill.py alert_create <NAME> <IP_RANGE>
  • Alert Info: python3 {baseDir}/scripts/shodan_skill.py alert_info <ALERT_ID>

6. DNS & Domains

  • Domain Info: python3 {baseDir}/scripts/shodan_skill.py dns_domain <DOMAIN>
  • Resolve: python3 {baseDir}/scripts/shodan_skill.py dns_resolve <HOSTNAMES>

7. Account & Tools

  • Profile: python3 {baseDir}/scripts/shodan_skill.py profile
  • My IP: python3 {baseDir}/scripts/shodan_skill.py myip
  • Ports: python3 {baseDir}/scripts/shodan_skill.py ports
  • Protocols: python3 {baseDir}/scripts/shodan_skill.py protocols

8. Directory (Saved Queries)

  • Search Queries: python3 {baseDir}/scripts/shodan_skill.py query_search "<TERM>"
  • Popular Tags: python3 {baseDir}/scripts/shodan_skill.py query_tags

9. Notifiers (Alerts)

  • List Notifiers: python3 {baseDir}/scripts/shodan_skill.py notifier_list

10. Exploits

  • Search Exploits: python3 {baseDir}/scripts/shodan_skill.py exploit_search "<QUERY>"

11. Stream (Realtime)

Stream realtime banners. Use --ports or --alert to filter.

python3 {baseDir}/scripts/shodan_skill.py stream --limit 10

12. Trends (Facets)

Use count with facets to analyze trends.

python3 {baseDir}/scripts/shodan_skill.py count "apache" --facets "country"

13. Cheat Sheets (Help)

  • List Filters: python3 {baseDir}/scripts/shodan_skill.py filters
  • List Banner Fields: python3 {baseDir}/scripts/shodan_skill.py datapedia