island: Move PBA filename paths to config_value_paths.py

This commit is contained in:
Mike Salvatore 2021-05-12 09:03:13 -04:00
parent 2485c85d59
commit 253588b3ac
4 changed files with 9 additions and 18 deletions

View File

@ -11,3 +11,5 @@ SUBNET_SCAN_LIST_PATH = ["basic_network", "scope", "subnet_scan_list"]
LOCAL_NETWORK_SCAN_PATH = ["basic_network", "scope", "local_network_scan"] LOCAL_NETWORK_SCAN_PATH = ["basic_network", "scope", "local_network_scan"]
LM_HASH_LIST_PATH = ["internal", "exploits", "exploit_lm_hash_list"] LM_HASH_LIST_PATH = ["internal", "exploits", "exploit_lm_hash_list"]
NTLM_HASH_LIST_PATH = ["internal", "exploits", "exploit_ntlm_hash_list"] NTLM_HASH_LIST_PATH = ["internal", "exploits", "exploit_ntlm_hash_list"]
PBA_LINUX_FILENAME_PATH = ["monkey", "post_breach", "PBA_linux_filename"]
PBA_WINDOWS_FILENAME_PATH = ["monkey", "post_breach", "PBA_windows_filename"]

View File

@ -6,13 +6,10 @@ import flask_restful
from flask import Response, request, send_from_directory from flask import Response, request, send_from_directory
from werkzeug.utils import secure_filename from werkzeug.utils import secure_filename
from common.config_value_paths import PBA_LINUX_FILENAME_PATH, PBA_WINDOWS_FILENAME_PATH
from monkey_island.cc.resources.auth.auth import jwt_required from monkey_island.cc.resources.auth.auth import jwt_required
from monkey_island.cc.services.config import ConfigService from monkey_island.cc.services.config import ConfigService
from monkey_island.cc.services.post_breach_files import ( from monkey_island.cc.services.post_breach_files import PostBreachFilesService
PBA_LINUX_FILENAME_PATH,
PBA_WINDOWS_FILENAME_PATH,
PostBreachFilesService,
)
__author__ = "VakarisZ" __author__ = "VakarisZ"

View File

@ -9,11 +9,7 @@ import monkey_island.cc.environment.environment_singleton as env_singleton
from monkey_island.cc.database import mongo from monkey_island.cc.database import mongo
from monkey_island.cc.server_utils.encryptor import get_encryptor from monkey_island.cc.server_utils.encryptor import get_encryptor
from monkey_island.cc.services.config_schema.config_schema import SCHEMA from monkey_island.cc.services.config_schema.config_schema import SCHEMA
from monkey_island.cc.services.post_breach_files import ( from monkey_island.cc.services.post_breach_files import PostBreachFilesService
PBA_LINUX_FILENAME_PATH,
PBA_WINDOWS_FILENAME_PATH,
PostBreachFilesService,
)
from monkey_island.cc.services.utils.network_utils import local_ip_addresses from monkey_island.cc.services.utils.network_utils import local_ip_addresses
__author__ = "itay.mizeretz" __author__ = "itay.mizeretz"
@ -24,6 +20,8 @@ from common.config_value_paths import (
LM_HASH_LIST_PATH, LM_HASH_LIST_PATH,
NTLM_HASH_LIST_PATH, NTLM_HASH_LIST_PATH,
PASSWORD_LIST_PATH, PASSWORD_LIST_PATH,
PBA_LINUX_FILENAME_PATH,
PBA_WINDOWS_FILENAME_PATH,
SSH_KEYS_PATH, SSH_KEYS_PATH,
STARTED_ON_ISLAND_PATH, STARTED_ON_ISLAND_PATH,
USER_LIST_PATH, USER_LIST_PATH,
@ -216,8 +214,8 @@ class ConfigService:
linux_filename = ConfigService.get_config_value(PBA_LINUX_FILENAME_PATH) linux_filename = ConfigService.get_config_value(PBA_LINUX_FILENAME_PATH)
windows_filename = ConfigService.get_config_value(PBA_WINDOWS_FILENAME_PATH) windows_filename = ConfigService.get_config_value(PBA_WINDOWS_FILENAME_PATH)
config_json["monkey"]["post_breach"]["PBA_linux_filename"] = linux_filename ConfigService.set_config_value(PBA_LINUX_FILENAME_PATH, linux_filename)
config_json["monkey"]["post_breach"]["PBA_windows_filename"] = windows_filename ConfigService.set_config_value(PBA_WINDOWS_FILENAME_PATH, windows_filename)
@staticmethod @staticmethod
def init_default_config(): def init_default_config():

View File

@ -2,14 +2,8 @@ import logging
import os import os
from pathlib import Path from pathlib import Path
__author__ = "VakarisZ"
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# Where to find file names in config
PBA_LINUX_FILENAME_PATH = ["monkey", "post_breach", "PBA_linux_filename"]
PBA_WINDOWS_FILENAME_PATH = ["monkey", "post_breach", "PBA_windows_filename"]
class PostBreachFilesService: class PostBreachFilesService:
DATA_DIR = None DATA_DIR = None