shodan_exploits
Search Shodan's exploit database to find public security vulnerabilities and exploits using queries like software names or CVE IDs.
Instructions
Search Shodan's exploit database for public exploits matching a query. Requires SHODAN_API_KEY.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Exploit search query (e.g. 'apache 2.4' or CVE ID) | |
| type | No | Filter by exploit type (e.g. 'exploit', 'metasploit') |
Implementation Reference
- src/shodan/index.ts:136-155 (handler)The handler function for shodan_exploits, which fetches exploit data from the Shodan API.
export async function shodanExploits(query: string, apiKey: string, type?: string): Promise<ShodanExploitResult> { await limiter.acquire(); const params = new URLSearchParams({ query, key: apiKey }); if (type) params.set("type", type); const res = await fetch(`https://exploits.shodan.io/api/search?${params}`); if (!res.ok) throw new Error(`Shodan exploit search failed: ${res.status}`); const data = await res.json(); return { total: data.total ?? 0, matches: (data.matches ?? []).map((m: any) => ({ title: m.description ?? m.title ?? "", source: m.source ?? "", type: m.type, author: m.author, date: m.date, cve: m.cve, })), }; - src/protocol/tools.ts:165-176 (registration)The tool registration and execution wrapper for shodan_exploits.
const shodanExploitsTool: ToolDef = { name: "shodan_exploits", description: "Search Shodan's exploit database for public exploits matching a query. Requires SHODAN_API_KEY.", schema: { query: z.string().describe("Exploit search query (e.g. 'apache 2.4' or CVE ID)"), type: z.string().optional().describe("Filter by exploit type (e.g. 'exploit', 'metasploit')"), }, execute: async (args, ctx) => { const key = requireApiKey(ctx.config.shodanApiKey, "Shodan", "SHODAN_API_KEY"); return json(await shodanExploits(args.query as string, key, args.type as string | undefined)); }, };