get_payloads
Lists available payloads for a specific Metasploit exploit to support authorized security testing and penetration testing workflows.
Instructions
List available payloads for a specific exploit
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exploitPath | Yes | Full exploit path |
Implementation Reference
- src/index.ts:364-401 (handler)The handler function for the 'get_payloads' tool. It takes an exploitPath argument, uses the specified exploit in msfconsole, shows available payloads, and returns the results as JSON.case "get_payloads": { const { exploitPath } = args as { exploitPath: string }; try { const payloads = await executeMsfCommand([ `use ${exploitPath}`, `show payloads`, ]); return { content: [ { type: "text", text: JSON.stringify( { success: true, exploitPath, payloads, }, null, 2 ), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: error.message, }), }, ], }; } }
- src/index.ts:123-136 (schema)The tool definition including name, description, and input schema (JSON Schema) for 'get_payloads'.{ name: "get_payloads", description: "List available payloads for a specific exploit", inputSchema: { type: "object", properties: { exploitPath: { type: "string", description: "Full exploit path", }, }, required: ["exploitPath"], }, },
- src/index.ts:219-220 (registration)Registration of the tools list handler which exposes the 'get_payloads' tool via the tools array.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools };