Agent: Remove dependency on SMBFingerprinter from SMBExploiter

This commit is contained in:
Mike Salvatore 2022-03-18 10:38:26 -04:00
parent df24d4ab6a
commit eddb9d527f
1 changed files with 0 additions and 18 deletions

View File

@ -7,8 +7,6 @@ from infection_monkey.exploit.HostExploiter import HostExploiter
from infection_monkey.exploit.tools.helpers import get_agent_dest_path
from infection_monkey.exploit.tools.smb_tools import SmbTools
from infection_monkey.model import DROPPER_CMDLINE_DETACHED_WINDOWS, MONKEY_CMDLINE_DETACHED_WINDOWS
from infection_monkey.network.tools import check_tcp_port
from infection_monkey.network_scanning.smbfinger import SMBFinger
from infection_monkey.telemetry.attack.t1035_telem import T1035Telem
from infection_monkey.utils.brute_force import generate_brute_force_combinations
from infection_monkey.utils.commands import build_monkey_commandline
@ -29,22 +27,6 @@ class SMBExploiter(HostExploiter):
def __init__(self, host):
super(SMBExploiter, self).__init__(host)
def is_os_supported(self):
if super(SMBExploiter, self).is_os_supported():
return True
if not self.host.os.get("type"):
is_smb_open, _ = check_tcp_port(self.host.ip_addr, 445)
if is_smb_open:
smb_finger = SMBFinger()
smb_finger.get_host_fingerprint(self.host)
else:
is_nb_open, _ = check_tcp_port(self.host.ip_addr, 139)
if is_nb_open:
self.host.os["type"] = "windows"
return self.host.os.get("type") in self._TARGET_OS_TYPE
return False
def _exploit_host(self):
agent_binary = self.agent_repository.get_agent_binary(self.host.os["type"])
dest_path = get_agent_dest_path(self.host, self.options)