search_auxiliary
Find Metasploit auxiliary modules for security testing by searching across scanner, admin, DoS, fuzzer, and data gathering categories to identify appropriate tools for penetration testing workflows.
Instructions
Search for auxiliary modules in Metasploit
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query for auxiliary modules | |
| type | No | Optional: Filter by auxiliary type |
Input Schema (JSON Schema)
{
"properties": {
"query": {
"description": "Search query for auxiliary modules",
"type": "string"
},
"type": {
"description": "Optional: Filter by auxiliary type",
"enum": [
"scanner",
"admin",
"dos",
"fuzzers",
"gather"
],
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
}
Implementation Reference
- src/index.ts:288-326 (handler)Handler implementation for the 'search_auxiliary' tool. Extracts query and optional type from arguments, builds Metasploit search command for auxiliary modules, executes via msfconsole, and returns formatted JSON results or error.case "search_auxiliary": { const { query, type } = args as { query: string; type?: string }; const searchQuery = type ? `search type:auxiliary ${type} ${query}` : `search type:auxiliary ${query}`; try { const results = await executeMsfCommand([searchQuery]); return { content: [ { type: "text", text: JSON.stringify( { success: true, query, type: type || null, results, }, null, 2 ), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: error.message, }), }, ], }; } }
- src/index.ts:90-108 (registration)Registration of the 'search_auxiliary' tool in the MCP tools array, including name, description, and input schema definition.{ name: "search_auxiliary", description: "Search for auxiliary modules in Metasploit", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query for auxiliary modules", }, type: { type: "string", enum: ["scanner", "admin", "dos", "fuzzers", "gather"], description: "Optional: Filter by auxiliary type", }, }, required: ["query"], }, },
- src/index.ts:93-107 (schema)Input schema definition for the 'search_auxiliary' tool, specifying required 'query' parameter and optional 'type' filter.inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query for auxiliary modules", }, type: { type: "string", enum: ["scanner", "admin", "dos", "fuzzers", "gather"], description: "Optional: Filter by auxiliary type", }, }, required: ["query"], },
- src/index.ts:27-40 (helper)Helper function used by search_auxiliary (and other tools) to execute Metasploit commands via msfconsole.async function executeMsfCommand(commands: string[]): Promise<string> { const commandString = commands.join("; "); const fullCommand = `msfconsole -q -x "${commandString}; exit"`; try { const { stdout, stderr } = await execAsync(fullCommand, { timeout: 60000, // 60 second timeout maxBuffer: 10 * 1024 * 1024, // 10MB buffer }); return stdout || stderr; } catch (error: any) { throw new Error(error.message || "Command execution failed"); } }