training.import_htb
Import HackTheBox challenge data into the VulneraMCP platform to create training materials for vulnerability testing and exploit development.
Instructions
Import training data from HackTheBox challenge
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| challengeName | Yes | Name of the HTB challenge | |
| challengeUrl | No | URL of the challenge | |
| vulnerabilityType | Yes | Type of vulnerability | |
| exploit | Yes | Exploit data with payloads and steps |
Implementation Reference
- src/tools/training.ts:285-328 (registration)Registration of the 'training.import_htb' tool, including schema and inline handler function.'training.import_htb', { description: 'Import training data from HackTheBox challenge', inputSchema: { type: 'object', properties: { challengeName: { type: 'string', description: 'Name of the HTB challenge' }, challengeUrl: { type: 'string', description: 'URL of the challenge' }, vulnerabilityType: { type: 'string', description: 'Type of vulnerability' }, exploit: { type: 'object', description: 'Exploit data with payloads and steps' }, }, required: ['challengeName', 'vulnerabilityType', 'exploit'], }, }, async (params: any): Promise<ToolResult> => { try { const exploit = params.exploit; const payloads = exploit.payloads || [exploit.payload || '']; const results: any[] = []; for (const payload of payloads) { const id = await saveTrainingData( 'htb', params.challengeName, params.vulnerabilityType, params.challengeUrl || '', payload, exploit.successPattern || 'flag', exploit.failurePattern || 'error', { exploit, challengeUrl: params.challengeUrl }, exploit.score || 8 ); results.push(id); } return formatToolResult(true, { imported: results.length, ids: results, }); } catch (error: any) { return formatToolResult(false, null, error.message); } } );
- src/tools/training.ts:299-327 (handler)The handler function that executes the tool logic: extracts payloads from HTB exploit object, saves each as training data via saveTrainingData, and returns import results.async (params: any): Promise<ToolResult> => { try { const exploit = params.exploit; const payloads = exploit.payloads || [exploit.payload || '']; const results: any[] = []; for (const payload of payloads) { const id = await saveTrainingData( 'htb', params.challengeName, params.vulnerabilityType, params.challengeUrl || '', payload, exploit.successPattern || 'flag', exploit.failurePattern || 'error', { exploit, challengeUrl: params.challengeUrl }, exploit.score || 8 ); results.push(id); } return formatToolResult(true, { imported: results.length, ids: results, }); } catch (error: any) { return formatToolResult(false, null, error.message); } }
- src/tools/training.ts:288-297 (schema)Input schema for the training.import_htb tool defining required parameters: challengeName, vulnerabilityType, exploit object.inputSchema: { type: 'object', properties: { challengeName: { type: 'string', description: 'Name of the HTB challenge' }, challengeUrl: { type: 'string', description: 'URL of the challenge' }, vulnerabilityType: { type: 'string', description: 'Type of vulnerability' }, exploit: { type: 'object', description: 'Exploit data with payloads and steps' }, }, required: ['challengeName', 'vulnerabilityType', 'exploit'], },