diff --git a/CHANGELOG.md b/CHANGELOG.md index a5bed0f19..66e7e5468 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Fix delay/jitter adjustment in python agent (@janit0rjoe) + ## [5.12.1] - 2025-01-08 ### Fixed diff --git a/empire/server/core/agent_task_service.py b/empire/server/core/agent_task_service.py index 4e2ac6e00..e6df66770 100644 --- a/empire/server/core/agent_task_service.py +++ b/empire/server/core/agent_task_service.py @@ -270,7 +270,7 @@ def create_task_update_sleep( db, agent, "TASK_CMD_WAIT", - f"global delay; global jitter; delay={delay}; jitter={jitter}; print('delay/jitter set to {delay}/{jitter}')", + f"global agent; agent.delay={delay}; agent.jitter={jitter}; print('delay/jitter set to {delay}/{jitter}')", user_id=user_id, ) if agent.language == "csharp": diff --git a/empire/server/data/agent/agent.py b/empire/server/data/agent/agent.py index b420a3646..8ed833f81 100644 --- a/empire/server/data/agent/agent.py +++ b/empire/server/data/agent/agent.py @@ -621,6 +621,7 @@ def dynamic_code_execute_wait_nosave(self, data, result_id): Task 100 """ try: + globals().update({'agent':self}) buffer = StringIO() sys.stdout = buffer code_obj = compile(data, "", "exec")