From d8b1dd5af3e402afc88efea9cb64f8b8900a6c41 Mon Sep 17 00:00:00 2001 From: Will Date: Thu, 25 Jan 2024 16:01:59 -0800 Subject: [PATCH] for stage1 connector, auto task pwd if one doesn't exist -for stage1 connector, auto task pwd if one doesn't exist --- .../stage1-connector/nemesis_connector/nemesis_connector.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/connectors/stage1-connector/nemesis_connector/nemesis_connector.py b/cmd/connectors/stage1-connector/nemesis_connector/nemesis_connector.py index 90151c5..0de8b44 100644 --- a/cmd/connectors/stage1-connector/nemesis_connector/nemesis_connector.py +++ b/cmd/connectors/stage1-connector/nemesis_connector/nemesis_connector.py @@ -19,6 +19,7 @@ from outflank_stage1.bot import BaseBot from outflank_stage1.implant import Implant from outflank_stage1.services.implant_service import ImplantService from outflank_stage1.task import BaseTask +from outflank_stage1.task.tasks import PwdTask from outflank_stage1.services.task_service import TaskService # 3rd Party Libraries from pip._internal import main as pipmain @@ -563,6 +564,10 @@ class NemesisConnector(BaseBot): except httpx.HTTPStatusError as e: self._logger.exception(f"Error sending file data message. Response body: {e.response.text} Exception: {e}") + # if we get to this point and there hasn't been a PWD, task one up + if not self._current_working_directories[implant_uid]: + self._task_service.schedule_task(implant_uid=implant.get_uid(), task=PwdTask()) + self._logger.info("Nemesis Connector is running") def get_download_disk_filepath(self, path: str, timestamp: datetime) -> Optional[str]: