shodan
БесплатноБез исполняемых скриптовНе проверенShodan is a search engine for internet-connected devices: it indexes open ports, service banners, certificates and known vulnerabilities for every public IP…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Shodan
Overview
Shodan is a search engine for internet-connected devices. Unlike traditional search engines that index web content, Shodan scans the entire internet and indexes open ports, banners, certificates, and service metadata. Use it to discover exposed services, audit your own infrastructure, perform OSINT on target organizations, and track vulnerable devices at scale. Queries read Shodan's database — they send nothing to the target — and are available through the shodan CLI, the Python library and a REST API.
Requires: Shodan API key from https://account.shodan.io, kept in the SHODAN_API_KEY environment variable. Host lookups and result counts spend nothing; search filters and paging spend query credits, which come with a Membership or an API subscription.
Instructions
Step 1: Install and authenticate
pip install shodan "setuptools<81"
shodan init "$SHODAN_API_KEY" # validates the key, stores it in ~/.config/shodan/api_key (mode 600)
shodan info # Query credits available / Scan credits available
The CLI in the current release (1.31.0) imports pkg_resources, which setuptools removed in version 81; without the pin, shodan exits with ModuleNotFoundError: No module named 'pkg_resources'. The Python library itself does not need setuptools.
import csv
import os
import shodan
api = shodan.Shodan(os.environ["SHODAN_API_KEY"])
# Verify the key works
info = api.info()
print(f"Plan: {info['plan']}, Query credits: {info['query_credits']}, Scan credits: {info['scan_credits']}")
Step 2: IP lookup — get all services on a specific host
def lookup_ip(ip_address):
"""Retrieve all information about a host from Shodan."""
try:
host = api.host(ip_address)
print(f"\n=== Host: {ip_address} ===")
print(f"Organization: {host.get('org', 'N/A')}")
print(f"OS: {host.get('os', 'N/A')}")
print(f"Country: {host.get('country_name', 'N/A')}")
print(f"ISP: {host.get('isp', 'N/A')}")
print(f"Last updated: {host.get('last_update', 'N/A')}")
print(f"\nOpen ports: {host['ports']}")
for item in host['data']:
print(f" Port {item['port']}/{item.get('transport', 'tcp')}: {item.get('product', 'unknown')} {item.get('version', '')}")
if 'vulns' in item:
print(f" CVEs: {', '.join(item['vulns'].keys())}")
return host
except shodan.APIError as e:
print(f"Error: {e}") # raised for an unknown IP, a bad key or an exhausted plan
return None
lookup_ip("45.33.32.156") # scanme.nmap.org, a host the Nmap project keeps for testing
Host lookups do not spend query credits. api.host(ip, history=True) adds historical banners. The CLI equivalent is shodan host 45.33.32.156.
For a quick look without any key, the InternetDB API returns open ports, hostnames, CPEs, tags and CVEs for one IP (free for non-commercial use; commercial use needs the Corporate plan or an enterprise license):
curl -s https://internetdb.shodan.io/8.8.8.8
# {"cpes":[],"hostnames":["mysegi.my","dns.google"],"ip":"8.8.8.8","ports":[53,443],"tags":[],"vulns":[]}
Step 3: Search queries — find hosts matching filters
def search_hosts(query, max_results=100):
"""Search Shodan with a filter query and return matching hosts."""
try:
count = api.count(query) # free: counting never spends credits
print(f"Searching: {query} — total results: {count['total']:,}")
results = []
# search_cursor pages for you; every page of 100 results costs 1 query credit
for banner in api.search_cursor(query, minify=False):
results.append({
"ip": banner.get("ip_str"),
"port": banner.get("port"),
"org": banner.get("org", "N/A"),
"product": banner.get("product", "N/A"),
"version": banner.get("version", "N/A"),
"country": banner.get("location", {}).get("country_name", "N/A"),
"vulns": list(banner.get("vulns", {}).keys()),
"timestamp": banner.get("timestamp"),
})
if len(results) >= max_results:
break
return results
except shodan.APIError as e:
print(f"API Error: {e}")
return []
results = search_hosts('net:203.0.113.0/24 port:3389', max_results=50)
for r in results[:10]:
print(f" {r['ip']}:{r['port']} — {r['org']} ({r['country']}) {r['vulns'] or ''}")
Step 4: Export results to CSV
def export_to_csv(results, filename="shodan_results.csv"):
"""Export Shodan search results to a CSV file."""
fieldnames = ["ip", "port", "org", "product", "version", "country", "vulns", "timestamp"]
with open(filename, "w", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=fiel
Установить shodan в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл shodan?
Shodan is a search engine for internet-connected devices: it indexes open ports, service banners, certificates and known vulnerabilities for every public IP. Use when: mapping the attack surface of an organization you are authorized to assess, finding exposed services by port, product or CVE, checking what a suspicious IP exposes, or monitoring your own network ranges for new exposure with the Shodan CLI, Python library or API.
Как установить скилл shodan?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл shodan запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic