forked from p15670423/monkey
Agent: Refactor MSSQL cleanup commands
* Simplify! * Remove the dependency on MSSQLLimitedSizePayload. * Use f-strings
This commit is contained in:
parent
257c6b0b05
commit
b2aa8333c3
|
@ -136,15 +136,8 @@ class MSSQLExploiter(HostExploiter):
|
|||
self.run_payload_file()
|
||||
|
||||
def remove_temp_dir(self):
|
||||
# Remove temporary dir we stored payload at
|
||||
tmp_file_removal_command = MSSQLLimitedSizePayload(
|
||||
command="del {}".format(self.payload_file_path)
|
||||
)
|
||||
self.run_mssql_command(tmp_file_removal_command)
|
||||
tmp_dir_removal_command = MSSQLLimitedSizePayload(
|
||||
command="rmdir {}".format(MSSQLExploiter.TMP_DIR_PATH)
|
||||
)
|
||||
self.run_mssql_command(tmp_dir_removal_command)
|
||||
self._run_mssql_command(f"del {self.payload_file_path}")
|
||||
self._run_mssql_command(f"rmdir {MSSQLExploiter.TMP_DIR_PATH}")
|
||||
|
||||
def start_monkey_server(self, monkey_path_on_victim: PureWindowsPath) -> LockedHTTPServer:
|
||||
self.agent_http_path, http_thread = HTTPTools.create_locked_transfer(
|
||||
|
|
Loading…
Reference in New Issue