(event, _context)
| 23 | } |
| 24 | |
| 25 | const generateCommand = function (event, _context) { |
| 26 | const { path, queryStringParameters } = event; |
| 27 | |
| 28 | const requiredName = decodeURIComponent(path.substring(1)); |
| 29 | const selectedItem = rsgData.reverseShellCommands.find(function ({ name }) { |
| 30 | return requiredName === name; |
| 31 | }); |
| 32 | |
| 33 | if (!selectedItem) { |
| 34 | return { |
| 35 | statusCode: 401, |
| 36 | body: `Command name '${requiredName}' not found` |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | const { command } = selectedItem; |
| 41 | const result = insertParameters(command, queryStringParameters); |
| 42 | |
| 43 | return { |
| 44 | statusCode: 200, |
| 45 | body: result |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | const extractRawValue = function (event) { |
| 50 | const { queryStringParameters } = event; |
no test coverage detected