Reworked module system. Modules can now be individually set to be included in the agent. For example, it is possible to compile an agent only capable of executing BOFs and nothing else.
This commit is contained in:
@@ -4,30 +4,33 @@ import ../common/[types, utils]
|
||||
proc executeDownload(ctx: AgentCtx, task: Task): TaskResult
|
||||
proc executeUpload(ctx: AgentCtx, task: Task): TaskResult
|
||||
|
||||
|
||||
# Command definition (as seq[Command])
|
||||
let commands*: seq[Command] = @[
|
||||
Command(
|
||||
name: protect("download"),
|
||||
commandType: CMD_DOWNLOAD,
|
||||
description: protect("Download a file."),
|
||||
example: protect("download C:\\Users\\john\\Documents\\Database.kdbx"),
|
||||
arguments: @[
|
||||
Argument(name: protect("file"), description: protect("Path to file to download from the target machine."), argumentType: STRING, isRequired: true),
|
||||
],
|
||||
execute: executeDownload
|
||||
),
|
||||
Command(
|
||||
name: protect("upload"),
|
||||
commandType: CMD_UPLOAD,
|
||||
description: protect("Upload a file."),
|
||||
example: protect("upload /path/to/payload.exe"),
|
||||
arguments: @[
|
||||
Argument(name: protect("file"), description: protect("Path to file to upload to the target machine."), argumentType: BINARY, isRequired: true),
|
||||
],
|
||||
execute: executeUpload
|
||||
)
|
||||
]
|
||||
# Module definition
|
||||
let module* = Module(
|
||||
name: protect("filetransfer"),
|
||||
description: protect("Upload/download files to/from the target system."),
|
||||
commands: @[
|
||||
Command(
|
||||
name: protect("download"),
|
||||
commandType: CMD_DOWNLOAD,
|
||||
description: protect("Download a file."),
|
||||
example: protect("download C:\\Users\\john\\Documents\\Database.kdbx"),
|
||||
arguments: @[
|
||||
Argument(name: protect("file"), description: protect("Path to file to download from the target machine."), argumentType: STRING, isRequired: true),
|
||||
],
|
||||
execute: executeDownload
|
||||
),
|
||||
Command(
|
||||
name: protect("upload"),
|
||||
commandType: CMD_UPLOAD,
|
||||
description: protect("Upload a file."),
|
||||
example: protect("upload /path/to/payload.exe"),
|
||||
arguments: @[
|
||||
Argument(name: protect("file"), description: protect("Path to file to upload to the target machine."), argumentType: BINARY, isRequired: true),
|
||||
],
|
||||
execute: executeUpload
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
# Implement execution functions
|
||||
when defined(server):
|
||||
|
||||
Reference in New Issue
Block a user