Island: Add endpoint to retrive propagation credentials

This commit is contained in:
Ilija Lazoroski 2021-11-22 19:58:49 +01:00
parent 0d8070080a
commit 3aad64dff7
3 changed files with 27 additions and 0 deletions

View File

@ -40,6 +40,7 @@ from monkey_island.cc.resources.node import Node
from monkey_island.cc.resources.node_states import NodeStates
from monkey_island.cc.resources.pba_file_download import PBAFileDownload
from monkey_island.cc.resources.pba_file_upload import FileUpload
from monkey_island.cc.resources.propagation_credentials import PropagationCredentials
from monkey_island.cc.resources.ransomware_report import RansomwareReport
from monkey_island.cc.resources.remote_run import RemoteRun
from monkey_island.cc.resources.root import Root
@ -165,6 +166,7 @@ def init_api_resources(api):
"/api/fileUpload/<string:file_type>?load=<string:filename>",
"/api/fileUpload/<string:file_type>?restore=<string:filename>",
)
api.add_resource(PropagationCredentials, "/api/propagationCredentials")
api.add_resource(RemoteRun, "/api/remote-monkey", "/api/remote-monkey/")
api.add_resource(VersionUpdate, "/api/version-update", "/api/version-update/")
api.add_resource(RemotePortCheck, "/api/monkey_control/check_remote_port/<string:port>")

View File

@ -0,0 +1,9 @@
import flask_restful
from monkey_island.cc.services.config import ConfigService
class PropagationCredentials(flask_restful.Resource):
def get(self):
return {'propagation_credentials': ConfigService.get_config_propagation_credentials()}

View File

@ -407,3 +407,19 @@ class ConfigService:
@staticmethod
def set_started_on_island(value: bool):
ConfigService.set_config_value(STARTED_ON_ISLAND_PATH, value)
@staticmethod
def get_config_propagation_credentials():
return {
"exploit_user_list": ConfigService.get_config_value(USER_LIST_PATH, should_decrypt=False),
"exploit_password_list": ConfigService.get_config_value(
PASSWORD_LIST_PATH, should_decrypt=False
),
"exploit_lm_hash_list": ConfigService.get_config_value(
LM_HASH_LIST_PATH, should_decrypt=False
),
"exploit_ntlm_hash_list": ConfigService.get_config_value(
NTLM_HASH_LIST_PATH, should_decrypt=False
),
"exploit_ssh_keys": ConfigService.get_config_value(SSH_KEYS_PATH, should_decrypt=False),
}