upload_file
Write files to the Kali Linux container for security testing, enabling upload of wordlists, scripts, or configuration files to support penetration testing workflows.
Instructions
Upload/write a file to the Kali Linux container. Useful for uploading wordlists, scripts, or configuration files.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path inside the container where the file should be written | |
| content | Yes | File content to write |
Implementation Reference
- src/tools/filesystem.ts:16-33 (handler)The handler function for the 'upload_file' tool, which writes content to a specified path in the Docker container.
async ({ path, content }) => { try { await docker.writeFile(path, content); return { content: [{ type: "text", text: `File written to ${path}` }], }; } catch (err) { return { content: [ { type: "text", text: `Failed to upload file: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } } - src/tools/filesystem.ts:9-34 (registration)Registration of the 'upload_file' tool with its schema definition and handler.
server.tool( "upload_file", "Upload/write a file to the Kali Linux container. Useful for uploading wordlists, scripts, or configuration files.", { path: z.string().describe("Absolute path inside the container where the file should be written"), content: z.string().describe("File content to write"), }, async ({ path, content }) => { try { await docker.writeFile(path, content); return { content: [{ type: "text", text: `File written to ${path}` }], }; } catch (err) { return { content: [ { type: "text", text: `Failed to upload file: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } } );