Improved module selection in payload generation modal with tooltips from the module manager.
This commit is contained in:
@@ -7,6 +7,7 @@ proc executeBof(ctx: AgentCtx, task: Task): TaskResult
|
||||
let module* = Module(
|
||||
name: protect("bof"),
|
||||
description: protect("Load and execute BOF/COFF files in memory."),
|
||||
moduleType: MODULE_BOF,
|
||||
commands: @[
|
||||
Command(
|
||||
name: protect("bof"),
|
||||
@@ -23,7 +24,7 @@ let module* = Module(
|
||||
)
|
||||
|
||||
# Implement execution functions
|
||||
when defined(server):
|
||||
when not defined(agent):
|
||||
proc executeBof(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
|
||||
when defined(agent):
|
||||
|
||||
@@ -7,6 +7,7 @@ proc executeAssembly(ctx: AgentCtx, task: Task): TaskResult
|
||||
let module* = Module(
|
||||
name: protect("dotnet"),
|
||||
description: protect("Load and execute .NET assemblies in memory."),
|
||||
moduleType: MODULE_DOTNET,
|
||||
commands: @[
|
||||
Command(
|
||||
name: protect("dotnet"),
|
||||
@@ -23,7 +24,7 @@ let module* = Module(
|
||||
)
|
||||
|
||||
# Implement execution functions
|
||||
when defined(server):
|
||||
when not defined(agent):
|
||||
proc executeAssembly(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
|
||||
when defined(agent):
|
||||
|
||||
@@ -13,6 +13,7 @@ proc executeCopy(ctx: AgentCtx, task: Task): TaskResult
|
||||
let module* = Module(
|
||||
name: protect("filesystem"),
|
||||
description: protect("Conduct simple filesystem operations via Windows API."),
|
||||
moduleType: MODULE_DOTNET,
|
||||
commands: @[
|
||||
Command(
|
||||
name: protect("pwd"),
|
||||
@@ -88,7 +89,7 @@ let module* = Module(
|
||||
)
|
||||
|
||||
# Implementation of the execution functions
|
||||
when defined(server):
|
||||
when not defined(agent):
|
||||
proc executePwd(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
proc executeCd(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
proc executeDir(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
|
||||
@@ -8,6 +8,7 @@ proc executeUpload(ctx: AgentCtx, task: Task): TaskResult
|
||||
let module* = Module(
|
||||
name: protect("filetransfer"),
|
||||
description: protect("Upload/download files to/from the target system."),
|
||||
moduleType: MODULE_FILESYSTEM,
|
||||
commands: @[
|
||||
Command(
|
||||
name: protect("download"),
|
||||
@@ -33,7 +34,7 @@ let module* = Module(
|
||||
)
|
||||
|
||||
# Implement execution functions
|
||||
when defined(server):
|
||||
when not defined(agent):
|
||||
proc executeDownload(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
proc executeUpload(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
|
||||
|
||||
@@ -5,12 +5,14 @@ const MODULES {.intdefine.} = 0
|
||||
|
||||
type
|
||||
ModuleManager* = object
|
||||
modules*: seq[Module]
|
||||
commandsByType*: Table[CommandType, Command]
|
||||
commandsByName*: Table[string, Command]
|
||||
|
||||
var manager: ModuleManager
|
||||
|
||||
proc registerModule(module: Module) {.discardable.} =
|
||||
manager.modules.add(module)
|
||||
for cmd in module.commands:
|
||||
manager.commandsByType[cmd.commandType] = cmd
|
||||
manager.commandsByName[cmd.name] = cmd
|
||||
@@ -71,4 +73,7 @@ proc getCommandByName*(cmdName: string): Command =
|
||||
raise newException(ValueError, fmt"The command '{cmdName}' does not exist.")
|
||||
|
||||
proc getAvailableCommands*(): Table[string, Command] =
|
||||
return manager.commandsByName
|
||||
return manager.commandsByName
|
||||
|
||||
proc getModules*(): seq[Module] =
|
||||
return manager.modules
|
||||
@@ -7,6 +7,7 @@ proc executeScreenshot(ctx: AgentCtx, task: Task): TaskResult
|
||||
let module* = Module(
|
||||
name: protect("screenshot"),
|
||||
description: protect("Take and retrieve a screenshot of the target desktop."),
|
||||
moduleType: MODULE_SCREENSHOT,
|
||||
commands: @[
|
||||
Command(
|
||||
name: protect("screenshot"),
|
||||
@@ -20,7 +21,7 @@ let module* = Module(
|
||||
)
|
||||
|
||||
# Implement execution functions
|
||||
when defined(server):
|
||||
when not defined(agent):
|
||||
proc executeScreenshot(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
|
||||
when defined(agent):
|
||||
|
||||
@@ -7,6 +7,7 @@ proc executeShell(ctx: AgentCtx, task: Task): TaskResult
|
||||
let module* = Module(
|
||||
name: protect("shell"),
|
||||
description: protect("Execute shell commands or programs."),
|
||||
moduleType: MODULE_SHELL,
|
||||
commands: @[
|
||||
Command(
|
||||
name: protect("shell"),
|
||||
@@ -23,7 +24,7 @@ let module* = Module(
|
||||
)
|
||||
|
||||
# Implement execution functions
|
||||
when defined(server):
|
||||
when not defined(agent):
|
||||
proc executeShell(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
|
||||
when defined(agent):
|
||||
|
||||
@@ -9,6 +9,7 @@ proc executeWhoami(ctx: AgentCtx, task: Task): TaskResult
|
||||
let module* = Module(
|
||||
name: protect("situational-awareness"),
|
||||
description: protect("Retrieve information about the target system and environment."),
|
||||
moduleType: MODULE_SITUATIONAL_AWARENESS,
|
||||
commands: @[
|
||||
Command(
|
||||
name: protect("ps"),
|
||||
@@ -38,7 +39,7 @@ let module* = Module(
|
||||
)
|
||||
|
||||
# Implement execution functions
|
||||
when defined(server):
|
||||
when not defined(agent):
|
||||
proc executePs(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
proc executeEnv(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
proc executeWhoami(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
|
||||
@@ -8,6 +8,7 @@ proc executeSleepmask(ctx: AgentCtx, task: Task): TaskResult
|
||||
let module* = Module(
|
||||
name: protect("sleep"),
|
||||
description: protect("Change sleep settings."),
|
||||
moduleType: MODULE_SLEEP,
|
||||
commands: @[
|
||||
Command(
|
||||
name: protect("sleep"),
|
||||
@@ -34,7 +35,7 @@ let module* = Module(
|
||||
)
|
||||
|
||||
# Implement execution functions
|
||||
when defined(server):
|
||||
when not defined(agent):
|
||||
proc executeSleep(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
proc executeSleepmask(ctx: AgentCtx, task: Task): TaskResult = nil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user