Is there an existing issue for this?
Empire Version
6.5.0
Python Version
3.14
Operating System
Kali
Database
SQLite
Current Behavior
When a module is set to be executed in the background, the module service sends a TASK_PYTHON_CMD_JOB:
|
module_data.command = "TASK_PYTHON_CMD_JOB" |
TASK_PYTHON_CMD_JOB is mapped to value 112:
|
"TASK_PYTHON_CMD_JOB": 112, |
However when the agent receive task 112 (
|
self.disk_code_execution_wait_save(data, result_id) |
) it calls disk_code_execution_wait_save, which does not execute jobs in background:
|
def disk_code_execution_wait_save(self, data, result_id): |
The function to execute jobs in background is assigned to task 113 (
), which is never sent by the module service (no other usage other than the definition in packets.py:
https://github.com/search?q=repo%3ABC-SECURITY%2FEmpire+TASK_PYTHON_CMD_JOB_SAVE&type=code).
Expected Behavior
Jobs should be executed in background.
Steps To Reproduce
- Start Empire.
- Create a listener and launch a python agent on a linux machine.
- Execute the long running linpeas module.
- Try to execute other commands while linpeas is running.
Anything else?
In addition to the problem above, the python agent is not ready for background jobs as-is, this is because jobs in python currently redirect stdout in order to capture the output. Multiple background job will likely pollute each other output.
I have a working branch that addresses this issue. I will send a merge request.
Is there an existing issue for this?
Empire Version
6.5.0
Python Version
3.14
Operating System
Kali
Database
SQLite
Current Behavior
When a module is set to be executed in the background, the module service sends a TASK_PYTHON_CMD_JOB:
Empire/empire/server/core/module_service.py
Line 186 in 4b82a26
TASK_PYTHON_CMD_JOB is mapped to value 112:
Empire/empire/server/common/packets.py
Line 115 in 4b82a26
However when the agent receive task 112 (
Empire/empire/server/data/agent/agent.py
Line 1100 in 4b82a26
Empire/empire/server/data/agent/agent.py
Line 671 in 4b82a26
The function to execute jobs in background is assigned to task 113 (
Empire/empire/server/data/agent/agent.py
Line 1102 in 4b82a26
Expected Behavior
Jobs should be executed in background.
Steps To Reproduce
Anything else?
In addition to the problem above, the python agent is not ready for background jobs as-is, this is because jobs in python currently redirect stdout in order to capture the output. Multiple background job will likely pollute each other output.
I have a working branch that addresses this issue. I will send a merge request.