diff --git a/empire/config_manager.py b/empire/config_manager.py index b0120557f..7d8c9bf01 100644 --- a/empire/config_manager.py +++ b/empire/config_manager.py @@ -45,21 +45,31 @@ def check_config_permission(config_dict: dict, config_type: str): if config_type == "server": paths_to_check = { ("api", "cert_path"): config_dict.get("api", {}).get("cert_path"), - ("database", "sqlite", "location"): config_dict.get("database", {}).get("sqlite", {}).get("location"), - ("starkiller", "directory"): config_dict.get("starkiller", {}).get("directory"), + ("database", "sqlite", "location"): config_dict.get("database", {}) + .get("sqlite", {}) + .get("location"), + ("starkiller", "directory"): config_dict.get("starkiller", {}).get( + "directory" + ), ("logging", "directory"): config_dict.get("logging", {}).get("directory"), - ("debug", "last_task", "file"): config_dict.get("debug", {}).get("last_task", {}).get("file"), - ("directories", "downloads"): config_dict.get("directories", {}).get("downloads"), + ("debug", "last_task", "file"): config_dict.get("debug", {}) + .get("last_task", {}) + .get("file"), + ("directories", "downloads"): config_dict.get("directories", {}).get( + "downloads" + ), } config_path = CONFIG_SERVER_PATH # Use the server config path elif config_type == "client": paths_to_check = { ("logging", "directory"): config_dict.get("logging", {}).get("directory"), - ("directories", "downloads"): config_dict.get("directories", {}).get("downloads"), - ("directories", "generated-stagers"): config_dict.get("directories", {}).get( - "generated-stagers" + ("directories", "downloads"): config_dict.get("directories", {}).get( + "downloads" ), + ("directories", "generated-stagers"): config_dict.get( + "directories", {} + ).get("generated-stagers"), } config_path = CONFIG_CLIENT_PATH # Use the client config path @@ -95,11 +105,12 @@ def check_config_permission(config_dict: dict, config_type: str): return config_dict + def paths2str(data): if isinstance(data, dict): return {key: paths2str(value) for key, value in data.items()} - elif isinstance(data, list): + if isinstance(data, list): return [paths2str(item) for item in data] - elif isinstance(data, Path): + if isinstance(data, Path): return str(data) - return data \ No newline at end of file + return data diff --git a/empire/server/core/config.py b/empire/server/core/config.py index 1e2356a3d..d6a626b03 100644 --- a/empire/server/core/config.py +++ b/empire/server/core/config.py @@ -106,20 +106,16 @@ class EmpireConfig(EmpireBaseModel): database: DatabaseConfig = DatabaseConfig( sqlite=SQLiteDatabaseConfig(), mysql=MySQLDatabaseConfig(), - defaults=DatabaseDefaultsConfig() + defaults=DatabaseDefaultsConfig(), ) plugins: dict[str, dict[str, str]] = {} - directories: DirectoriesConfig = DirectoriesConfig( - downloads=Path("empire/server/downloads"), - module_source=Path("empire/server/modules"), - obfuscated_module_source=Path("empire/server/modules_obfuscated") - ) + directories: DirectoriesConfig = DirectoriesConfig() logging: LoggingConfig = LoggingConfig() debug: DebugConfig = DebugConfig(last_task=LastTaskConfig()) model_config = ConfigDict(extra="allow") - def __init__(self, config_dict: dict = None): + def __init__(self, config_dict: dict | None = None): if config_dict is None: config_dict = {} if not isinstance(config_dict, dict): diff --git a/empire/server/csharp/Covenant/Data/ReferenceSourceLibraries/Certify b/empire/server/csharp/Covenant/Data/ReferenceSourceLibraries/Certify index a2d230f60..f676ac988 160000 --- a/empire/server/csharp/Covenant/Data/ReferenceSourceLibraries/Certify +++ b/empire/server/csharp/Covenant/Data/ReferenceSourceLibraries/Certify @@ -1 +1 @@ -Subproject commit a2d230f607217b7b567d82ec7abb663311352131 +Subproject commit f676ac9889e6fa63149bfdc90b6ac86537222d5d diff --git a/empire/server/modules/bof/nanodump.py b/empire/server/modules/bof/nanodump.py index 30d635115..c214234b8 100644 --- a/empire/server/modules/bof/nanodump.py +++ b/empire/server/modules/bof/nanodump.py @@ -16,8 +16,7 @@ def generate( module=module, params=params, obfuscate=obfuscate ) - for name in params: - value = params[name] + for name, value in params.items(): if name == "write": if value != "": dump_path = value