diff --git a/monkey/infection_monkey/exploit/vsftpd.py b/monkey/infection_monkey/exploit/vsftpd.py index 8ecac35f1..ec263411f 100644 --- a/monkey/infection_monkey/exploit/vsftpd.py +++ b/monkey/infection_monkey/exploit/vsftpd.py @@ -14,8 +14,8 @@ from infection_monkey.exploit.tools.helpers import (build_monkey_commandline, get_monkey_depth, get_target_monkey) from infection_monkey.exploit.tools.http_tools import HTTPTools -from infection_monkey.model import (CHMOD_MONKEY, DOWNLOAD_TIMEOUT, MONKEY_ARG, - RUN_MONKEY, WGET_HTTP_UPLOAD) +from infection_monkey.model import ( + CHMOD_MONKEY, DOWNLOAD_TIMEOUT, MONKEY_ARG, RUN_MONKEY, WGET_HTTP_UPLOAD) from infection_monkey.telemetry.attack.t1222_telem import T1222Telem LOG = getLogger(__name__) diff --git a/monkey/monkey_island/cc/environment/environment_config.py b/monkey/monkey_island/cc/environment/environment_config.py index cf54d049e..79182d56b 100644 --- a/monkey/monkey_island/cc/environment/environment_config.py +++ b/monkey/monkey_island/cc/environment/environment_config.py @@ -5,12 +5,11 @@ import os from pathlib import Path from typing import Dict, List +import monkey_island.cc.environment.server_config_generator as server_config_generator from monkey_island.cc.consts import MONKEY_ISLAND_ABS_PATH from monkey_island.cc.environment.user_creds import UserCreds from monkey_island.cc.resources.auth.auth_user import User from monkey_island.cc.resources.auth.user_store import UserStore -import monkey_island.cc.environment.server_config_generator as server_config_generator - SERVER_CONFIG_FILENAME = "server_config.json" diff --git a/monkey/monkey_island/cc/environment/set_server_config.py b/monkey/monkey_island/cc/environment/set_server_config.py index 359110ebc..68ac1b619 100644 --- a/monkey/monkey_island/cc/environment/set_server_config.py +++ b/monkey/monkey_island/cc/environment/set_server_config.py @@ -1,8 +1,20 @@ import argparse import json import logging +import os +import sys +from pathlib import Path -from monkey_island.cc.environment.environment_config import EnvironmentConfig + +def add_monkey_dir_to_sys_path(): + monkey_path = Path(sys.path[0]) + monkey_path = monkey_path.parents[2] + sys.path.insert(0, monkey_path.__str__()) + + +add_monkey_dir_to_sys_path() + +from monkey_island.cc.environment.environment_config import EnvironmentConfig #isort:skip SERVER_CONFIG = "server_config"