recon.httpx
Identify live hosts and retrieve HTTP status codes for reconnaissance during security testing.
Instructions
Run httpx to check which hosts are live and get status codes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Input file path or comma-separated URLs | |
| statusCode | No | Show status codes | |
| title | No | Extract page titles |
Implementation Reference
- src/tools/recon.ts:77-114 (handler)Executes the httpx binary to probe input hosts/URLs for liveness, constructs command arguments based on options, parses stdout to extract live hosts, stores in Redis working memory, and returns formatted ToolResult.async ({ input, statusCode = true, title = false }: any): Promise<ToolResult> => { try { const exists = await checkCommandExists('httpx'); if (!exists) { return formatToolResult( false, null, 'httpx not found. Install from: https://github.com/projectdiscovery/httpx' ); } const args = ['-silent']; if (statusCode) args.push('-status-code'); if (title) args.push('-title'); // Check if input is a file or URLs if (input.includes(',') || input.startsWith('http')) { args.push('-u', input); } else { args.push('-l', input); } const result = await runCommand('httpx', args); const liveHosts = result.stdout .split('\n') .filter((s) => s.trim().length > 0); await setWorkingMemory('recon:live_hosts', liveHosts, 3600); return formatToolResult(true, { liveHosts, count: liveHosts.length, raw: result.stdout, }); } catch (error: any) { return formatToolResult(false, null, error.message); } }
- src/tools/recon.ts:62-76 (schema)Defines the input schema for the recon.httpx tool, including required 'input' parameter and optional flags for statusCode and title.{ description: 'Run httpx to check which hosts are live and get status codes', inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'Input file path or comma-separated URLs', }, statusCode: { type: 'boolean', description: 'Show status codes', default: true }, title: { type: 'boolean', description: 'Extract page titles', default: false }, }, required: ['input'], }, },
- src/tools/recon.ts:61-115 (registration)Registers the recon.httpx MCP tool on the server within the registerReconTools function.'recon.httpx', { description: 'Run httpx to check which hosts are live and get status codes', inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'Input file path or comma-separated URLs', }, statusCode: { type: 'boolean', description: 'Show status codes', default: true }, title: { type: 'boolean', description: 'Extract page titles', default: false }, }, required: ['input'], }, }, async ({ input, statusCode = true, title = false }: any): Promise<ToolResult> => { try { const exists = await checkCommandExists('httpx'); if (!exists) { return formatToolResult( false, null, 'httpx not found. Install from: https://github.com/projectdiscovery/httpx' ); } const args = ['-silent']; if (statusCode) args.push('-status-code'); if (title) args.push('-title'); // Check if input is a file or URLs if (input.includes(',') || input.startsWith('http')) { args.push('-u', input); } else { args.push('-l', input); } const result = await runCommand('httpx', args); const liveHosts = result.stdout .split('\n') .filter((s) => s.trim().length > 0); await setWorkingMemory('recon:live_hosts', liveHosts, 3600); return formatToolResult(true, { liveHosts, count: liveHosts.length, raw: result.stdout, }); } catch (error: any) { return formatToolResult(false, null, error.message); } } );