training.import_all
Import pre-loaded training data from Intigriti, PortSwigger, and other sources to enhance security testing skills for bug bounty hunting.
Instructions
Import all pre-loaded training data from Intigriti, PortSwigger, and other sources
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sources | No | Sources to import (csrf, xss, sqli, registration, dorking, all) |
Implementation Reference
- src/tools/training_extractor.ts:242-295 (handler)Handler function that imports specified training data sources (CSRF, XSS, SQLi, registration, dorking) from pre-loaded arrays into the database using saveTrainingData, returning import statistics.async ({ sources = ['all'] }: any): Promise<ToolResult> => { try { const allData: any[] = []; const importSources = sources.includes('all') ? ['csrf', 'xss', 'sqli', 'registration', 'dorking'] : sources; if (importSources.includes('csrf')) { allData.push(...CSRF_TRAINING_DATA); } if (importSources.includes('xss')) { allData.push(...XSS_TRAINING_DATA); } if (importSources.includes('sqli')) { allData.push(...SQLI_TRAINING_DATA); } if (importSources.includes('registration')) { allData.push(...REGISTRATION_TRAINING_DATA); } if (importSources.includes('dorking')) { allData.push(...GOOGLE_DORKING_PATTERNS); } const imported: number[] = []; for (const data of allData) { try { const id = await saveTrainingData( data.source, data.sourceId, data.vulnerabilityType, data.targetPattern, data.payloadPattern, data.successPattern, data.failurePattern, data.contextData, data.score ); imported.push(id); } catch (error: any) { console.error(`Error importing ${data.sourceId}:`, error.message); } } return formatToolResult(true, { imported: imported.length, total: allData.length, ids: imported, sources: importSources, }); } catch (error: any) { return formatToolResult(false, null, error.message); } } );
- Input schema defining optional 'sources' array parameter for selecting which training data sets to import.{ description: 'Import all pre-loaded training data from Intigriti, PortSwigger, and other sources', inputSchema: { type: 'object', properties: { sources: { type: 'array', items: { type: 'string' }, description: 'Sources to import (csrf, xss, sqli, registration, dorking, all)', default: ['all'], }, }, }, },
- src/tools/training_extractor.ts:225-295 (registration)Registration of the 'training.import_all' tool using server.tool(), including schema and handler.// Import all pre-loaded training data server.tool( 'training.import_all', { description: 'Import all pre-loaded training data from Intigriti, PortSwigger, and other sources', inputSchema: { type: 'object', properties: { sources: { type: 'array', items: { type: 'string' }, description: 'Sources to import (csrf, xss, sqli, registration, dorking, all)', default: ['all'], }, }, }, }, async ({ sources = ['all'] }: any): Promise<ToolResult> => { try { const allData: any[] = []; const importSources = sources.includes('all') ? ['csrf', 'xss', 'sqli', 'registration', 'dorking'] : sources; if (importSources.includes('csrf')) { allData.push(...CSRF_TRAINING_DATA); } if (importSources.includes('xss')) { allData.push(...XSS_TRAINING_DATA); } if (importSources.includes('sqli')) { allData.push(...SQLI_TRAINING_DATA); } if (importSources.includes('registration')) { allData.push(...REGISTRATION_TRAINING_DATA); } if (importSources.includes('dorking')) { allData.push(...GOOGLE_DORKING_PATTERNS); } const imported: number[] = []; for (const data of allData) { try { const id = await saveTrainingData( data.source, data.sourceId, data.vulnerabilityType, data.targetPattern, data.payloadPattern, data.successPattern, data.failurePattern, data.contextData, data.score ); imported.push(id); } catch (error: any) { console.error(`Error importing ${data.sourceId}:`, error.message); } } return formatToolResult(true, { imported: imported.length, total: allData.length, ids: imported, sources: importSources, }); } catch (error: any) { return formatToolResult(false, null, error.message); } } );