get_payloads
Retrieve compatible payloads for a specific Metasploit exploit to enable effective penetration testing and security assessment workflows.
Instructions
List available payloads for a specific exploit
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exploitPath | Yes | Full exploit path |
Input Schema (JSON Schema)
{
"properties": {
"exploitPath": {
"description": "Full exploit path",
"type": "string"
}
},
"required": [
"exploitPath"
],
"type": "object"
}
Implementation Reference
- src/index.ts:364-401 (handler)Handler implementation for the 'get_payloads' tool. It takes an exploitPath, runs 'use [exploitPath]' and 'show payloads' in msfconsole, and returns the list of payloads.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 (registration)Registration of the 'get_payloads' tool in the tools array, including name, description, and input schema definition.{ 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:126-135 (schema)Input schema definition for the 'get_payloads' tool, specifying the required 'exploitPath' parameter.inputSchema: { type: "object", properties: { exploitPath: { type: "string", description: "Full exploit path", }, }, required: ["exploitPath"], },