Agent: Refactor MSSQL create directory commands

Use _run_mssql_command() and remove the dependency on
MSSQLLimitedSizePayload.
This commit is contained in:
Mike Salvatore 2022-06-14 12:57:19 -04:00
parent 7b356cf893
commit 522e62ad14
1 changed files with 3 additions and 4 deletions

View File

@ -103,10 +103,9 @@ class MSSQLExploiter(HostExploiter):
def create_temp_dir(self): def create_temp_dir(self):
logger.debug(f"Creating a temporary directory: {MSSQLExploiter.TMP_DIR_PATH}") logger.debug(f"Creating a temporary directory: {MSSQLExploiter.TMP_DIR_PATH}")
dir_creation_command = MSSQLLimitedSizePayload(
command="mkdir {}".format(MSSQLExploiter.TMP_DIR_PATH) mkdir_command = f"mkdir {MSSQLExploiter.TMP_DIR_PATH}"
) self._run_mssql_command(mkdir_command)
self.run_mssql_command(dir_creation_command)
def run_mssql_command(self, mssql_command): def run_mssql_command(self, mssql_command):
array_of_commands = mssql_command.split_into_array_of_smaller_payloads() array_of_commands = mssql_command.split_into_array_of_smaller_payloads()