Skip to main content
Glama
badchars

osint-mcp-server

by badchars

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
NameRequiredDescriptionDefault
queryYesExploit search query (e.g. 'apache 2.4' or CVE ID)
typeNoFilter by exploit type (e.g. 'exploit', 'metasploit')

Implementation Reference

  • 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,
        })),
      };
  • 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));
      },
    };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/badchars/osint-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server