Implemented agent kill date.

This commit is contained in:
Jakob Friedl
2025-10-28 21:01:10 +01:00
parent 7417cb2822
commit 7f89487fb7
12 changed files with 217 additions and 70 deletions

View File

@@ -17,10 +17,10 @@ let commands* = @[
execute: executeExit
),
Command(
name: protect("self-destroy"),
commandType: CMD_SELF_DESTROY,
name: protect("self-destruct"),
commandType: CMD_SELF_DESTRUCT,
description: protect("Exit the agent and delete the executable from disk."),
example: protect("self-destroy"),
example: protect("self-destruct"),
arguments: @[
],
execute: executeSelfDestroy
@@ -55,7 +55,7 @@ when defined(agent):
proc executeSelfDestroy(ctx: AgentCtx, task: Task): TaskResult =
try:
print " [>] Self-destroying."
print " [>] Self-destructing."
exit(EXIT_PROCESS, true)
except CatchableError as err:

View File

@@ -103,7 +103,7 @@ proc getModules*(modules: uint32 = 0): seq[Module] =
proc getCommands*(modules: uint32 = 0): seq[Command] =
# House-keeping
result.add(manager.commandsByType[CMD_EXIT])
result.add(manager.commandsByType[CMD_SELF_DESTROY])
result.add(manager.commandsByType[CMD_SELF_DESTRUCT])
# Modules
if modules == 0: