Implemented sleep command to update sleep delay on agent

This commit is contained in:
Jakob Friedl
2025-05-28 10:39:30 +02:00
parent c03592c7fd
commit 4397f728de
11 changed files with 80 additions and 36 deletions

View File

@@ -0,0 +1,21 @@
import nanoid, sequtils, strutils, strformat, terminal, times
import ../../types
proc taskExecuteSleep*(cq: Conquest, delay: int) =
# Create a new task
let
date: string = now().format("dd-MM-yyyy HH:mm:ss")
task = Task(
id: generate(alphabet=join(toSeq('A'..'Z'), ""), size=8),
agent: cq.interactAgent.name,
command: Sleep,
args: @[$delay],
result: "",
status: Created
)
# Add new task to the agent's task queue
cq.interactAgent.tasks.add(task)
cq.writeLine(fgBlack, styleBright, fmt"[*] [{task.id}] ", resetStyle, "Tasked agent to update sleep settings.")