db_services
List and filter database services in the Metasploit workspace to identify network services for penetration testing and security assessment.
Instructions
List all services in the current workspace
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | Optional: filter by host IP address |
Implementation Reference
- src/index.ts:166-178 (registration)Registration of the 'db_services' tool, including name, description, and input schema (optional host filter).
{ name: "db_services", description: "List all services in the current workspace", inputSchema: { type: "object", properties: { host: { type: "string", description: "Optional: filter by host IP address", }, }, }, }, - src/index.ts:169-177 (schema)Input schema for db_services tool: optional 'host' string parameter to filter services by IP.
inputSchema: { type: "object", properties: { host: { type: "string", description: "Optional: filter by host IP address", }, }, }, - src/index.ts:508-545 (handler)Handler implementation for 'db_services': runs 'services' or 'services -R <host>' via msfconsole and returns JSON results.
case "db_services": { const { host } = args as { host?: string }; const commands = host ? [`services -R ${host}`] : [`services`]; try { const services = await executeMsfCommand(commands); return { content: [ { type: "text", text: JSON.stringify( { success: true, host: host || "all", services, }, null, 2 ), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: error.message, }), }, ], }; } }